]> Dogcows Code - chaz/openbox/blobdiff - openbox/client.c
RrFontHeight is meaningless with pango, it will be different for every string drawn...
[chaz/openbox] / openbox / client.c
index d5069b0a6e0563cf861c7835d366acc5860010ab..2285bed853179db43500e66918340b58dd1cd4bb 100644 (file)
@@ -344,14 +344,17 @@ void client_manage(Window window)
 
         place_client(self, &x, &y);
 
-        /* make sure the window is visible.
-           
-           this is about the rude parameter:
-           non-normal clients has less rules, and
-           windows that are being restored from a session
-           do also. we can assume you want it back where
-           you saved it */
-        client_move_onscreen(self, client_normal(self) && !self->session);
+        /* make sure the window is visible. */
+        client_find_onscreen(self, &x, &y,
+                             self->frame->area.width,
+                             self->frame->area.height,
+                             /* non-normal clients has less rules, and
+                                windows that are being restored from a session
+                                do also. we can assume you want it back where
+                                you saved it */
+                             client_normal(self) && !self->session);
+        if (x != ox || y != oy)         
+            client_move(self, x, y);
     }
 
     keyboard_grab_for_client(self, TRUE);
@@ -607,9 +610,9 @@ gboolean client_find_onscreen(ObClient *self, gint *x, gint *y, gint w, gint h,
                                                 would be */
 
     /* XXX watch for xinerama dead areas */
-
-    /* a = screen_area(self->desktop); */
-    a = screen_physical_area_monitor(client_monitor(self));
+    /* This makes sure windows aren't entirely outside of the screen so you
+     * can't see them at all */
+    a = screen_area(self->desktop);
     if (client_normal(self)) {
         if (!self->strut.right && *x >= a->x + a->width - 1)
             *x = a->x + a->width - self->frame->area.width;
@@ -621,9 +624,16 @@ gboolean client_find_onscreen(ObClient *self, gint *x, gint *y, gint w, gint h,
             *y = a->y;
     }
 
-    if (rude) {
-        /* this is my MOZILLA BITCHSLAP. oh ya it fucking feels good.
-           Java can suck it too. */
+    /* This here doesn't let windows even a pixel outside the screen,
+     * not applied to all windows. Not sure if it's going to stay at all.
+     * I wonder if disabling this will break struts somehow? Let's find out. */
+    if (0 && rude) {
+        /* avoid the xinerama monitor divide while we're at it,
+         * remember to fix the placement stuff to avoid it also and
+         * then remove this XXX */
+        a = screen_physical_area_monitor(client_monitor(self));
+        /* this is ben's MOZILLA BITCHSLAP. "oh ya it fucking feels good.
+           Java can suck it too." */
 
         /* dont let windows map/move into the strut unless they
            are bigger than the available area */
@@ -1785,9 +1795,8 @@ static ObStackingLayer calc_layer(ObClient *self)
     else if (self->type == OB_CLIENT_TYPE_DESKTOP)
         l = OB_STACKING_LAYER_DESKTOP;
     else if (self->type == OB_CLIENT_TYPE_DOCK) {
-        if (self->above) l = OB_STACKING_LAYER_DOCK_ABOVE;
-        else if (self->below) l = OB_STACKING_LAYER_DOCK_BELOW;
-        else l = OB_STACKING_LAYER_DOCK_NORMAL;
+        if (self->below) l = OB_STACKING_LAYER_NORMAL;
+        else l = OB_STACKING_LAYER_ABOVE;
     }
     else if (self->above) l = OB_STACKING_LAYER_ABOVE;
     else if (self->below) l = OB_STACKING_LAYER_BELOW;
@@ -2999,6 +3008,12 @@ void client_set_undecorated(ObClient *self, gboolean undecorated)
     if (self->undecorated != undecorated) {
         self->undecorated = undecorated;
         client_setup_decor_and_functions(self);
+        // Make sure the client knows it might have moved. Maybe there is a
+        // better way of doing this so only one client_configure is sent, but
+        // since 125 of these are sent per second when moving the window (with
+        // user = FALSE) i doubt it matters much.
+        client_configure(self, OB_CORNER_TOPLEFT, self->area.x, self->area.y,
+                         self->area.width, self->area.height, TRUE, TRUE);
         client_change_state(self); /* reflect this in the state hints */
     }
 }
This page took 0.023995 seconds and 4 git commands to generate.