At Wed, 21 Jan 2009 18:12:04 +0100 Gregor Best wrote: > At Wed, 21 Jan 2009 17:28:02 +0100 > Gregor Best wrote: > > > Hi people, > > > > the attached patch basicall reimplements the changes introduced in commit id > > f5c35765d21, but it fixes an issue I had with the patch which was that with > > more than two clients on the screen, windows would dissappear (seemingly, > > they didn't get their geometry reset after being unfocused for some reason). > > Also this patch only accepts the currently focused window as the window > > displayed in the middle of the screen when it is on the same screen. > > Previously, if you had for example tile on the left and magnifier on the > > right screen and moved your mouse from the right to the left screen, the > > magnifier layout would sometimes "steal" clients. > > > > I just noticed the previous patch has a little problem, a fixed version is > attached >
I stand corrected, i messed up the previous patch, sorry for all the
inconvenience, i'm a bit confused today :)
--
Gregor Best
From aa9cc2a2ddd8c30529f0482006fbf11fdcb0cf25 Mon Sep 17 00:00:00 2001 From: Gregor Best <[email protected]> Date: Wed, 21 Jan 2009 18:14:15 +0100 Subject: [PATCH] awful.layout.suit.magnifier: restore client ordering by focus list Signed-off-by: Gregor Best <[email protected]> --- lib/awful/layout/suit/magnifier.lua.in | 23 +++++++++++++++++------ 1 files changed, 17 insertions(+), 6 deletions(-) diff --git a/lib/awful/layout/suit/magnifier.lua.in b/lib/awful/layout/suit/magnifier.lua.in index e6762aa..ad64871 100644 --- a/lib/awful/layout/suit/magnifier.lua.in +++ b/lib/awful/layout/suit/magnifier.lua.in @@ -42,10 +42,18 @@ local function magnifier(_, screen) end -- If focused window is not tiled, take the first one which is tiled. - if client.floating.get(focus) then + if client.floating.get(focus) or focus.screen ~= screen then focus = cls[1] end + local fidx + for k, v in ipairs(cls) do + if v == focus then + fidx = k + break + end + end + local geometry = {} if #cls - 1 > 0 then geometry.width = area.width * math.sqrt(mwfact) @@ -67,11 +75,14 @@ local function magnifier(_, screen) geometry.height = area.height / (#cls - 1) geometry.width = area.width - for k, c in ipairs(cls) do - if c ~= focus then - c:geometry(geometry) - geometry.y = geometry.y + geometry.height - end + for k = fidx + 1, #cls do + cls[k]:geometry(geometry) + geometry.y = geometry.y + geometry.height + end + + for k = 1, fidx - 1 do + cls[k]:geometry(geometry) + geometry.y = geometry.y + geometry.height end end end -- 1.6.1
signature.asc
Description: PGP signature
