Merge pull request #1 from unisgn/unisgn-stateful-quake

make quake to remember maximize and fullscreen
This commit is contained in:
unisgn 2020-11-26 01:21:59 +08:00 committed by GitHub
commit 22546f1d84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 1 deletions

View File

@ -60,6 +60,8 @@ function quake:display()
client.floating = true
client.border_width = self.border
client.size_hints_honor = false
local maximized = client.maximized
local fullscreen = client.fullscreen
client:geometry(self.geometry[self.screen.index] or self:compute_size())
-- Set not sticky and on top
@ -74,11 +76,16 @@ function quake:display()
-- Toggle display
if self.visible then
client.hidden = false
client.maximized = self.maximized
client.fullscreen = self.fullscreen
client:raise()
self.last_tag = self.screen.selected_tag
client:tags({self.screen.selected_tag})
capi.client.focus = client
else
else
self.maximized = maximized
self.fullscreen = fullscreen
client.fullscreen = false
client.hidden = true
local ctags = client:tags()
for i, t in pairs(ctags) do
@ -135,6 +142,9 @@ function quake:new(config)
conf.horiz = conf.horiz or "left" -- left, right or center
conf.geometry = {} -- internal use
conf.maximized = false
conf.fullscreen = false
local dropdown = setmetatable(conf, { __index = quake })
capi.client.connect_signal("manage", function(c)