On 06/18/2010 10:07 AM, Julien Danjou wrote:
On Thu, Jun 17 2010, Uli Schlachter wrote:

Given that my local timezone is GMT+2:
Good night, I'll hopefully find the time to look into this tomorrow (unless
someone feels like beating me to this...)

@jd: How exactly does the code make sure fullscreen'd clients aren't touched by
the layout function? I don't seem to find that code, but there must be sth that
does this, obviously. Perhaps it first changes the client's geometry and then
makes sure the layout doesnt touch the client...?

I wrote that a long time ago, I can't recall exactly.
As far as I remember what I wanted to write is:
"Hey, client wants to go full-screen. Deal with it."

Goal was that going full-screen could mean something else than taking
the whole screen size hard-coded in C.

I don't think there's something that prevents the user to move the
client. But the layouts function should check if c.fullscreen is true or
false before deciding it should be arranged.

Maybe the .fullscreen attribute is not set correctly?

Once you look at that code, it becomes obvious what happens (See commit message for details).

I'm at work right now so I can neither test nor commit this. Volunteers? ;)

Uli
From e5a96321d0122ddbcedd4c790b71eb66fe2fb1c0 Mon Sep 17 00:00:00 2001
From: Uli Schlachter <[email protected]>
Date: Fri, 18 Jun 2010 11:08:06 +0200
Subject: [PATCH] Reorder some code for fullscreening windows

When one sets a client to fullscreen, this is what currently happens:
- lua code: c.fullscreen = true
- The C code emits request::fullscreen without having touched the client's
  fullscreen property yet (c.fullscreen is still false)
- awful.ewmh changes the client's geometry to fullscreen via c:geometry()
- This causes property::geometry to be emitted
- awful.layout reacts on this and causes the screen to be re-arranged, undoing
  the fullscreen geometry set in awful.ewmh
- The C code for c.fullscreen = true continues and actually changes the client's
  fullscreen flag

The result of this is that we get a client which thinks it is fullscreen'd
without actually being that.

Fix this by first changing the client's fullscreen property and then emitting
request::fullscreen. Same thing for maximized_{vertical,horizontal}.

Thanks to Jim Pryor for reporting this bug and helping reproducing it.

Signed-off-by: Uli Schlachter <[email protected]>
---
 objects/client.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/objects/client.c b/objects/client.c
index 79dce8f..af01c01 100644
--- a/objects/client.c
+++ b/objects/client.c
@@ -762,10 +762,10 @@ client_set_fullscreen(lua_State *L, int cidx, bool s)
         }
         int abs_cidx = luaA_absindex(L, cidx); \
         lua_pushboolean(L, s);
-        luaA_object_emit_signal(L, abs_cidx, "request::fullscreen", 1);
         c->fullscreen = s;
-        stack_windows();
+        luaA_object_emit_signal(L, abs_cidx, "request::fullscreen", 1);
         luaA_object_emit_signal(L, abs_cidx, "property::fullscreen", 0);
+        stack_windows();
     }
 }
 
@@ -785,10 +785,10 @@ client_set_fullscreen(lua_State *L, int cidx, bool s)
             if(s) \
                 client_set_fullscreen(L, abs_cidx, false); \
             lua_pushboolean(L, s); \
-            luaA_object_emit_signal(L, abs_cidx, "request::maximized_" #type, 
1); \
             c->maximized_##type = s; \
-            stack_windows(); \
+            luaA_object_emit_signal(L, abs_cidx, "request::maximized_" #type, 
1); \
             luaA_object_emit_signal(L, abs_cidx, "property::maximized_" #type, 
0); \
+            stack_windows(); \
         } \
     }
 DO_FUNCTION_CLIENT_MAXIMIZED(vertical)
-- 
1.7.1

Reply via email to