From 8229a2827c708eab9ceb95172dc7e52156e6eb14 Mon Sep 17 00:00:00 2001
From: Olivier Fourdan <fourdan.olivier@wanadoo.fr>
Date: Wed, 4 Sep 2002 14:29:31 +0000
Subject: [PATCH] *** empty log message ***

(Old svn revision: 10538)
---
 src/client.c | 30 +++++++++++++++++-------------
 src/client.h |  1 +
 2 files changed, 18 insertions(+), 13 deletions(-)

diff --git a/src/client.c b/src/client.c
index dd87bf667..a509b2226 100644
--- a/src/client.c
+++ b/src/client.c
@@ -654,12 +654,17 @@ static void clientWindowType(Client * c)
             layer = WIN_LAYER_ABOVE_DOCK;
         }
     }
-    else if(c->transient_for)
+    else
     {
-        Client *c2;
-
         DBG("no \"net\" atom detected\n");
+        c->type = UNSET;
+        layer = c->win_layer;
+    }
+    if(c->transient_for)
+    {
+        Client *c2;
 
+        DBG("Window is a transient\n");
         c2 = clientGetFromWindow(c->transient_for, WINDOW);
         if(c2)
         {
@@ -667,12 +672,6 @@ static void clientWindowType(Client * c)
             layer = c2->win_layer;
         }
     }
-    else
-    {
-        DBG("no \"net\" atom detected, not even a transient\n");
-        c->type = UNSET;
-        layer = c->win_layer;
-    }
     if((old_type != c->type) || (layer != c->win_layer))
     {
         DBG("setting layer %i\n", layer);
@@ -2202,6 +2201,7 @@ void clientToggleMaximized(Client * c, int mode)
 void clientToggleFullscreen(Client * c)
 {
     XWindowChanges wc;
+    int layer;
 
     g_return_if_fail(c != NULL);
     DBG("entering clientToggleFullscreen\n");
@@ -2213,11 +2213,13 @@ void clientToggleFullscreen(Client * c)
         c->fullscreen_old_y = c->y;
         c->fullscreen_old_width = c->width;
         c->fullscreen_old_height = c->height;
+        c->fullscreen_old_layer = c->win_layer;
 
-        wc.x = (int)margins[MARGIN_LEFT];
-        wc.y = (int)margins[MARGIN_TOP];
-        wc.width = XDisplayWidth(dpy, screen) - (int)margins[MARGIN_LEFT] - (int)margins[MARGIN_RIGHT];
-        wc.height = XDisplayHeight(dpy, screen) - (int)margins[MARGIN_TOP] - (int)margins[MARGIN_BOTTOM];
+        wc.x = 0;
+        wc.y = 0;
+        wc.width = XDisplayWidth(dpy, screen);
+        wc.height = XDisplayHeight(dpy, screen);
+	layer = WIN_LAYER_ABOVE_DOCK;
     }
     else
     {
@@ -2225,8 +2227,10 @@ void clientToggleFullscreen(Client * c)
         wc.y = c->fullscreen_old_y;
         wc.width = c->fullscreen_old_width;
         wc.height = c->fullscreen_old_height;
+	layer = c->fullscreen_old_layer;
     }
     clientSetNetState(c);
+    clientSetLayer(c, layer);
     clientConfigure(c, &wc, CWX | CWY | CWWidth | CWHeight);
 }
 
diff --git a/src/client.h b/src/client.h
index ed54a4462..514537b47 100644
--- a/src/client.h
+++ b/src/client.h
@@ -197,6 +197,7 @@ struct _Client
     int fullscreen_old_y;
     int fullscreen_old_width;
     int fullscreen_old_height;
+    int fullscreen_old_layer;
     int ncmap;
     int button_pressed[BUTTON_COUNT];
     int struts[4];
-- 
GitLab