From a59540f25aed8551262a89b6426b201546a8418c Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Sun, 27 May 2007 22:38:48 +0000 Subject: [PATCH] improve the colormap setting code --- openbox/screen.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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); } -- 2.44.0