From cf033623a0f5519a42d13119db5e023ffe08a1ac Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Wed, 9 Dec 2009 10:56:43 -0500 Subject: Allow skip_taskbar windows to be focused on map when the user requests it in rc.xml. Fixes bug #4350 --- openbox/client.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'openbox/client.c') diff --git a/openbox/client.c b/openbox/client.c index a91b9503..c4576952 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -370,7 +370,8 @@ void client_manage(Window window, ObPrompt *prompt) (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; } -- cgit v1.2.3 From 324ba15ebc79eb95cf6ec9c0f7d42250fc30f11b Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Wed, 9 Dec 2009 13:25:19 -0500 Subject: Fix the Focus/Activate actions to focus windows on other desktops correctly --- openbox/client.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'openbox/client.c') diff --git a/openbox/client.c b/openbox/client.c index c4576952..b3f95364 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -3931,7 +3931,8 @@ static void client_present(ObClient *self, gboolean here, gboolean raise, } /* 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 || @@ -3939,7 +3940,7 @@ void client_activate(ObClient *self, gboolean desktop, gboolean raise, 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); -- cgit v1.2.3 From 543828c23f36315e27516a88b7bd0bc8998e741c Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Wed, 9 Dec 2009 14:00:51 -0500 Subject: Properly react when a client's strut changes. Previously it would only react if the height of the strut changed, not if its start/end changed (that was a long-standing bug). --- openbox/client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'openbox/client.c') diff --git a/openbox/client.c b/openbox/client.c index b3f95364..030e893a 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -2111,7 +2111,7 @@ void client_update_strut(ObClient *self) 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 -- cgit v1.2.3 From ade3b4dd69cf275bbaf5de663e1b723d6c073eb1 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Wed, 9 Dec 2009 16:00:32 -0500 Subject: Make the edge detection fully include monitor edges. This fixes the move-to-edge behaviour, when moving past the edge of a monitor, the window will stop with its tail edge against the inside of the monitor's edge. --- openbox/client.c | 35 +++++++++++++++-------------------- 1 file changed, 15 insertions(+), 20 deletions(-) (limited to 'openbox/client.c') diff --git a/openbox/client.c b/openbox/client.c index 030e893a..fcbe7cd9 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -4237,39 +4237,26 @@ void client_find_edge_directional(ObClient *self, ObDirection dir, 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(); @@ -4278,6 +4265,15 @@ void client_find_edge_directional(ObClient *self, ObDirection dir, *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; @@ -4299,7 +4295,6 @@ void client_find_edge_directional(ObClient *self, ObDirection dir, 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, -- cgit v1.2.3 From 9ba2b04e96449fea5b6bd212aa3d431638754bdd Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Fri, 11 Dec 2009 18:27:46 -0500 Subject: Set hints that remember the WM_WINDOW_ROLE and WM_CLASS properties for our users. The hints are _OB_ROLE, _OB_NAME, and _OB_CLASS. --- openbox/client.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'openbox/client.c') diff --git a/openbox/client.c b/openbox/client.c index fcbe7cd9..e3a7d6ec 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -76,6 +76,7 @@ static RrImage *client_default_icon = NULL; 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); @@ -1159,6 +1160,7 @@ static void client_get_all(ObClient *self, gboolean real) /* 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) @@ -2367,6 +2369,15 @@ static void client_get_session_ids(ObClient *self) } } +/*! 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) +{ + PROP_SETS(self->window, ob_role, self->role); + PROP_SETS(self->window, ob_name, self->name); + PROP_SETS(self->window, ob_class, self->class); +} + static void client_change_wm_state(ObClient *self) { gulong state[2]; -- cgit v1.2.3