]> Dogcows Code - chaz/openbox/blobdiff - openbox/client.c
add a reconfigure action, also reconfigure on SIGUSR2.
[chaz/openbox] / openbox / client.c
index c7c9a548de6a3f666c92c474961d08cef34334af..0d08f0f4693748b8e9d898a7e4768f2d89e84a54 100644 (file)
@@ -49,23 +49,25 @@ static void client_change_state(ObClient *self);
 static void client_apply_startup_state(ObClient *self);
 static void client_restore_session_state(ObClient *self);
 static void client_restore_session_stacking(ObClient *self);
-static void client_act_urgent(ObClient *self);
+static void client_urgent_notify(ObClient *self);
 
-void client_startup()
+void client_startup(gboolean reconfig)
 {
+    if (reconfig) return;
+
     client_set_list();
 }
 
-void client_shutdown()
+void client_shutdown(gboolean reconfig)
 {
 }
 
-void client_add_destructor(ObClientDestructorFunc func)
+void client_add_destructor(GDestroyNotify func)
 {
     client_destructors = g_slist_prepend(client_destructors, (gpointer)func);
 }
 
-void client_remove_destructor(ObClientDestructorFunc func)
+void client_remove_destructor(GDestroyNotify func)
 {
     client_destructors = g_slist_remove(client_destructors, (gpointer)func);
 }
@@ -423,7 +425,7 @@ void client_unmanage(ObClient *self)
     }
 
     for (it = client_destructors; it; it = g_slist_next(it)) {
-        ObClientDestructorFunc func = (ObClientDestructorFunc) it->data;
+        GDestroyNotify func = (GDestroyNotify) it->data;
         func(self);
     }
         
@@ -482,16 +484,12 @@ void client_unmanage(ObClient *self)
     client_set_list();
 }
 
-static void client_act_urgent(ObClient *self)
+static void client_urgent_notify(ObClient *self)
 {
-    GSList *it;
-
-    for (it = config_urgent_actions; it; it = g_slist_next(it)) {
-        ObAction *a = it->data;
-
-        a->data.any.c = self;
-        a->func(&a->data);
-    }
+    if (self->urgent)
+        frame_flash_start(self->frame);
+    else
+        frame_flash_stop(self->frame);
 }
 
 static void client_restore_session_state(ObClient *self)
@@ -1305,8 +1303,8 @@ void client_update_wmhints(ObClient *self)
                  ur ? "ON" : "OFF");
        /* fire the urgent callback if we're mapped, otherwise, wait until
           after we're mapped */
-       if (self->frame && self->urgent)
-            client_act_urgent(self);
+       if (self->frame)
+            client_urgent_notify(self);
     }
 }
 
@@ -1730,7 +1728,7 @@ static void client_apply_startup_state(ObClient *self)
        client_shade(self, TRUE);
     }
     if (self->urgent)
-        client_act_urgent(self);
+        client_urgent_notify(self);
   
     if (self->max_vert && self->max_horz) {
        self->max_vert = self->max_horz = FALSE;
@@ -1837,7 +1835,6 @@ void client_configure_full(ObClient *self, ObCorner anchor,
 
     if (!(w == self->area.width && h == self->area.height)) {
         int basew, baseh, minw, minh;
-        int mw, mh, aw, ah;
 
         /* base size is substituted with min size if not specified */
         if (self->base_size.width || self->base_size.height) {
@@ -1856,23 +1853,6 @@ void client_configure_full(ObClient *self, ObCorner anchor,
             minh = self->base_size.height;
         }
 
-        /* for interactive resizing. have to move half an increment in each
-           direction. */
-
-        /* how far we are towards the next size inc */
-        mw = (w - basew) % self->size_inc.width; 
-        mh = (h - baseh) % self->size_inc.height;
-        /* amount to add */
-        aw = self->size_inc.width / 2;
-        ah = self->size_inc.height / 2;
-        /* don't let us move into a new size increment */
-        if (mw + aw >= self->size_inc.width)
-            aw = self->size_inc.width - mw - 1;
-        if (mh + ah >= self->size_inc.height)
-            ah = self->size_inc.height - mh - 1;
-        w += aw;
-        h += ah;
-    
         /* if this is a user-requested resize, then check against min/max
            sizes */
 
This page took 0.026775 seconds and 4 git commands to generate.