parent
63f2dd3908
commit
4d6bf949a8
15
client.c
15
client.c
|
@ -202,7 +202,7 @@ client_unfocus_hook(client_t *c)
|
||||||
/** Unfocus a client.
|
/** Unfocus a client.
|
||||||
* \param c The client.
|
* \param c The client.
|
||||||
*/
|
*/
|
||||||
void
|
static void
|
||||||
client_unfocus(client_t *c)
|
client_unfocus(client_t *c)
|
||||||
{
|
{
|
||||||
xcb_window_t root_win = xutil_screen_get(globalconf.connection, c->phys_screen)->root;
|
xcb_window_t root_win = xutil_screen_get(globalconf.connection, c->phys_screen)->root;
|
||||||
|
@ -293,10 +293,6 @@ client_focus(client_t *c, bool sendmessage)
|
||||||
if(c == focused_before)
|
if(c == focused_before)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* If we recieved a FocusOut event, this condition won't be hit. */
|
|
||||||
if(focused_before)
|
|
||||||
client_unfocus(focused_before);
|
|
||||||
|
|
||||||
/* stop hiding c */
|
/* stop hiding c */
|
||||||
c->ishidden = false;
|
c->ishidden = false;
|
||||||
client_setminimized(c, false);
|
client_setminimized(c, false);
|
||||||
|
@ -323,6 +319,15 @@ client_focus(client_t *c, bool sendmessage)
|
||||||
* And anyway, we have maybe unhidden */
|
* And anyway, we have maybe unhidden */
|
||||||
client_need_arrange(c);
|
client_need_arrange(c);
|
||||||
|
|
||||||
|
/* unfocus current selected client
|
||||||
|
* We don't really need to unfocus here,
|
||||||
|
* because client already received FocusOut event.
|
||||||
|
* What we need to do is call unfocus hook, to
|
||||||
|
* inform lua script, about this event.
|
||||||
|
*/
|
||||||
|
if(focused_before)
|
||||||
|
client_unfocus_hook(focused_before);
|
||||||
|
|
||||||
client_focus_hook(c);
|
client_focus_hook(c);
|
||||||
|
|
||||||
/* according to EWMH, we have to remove the urgent state from a client */
|
/* according to EWMH, we have to remove the urgent state from a client */
|
||||||
|
|
1
client.h
1
client.h
|
@ -76,7 +76,6 @@ void client_setminimized(client_t *, bool);
|
||||||
void client_setborder(client_t *, int);
|
void client_setborder(client_t *, int);
|
||||||
void client_seturgent(client_t *, bool);
|
void client_seturgent(client_t *, bool);
|
||||||
void client_focus(client_t *, bool);
|
void client_focus(client_t *, bool);
|
||||||
void client_unfocus(client_t *);
|
|
||||||
|
|
||||||
int luaA_client_newindex(lua_State *);
|
int luaA_client_newindex(lua_State *);
|
||||||
|
|
||||||
|
|
24
event.c
24
event.c
|
@ -551,29 +551,6 @@ event_handle_focusin(void *data __attribute__ ((unused)),
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** The focus out event handler.
|
|
||||||
* \param data currently unused.
|
|
||||||
* \param connection The connection to the X server.
|
|
||||||
* \param ev The event.
|
|
||||||
*/
|
|
||||||
static int
|
|
||||||
event_handle_focusout(void *data __attribute__ ((unused)),
|
|
||||||
xcb_connection_t *connection,
|
|
||||||
xcb_focus_out_event_t *ev)
|
|
||||||
{
|
|
||||||
/* filter focus-out events */
|
|
||||||
if (ev->detail != XCB_NOTIFY_DETAIL_NONLINEAR)
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
client_t *c;
|
|
||||||
|
|
||||||
if((c = client_getbytitlebarwin(ev->event))
|
|
||||||
|| (c = client_getbywin(ev->event)))
|
|
||||||
client_unfocus(c);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/** The expose event handler.
|
/** The expose event handler.
|
||||||
* \param data currently unused.
|
* \param data currently unused.
|
||||||
* \param connection The connection to the X server.
|
* \param connection The connection to the X server.
|
||||||
|
@ -891,7 +868,6 @@ void a_xcb_set_event_handlers(void)
|
||||||
xcb_event_set_enter_notify_handler(&globalconf.evenths, event_handle_enternotify, NULL);
|
xcb_event_set_enter_notify_handler(&globalconf.evenths, event_handle_enternotify, NULL);
|
||||||
xcb_event_set_leave_notify_handler(&globalconf.evenths, event_handle_leavenotify, NULL);
|
xcb_event_set_leave_notify_handler(&globalconf.evenths, event_handle_leavenotify, NULL);
|
||||||
xcb_event_set_focus_in_handler(&globalconf.evenths, event_handle_focusin, NULL);
|
xcb_event_set_focus_in_handler(&globalconf.evenths, event_handle_focusin, NULL);
|
||||||
xcb_event_set_focus_out_handler(&globalconf.evenths, event_handle_focusout, NULL);
|
|
||||||
xcb_event_set_motion_notify_handler(&globalconf.evenths, event_handle_motionnotify, NULL);
|
xcb_event_set_motion_notify_handler(&globalconf.evenths, event_handle_motionnotify, NULL);
|
||||||
xcb_event_set_expose_handler(&globalconf.evenths, event_handle_expose, NULL);
|
xcb_event_set_expose_handler(&globalconf.evenths, event_handle_expose, NULL);
|
||||||
xcb_event_set_key_press_handler(&globalconf.evenths, event_handle_key, NULL);
|
xcb_event_set_key_press_handler(&globalconf.evenths, event_handle_key, NULL);
|
||||||
|
|
Loading…
Reference in New Issue