]> Dogcows Code - chaz/openbox/commitdiff
improve the colormap setting code
authorDana Jansens <danakj@orodu.net>
Sun, 27 May 2007 22:38:48 +0000 (22:38 +0000)
committerDana Jansens <danakj@orodu.net>
Sun, 27 May 2007 22:38:48 +0000 (22:38 +0000)
openbox/screen.c

index f424ca041c13480c076eea71840da70878bb3649..deaf55ee20dee5910d38a1a2a55f1831dd16f54d 100644 (file)
@@ -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);
     }
This page took 0.023636 seconds and 4 git commands to generate.