X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;ds=inline;f=openbox%2Ffocus.c;h=8950a31e1499e42a2e34d296e6207973c8f9f6a9;hb=cd54e31a5922b329de20ca6cb355a4212a7aa704;hp=949a3291721be33c9aaed16b6dfb28aede962ba4;hpb=f41d06f583b0461446aeac93551a2e0931d50ac0;p=chaz%2Fopenbox diff --git a/openbox/focus.c b/openbox/focus.c index 949a3291..8950a31e 100644 --- a/openbox/focus.c +++ b/openbox/focus.c @@ -122,13 +122,17 @@ static gboolean focus_under_pointer() if (ob_pointer_pos(&x, &y)) { for (it = stacking_list; it != NULL; it = it->next) { - Client *c = it->data; - if (c->desktop == screen_desktop && - RECT_CONTAINS(c->frame->area, x, y)) - break; + if (WINDOW_IS_CLIENT(it->data)) { + Client *c = WINDOW_AS_CLIENT(it->data); + if (c->desktop == screen_desktop && + RECT_CONTAINS(c->frame->area, x, y)) + break; + } } - if (it != NULL) + if (it != NULL) { + g_assert(WINDOW_IS_CLIENT(it->data)); return client_normal(it->data) && client_focus(it->data); + } } return FALSE; } @@ -215,7 +219,8 @@ void focus_fallback(FallbackType type) if (type != Fallback_Unfocusing || it->data != old) if (client_normal(it->data) && /* dont fall back to 'anonymous' fullscreen windows. theres no - checks for this is in transient/group fallbacks. */ + checks for this is in transient/group fallbacks, so they can + be fallback targets there. */ !((Client*)it->data)->fullscreen && client_focus(it->data)) return; @@ -261,7 +266,6 @@ Client *focus_cycle(gboolean forward, gboolean linear, gboolean done, Client *ft; if (cancel) { - /*if (first) client_focus(first); XXX*/ if (focus_cycle_target) frame_adjust_focus(focus_cycle_target->frame, FALSE); if (focus_client)