#include "event.h"
#include "openbox.h"
+#include "grab.h"
#include "framerender.h"
#include "client.h"
#include "config.h"
#include "prop.h"
#include "dispatch.h"
#include "focus.h"
-#include "parse.h"
#include "stacking.h"
#include "popup.h"
Window active;
Client *old;
+#ifdef DEBUG_FOCUS
+ g_message("focus_set_client 0x%lx", client ? client->window : 0);
+#endif
+
/* uninstall the old colormap, and install the new one */
screen_install_colormap(focus_client, FALSE);
screen_install_colormap(client, TRUE);
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;
}
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;
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)