From 41133c9836d3975c0390ff554dc7a6d86a00a16e Mon Sep 17 00:00:00 2001 From: cmertz Date: Wed, 27 Jul 2016 09:50:11 +0200 Subject: [PATCH 1/3] test client.border_width restore after fullscreen --- tests/test-maximize.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/test-maximize.lua b/tests/test-maximize.lua index bddf693e3..a49e74f20 100644 --- a/tests/test-maximize.lua +++ b/tests/test-maximize.lua @@ -41,6 +41,22 @@ local steps = { c.maximized_horizontal = false return true end, + + -- Test restoring client.border_width + function() + local c = client.get()[1] + local test_width = 2 + + c.border_width = test_width + + c.fullscreen = true + c.fullscreen = false + + assert(c.border_width == test_width) + + return true + end, + -- Test restoring a geometry function() local c = client.get()[1] From 4389297b58048d01897bea1fe08d8d3a41258df2 Mon Sep 17 00:00:00 2001 From: cmertz Date: Wed, 27 Jul 2016 09:54:42 +0200 Subject: [PATCH 2/3] restore client.border_width after fullscreen --- lib/awful/placement.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/awful/placement.lua b/lib/awful/placement.lua index c003d3f1f..0eb7825a5 100644 --- a/lib/awful/placement.lua +++ b/lib/awful/placement.lua @@ -278,6 +278,7 @@ local function store_geometry(d, reqtype) if not data[d][reqtype] then data[d][reqtype] = {} end data[d][reqtype] = d:geometry() data[d][reqtype].screen = d.screen + data[d][reqtype].border_width = d.border_width end --- Get the margins and offset @@ -1161,6 +1162,9 @@ function placement.restore(d, args) if not memento then return false end memento.screen = nil --TODO use it + + d.border_width = memento.border_width + d:geometry(memento) return true end From 2231158adf727a1fc9aa043604ae1f20bdf398fb Mon Sep 17 00:00:00 2001 From: cmertz Date: Wed, 27 Jul 2016 13:43:28 +0200 Subject: [PATCH 3/3] change test value for client.border_width --- tests/test-maximize.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test-maximize.lua b/tests/test-maximize.lua index a49e74f20..d16c980e0 100644 --- a/tests/test-maximize.lua +++ b/tests/test-maximize.lua @@ -45,7 +45,9 @@ local steps = { -- Test restoring client.border_width function() local c = client.get()[1] - local test_width = 2 + + -- pick an arbitrary border_width distinct from the default one + local test_width = c.border_width + 1 c.border_width = test_width