From: Dana Jansens Date: Sun, 27 May 2007 22:40:41 +0000 (+0000) Subject: merge r6948-6953 from trunk X-Git-Tag: openbox-3_3_995-RELEASE~55 X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=1d15f0df91b86f50efd3e015a0fa5e1f5a304116;p=dana%2Fopenbox.git merge r6948-6953 from trunk --- diff --git a/openbox/client.c b/openbox/client.c index 275742b3..3f891b5a 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -277,7 +277,7 @@ void client_manage(Window window) XFree(wmhint); } - ob_debug("Managing window: %lx\n", window); + ob_debug("Managing window: 0x%lx\n", window); /* choose the events we want to receive on the CLIENT window */ attrib_set.event_mask = CLIENT_EVENTMASK; @@ -1534,7 +1534,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) @@ -3463,8 +3472,8 @@ gboolean client_focus(ObClient *self) } ob_debug_type(OB_DEBUG_FOCUS, - "Focusing client \"%s\" at time %u\n", - self->title, event_curtime); + "Focusing client \"%s\" (0x%x) at time %u\n", + self->title, self->window, event_curtime); /* if there is a grab going on, then we need to cancel it. if we move focus during the grab, applications will get NotifyWhileGrabbed events @@ -3502,6 +3511,7 @@ gboolean client_focus(ObClient *self) xerror_set_ignore(FALSE); + ob_debug_type(OB_DEBUG_FOCUS, "Error focusing? %d\n", xerror_occured); return !xerror_occured; } diff --git a/openbox/event.c b/openbox/event.c index 3bfca98e..ac5919ed 100644 --- a/openbox/event.c +++ b/openbox/event.c @@ -1455,6 +1455,7 @@ static void event_handle_client(ObClient *client, XEvent *e) client_update_sync_request_counter(client); } #endif + break; case ColormapNotify: client_update_colormap(client, e->xcolormap.colormap); break; diff --git a/openbox/frame.c b/openbox/frame.c index 1e93649d..92db14ae 100644 --- a/openbox/frame.c +++ b/openbox/frame.c @@ -856,13 +856,11 @@ void frame_grab_client(ObFrame *self) /* When reparenting the client window, it is usually not mapped yet, since this occurs from a MapRequest. However, in the case where Openbox is - starting up, the window is already mapped, so we'll see unmap events for - it. There are 2 unmap events generated that we see, one with the 'event' - member set the root window, and one set to the client, but both get - handled and need to be ignored. + starting up, the window is already mapped, so we'll see an unmap event + for it. */ if (ob_state() == OB_STATE_STARTING) - self->client->ignore_unmaps += 2; + ++self->client->ignore_unmaps; /* select the event mask on the client's parent (to receive config/map req's) the ButtonPress is to catch clicks on the client border */ diff --git a/openbox/screen.c b/openbox/screen.c index f424ca04..deaf55ee 100644 --- a/openbox/screen.c +++ b/openbox/screen.c @@ -1026,17 +1026,16 @@ void screen_show_desktop(gboolean show, ObClient *show_only) void screen_install_colormap(ObClient *client, gboolean install) { - if (client == NULL) { + if (client == NULL || client->colormap == None) { if (install) XInstallColormap(RrDisplay(ob_rr_inst), RrColormap(ob_rr_inst)); else XUninstallColormap(RrDisplay(ob_rr_inst), RrColormap(ob_rr_inst)); } else { xerror_set_ignore(TRUE); - if (install) { - if (client->colormap != None) - XInstallColormap(RrDisplay(ob_rr_inst), client->colormap); - } else + if (install) + XInstallColormap(RrDisplay(ob_rr_inst), client->colormap); + else XUninstallColormap(RrDisplay(ob_rr_inst), client->colormap); xerror_set_ignore(FALSE); } diff --git a/openbox/xerror.c b/openbox/xerror.c index 3de593b8..14c0ecd6 100644 --- a/openbox/xerror.c +++ b/openbox/xerror.c @@ -27,20 +27,22 @@ gboolean xerror_occured = FALSE; gint xerror_handler(Display *d, XErrorEvent *e) { - xerror_occured = TRUE; #ifdef DEBUG - if (!xerror_ignore) { - gchar errtxt[128]; + gchar errtxt[128]; - XGetErrorText(d, e->error_code, errtxt, 127); + XGetErrorText(d, e->error_code, errtxt, 127); + if (!xerror_ignore) { if (e->error_code == BadWindow) /*g_message(_("X Error: %s\n"), errtxt)*/; else g_error(_("X Error: %s"), errtxt); - } + } else + ob_debug("XError code %d '%s'\n", e->error_code, errtxt); #else (void)d; (void)e; #endif + + xerror_occured = TRUE; return 0; }