From a34a66594dcea571dae16801e7fb11342c5f562f Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sat, 5 May 2007 02:39:46 +0000 Subject: [PATCH] merge r6053-6058 from trunk --- openbox/action.c | 21 +++++++++++++++++---- openbox/client.c | 19 +++++++++---------- openbox/focus.c | 17 ++++++++++++----- openbox/moveresize.c | 4 ++-- 4 files changed, 40 insertions(+), 21 deletions(-) diff --git a/openbox/action.c b/openbox/action.c index 249dec07..c91ea3c7 100644 --- a/openbox/action.c +++ b/openbox/action.c @@ -1098,16 +1098,29 @@ void action_run_list(GSList *acts, ObClient *c, ObFrameContext context, if (a->data.any.interactive || a->func == action_moveresize) { /* interactive actions are not queued */ a->func(&a->data); - } else if (context == OB_FRAME_CONTEXT_CLIENT || - (c && c->type == OB_CLIENT_TYPE_DESKTOP && - context == OB_FRAME_CONTEXT_DESKTOP)) { + } else if ((context == OB_FRAME_CONTEXT_CLIENT || + (c && c->type == OB_CLIENT_TYPE_DESKTOP && + context == OB_FRAME_CONTEXT_DESKTOP)) && + (a->func == action_focus || + a->func == action_activate)) + { /* XXX MORE UGLY HACK actions from clicks on client windows are NOT queued. this solves the mysterious click-and-drag-doesnt-work problem. it was because the window gets focused and stuff after the button event has already been passed through. i dont really know why it should care but it does and it makes - a difference. */ + a difference. + + however this very bogus ! ! + we want to send the button press to the window BEFORE + we do the action because the action might move the windows + (eg change desktops) and then the button press ends up on + the completely wrong window ! + so, this is just for that bug, and it will only NOT queue it + if it is a focusing action that can be used with the mouse + pointer. ugh. + */ a->func(&a->data); } else ob_main_loop_queue_action(ob_main_loop, a); diff --git a/openbox/client.c b/openbox/client.c index 1714e29c..c0323c26 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -931,7 +931,7 @@ static void client_get_all(ObClient *self) client_update_wmhints(self); /* this may have already been called from client_update_wmhints */ - if (self->transient && self->transient_for == NULL) + if (self->transient_for == NULL) client_update_transient_for(self); client_get_startup_id(self); client_get_desktop(self);/* uses transient data/group/startup id if a @@ -1179,15 +1179,14 @@ void client_update_transient_for(ObClient *self) } } } - } else if (self->group) { - if (self->type == OB_CLIENT_TYPE_DIALOG || - self->type == OB_CLIENT_TYPE_TOOLBAR || - self->type == OB_CLIENT_TYPE_MENU || - self->type == OB_CLIENT_TYPE_UTILITY) - { - self->transient = TRUE; + } else if (self->type == OB_CLIENT_TYPE_DIALOG || + self->type == OB_CLIENT_TYPE_TOOLBAR || + self->type == OB_CLIENT_TYPE_MENU || + self->type == OB_CLIENT_TYPE_UTILITY) + { + self->transient = TRUE; + if (self->group) target = OB_TRAN_GROUP; - } } else self->transient = FALSE; @@ -1281,7 +1280,7 @@ static void client_update_transient_tree(ObClient *self, !client_is_direct_child(self, newparent)) newparent->transients = g_slist_append(newparent->transients, self); - /* If the group changed then we need to add any old group transient + /* If the group changed then we need to add any new group transient windows to our children. But if we're transient for the group, then other group transients are not our children. diff --git a/openbox/focus.c b/openbox/focus.c index b1e31236..823435c9 100644 --- a/openbox/focus.c +++ b/openbox/focus.c @@ -475,13 +475,20 @@ static gboolean valid_focus_target(ObClient *ft, gboolean dock_windows) else ok = (ft->type == OB_CLIENT_TYPE_NORMAL || ft->type == OB_CLIENT_TYPE_DIALOG || - (!client_has_application_group_siblings(ft) && - (ft->type == OB_CLIENT_TYPE_TOOLBAR || + ((ft->type == OB_CLIENT_TYPE_TOOLBAR || ft->type == OB_CLIENT_TYPE_MENU || - ft->type == OB_CLIENT_TYPE_UTILITY))); + ft->type == OB_CLIENT_TYPE_UTILITY) && + /* let alt-tab go to these windows when a window in its group + already has focus ... */ + ((focus_client && ft->group == focus_client->group) || + /* ... or if there are no application windows in its group */ + !client_has_application_group_siblings(ft)))); ok = ok && (ft->can_focus || ft->focus_notify); - if (!dock_windows) /* use dock windows that skip taskbar too */ - ok = ok && !ft->skip_taskbar; + if (!dock_windows && /* use dock windows that skip taskbar too */ + !(ft->type == OB_CLIENT_TYPE_TOOLBAR || /* also, if we actually are */ + ft->type == OB_CLIENT_TYPE_MENU || /* being allowed to target */ + ft->type == OB_CLIENT_TYPE_UTILITY)) /* one of these, don't let */ + ok = ok && !ft->skip_taskbar; /* skip taskbar stop us */ ok = ok && (ft->desktop == screen_desktop || ft->desktop == DESKTOP_ALL); ok = ok && ft == client_focus_target(ft); return ok; diff --git a/openbox/moveresize.c b/openbox/moveresize.c index afd0de2a..868c0c25 100644 --- a/openbox/moveresize.c +++ b/openbox/moveresize.c @@ -407,12 +407,12 @@ gboolean moveresize_event(XEvent *e) start_y = e->xbutton.y_root; button = e->xbutton.button; /* this will end it now */ } - used = TRUE; + used = e->xbutton.button == button; } else if (e->type == ButtonRelease) { if (!button || e->xbutton.button == button) { moveresize_end(FALSE); + used = TRUE; } - used = TRUE; } else if (e->type == MotionNotify) { if (moving) { cur_x = start_cx + e->xmotion.x_root - start_x; -- 2.34.1