Bug 347818 - asynchronous motif hint reading (maybe others) is broken. fetch() from events.cpp deletes m_hints, causing a (false) shortcut return for the tested function
Summary: asynchronous motif hint reading (maybe others) is broken. fetch() from events...
Alias: None
Product: kwin
Classification: Plasma
Component: core (show other bugs)
Version: 5.3.0
Platform: Archlinux Linux
: NOR normal (vote)
Target Milestone: ---
Assignee: KWin default assignee
URL: https://git.reviewboard.kde.org/r/125...
Depends on:
Reported: 2015-05-16 23:07 UTC by Soukyuu
Modified: 2015-09-14 20:07 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.4.2
thomas.luebking: ReviewRequest+

xprop for the main foobar window (3.32 KB, text/plain)
2015-05-17 20:27 UTC, Soukyuu
xprop for a second dialog window opened by foobar2000 (3.38 KB, text/plain)
2015-05-17 20:28 UTC, Soukyuu
kwin support information (5.33 KB, text/plain)
2015-05-17 20:28 UTC, Soukyuu
Picture showing the disappearance of the close button in Notepad++ under wine. Some thing happens to FreeFileSync as well. (34.79 KB, image/png)
2015-08-31 11:45 UTC, d_tassos

Note You need to log in before you can comment on or make changes to this bug.
Description Soukyuu 2015-05-16 23:07:26 UTC
When running any wine applications, they lose the "close" button as soon as you execute an action that opens a (wine) file/folder dialog. The decoration shows min/maximize buttons and empty space instead of the close button. If you resize the window, the empty space clears, but the close button does not come back.

Reproducible: Always

Steps to Reproduce:
1. start any wine program (for example, foobar2000)
2. make it open any dialog (for example, load some music files with foobar2000)

Actual Results:  
"Close" button disappears from the application main window.

Expected Results:  
"Close" button should not be affected in any way.

I only noticed that after upgrading to plasma, so I'm not sure if it's a wine or a kwin bug. 
I am currently on wine 1.7.42

Workaround: use alt+f4 or file->exit to exit the wine app in the meantime.
Comment 1 Thomas Lübking 2015-05-17 07:27:30 UTC
please attach the ouputs of
a) "qdbus org.kde.KWin /KWin supportInformation"
b) "xprop" of such window that lost it's close button

Sounds familiar, btw.
Comment 2 Soukyuu 2015-05-17 20:27:52 UTC
Created attachment 92669 [details]
xprop for the main foobar window
Comment 3 Soukyuu 2015-05-17 20:28:19 UTC
Created attachment 92670 [details]
xprop for a second dialog window opened by foobar2000
Comment 4 Soukyuu 2015-05-17 20:28:40 UTC
Created attachment 92671 [details]
kwin support information
Comment 5 Thomas Lübking 2015-05-17 21:28:40 UTC
dev note:
MWM says the windows are closeable and they participate in _NET_WM_ACTION_CLOSE
Breeze deco, hugo wired up closeableChanged for 5.2

Did both windows have no closebutton when you took the xprop or only the main window?
Comment 6 Soukyuu 2015-05-17 21:51:19 UTC
Both windows did not have a close button, correct.

Basically main window opens converter window, which opens a folder select dialog. Once the folder select dialog is opened, both main and converter windows lose the close button.

I can add an xprop of the folder select dialog window with a close button present, if you'd like me to.
Comment 7 d_tassos 2015-08-31 11:43:14 UTC
I can confirm this as well. I reported this quite some time ago, but i have no idea what happened to that report, can't find it by searching.

 I am using Notepad++ with wine and if you open a dialog box, eg save as... you will loose the close button, you don't need to save anything, just opening the dialog box is enough.

However, this is also happening to FreeFileSync as well which is not running under wine. If you do a sync a new window pops up to show the sync process, after that the close button on the main application window has disappeared.

You can still close a window by double clicking the menu button if that function is activated...
Comment 8 d_tassos 2015-08-31 11:45:45 UTC
Created attachment 94298 [details]
Picture showing the disappearance of the close button in Notepad++ under wine. Some thing happens to FreeFileSync as well.
Comment 9 Thomas Lübking 2015-08-31 20:33:51 UTC
The bug itself is far more general.

Interestingly, wine triggers it because it feels like it has to remove the close button for a window that is blocked by a modal transient.
(I wonder whether we should ignore that hint as well - every window should be closable and we know how to handle modal states...)
Comment 10 Thomas Lübking 2015-09-14 20:07:24 UTC
Git commit cc6886d7dd91ab7a4206ae6637886d7664127bb9 by Thomas Lübking.
Committed on 14/09/2015 at 19:01.
Pushed by luebking into branch 'Plasma/5.4'.

fetch motif hints when get them for managed client

notably *after* storing the old values.
Otherwise the old value is polluted because of
m_hints being nullptr, thus a default value is
returned (instead of the actual old value)
FIXED-IN: 5.4.2
REVIEW: 125007

M  +2    -0    client.cpp
M  +0    -1    events.cpp