]> Dogcows Code - chaz/openbox/blobdiff - openbox/frame.c
add a client destructor to frame.c so it doesn't try to keep flashing a free'd frame
[chaz/openbox] / openbox / frame.c
index 47c3f0271b2fed6146831590935a96783273621e..2c495b27e76e4071c081e2428547f5c755f364d4 100644 (file)
@@ -43,6 +43,7 @@
 static void layout_title(ObFrame *self);
 static void flash_done(gpointer data);
 static gboolean flash_timeout(gpointer data);
+static void flash_client_dest(ObClient *client, gpointer data);
 
 static void set_theme_statics(ObFrame *self);
 static void free_theme_statics(ObFrame *self);
@@ -56,6 +57,18 @@ static Window createWindow(Window parent, gulong mask,
                        
 }
 
+void frame_startup(gboolean reconfig)
+{
+    if (reconfig) return;
+    client_add_destructor(flash_client_dest, NULL);
+}
+
+void frame_shutdown(gboolean reconfig)
+{
+    if (reconfig) return;
+    client_remove_destructor(flash_client_dest);
+}
+
 ObFrame *frame_new()
 {
     XSetWindowAttributes attrib;
@@ -417,7 +430,6 @@ void frame_adjust_area(ObFrame *self, gboolean moved,
 
         if (resized) {
             framerender_frame(self);
-
             frame_adjust_shape(self);
         }
 
@@ -436,6 +448,9 @@ void frame_adjust_area(ObFrame *self, gboolean moved,
         if (focus_cycle_target == self->client)
             focus_cycle_draw_indicator();
     }
+    if (resized && (self->decorations & OB_FRAME_DECOR_TITLEBAR))
+        XResizeWindow(ob_display, self->label, self->label_width,
+                      ob_rr_theme->label_height);
 }
 
 void frame_adjust_state(ObFrame *self)
@@ -625,9 +640,6 @@ static void layout_title(ObFrame *self)
     }
     if (self->label_width < 1) self->label_width = 1;
 
-    XResizeWindow(ob_display, self->label, self->label_width,
-                  ob_rr_theme->label_height);
-  
     if (!n) XUnmapWindow(ob_display, self->icon);
     if (!d) XUnmapWindow(ob_display, self->desk);
     if (!s) XUnmapWindow(ob_display, self->shade);
@@ -909,6 +921,11 @@ static gboolean flash_timeout(gpointer data)
     return TRUE; /* go again */
 }
 
+static void flash_client_dest(ObClient *client, gpointer data)
+{
+    ob_main_loop_timeout_remove_data(ob_main_loop, flash_timeout, client);
+}
+
 void frame_flash_start(ObFrame *self)
 {
     self->flash_on = self->focused;
This page took 0.022069 seconds and 4 git commands to generate.