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);
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
}
}
}
- } 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;
!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.
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;
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;