At Thu, 12 Mar 2009 20:13:30 +0100
Gregor Best wrote:

> Take it, hold it, love it :)
> 

This version should be even more usable.

-- 
GCS/IT/M d- s+:- a--- C++ UL+++ US UB++ P+++ L+++ E--- W+ N+ o--
K- w--- O M-- V PS+ PE- Y+ PGP+++ t+ 5 X+ R tv+ b++ DI+++ D+++ G+
e- h! r y+

    Gregor Best
From 2805647b4f2360e11af35d3dcd1f179250f56aca Mon Sep 17 00:00:00 2001
From: Gregor Best <[email protected]>
Date: Thu, 12 Mar 2009 20:11:52 +0100
Subject: [PATCH] lib/awful/client: store floating geometry of clients in awful

Signed-off-by: Gregor Best <[email protected]>
---
 lib/awful/client.lua.in |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/lib/awful/client.lua.in b/lib/awful/client.lua.in
index 36d992d..ecf97f6 100644
--- a/lib/awful/client.lua.in
+++ b/lib/awful/client.lua.in
@@ -551,11 +551,24 @@ function floating.set(c, s)
     local c = c or capi.client.focus
     if c and property.get(c, "floating") ~= s then
         property.set(c, "floating", s)
+        if s == true then
+            c:geometry(property.get(c, "floating_geometry"))
+        end
         capi.hooks.arrange()(c.screen)
         capi.hooks.property()(c, "floating")
     end
 end
 
+hooks.manage.register(function (c)
+    property.set(c, "floating_geometry", c:geometry())
+end)
+
+hooks.property.register(function (c, prop)
+    if prop == "geometry" and floating.get(c) then
+        property.set(c, "floating_geometry", c:geometry())
+    end
+end)
+
 --- Return if a client has a fixe size or not.
 -- @param c The client.
 function isfixed(c)
-- 
1.6.2

Attachment: signature.asc
Description: PGP signature

Reply via email to