X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Ffocus.c;h=8d5e6c547755654b037779ebedd6cba3c3cc996f;hb=276b2be581c6cb138b439537761ff2ca42201805;hp=141fc4746b342a519c66ccbccbcfb8b835267a90;hpb=8a1fa6d3ac47eba3e781463aec131cf401a29ec2;p=chaz%2Fopenbox diff --git a/openbox/focus.c b/openbox/focus.c index 141fc474..8d5e6c54 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); } @@ -108,7 +111,7 @@ void focus_set_client(Client *client) push_to_top(client); /* set the NET_ACTIVE_WINDOW hint, but preserve it on shutdown */ - if (ob_state != State_Exiting) { + if (ob_state != OB_STATE_EXITING) { active = client ? client->window : None; PROP_SET32(ob_root, net_active_window, window, active); } @@ -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_monitor(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); @@ -266,9 +268,9 @@ static void popup_cycle(Client *c, gboolean show) if (p == c) title = NULL; else - title = g_strconcat((p->iconic ? p->icon_title : p->title), + title = g_strconcat((c->iconic ? c->icon_title : c->title), " - ", - (c->iconic ? c->icon_title : c->title), + (p->iconic ? p->icon_title : p->title), NULL); popup_show(focus_cycle_popup,