]> Dogcows Code - chaz/openbox/commitdiff
fix fullscreen windows being stuck in the wrong layer when they come out of
authorDana Jansens <danakj@orodu.net>
Mon, 14 May 2007 22:20:48 +0000 (22:20 +0000)
committerDana Jansens <danakj@orodu.net>
Mon, 14 May 2007 22:20:48 +0000 (22:20 +0000)
fullscreen.
add a new layer where fullscreen windows go when are aren't focused, below
all normal windows, so you can alt-tab to a below layer window and it will
show itself.

openbox/client.c
openbox/stacking.h

index 18aac8180d0f78df84e09e376f8f39e1f805116c..16c249378c3ec85de487e72b5b1c8b64e817bb25 100644 (file)
@@ -2367,9 +2367,12 @@ static ObStackingLayer calc_layer(ObClient *self)
                 self->frame->size.bottom == 0 && self->frame->size.top == 0 &&
                 RECT_EQUAL(self->area,
                            *screen_physical_area_monitor
-                           (client_monitor(self)))))) &&
-             (client_focused(self) || client_search_focus_tree(self)))
-        l = OB_STACKING_LAYER_FULLSCREEN;
+                           (client_monitor(self))))))) {
+        if (client_focused(self) || client_search_focus_tree(self))
+            l = OB_STACKING_LAYER_FULLSCREEN;
+        else
+            l = OB_STACKING_LAYER_FULLSCREEN_BELOW;
+    }
     else if (self->above) l = OB_STACKING_LAYER_ABOVE;
     else if (self->below) l = OB_STACKING_LAYER_BELOW;
     else l = OB_STACKING_LAYER_NORMAL;
@@ -2814,7 +2817,6 @@ void client_fullscreen(ObClient *self, gboolean fs)
 
     self->fullscreen = fs;
     client_change_state(self); /* change the state hints on the client */
-    client_calc_layer(self);   /* and adjust out layer/stacking */
 
     if (fs) {
         self->pre_fullscreen_area = self->area;
@@ -2850,8 +2852,15 @@ void client_fullscreen(ObClient *self, gboolean fs)
 
     client_move_resize(self, x, y, w, h);
 
-    /* try focus us when we go into fullscreen mode */
-    client_focus(self);
+    /* and adjust our layer/stacking. do this after resizing the window,
+       and applying decorations, because windows which fill the screen are
+       considered "fullscreen" and it affects their layer */
+    client_calc_layer(self);
+
+    if (fs) {
+        /* try focus us when we go into fullscreen mode */
+        client_focus(self);
+    }
 }
 
 static void client_iconify_recursive(ObClient *self,
index ded4644ebb13d791b3df1da57e58c42312bcf2f6..ea1ea8c9d43254ddb7ac2241a7fe334ec70de61c 100644 (file)
 /*! The possible stacking layers a client window can be a part of */
 typedef enum {
     OB_STACKING_LAYER_INVALID,
-    OB_STACKING_LAYER_DESKTOP,     /*!< 0 - desktop windows */
-    OB_STACKING_LAYER_BELOW,       /*!< 1 - normal windows w/ below */
-    OB_STACKING_LAYER_NORMAL,      /*!< 2 - normal windows */
-    OB_STACKING_LAYER_ABOVE,       /*!< 3 - normal windows w/ above */
-    OB_STACKING_LAYER_FULLSCREEN,  /*!< 4 - fullscreeen windows */
-    OB_STACKING_LAYER_INTERNAL,    /*!< 5 - openbox windows/menus */
+    OB_STACKING_LAYER_DESKTOP,          /*!< 0 - desktop windows */
+    OB_STACKING_LAYER_FULLSCREEN_BELOW, /*!< 1 - unfocused fullscreens */
+    OB_STACKING_LAYER_BELOW,            /*!< 2 - normal windows w/ below */
+    OB_STACKING_LAYER_NORMAL,           /*!< 3 - normal windows */
+    OB_STACKING_LAYER_ABOVE,            /*!< 4 - normal windows w/ above */
+    OB_STACKING_LAYER_FULLSCREEN,       /*!< 5 - fullscreeen windows */
+    OB_STACKING_LAYER_INTERNAL,         /*!< 6 - openbox windows/menus */
     OB_NUM_STACKING_LAYERS
 } ObStackingLayer;
 
This page took 0.027466 seconds and 4 git commands to generate.