]> Dogcows Code - chaz/openbox/blobdiff - openbox/client.c
make the default screen-edge resistance 20 (double what it is for windows)
[chaz/openbox] / openbox / client.c
index adbab7a74774e9e2b618910efdca192490e0961e..34d263b6364b04f7720ab991415bbf099c89e37d 100644 (file)
@@ -49,6 +49,7 @@ 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_urgent_notify(ObClient *self);
 
 void client_startup()
 {
@@ -323,20 +324,16 @@ void client_manage(Window window)
 
         place_client(self, &x, &y);
 
+        /* make sure the window is visible */
         client_find_onscreen(self, &x, &y,
                              self->frame->area.width,
                              self->frame->area.height,
                              client_normal(self));
 
         if (x != ox || y != oy)
-            client_configure(self, OB_CORNER_TOPLEFT, x, y,
-                             self->area.width, self->area.height,
-                             TRUE, TRUE);
+            client_move(self, x, y);
     }
 
-    /* make sure the window is visible */
-        client_move_onscreen(self, client_normal(self));
-
     client_showhide(self);
 
     /* use client_focus instead of client_activate cuz client_activate does
@@ -485,6 +482,14 @@ void client_unmanage(ObClient *self)
     client_set_list();
 }
 
+static void client_urgent_notify(ObClient *self)
+{
+    if (self->urgent)
+        frame_flash_start(self->frame);
+    else
+        frame_flash_stop(self->frame);
+}
+
 static void client_restore_session_state(ObClient *self)
 {
     GList *it;
@@ -545,9 +550,7 @@ void client_move_onscreen(ObClient *self, gboolean rude)
     if (client_find_onscreen(self, &x, &y,
                              self->frame->area.width,
                              self->frame->area.height, rude)) {
-        client_configure(self, OB_CORNER_TOPLEFT, x, y,
-                         self->area.width, self->area.height,
-                         TRUE, TRUE);
+        client_move(self, x, y);
     }
 }
 
@@ -1298,9 +1301,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) {
-            /* XXX do shit */
-        }
+       if (self->frame)
+            client_urgent_notify(self);
     }
 }
 
@@ -1724,7 +1726,7 @@ static void client_apply_startup_state(ObClient *self)
        client_shade(self, TRUE);
     }
     if (self->urgent)
-        /* XXX do shit */;
+        client_urgent_notify(self);
   
     if (self->max_vert && self->max_horz) {
        self->max_vert = self->max_horz = FALSE;
@@ -1831,7 +1833,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) {
@@ -1850,23 +1851,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 */
 
@@ -2023,7 +2007,7 @@ void client_fullscreen(ObClient *self, gboolean fs, gboolean savearea)
 
     client_setup_decor_and_functions(self);
 
-    client_configure(self, OB_CORNER_TOPLEFT, x, y, w, h, TRUE, TRUE);
+    client_move_resize(self, x, y, w, h);
 
     /* try focus us when we go into fullscreen mode */
     client_focus(self);
@@ -2199,7 +2183,7 @@ void client_maximize(ObClient *self, gboolean max, int dir, gboolean savearea)
 
     /* figure out where the client should be going */
     frame_frame_gravity(self->frame, &x, &y);
-    client_configure(self, OB_CORNER_TOPLEFT, x, y, w, h, TRUE, TRUE);
+    client_move_resize(self, x, y, w, h);
 }
 
 void client_shade(ObClient *self, gboolean shade)
This page took 0.022869 seconds and 4 git commands to generate.