X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fevent.c;h=cb739339e6d8b961bb9c653b1e90f3e4f17626d7;hb=7d164842e0d0c3138401fad0dafc6f21bba0a04f;hp=868712c1fe53209ea28322b007e22315251a4a36;hpb=7cf4c970ae89f06aa77345900f96a310400c8595;p=chaz%2Fopenbox diff --git a/openbox/event.c b/openbox/event.c index 868712c1..cb739339 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -526,10 +526,7 @@ static void event_process(const XEvent *ec, gpointer data) /* If you send focus to a window and then it disappears, you can get the FocusIn for it, after it is unmanaged. - Just wait for the next FocusOut/FocusIn pair, but note that - nothing is focused now. - */ - focus_set_client(NULL); + Just wait for the next FocusOut/FocusIn pair. */ } else if (client != focus_client) { focus_left_screen = FALSE; @@ -542,13 +539,6 @@ static void event_process(const XEvent *ec, gpointer data) gboolean nomove = FALSE; XEvent ce; - if (client) { - frame_adjust_focus(client->frame, FALSE); - /* focus_set_client(NULL) has already been called in this - section or by focus_fallback */ - client_calc_layer(client); - } - /* Look for the followup FocusIn */ if (!XCheckIfEvent(ob_display, &ce, event_look_for_focusin, NULL)) { /* There is no FocusIn, this means focus went to a window that @@ -584,6 +574,13 @@ static void event_process(const XEvent *ec, gpointer data) focus_fallback(TRUE); } } + + if (client && client != focus_client) { + frame_adjust_focus(client->frame, FALSE); + /* focus_set_client(NULL) has already been called in this + section or by focus_fallback */ + client_calc_layer(client); + } } else if (timewinclients) event_handle_user_time_window_clients(timewinclients, e); else if (client) @@ -1591,8 +1588,8 @@ static gboolean event_handle_menu_keyboard(XEvent *ev) menu_frame_select_next(frame); } - /* keyboard accelerator shortcuts. */ - else if (ev->xkey.state == 0 && + /* keyboard accelerator shortcuts. (allow controlmask) */ + else if ((ev->xkey.state & ~ControlMask) == 0 && /* was it a valid key? */ unikey != 0 && /* don't bother if the menu is empty. */