[statusbar] Fix event handling on child window
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
c9fde5a9f0
commit
083a4f13f7
7
event.c
7
event.c
|
@ -77,6 +77,13 @@ event_handle_buttonpress(void *data __attribute__ ((unused)),
|
||||||
for(statusbar = globalconf.screens[screen].statusbar; statusbar; statusbar = statusbar->next)
|
for(statusbar = globalconf.screens[screen].statusbar; statusbar; statusbar = statusbar->next)
|
||||||
if(statusbar->sw->window == ev->event || statusbar->sw->window == ev->child)
|
if(statusbar->sw->window == ev->event || statusbar->sw->window == ev->child)
|
||||||
{
|
{
|
||||||
|
/* If the statusbar is child, then x,y are
|
||||||
|
* relative to root window */
|
||||||
|
if(statusbar->sw->window == ev->child)
|
||||||
|
{
|
||||||
|
ev->event_x -= statusbar->sw->geometry.x;
|
||||||
|
ev->event_y -= statusbar->sw->geometry.y;
|
||||||
|
}
|
||||||
switch(statusbar->position)
|
switch(statusbar->position)
|
||||||
{
|
{
|
||||||
case Top:
|
case Top:
|
||||||
|
|
Loading…
Reference in New Issue