screen.c for the Openbox window manager
Copyright (c) 2006 Mikael Magnusson
- Copyright (c) 2003 Ben Jansens
+ Copyright (c) 2003-2007 Dana Jansens
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
/*! The event mask to grab on the root window */
#define ROOT_EVENTMASK (StructureNotifyMask | PropertyChangeMask | \
EnterWindowMask | LeaveWindowMask | \
- SubstructureNotifyMask | SubstructureRedirectMask | \
+ SubstructureRedirectMask | \
ButtonPressMask | ButtonReleaseMask | ButtonMotionMask)
guint screen_num_desktops;
for (it = stacking_list; it; it = g_list_next(it)) {
if (WINDOW_IS_CLIENT(it->data)) {
ObClient *c = it->data;
- if (client_should_show(c))
- frame_show(c->frame);
+ client_showhide(c);
}
}
for (it = g_list_last(stacking_list); it; it = g_list_previous(it)) {
if (WINDOW_IS_CLIENT(it->data)) {
ObClient *c = it->data;
- if (c->frame->visible && !client_should_show(c))
- frame_hide(c->frame);
+ client_showhide(c);
}
}
event_ignore_queued_enters();
- focus_hilite = focus_fallback_target(OB_FOCUS_FALLBACK_NOFOCUS, NULL);
+ focus_hilite = focus_fallback_target(TRUE, focus_client);
if (focus_hilite) {
frame_adjust_focus(focus_hilite->frame, TRUE);
for (it = g_list_last(stacking_list); it; it = g_list_previous(it)) {
if (WINDOW_IS_CLIENT(it->data)) {
ObClient *client = it->data;
- if (client->frame->visible && !client_should_show(client))
- frame_hide(client->frame);
+ client_showhide(client);
}
}
} else {
for (it = stacking_list; it; it = g_list_next(it)) {
if (WINDOW_IS_CLIENT(it->data)) {
ObClient *client = it->data;
- if (!client->frame->visible && client_should_show(client))
- frame_show(client->frame);
+ client_showhide(client);
}
}
}
/* focus desktop */
for (it = focus_order[screen_desktop]; it; it = g_list_next(it))
if (((ObClient*)it->data)->type == OB_CLIENT_TYPE_DESKTOP &&
- client_focus(it->data))
+ client_validate(it->data) && client_focus(it->data))
break;
} else {
- focus_fallback(OB_FOCUS_FALLBACK_NOFOCUS);
+ focus_fallback(TRUE);
}
show = !!show; /* make it boolean */
return &area[desktop][head];
}
+guint screen_find_monitor(Rect *search)
+{
+ guint i;
+ guint most = 0;
+ guint mostv = 0;
+
+ for (i = 0; i < screen_num_monitors; ++i) {
+ Rect *area = screen_physical_area_monitor(i);
+ if (RECT_INTERSECTS_RECT(*area, *search)) {
+ Rect r;
+ guint v;
+
+ RECT_SET_INTERSECTION(r, *area, *search);
+ v = r.width * r.height;
+
+ if (v > mostv) {
+ mostv = v;
+ most = i;
+ }
+ }
+ }
+ return most;
+}
+
Rect *screen_physical_area()
{
return screen_physical_area_monitor(screen_num_monitors);