Hi people,

since the transition from storing a clients floating state in the C structures
to storing it in awful, awful.client.movetoscreen had an odd quirk. If you had
two screens with different size (1440x900 and 1280x800 in my setup) and used
movetoscreen to move a tiled client from the larger to the smaller screen, it
would flicker onto the smaller screen for a second and then reappear on the
larger screen. Transition from the smaller to the larger screen however was
unaffected.

The attached patch addresses this issue by resizing the client if it doesn't
fit into the targets workarea after moving it.

-- 
    Gregor Best
From ea65264d85c50a1a721f9934996982144c681a6d Mon Sep 17 00:00:00 2001
From: Gregor Best <[EMAIL PROTECTED]>
Date: Sun, 7 Dec 2008 15:45:19 +0100
Subject: [PATCH] awful.client: fix movetoscreen for different screen size

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

diff --git a/lib/awful/client.lua.in b/lib/awful/client.lua.in
index 5ad971f..0913f71 100644
--- a/lib/awful/client.lua.in
+++ b/lib/awful/client.lua.in
@@ -441,6 +441,14 @@ function movetoscreen(c, s)
         end
         if s > sc then s = 1 elseif s < 1 then s = sc end
         sel.screen = s
+        -- check whether the client fits into its new screen
+        -- and resize it if neccessary
+        local wa = capi.screen[s].workarea
+        local cg = sel:geometry()
+        if cg.width > wa.width or cg.height > wa.height then
+            sel:geometry(capi.screen[s].workarea)
+        end
+
         capi.mouse.coords(capi.screen[s].geometry)
         capi.client.focus = sel
     end
-- 
1.6.0.4

Attachment: signature.asc
Description: PGP signature

Reply via email to