Version: (using KDE 4.2.2) OS: Linux Installed from: Ubuntu Packages The Chrome web browser has a feature where it draws its own window decorations. When this setting is toggled, Chrome calls gtk_window_set_decorated(), which makes GTK change the window's requested decorated state via the _MOTIF_WM_HINTS property. kwin honors this property on new windows but doesn't always respect it when it changes, so already-open windows sometimes don't get updated when the setting is changed. More specifically, if an already-open window requests no decorations, kwin removes the window's border, but if the window then requests decorations, the border doesn't get re-added.
The patch that I'm about to attach (written against head but tested against 4.2.2) appears to fix this. I'm also attaching a small test program that illustrates the issue -- compile decorations.c and run it with 1 or 0 as an argument to start with the border shown or hidden. Middle-clicking on the window makes it toggle the decorations setting in the _MOTIF_WM_HINTS property to attempt to show or hide the border.
Created attachment 35639 [details] patch to show or hide border when Motif WM hints change
Created attachment 35640 [details] test program to illustrate the issue
SVN commit 1030932 by lmurray: Detect when _MOTIF_WM_HINTS gains or loses the no border hint. Patch by Daniel Erat. BUG: 201523 M +12 -5 client.cpp M +2 -1 client.h M +6 -5 utils.cpp M +8 -3 utils.h WebSVN link: http://websvn.kde.org/?view=rev&revision=1030932
SVN commit 1030933 by lmurray: Backport r1030932: Detect when _MOTIF_WM_HINTS gains or loses the no border hint. Patch by Daniel Erat. CCBUG: 201523 M +12 -5 client.cpp M +2 -1 client.h M +6 -5 utils.cpp M +8 -3 utils.h WebSVN link: http://websvn.kde.org/?view=rev&revision=1030933
This bug still seems to be a problem in KDE 4.3.4 running on QT 4.6.0. I have the problem with both Chromium and with the test file attached here.
Still a problem in 4.4.0. Has the patch really been applied?
Yes, the patch has been applied. If it's not working then either the patch is incorrect or there is a another bug somewhere.
comment #6: The test case doesn't pass because it is wrong; the int array should be made of longs to account for XChangeProperty doing some word size twiddling. I presume you are running a 64-bit machine? The corrected test case should already pass on kwin. The change in Chrome still doesn't work because of two issues relating to XShape, which the client-side-decorations version of Chrome uses. I've made three patches. The first two fix it, and I'd like to commit them in time for 4.4.5, pending review. (The third is related and I'd like to land it in trunk.) http://reviewboard.kde.org/r/4396/ http://reviewboard.kde.org/r/4398/ http://reviewboard.kde.org/r/4400/
> which the client-side-decorations version of Chrome uses Er, that was somewhat ambiguous. I mean that Chrome uses XShape when it is configured to draw its client-side decoration. Kwin doesn't react properly to it ceasing to set a custom shape when you turn the system title bar on.