X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;ds=sidebyside;f=openbox%2Ffocus.c;h=b8477bcb148c2cb4297baa3524c1381c67016b1c;hb=953b68a1d619d9bb69fc8594a42693c6c32b4a2f;hp=761d4f4ea3e1b3cdfd2b6fdf8842fd4a672cdccd;hpb=4cb48bebb5e13224c0f272809914de679cf395e1;p=chaz%2Fopenbox diff --git a/openbox/focus.c b/openbox/focus.c index 761d4f4e..b8477bcb 100644 --- a/openbox/focus.c +++ b/openbox/focus.c @@ -34,7 +34,6 @@ void focus_startup() XSetWindowAttributes attrib; focus_client = NULL; - focus_cycle_popup = popup_new(TRUE); attrib.override_redirect = TRUE; focus_backup = XCreateWindow(ob_display, ob_root, @@ -43,6 +42,10 @@ void focus_startup() CWOverrideRedirect, &attrib); XMapRaised(ob_display, focus_backup); + /* do this *after* focus_backup is created, since it is used for + stacking */ + focus_cycle_popup = popup_new(TRUE); + /* start with nothing focused */ focus_set_client(NULL); } @@ -235,8 +238,7 @@ void focus_fallback(FallbackType type) return; } - /* nothing to focus */ - focus_set_client(NULL); + /* nothing to focus, and already set it to none above */ } static void popup_cycle(Client *c, gboolean show) @@ -248,7 +250,7 @@ static void popup_cycle(Client *c, gboolean show) Client *p = c; char *title; - a = screen_area(c->desktop); + a = screen_physical_area_xinerama(0); popup_position(focus_cycle_popup, CenterGravity, a->x + a->width / 2, a->y + a->height / 2); /* popup_size(focus_cycle_popup, a->height/2, a->height/16); @@ -322,8 +324,13 @@ Client *focus_cycle(gboolean forward, gboolean linear, gboolean done, } /*ft = client_focus_target(it->data);*/ ft = it->data; + /* we don't use client_can_focus here, because that doesn't let you + focus an iconic window, but we want to be able to, so we just check + if the focus flags on the window allow it, and its on the current + desktop */ if (ft->transients == NULL && client_normal(ft) && - client_can_focus(ft)) { + ((ft->can_focus || ft->focus_notify) && + (ft->desktop == screen_desktop || ft->desktop == DESKTOP_ALL))) { if (ft != focus_cycle_target) { /* prevents flicker */ if (focus_cycle_target) frame_adjust_focus(focus_cycle_target->frame, FALSE);