screen_update_struts();
+ dispatch_client(Event_Client_New, self, 0, 0);
+
/* make sure the window is visible */
client_move_onscreen(self);
- dispatch_client(Event_Client_New, self, 0, 0);
-
client_showhide(self);
if (activate) client_activate(self);
static void client_get_desktop(Client *self)
{
- guint32 d;
+ guint32 d = screen_num_desktops; /* an always-invalid value */
if (PROP_GET32(self->window, net_wm_desktop, cardinal, &d)) {
if (d >= screen_num_desktops && d != DESKTOP_ALL)
- d = screen_num_desktops - 1;
- self->desktop = d;
+ self->desktop = screen_num_desktops - 1;
+ else
+ self->desktop = d;
} else {
gboolean trdesk = FALSE;
/* defaults to the current desktop */
self->desktop = screen_desktop;
+ }
+ if (self->desktop != d) {
/* set the desktop hint, to make sure that it always exists */
PROP_SET32(self->window, net_wm_desktop, cardinal, self->desktop);
}
if (self->type == Type_Desktop && self->desktop != DESKTOP_ALL)
client_set_desktop(self, DESKTOP_ALL, FALSE);
- /* change the decors on the frame, and with more/less decorations,
- we may also need to be repositioned */
- frame_adjust_area(self->frame, TRUE, TRUE);
- /* with new decor, the window's maximized size may change */
+ /* adjust the client's decorations, etc. */
client_reconfigure(self);
} else {
/* this makes sure that these windows appear on all desktops */
void client_reconfigure(Client *self)
{
+ /* by making this pass FALSE for user, we avoid the emacs event storm where
+ every configurenotify causes an update in its normal hints, i think this
+ is generally what we want anyways... */
client_configure(self, Corner_TopLeft, self->area.x, self->area.y,
- self->area.width, self->area.height, TRUE, TRUE);
+ self->area.width, self->area.height, FALSE, TRUE);
}
void client_update_wmhints(Client *self)
calc_recursive(it->data, orig, l, raised ? raised : l != old);
if (!raised && l != old)
- if (orig->frame) /* only restack if the original window is managed */
- stacking_raise(CLIENT_AS_WINDOW(self));
+ if (orig->frame) { /* only restack if the original window is managed */
+ /* XXX add_non_intrusive ever? */
+ stacking_remove(CLIENT_AS_WINDOW(self));
+ stacking_add(CLIENT_AS_WINDOW(self));
+ }
}
void client_calc_layer(Client *self)
/* move/resize the frame to match the request */
if (self->frame) {
+ if (self->decorations != self->frame->decorations)
+ moved = resized = TRUE;
+
if (moved || resized)
frame_adjust_area(self->frame, moved, resized);