[titlebar] Give focus when clicking with Button1
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
5a062eb0d3
commit
2f513459e2
16
event.c
16
event.c
|
@ -125,6 +125,19 @@ event_handle_buttonpress(XEvent *e)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for(c = globalconf.clients; c; c = c->next)
|
||||||
|
if(c->titlebar.sw && c->titlebar.sw->window == ev->window)
|
||||||
|
{
|
||||||
|
if(!client_focus(c, c->screen, True))
|
||||||
|
client_stack(c);
|
||||||
|
if(CLEANMASK(ev->state) == NoSymbol
|
||||||
|
&& ev->button == Button1)
|
||||||
|
window_grabbuttons(c->win, c->phys_screen);
|
||||||
|
event_handle_mouse_button_press(c->screen, ev->button, ev->state,
|
||||||
|
globalconf.buttons.titlebar, NULL);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if((c = client_get_bywin(globalconf.clients, ev->window)))
|
if((c = client_get_bywin(globalconf.clients, ev->window)))
|
||||||
{
|
{
|
||||||
if(!client_focus(c, c->screen, True))
|
if(!client_focus(c, c->screen, True))
|
||||||
|
@ -140,9 +153,6 @@ event_handle_buttonpress(XEvent *e)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for(c = globalconf.clients; c; c = c->next)
|
|
||||||
if(c->titlebar.sw && c->titlebar.sw->window == ev->window)
|
|
||||||
event_handle_mouse_button_press(c->screen, ev->button, ev->state, globalconf.buttons.titlebar, NULL);
|
|
||||||
for(screen = 0; screen < ScreenCount(e->xany.display); screen++)
|
for(screen = 0; screen < ScreenCount(e->xany.display); screen++)
|
||||||
if(RootWindow(e->xany.display, screen) == ev->window
|
if(RootWindow(e->xany.display, screen) == ev->window
|
||||||
&& XQueryPointer(e->xany.display,
|
&& XQueryPointer(e->xany.display,
|
||||||
|
|
Loading…
Reference in New Issue