From 952dfd94637b7b03339b64796da8c861061a8400 Mon Sep 17 00:00:00 2001 From: Kolan Sh Date: Wed, 7 Apr 2021 03:53:55 +0300 Subject: [PATCH] Many fixes on client behaviour: float, full, maximize. --- rc.lua | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/rc.lua b/rc.lua index 6ed1318..80d841d 100644 --- a/rc.lua +++ b/rc.lua @@ -737,7 +737,7 @@ awful.rules.rules = { -- Add titlebars to normal clients and dialogs { rule_any = {type = { "normal", "dialog" } - }, properties = { titlebars_enabled = titlebars_enabled } + }, properties = { titlebars_enabled = false } }, -- Set Firefox to always map on the tag named "2" on screen 1. @@ -1030,14 +1030,28 @@ client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_n -- Borders for floating windows client.connect_signal("property::floating", function(c) - if c.floating then + if c.maximized or c.fullscreen then return end + + if c.floating and not c.maximized and not c.fullscreen then if c.titlebar == nil then - c:emit_signal("request::titlebars", "rules", {}) + c:emit_signal("request::titlebars", "rules", {}) end - c.border_width = 2 awful.titlebar.show(c) + c.border_width = 2 else - c.border_width = 0 awful.titlebar.hide(c) + c.border_width = 0 + end +end) + +client.connect_signal("property::maximized", function(c) + if c.maximized or c.fullscreen or not c.floating then + awful.titlebar.hide(c) + c.border_width = 0 + else + if c.floating then + awful.titlebar.show(c) + c.border_width = 2 + end end end)