Revert "event: add FocusOut handler"

This reverts commit 31ba962065.
This commit is contained in:
Julien Danjou 2009-04-06 13:27:53 +02:00
parent 63f2dd3908
commit 4d6bf949a8
3 changed files with 10 additions and 30 deletions

View File

@ -202,7 +202,7 @@ client_unfocus_hook(client_t *c)
/** Unfocus a client.
* \param c The client.
*/
void
static void
client_unfocus(client_t *c)
{
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)
return;
/* If we recieved a FocusOut event, this condition won't be hit. */
if(focused_before)
client_unfocus(focused_before);
/* stop hiding c */
c->ishidden = false;
client_setminimized(c, false);
@ -323,6 +319,15 @@ client_focus(client_t *c, bool sendmessage)
* And anyway, we have maybe unhidden */
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);
/* according to EWMH, we have to remove the urgent state from a client */

View File

@ -76,7 +76,6 @@ void client_setminimized(client_t *, bool);
void client_setborder(client_t *, int);
void client_seturgent(client_t *, bool);
void client_focus(client_t *, bool);
void client_unfocus(client_t *);
int luaA_client_newindex(lua_State *);

24
event.c
View File

@ -551,29 +551,6 @@ event_handle_focusin(void *data __attribute__ ((unused)),
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.
* \param data currently unused.
* \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_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_out_handler(&globalconf.evenths, event_handle_focusout, 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_key_press_handler(&globalconf.evenths, event_handle_key, NULL);