]> Dogcows Code - chaz/openbox/blobdiff - openbox/screen.c
asserts in unmanage to try track a crash
[chaz/openbox] / openbox / screen.c
index 073b565f0342e239cd469f140c4d8054c2b8d817..82e51f4b04c3787b27255c7c7c443b030a63d6e3 100644 (file)
@@ -377,24 +377,16 @@ void screen_update_desktop_names()
 void screen_show_desktop(gboolean show)
 {
     GList *it;
-    static Window saved_focus = 0;
      
     if (show == screen_showing_desktop) return; /* no change */
 
-    /* save the window focus, and restore it when leaving the show-desktop
-       mode */
-    if (show && focus_client)
-       saved_focus = focus_client->window;
-  
     screen_showing_desktop = show;
 
     if (show) {
        /* bottom to top */
        for (it = g_list_last(stacking_list); it != NULL; it = it->prev) {
            Client *client = it->data;
-           if (client->type == Type_Desktop)
-               client_focus(client);
-           else if (client->frame->visible && !client_should_show(client))
+           if (client->frame->visible && !client_should_show(client))
                 engine_frame_hide(client->frame);
        }
     } else {
@@ -406,15 +398,6 @@ void screen_show_desktop(gboolean show)
        }
     }
 
-    if (!show) {
-       Client *f = focus_client;
-       if (!f || f->type == Type_Desktop) {
-           Client *c = g_hash_table_lookup(client_map,
-                                           (gpointer)saved_focus);
-           if (c) client_focus(c);
-       }
-    }
-
     show = !!show; /* make it boolean */
     PROP_SET32(ob_root, net_showing_desktop, cardinal, show);
 
@@ -423,13 +406,14 @@ void screen_show_desktop(gboolean show)
 
 void screen_install_colormap(Client *client, gboolean install)
 {
+    XWindowAttributes wa;
+
     if (client == NULL) {
        if (install)
            XInstallColormap(ob_display, render_colormap);
        else
            XUninstallColormap(ob_display, render_colormap);
     } else {
-       XWindowAttributes wa;
        if (XGetWindowAttributes(ob_display, client->window, &wa) &&
             wa.colormap != None) {
            if (install)
@@ -445,11 +429,10 @@ void screen_update_struts()
     GSList *it;
     guint i;
      
-    if (strut != NULL)
-       g_free(strut);
+    g_free(strut);
     strut = g_new0(Strut, screen_num_desktops + 1);
 
-    for (it = client_list; it; it = it->next) {
+    for (it = client_list; it != NULL; it = it->next) {
        Client *c = it->data;
        if (c->iconic) continue; /* these dont count in the strut */
     
@@ -470,9 +453,8 @@ static void screen_update_area()
 {
     guint i;
     gulong *dims;
-     
-    if (area != NULL)
-       g_free(area);
+
+    g_free(area);
     area = g_new0(Rect, screen_num_desktops + 1);
      
     dims = g_new(unsigned long, 4 * screen_num_desktops);
This page took 0.027229 seconds and 4 git commands to generate.