From 520787d81a3d43ca3d685edb171c6d1d8374a397 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sat, 2 Jun 2007 19:18:30 +0000 Subject: [PATCH] merge r7243-7255 from trunk --- README.NLS | 3 +++ openbox/action.c | 27 +++------------------------ openbox/client.c | 12 +++++------- openbox/event.c | 26 ++++++++++++++++++++++---- openbox/stacking.c | 22 +++++++++++++++++++--- openbox/stacking.h | 2 +- 6 files changed, 53 insertions(+), 39 deletions(-) create mode 100644 README.NLS diff --git a/README.NLS b/README.NLS new file mode 100644 index 00000000..7495afda --- /dev/null +++ b/README.NLS @@ -0,0 +1,3 @@ +Use this command to create a new .po + +msginit --locale xx_YY file.pot diff --git a/openbox/action.c b/openbox/action.c index a01f4d06..39c1169b 100644 --- a/openbox/action.c +++ b/openbox/action.c @@ -1329,31 +1329,10 @@ void action_focus_order_to_bottom(union ActionData *data) void action_raiselower(union ActionData *data) { ObClient *c = data->client.any.c; - GList *it; - gboolean raise = FALSE; - - for (it = stacking_list; it; it = g_list_next(it)) { - if (WINDOW_IS_CLIENT(it->data)) { - ObClient *cit = it->data; - - if (cit == c) break; - if (client_normal(cit) == client_normal(c) && - cit->layer == c->layer && - cit->frame->visible && - !client_search_transient(c, cit)) - { - if (RECT_INTERSECTS_RECT(cit->frame->area, c->frame->area)) { - raise = TRUE; - break; - } - } - } - } - if (raise) - action_raise(data); - else - action_lower(data); + client_action_start(data); + stacking_restack_request(c, NULL, Opposite, FALSE); + client_action_end(data); } void action_raise(union ActionData *data) diff --git a/openbox/client.c b/openbox/client.c index 89873331..7da2d28a 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -3246,8 +3246,7 @@ void client_set_desktop_recursive(ObClient *self, client_set_desktop_recursive(it->data, target, donthide); } -void client_set_desktop(ObClient *self, guint target, - gboolean donthide) +void client_set_desktop(ObClient *self, guint target, gboolean donthide) { self = client_search_top_normal_parent(self); client_set_desktop_recursive(self, target, donthide); @@ -3871,13 +3870,12 @@ ObClient *client_search_transient(ObClient *self, ObClient *search) } #define WANT_EDGE(cur, c) \ - if(cur == c) \ + if (cur == c) \ continue; \ - if(!client_normal(cur)) \ + if (c->desktop != cur->desktop && cur->desktop != DESKTOP_ALL && \ + cur->desktop != screen_desktop) \ continue; \ - if(screen_desktop != cur->desktop && cur->desktop != DESKTOP_ALL) \ - continue; \ - if(cur->iconic) \ + if (cur->iconic) \ continue; #define HIT_EDGE(my_edge_start, my_edge_end, his_edge_start, his_edge_end) \ diff --git a/openbox/event.c b/openbox/event.c index 77d5b982..6e4b4b50 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -484,6 +484,23 @@ static void event_process(const XEvent *ec, gpointer data) /* crossing events for menu */ event_handle_menu(e); } else if (e->type == FocusIn) { + if (client && + e->xfocus.detail == NotifyInferior) + { + ob_debug_type(OB_DEBUG_FOCUS, + "Focus went to the frame window"); + + focus_left_screen = FALSE; + + focus_fallback(FALSE, FALSE); + + /* We don't get a FocusOut for this case, because it's just moving + from our Inferior up to us. This happens when iconifying a + window with RevertToParent focus */ + frame_adjust_focus(client->frame, FALSE); + /* focus_set_client(NULL) has already been called */ + client_calc_layer(client); + } if (e->xfocus.detail == NotifyPointerRoot || e->xfocus.detail == NotifyDetailNone || e->xfocus.detail == NotifyInferior || @@ -491,9 +508,8 @@ static void event_process(const XEvent *ec, gpointer data) { XEvent ce; - ob_debug_type(OB_DEBUG_FOCUS, "Focus went to root, " - "pointer root/none or " - "the frame window\n"); + ob_debug_type(OB_DEBUG_FOCUS, + "Focus went to root or pointer root/none\n"); if (e->xfocus.detail == NotifyInferior || e->xfocus.detail == NotifyNonlinear) @@ -538,7 +554,9 @@ static void event_process(const XEvent *ec, gpointer data) /* If you send focus to a window and then it disappears, you can get the FocusIn for it, after it is unmanaged. - Just wait for the next FocusOut/FocusIn pair. */ + Just wait for the next FocusOut/FocusIn pair, but make note that + the window that was focused no longer is. */ + focus_set_client(NULL); } else if (client != focus_client) { focus_left_screen = FALSE; diff --git a/openbox/stacking.c b/openbox/stacking.c index ce3befca..5d01e5e9 100644 --- a/openbox/stacking.c +++ b/openbox/stacking.c @@ -483,7 +483,10 @@ static gboolean stacking_occluded(ObClient *client, ObClient *sibling) it = (found ? g_list_previous(it) :g_list_next(it))) if (WINDOW_IS_CLIENT(it->data)) { ObClient *c = it->data; - if (found) { + if (found && !c->iconic && + (c->desktop == DESKTOP_ALL || client->desktop == DESKTOP_ALL || + c->desktop == client->desktop)) + { if (RECT_INTERSECTS_RECT(c->frame->area, client->frame->area)) { if (sibling != NULL) { @@ -506,7 +509,7 @@ static gboolean stacking_occluded(ObClient *client, ObClient *sibling) return occluded; } -/*! Returns TRUE if client is occludes the sibling. If sibling is NULL it tries +/*! Returns TRUE if client occludes the sibling. If sibling is NULL it tries against all other clients. */ static gboolean stacking_occludes(ObClient *client, ObClient *sibling) @@ -522,7 +525,10 @@ static gboolean stacking_occludes(ObClient *client, ObClient *sibling) for (it = stacking_list; it; it = g_list_next(it)) if (WINDOW_IS_CLIENT(it->data)) { ObClient *c = it->data; - if (found) { + if (found && !c->iconic && + (c->desktop == DESKTOP_ALL || client->desktop == DESKTOP_ALL || + c->desktop == client->desktop)) + { if (RECT_INTERSECTS_RECT(c->frame->area, client->frame->area)) { if (sibling != NULL) { @@ -548,6 +554,16 @@ static gboolean stacking_occludes(ObClient *client, ObClient *sibling) void stacking_restack_request(ObClient *client, ObClient *sibling, gint detail, gboolean activate) { + if (sibling && ((client->desktop != sibling->desktop && + client->desktop != DESKTOP_ALL && + sibling->desktop != DESKTOP_ALL) || + sibling->iconic)) + { + ob_debug("Setting restack sibling to NULL, they are not on the same " + "desktop or it is iconified\n"); + sibling = NULL; + } + switch (detail) { case Below: ob_debug("Restack request Below for client %s sibling %s\n", diff --git a/openbox/stacking.h b/openbox/stacking.h index d93341c8..eb638734 100644 --- a/openbox/stacking.h +++ b/openbox/stacking.h @@ -72,6 +72,6 @@ void stacking_below(ObWindow *window, ObWindow *below); */ void stacking_restack_request(struct _ObClient *client, struct _ObClient *sibling, - gint detail, gboolean); + gint detail, gboolean activate); #endif -- 2.34.1