From 7ae95e46606a1fa22e302fd2c1ea99cb23acbd81 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Tue, 24 Apr 2007 01:29:53 +0000 Subject: save windows' colormaps rather than querying them from the server every time you focus it --- openbox/screen.c | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'openbox/screen.c') diff --git a/openbox/screen.c b/openbox/screen.c index 74b8e71d..587dc647 100644 --- a/openbox/screen.c +++ b/openbox/screen.c @@ -907,23 +907,19 @@ void screen_show_desktop(gboolean show) void screen_install_colormap(ObClient *client, gboolean install) { - XWindowAttributes wa; - if (client == NULL) { if (install) XInstallColormap(RrDisplay(ob_rr_inst), RrColormap(ob_rr_inst)); else XUninstallColormap(RrDisplay(ob_rr_inst), RrColormap(ob_rr_inst)); } else { - if (XGetWindowAttributes(ob_display, client->window, &wa) && - wa.colormap != None) { - xerror_set_ignore(TRUE); - if (install) - XInstallColormap(RrDisplay(ob_rr_inst), wa.colormap); - else - XUninstallColormap(RrDisplay(ob_rr_inst), wa.colormap); - xerror_set_ignore(FALSE); - } + xerror_set_ignore(TRUE); + if (install) { + if (client->colormap != None) + XInstallColormap(RrDisplay(ob_rr_inst), client->colormap); + } else + XUninstallColormap(RrDisplay(ob_rr_inst), client->colormap); + xerror_set_ignore(FALSE); } } -- cgit v1.2.3