X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;ds=sidebyside;f=openbox%2Fclient.c;h=477575a8cf9817717e33bd8ca395d5103c35a5f6;hb=16fcb1213d4ccfccd4e4a8ad5e8b0c826dc5c16e;hp=8bdd092da23402950145fa4768e6185faed0545c;hpb=a9ff8217bf24a6c8f2e8e013b97a283df9910f39;p=chaz%2Fopenbox diff --git a/openbox/client.c b/openbox/client.c index 8bdd092d..477575a8 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -1122,13 +1122,16 @@ static void client_get_desktop(ObClient *self) self->desktop = screen_num_desktops - 1; else self->desktop = d; + ob_debug("client requested desktop 0x%x\n", self->desktop); } else { gboolean trdesk = FALSE; if (self->transient_for) { if (self->transient_for != OB_TRAN_GROUP) { - self->desktop = self->transient_for->desktop; - trdesk = TRUE; + if (self->transient_for->desktop != DESKTOP_ALL) { + self->desktop = self->transient_for->desktop; + trdesk = TRUE; + } } else { /* if all the group is on one desktop, then open it on the same desktop */ @@ -1534,7 +1537,16 @@ void client_get_colormap(ObClient *self) void client_update_colormap(ObClient *self, Colormap colormap) { - self->colormap = colormap; + if (colormap == self->colormap) return; + + ob_debug("Setting client %s colormap: 0x%x\n", self->title, colormap); + + if (client_focused(self)) { + screen_install_colormap(self, FALSE); /* uninstall old one */ + self->colormap = colormap; + screen_install_colormap(self, FALSE); /* install new one */ + } else + self->colormap = colormap; } void client_update_normal_hints(ObClient *self) @@ -3451,6 +3463,8 @@ gboolean client_can_focus(ObClient *self) gboolean client_focus(ObClient *self) { + client_bring_modal_windows(self); + /* choose the correct target */ self = client_focus_target(self); @@ -3570,15 +3584,18 @@ void client_activate(ObClient *self, gboolean here, gboolean user) client_hilite(self, TRUE); } -static void client_bring_helper_windows_recursive(ObClient *self, - guint desktop) +static void client_bring_windows_recursive(ObClient *self, + guint desktop, + gboolean helpers, + gboolean modals) { GSList *it; for (it = self->transients; it; it = g_slist_next(it)) - client_bring_helper_windows_recursive(it->data, desktop); + client_bring_windows_recursive(it->data, desktop, helpers, modals); - if (client_helper(self) && + if (((helpers && client_helper(self)) || + (modals && self->modal))&& self->desktop != desktop && self->desktop != DESKTOP_ALL) { client_set_desktop(self, desktop, FALSE); @@ -3587,7 +3604,12 @@ static void client_bring_helper_windows_recursive(ObClient *self, void client_bring_helper_windows(ObClient *self) { - client_bring_helper_windows_recursive(self, self->desktop); + client_bring_windows_recursive(self, self->desktop, TRUE, FALSE); +} + +void client_bring_modal_windows(ObClient *self) +{ + client_bring_windows_recursive(self, self->desktop, FALSE, TRUE); } gboolean client_focused(ObClient *self)