Applications with client-side decorations shouldn't have server-side decorations drawn (unless the script for that is enabled), because the double titlebar wastes space and looks broken. With the setting BorderlessMaximisedWindows false or unset, this is the case. When set to 'true', maximising and then unmaximising a window gives it server-side decorations even if it didn't originally have them.
Wild guess: diff --git a/geometry.cpp b/geometry.cpp index 1bffa9b..9b06d32 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -2256,7 +2256,7 @@ void Client::changeMaximize(bool vertical, bool horizontal, bool adjust) // triggers a maximize change. // The next setNoBorder interation will exit since there's no change but the first recursion pullutes the restore geometry changeMaximizeRecursion = true; - setNoBorder(app_noborder || max_mode == MaximizeFull); + setNoBorder(app_noborder || m_motif.noBorder() || max_mode == MaximizeFull); changeMaximizeRecursion = false; } If you can try the patch, that would be awesome - otherwise please attach the output of "xprop" on such window (state doesn't matter)
Created attachment 97560 [details] xprop output, before maximising (no border) Output of running xprop on a gitg window under KWin, before maximising the window.
Created attachment 97561 [details] diff to after maximising/unmaximising (with border added) After maximising and unmaximising, a border is added and xprop's output changes slightly.
I tried the patch (compiling KWin made my laptop's fan rather unhappy, not to mention my ears). Unfortunately there was no noticeable change; decorations still appear when unmaximising the window. xprop output is attached above.
You likely installed the recompiled kwin version out of PATH or similar - the patch works (tested gtk3-demo which shares CSD & relevant props) and the props support that. Correct patch (motif hint must be flagged & invoking rules is nice - neither is relevant for the behavior) diff --git a/geometry.cpp b/geometry.cpp index 1bffa9b..2a07a20 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -2256,7 +2256,7 @@ void Client::changeMaximize(bool vertical, bool horizontal, bool adjust) // triggers a maximize change. // The next setNoBorder interation will exit since there's no change but the first recursion pullutes the restore geometry changeMaximizeRecursion = true; - setNoBorder(app_noborder || max_mode == MaximizeFull); + setNoBorder(rules()->checkNoBorder(app_noborder || (m_motif.hasDecoration() && m_motif.noBorder()) || max_mode == MaximizeFull)); changeMaximizeRecursion = false; } Review-request as soon as I can focus for more than a minute next time :-(
Sorry, yes, I must have done something wrong. Latest patch works for me.
Git commit 9d09cf6dc9cb36ebf94663106a87141642599430 by Thomas Lübking. Committed on 29/02/2016 at 08:48. Pushed by luebking into branch 'master'. respect motif and rules on unmaximizing when restoring a borderless maximized, the window shall not suddenly be decorated FIXED-IN: 5.6 REVIEW: 127198 M +1 -1 geometry.cpp http://commits.kde.org/kwin/9d09cf6dc9cb36ebf94663106a87141642599430