/* -*- indent-tabs-mode: nil; tab-width: 4; c-basic-offset: 4; -*-
client.c for the Openbox window manager
- Copyright (c) 2004 Mikael Magnusson
+ Copyright (c) 2006 Mikael Magnusson
Copyright (c) 2003 Ben Jansens
This program is free software; you can redistribute it and/or modify
/* get and set application level settings */
settings = get_settings(self);
+ stacking_add(CLIENT_AS_WINDOW(self));
+ client_restore_session_stacking(self);
+
if (settings) {
/* Don't worry, we won't actually both shade and undecorate the
* window when push comes to shove. */
if (settings->fullscreen != -1)
client_fullscreen(self, !!settings->fullscreen, TRUE);
- if (settings->desktop < screen_num_desktops)
- client_set_desktop(self, settings->desktop, FALSE);
+ if (settings->desktop < screen_num_desktops
+ || settings->desktop == DESKTOP_ALL)
+ client_set_desktop(self, settings->desktop, TRUE);
if (settings->layer > -2 && settings->layer < 2)
client_set_layer(self, settings->layer);
}
- stacking_add(CLIENT_AS_WINDOW(self));
- client_restore_session_stacking(self);
-
/* focus the new window? */
if (ob_state() != OB_STATE_STARTING &&
(config_focus_new || client_search_focus_parent(self)) ||
if (ob_state() == OB_STATE_RUNNING) {
gint x = self->area.x, ox = x;
gint y = self->area.y, oy = y;
+ gboolean transient;
- place_client(self, &x, &y, settings);
+ transient = place_client(self, &x, &y, settings);
/* make sure the window is visible. */
client_find_onscreen(self, &x, &y,
off-screen and on xinerama divides (ie,
it is up to the placement routines to avoid
the xinerama divides) */
- ((self->positioned & PPosition) &&
- !(self->positioned & USPosition)) &&
- client_normal(self) &&
- !self->session);
+ transient ||
+ (((self->positioned & PPosition) &&
+ !(self->positioned & USPosition)) &&
+ client_normal(self) &&
+ !self->session));
if (x != ox || y != oy)
client_move(self, x, y);
}
(self->mwmhints.decorations & OB_MWM_DECOR_TITLE)))
/* if the mwm hints request no handle or title, then all
decorations are disabled */
- self->decorations = config_theme_keepborder ? OB_FRAME_DECOR_BORDER : 0;
+ self->decorations = config_theme_keepborder ?
+ self->decorations & OB_FRAME_DECOR_BORDER : 0;
}
}
void client_activate(ObClient *self, gboolean here)
{
- /* This check is for the client_list_menu trying to activate
- * a closed client. */
- if (!g_list_find(client_list, self)) return;
if (client_normal(self) && screen_showing_desktop)
screen_show_desktop(FALSE);
if (self->iconic)