Open Golddouble opened 4 years ago
Yep. This is a lack of support for the minimize operation in the window manager + Wine interaction.
The Wine windows lack the _NET_WM_ACTION_MINIMIZE
operation in the _NET_WM_ALLOWED_ACTIONS
property. The following is the relevant output from xprop
, formatted for readability:
_NET_WM_ALLOWED_ACTIONS(ATOM) =
_NET_WM_ACTION_CLOSE,
_NET_WM_ACTION_ABOVE,
_NET_WM_ACTION_BELOW,
_NET_WM_ACTION_FULLSCREEN,
_NET_WM_ACTION_MOVE,
_NET_WM_ACTION_RESIZE,
_NET_WM_ACTION_MAXIMIZE_HORZ,
_NET_WM_ACTION_MAXIMIZE_VERT,
_NET_WM_ACTION_SHADE,
_NET_WM_ACTION_CHANGE_DESKTOP,
_NET_WM_ACTION_STICK
While it is possible to add the _NET_WM_ACTION_MINIMIZE
action (possibly, with wmctrl
or other utilities), you would have to do it to every mapped window (Contents, Browser, Dock, Status bar, Element), and minimizing one window would not minimize the rest.
For a proof of this limitation, force-minimize one of the SuperMemo windows with:
xdotool selectwindow windowminimize
and click on a SuperMemo window. You will notice that only that window will be minimized. EDIT: actually, if you have enabled and minimized the Dock window that way, all other windows will be minimized on xfwm, the XFCE window manager.
I seem to remember that kwm (the window manager from KDE Plasma) does minimize all windows, but it is implementation specific. To my knowledge, it has a lot of heuristics that try to do the right thing, at the expense of more complexity.
In order not to have to detect and forcefully minimize the dock window to achieve the purpose every time, here are two suggestions:
Shift+Ctrl+G
shortcut to send SuperMemo windows to the system tray.Lutris
SuperMemo 17
Configure
Runner options
[X] Windowed (virtual desktop)
Virtual desktop resolution: (choose desired resolution)
Additional suggestion: define a keyboard shortcut at the window manager level; say, with xfce4-keyboard-settings
, that would minimize the dock window upon click:
A refinement would be to detect the dock window instead of clicking on it , but it isn't simple.
The logical solution to minimize the dock window would be something like:
xdotool search --name " \(SuperMemo [0-9]+:" windowminimize
but it doesn't have a good hiding behavior on my system (freezes)
I'll research into existing tools and/or Xlib to add minimize capability through _NET_WM_ACTION_MINIMIZE
after a Wine SuperMemo window has been created.
Thank you again. :-)
Here is a feedback:
Use the Shift+Ctrl+G shortcut to send SuperMemo windows to the system tray.
Minimize SM this way works great, but there is no change to maximize it after. The only way to get the window back, is to close SM and open it again, to have it maximized again.
Use a Wine virtual desktop window. Example
This works great. But I don't like the title bar of "wine desktop" on the top. Is there a way to hide it?
xdotool search --name " (SuperMemo [0-9]+:" windowminimize
I have added this command entry in this App (Xfce settings):
Result: Works not better than CTRL+ALT+D (same behaviour)
So my favourite until now is "Use a Wine virtual desktop window".
Use the Shift+Ctrl+G shortcut to send SuperMemo windows to the system tray.
Minimize SM this way works great, but there is no change to maximize it after. The only way to get the window back, is to close SM and open it again, to have it maximized again.
All I have to do is click on the tray icon to have the floating (not Wine virtual desktop) SuperMemo windows back (as in "restore windows"), but yes, this doesn't come automatically with Ctrl+Alt+D; it is an additional operation.
Use a Wine virtual desktop window. Example
This works great. But I don't like the title bar of "wine desktop" on the top. Is there a way to hide it?
The "wine desktop window" is how I deal with the multiple floating SuperMemo windows on incompatible window managers as well as tiling window managers. And yes to your question; you want to undecorate the window. XFCE doesn't have such option built-in, but you can do it with a third-party app.
Install devilspie
using your package manager, then create the following file:
~/.devilspie/supermemo-wine-desktop.ds
:
;; -*- scheme -*-
(if (and (contains (application_name) " - Wine desktop")
;; Unfortunately, when running a Wine virtual desktop, the SuperMemo
;; window class changes from "sm17.exe" (easier to identify) to
;; "explorer.exe"
(is (window_class) "explorer.exe"))
(undecorate)) ;remove title bar
Run the following command in a terminal to test: devilspie -a
. The SuperMemo Wine desktop window should be undecorated. You can Ctrl+C
to stop the test.
To persist this configuration, add the devilspie
command to your desktop environment's startup. (Here, xfce4-session-settings
)
xdotool search --name " (SuperMemo [0-9]+:" windowminimize
I have added this command entry in this App (Xfce settings)... Works not better than CTRL+ALT+D (same behaviour)
I was also far from happy with the window freezing!
Use either:
devilspie
).Here is another solution: Right click onto the title bar and change Lutris window into full-screen mode:
What's the hook? When I start SM again, Lutris window is again not in Full-screen mode.
1. The Window manager always has the final say on how to display a window.
2. There is a Window state named _NET_WM_STATE_FULLSCREEN
, that the window
manager can choose to implement.
2a. Apparently, Lutris is concerned with configuring Wine apps to use exclusive full screen not through this window state, but through OpenGL and other methods more commonly used in games.
3. To set this full screen state on the Wine desktop window upon starting, you can use a devilspie script (see above instructions).
;; -*- scheme -*-
(if (and (contains (application_name) " - Wine desktop")
(is (window_class) "explorer.exe"))
(fullscreen))
Thank you. My "Lutris window full-screen method" is not a good idea. When full screen is active, I can't click on any icons in the taskbar. I can see them, but when I click on them, they don't react.
So I tried now the devilspie method. With
~/.devilspie/supermemo-wine-desktop.ds
and
devilspie -a
But the test was not working:
Golddouble@mx:~
$devilspie -a
^C
Golddouble@mx:~
$
No effect.
My expectation was, that now the title bar wine Lutris goes away. But as you can see it remains. Or do I miss anything?
The window properties may differ. Please change:
(is (window_class) "explorer.exe")
To:
(is (window_class) "Wine")
Thank you. This works great. :+1:
Normally I can press CTRL+ALT+D to minimize all open programs, so that the desktop appears. This does not work when SM from Lutris-Wine is open. I also can not minimize SM itself. Can you reproduce this?