static void client_get_all(ObClient *self, gboolean real);
static void client_get_startup_id(ObClient *self);
static void client_get_session_ids(ObClient *self);
+static void client_save_session_ids(ObClient *self);
static void client_get_area(ObClient *self);
static void client_get_desktop(ObClient *self);
static void client_get_state(ObClient *self);
(user_time != 0) &&
/* this checks for focus=false for the window */
(!settings || settings->focus != 0) &&
- focus_valid_target(self, FALSE, FALSE, TRUE, FALSE, FALSE))
+ focus_valid_target(self, FALSE, FALSE, TRUE, FALSE, FALSE,
+ settings->focus == 1))
{
activate = TRUE;
}
/* get the session related properties, these can change decorations
from per-app settings */
client_get_session_ids(self);
+ client_save_session_ids(self);
/* now we got everything that can affect the decorations */
if (!real)
STRUT_PARTIAL_SET(strut, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0);
- if (!STRUT_EQUAL(strut, self->strut)) {
+ if (!PARTIAL_STRUT_EQUAL(strut, self->strut)) {
self->strut = strut;
/* updating here is pointless while we're being mapped cuz we're not in
}
}
+/*! Save the session IDs as seen by Openbox when the window mapped, so that
+ users can still access them later if the app changes them */
+static void client_save_session_ids(ObClient *self)
+{
+ OBT_PROP_SETS(self->window, OB_ROLE, utf8, self->role);
+ OBT_PROP_SETS(self->window, OB_NAME, utf8, self->name);
+ OBT_PROP_SETS(self->window, OB_CLASS, utf8, self->class);
+}
+
static void client_change_wm_state(ObClient *self)
{
gulong state[2];
}
/* this function exists to map to the net_active_window message in the ewmh */
-void client_activate(ObClient *self, gboolean desktop, gboolean raise,
+void client_activate(ObClient *self, gboolean desktop,
+ gboolean here, gboolean raise,
gboolean unshade, gboolean user)
{
if ((user && (desktop ||
self->desktop == screen_desktop)) ||
client_can_steal_focus(self, event_curtime, CurrentTime))
{
- client_present(self, FALSE, raise, unshade);
+ client_present(self, here, raise, unshade);
}
else
client_hilite(self, TRUE);
gint *dest, gboolean *near_edge)
{
GList *it;
- Rect *a, *mon;
+ Rect *a;
Rect dock_area;
gint edge;
+ guint i;
a = screen_area(self->desktop, SCREEN_AREA_ALL_MONITORS,
&self->frame->area);
- mon = screen_area(self->desktop, SCREEN_AREA_ONE_MONITOR,
- &self->frame->area);
switch (dir) {
case OB_DIRECTION_NORTH:
- if (my_head >= RECT_TOP(*mon) + 1)
- edge = RECT_TOP(*mon) - 1;
- else
- edge = RECT_TOP(*a) - 1;
+ edge = RECT_TOP(*a) - 1;
break;
case OB_DIRECTION_SOUTH:
- if (my_head <= RECT_BOTTOM(*mon) - 1)
- edge = RECT_BOTTOM(*mon) + 1;
- else
- edge = RECT_BOTTOM(*a) + 1;
+ edge = RECT_BOTTOM(*a) + 1;
break;
case OB_DIRECTION_EAST:
- if (my_head <= RECT_RIGHT(*mon) - 1)
- edge = RECT_RIGHT(*mon) + 1;
- else
- edge = RECT_RIGHT(*a) + 1;
+ edge = RECT_RIGHT(*a) + 1;
break;
case OB_DIRECTION_WEST:
- if (my_head >= RECT_LEFT(*mon) + 1)
- edge = RECT_LEFT(*mon) - 1;
- else
- edge = RECT_LEFT(*a) - 1;
+ edge = RECT_LEFT(*a) - 1;
break;
default:
g_assert_not_reached();
*dest = edge;
*near_edge = TRUE;
+ /* search for edges of monitors */
+ for (i = 0; i < screen_num_monitors; ++i) {
+ Rect *area = screen_area(self->desktop, i, NULL);
+ detect_edge(*area, dir, my_head, my_size, my_edge_start,
+ my_edge_size, dest, near_edge);
+ g_free(area);
+ }
+
+ /* search for edges of clients */
for (it = client_list; it; it = g_list_next(it)) {
ObClient *cur = it->data;
detect_edge(dock_area, dir, my_head, my_size, my_edge_start,
my_edge_size, dest, near_edge);
g_free(a);
- g_free(mon);
}
void client_find_move_directional(ObClient *self, ObDirection dir,