X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=openbox%2Fclient.c;h=5faeacca9ed7bd0b03181c98b6021d47c762696a;hb=881a8647d2eb5f13eccda87a712c180fa9e902cf;hp=2f374bbff5051250d00be751679e92149dbf1cfc;hpb=94140a4b359d5e570a8a886dc359d64f5fcaaf86;p=chaz%2Fopenbox diff --git a/openbox/client.c b/openbox/client.c index 2f374bbf..5faeacca 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -1123,16 +1123,24 @@ static void client_get_desktop(ObClient *self) } if (all != screen_num_desktops) { self->desktop = all; + + ob_debug("client desktop set from parents: 0x%x\n", + self->desktop); } /* try get from the startup-notification protocol */ else if (sn_get_desktop(self->startup_id, &self->desktop)) { if (self->desktop >= screen_num_desktops && self->desktop != DESKTOP_ALL) self->desktop = screen_num_desktops - 1; + ob_debug("client desktop set from startup-notification: 0x%x\n", + self->desktop); } /* defaults to the current desktop */ - else + else { self->desktop = screen_desktop; + ob_debug("client desktop set to the current desktop: %d\n", + self->desktop); + } } } @@ -1700,12 +1708,8 @@ void client_setup_decor_and_functions(ObClient *self, gboolean reconfig) /* finally, the user can have requested no decorations, which overrides everything (but doesnt give it a border if it doesnt have one) */ - if (self->undecorated) { - if (config_theme_keepborder) - self->decorations &= OB_FRAME_DECOR_BORDER; - else - self->decorations = 0; - } + if (self->undecorated) + self->decorations = 0; /* if we don't have a titlebar, then we cannot shade! */ if (!(self->decorations & OB_FRAME_DECOR_TITLEBAR)) @@ -2039,18 +2043,19 @@ void client_update_icons(ObClient *self) if ((hints = XGetWMHints(ob_display, self->window))) { if (hints->flags & IconPixmapHint) { - self->nicons++; + self->nicons = 1; self->icons = g_new(ObClientIcon, self->nicons); xerror_set_ignore(TRUE); if (!RrPixmapToRGBA(ob_rr_inst, hints->icon_pixmap, (hints->flags & IconMaskHint ? hints->icon_mask : None), - &self->icons[self->nicons-1].width, - &self->icons[self->nicons-1].height, - &self->icons[self->nicons-1].data)){ - g_free(&self->icons[self->nicons-1]); - self->nicons--; + &self->icons[0].width, + &self->icons[0].height, + &self->icons[0].data)) + { + g_free(self->icons); + self->nicons = 0; } xerror_set_ignore(FALSE); } @@ -2545,10 +2550,10 @@ static void client_apply_startup_state(ObClient *self, */ client_try_configure(self, &x, &y, &w, &h, &l, &l, FALSE); ob_debug("placed window 0x%x at %d, %d with size %d x %d\n", - self->window, self->area.x, self->area.y, - self->area.width, self->area.height); - oldarea = self->area; /* save the area */ - RECT_SET(self->area, x, y, w, h); /* put where it should be for the premax stuff */ + self->window, x, y, w, h); + /* save the area, and make it where it should be for the premax stuff */ + oldarea = self->area; + RECT_SET(self->area, x, y, w, h); /* apply the states. these are in a carefully crafted order.. */ @@ -3561,17 +3566,19 @@ void client_activate(ObClient *self, gboolean here, gboolean user) guint32 last_time = focus_client ? focus_client->user_time : CurrentTime; gboolean allow = FALSE; - /* if the request came from the user, or if nothing is focused, then grant - the request. - if the currently focused app doesn't set a user_time, then it can't + /* if the currently focused app doesn't set a user_time, then it can't benefit from any focus stealing prevention. + + if the timestamp is missing in the request then let it go through + even if it is source=app, because EVERY APPLICATION DOES THIS because + GTK IS VERY BUGGY AND HARDCODES source=application... WHY!? */ - if (user || !focus_client || !last_time) + if (!last_time || !event_curtime) allow = TRUE; /* otherwise, if they didn't give a time stamp or if it is too old, they don't get focus */ else - allow = event_curtime && event_time_after(event_curtime, last_time); + allow = event_time_after(event_curtime, last_time); ob_debug_type(OB_DEBUG_FOCUS, "Want to activate window 0x%x with time %u (last time %u), " @@ -3977,6 +3984,11 @@ ObClient* client_under_pointer() if (WINDOW_IS_CLIENT(it->data)) { ObClient *c = WINDOW_AS_CLIENT(it->data); if (c->frame->visible && + /* check the desktop, this is done during desktop + switching and windows are shown/hidden status is not + reliable */ + (c->desktop == screen_desktop || + c->desktop == DESKTOP_ALL) && /* ignore all animating windows */ !frame_iconify_animating(c->frame) && RECT_CONTAINS(c->frame->area, x, y))