#include "openbox/event.h"
#include "openbox/client.h"
#include "openbox/focus.h"
+#include "openbox/screen.h"
typedef struct {
gboolean here;
data->context != OB_FRAME_CONTEXT_FRAME))
{
actions_client_move(data, TRUE);
- client_activate(data->client, o->here, FALSE, FALSE, TRUE);
+ client_activate(data->client, TRUE, o->here, FALSE, FALSE, TRUE);
actions_client_move(data, FALSE);
}
} else if (data->context == OB_FRAME_CONTEXT_DESKTOP) {
}
/* 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);
when the user deliberately selects a window for use.
@param desktop If true, and the window is on another desktop, it will still
be activated.
+ @param here If true, and the window is on another desktop, it will be moved
+ to the current desktop, otherwise the desktop will switch to
+ where the window is.
@param raise If true, the client is brought to the front.
@param unshade If true, the client is unshaded (if it is shaded)
@param user If true, then a user action is what requested the activation;
otherwise, it means an application requested it on its own
*/
-void client_activate(ObClient *self, gboolean desktop, gboolean raise,
- gboolean unshade, gboolean user);
+void client_activate(ObClient *self, gboolean desktop, gboolean here,
+ gboolean raise, gboolean unshade, gboolean user);
/*! Bring all of its helper windows to its desktop. These are the utility and
stuff windows. */
else {
ObClient *t = self->data.normal.data;
if (t) { /* it's set to NULL if its destroyed */
- client_activate(t, TRUE, TRUE, TRUE, TRUE);
+ client_activate(t, TRUE, FALSE, TRUE, TRUE, TRUE);
/* if the window is omnipresent then we need to go to its
desktop */
if (t->desktop == DESKTOP_ALL)
{
ObClient *t = self->data.normal.data;
if (t) { /* it's set to NULL if its destroyed */
- client_activate(t, TRUE, TRUE, TRUE, TRUE);
+ client_activate(t, TRUE, FALSE, TRUE, TRUE, TRUE);
/* if the window is omnipresent then we need to go to its
desktop */
if (t->desktop == DESKTOP_ALL)
it can happen now when the window is on
another desktop, but we still don't
want it! */
- client_activate(client, FALSE, TRUE, TRUE, TRUE);
+ client_activate(client, FALSE, FALSE, TRUE, TRUE, TRUE);
break;
case ClientMessage:
/* validate cuz we query stuff off the client here */
ob_debug_type(OB_DEBUG_APP_BUGS,
"_NET_ACTIVE_WINDOW message for window %s is "
"missing source indication\n", client->title);
- client_activate(client, FALSE, TRUE, TRUE,
+ client_activate(client, FALSE, FALSE, TRUE, TRUE,
(e->xclient.data.l[0] == 0 ||
e->xclient.data.l[0] == 2));
} else if (msgtype == prop_atoms.net_wm_moveresize) {