X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Ffocus.c;h=c2d7e11e5dd879d8a776fd7bfb65ce0524d1d3db;hb=d9e6aa5643e74ab84fde0ddb1fcb8418ff212281;hp=b056db7e466f3cde9c6b7c7ab4f3db58a011f5ca;hpb=0cfd92ab9e56d8f790c92b83436e981fa46efe20;p=chaz%2Fopenbox diff --git a/openbox/focus.c b/openbox/focus.c index b056db7e..c2d7e11e 100644 --- a/openbox/focus.c +++ b/openbox/focus.c @@ -57,6 +57,14 @@ void focus_shutdown(gboolean reconfig) static void push_to_top(ObClient *client) { + ObClient *p; + + /* if it is modal for a single window, then put that window at the top + of the focus order first, so it will be right after ours. the same is + done with stacking */ + if (client->modal && (p = client_direct_parent(client))) + push_to_top(p); + focus_order = g_list_remove(focus_order, client); focus_order = g_list_prepend(focus_order, client); } @@ -178,7 +186,7 @@ ObClient* focus_fallback(gboolean allow_refocus, gboolean allow_pointer, return new; } -void focus_nothing() +void focus_nothing(void) { /* Install our own colormap */ if (focus_client != NULL) { @@ -337,13 +345,9 @@ gboolean focus_valid_target(ObClient *ft, that can be focused instead */ !focus_target_has_siblings(ft, iconic_windows, all_desktops)))); - /* it's not set to skip the taskbar (unless it is a type that would be - expected to set this hint, or modal) */ - ok = ok && ((ft->type == OB_CLIENT_TYPE_DOCK || - ft->type == OB_CLIENT_TYPE_DESKTOP || - ft->type == OB_CLIENT_TYPE_TOOLBAR || - ft->type == OB_CLIENT_TYPE_MENU || - ft->type == OB_CLIENT_TYPE_UTILITY) || + /* it's not set to skip the taskbar (but this only applies to normal typed + windows, and is overridden if the window is modal) */ + ok = ok && (ft->type != OB_CLIENT_TYPE_NORMAL || ft->modal || !ft->skip_taskbar);