From 9dca1330c2d92bf9b04ae7c123fd1f60e6f794a6 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Wed, 1 Oct 2008 15:05:54 +0200 Subject: [PATCH] awful.client: maximize works in floating layout Signed-off-by: Julien Danjou --- lib/awful/client.lua.in | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/awful/client.lua.in b/lib/awful/client.lua.in index 68f3db608..44f15bf8d 100644 --- a/lib/awful/client.lua.in +++ b/lib/awful/client.lua.in @@ -7,6 +7,7 @@ -- Grab environment we need local hooks = require("awful.hooks") local util = require("awful.util") +local layout = require("awful.layout") local pairs = pairs local ipairs = ipairs local table = table @@ -356,18 +357,19 @@ end function maximize(c) local sel = c or capi.client.focus if sel then + local curlay = layout.get() local ws = capi.screen[sel.screen].workarea ws.width = ws.width - 2 * sel.border_width ws.height = ws.height - 2 * sel.border_width - if sel.floating and data.maximize[sel] then + if (sel.floating or curlay == "floating") and data.maximize[sel] then + sel:coords(data.maximize[sel].coords) sel.floating = data.maximize[sel].floating - if sel.floating then - sel:coords(data.maximize[sel].coords) - end data.maximize[sel] = nil else data.maximize[sel] = { coords = sel:coords(), floating = sel.floating } - sel.floating = true + if curlay ~= "floating" then + sel.floating = true + end sel:coords(ws) end end