Bug 413337 - setting an existing window as transient doesn't disable minimize button on dialog
Summary: setting an existing window as transient doesn't disable minimize button on di...
Status: RESOLVED INTENTIONAL
Alias: None
Product: kwin
Classification: Plasma
Component: decorations (show other bugs)
Version: 5.17.1
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-10-22 21:53 UTC by Samuel Venable
Modified: 2019-10-31 12:02 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Samuel Venable 2019-10-22 21:53:31 UTC
SUMMARY
I compile this cpp file and run it from the terminal like specified in code comments: https://gist.github.com/time-killer-games/3127b74e0e40e1515848f98ee734b776 and while the window does become transient for the specified window id it does not get its minimize button and task manager icons diabled/removed, even though that is the desirable behavior that most WM's have.

STEPS TO REPRODUCE
1. install the compiler and dependencies:
sudo apt-get install g++ zenity libpng-dev libx11-dev
2. build xtransientfor.cpp:
cd "${0%/*}"
g++ xtransientfor.cpp -o xtransientfor -Wl,-Bstatic -lpng16 -lz -Wl,-Bdynamic -lX11
3. run a test command from terminal:
cd "${0%/*}"
./xtransientfor $WINDOWID "zenity --file-selection"

OBSERVED RESULT
minimize button and task manager icons enabled and show

EXPECTED RESULT
minimize button and task manager icons disabled and/or hidden

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: KDE neon 5.17.0
(available in About System)
KDE Plasma Version: 5.17.0
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Kai Uwe Broulik 2019-10-23 08:31:54 UTC
Why is that desirable? From what I can tell minimizing a transient minimizes its parent with it.
Comment 2 Samuel Venable 2019-10-23 18:29:59 UTC
The problem is that when you try to minimize the transient window, the parent does not minimize with it - so for example, in a fullscreen app, this forces the user to Alt+Tab their way back to the transient window.

This has been tested with a good number of apps, not just zenity; it has also been tested with kdialog, kwrite, and kate to name a few. All of which have this problem. I'm not certain whether this is a problem with kwin or my code specifically; but I do know my code works as intended on other WM's.
Comment 3 Samuel Venable 2019-10-27 19:40:24 UTC
I mean to clarify, in the case of some apps, such as kdialog, the opposite is the problem, while minimizing the trnasient window does minimize the parent, minimizing the parent doesn't minimize the transient window. I'm not sure what makes the difference, but either way there is an issue with one window minimizing while the the other does not.
Comment 4 Samuel Venable 2019-10-27 19:48:40 UTC
The reason why i said that disabling / making invisible the minimize button on the transient window is a desirable solution, or partial solution, is because that is what most other modern WM's do with their decorations for transient windows, this includes Xfwm, Metacity, Mutter, etc. KWin is the only one among the most popular WM's that has such issues and deviates away from the norm by not having the minimize button and taskbar icon hidden for transient windows.
Comment 5 Samuel Venable 2019-10-27 19:53:35 UTC
these issues only apply to certain windows, not all of them. But it as long as the window type is being set to a dialog via setting the correct Atom property, and using the XSetTransientFor() Xlib function, these things should never be an issue if it worked how other WM's did. Not every WM has to be the same; if the minimize button doesn't get disabled or hidden, at the very least both windows should reliably minimize regardless of which minimize button was pressed, whether parent or transient window. And the task bar icon being hidden should be a given, imo, but if you guys feel differently, it's not like you need to do it. I hope I gave enough details this time. Sorry for not being thorough initially.
Comment 6 Vlad Zahorodnii 2019-10-31 12:02:14 UTC
So, there are four cases we have to take into account:

- Minimize the parent window, which has a modal dialog: Only the parent window will be minimized
- Minimize a modal dialog: The dialog and all its main clients will be minimized

- Minimize the parent window, which has a dialog: Both the parent window and the dialog will be minimized
- Minimize the dialog: Only the dialog will be minimized

Such behavior has been present since long time ago and we don't have plans to change it. Also, if my memory serves me well, the EWMH spec doesn't say that transients must not be minimizeable.