Giter Site home page Giter Site logo

Comments (11)

alessivs avatar alessivs commented on June 3, 2024 2

The window properties may differ. Please change:

(is (window_class) "explorer.exe")

To:

(is (window_class) "Wine")

from supermemo-wine.

alessivs avatar alessivs commented on June 3, 2024

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:

  1. Use the Shift+Ctrl+G shortcut to send SuperMemo windows to the system tray.
  2. Use a Wine virtual desktop window. Example:
Lutris
  SuperMemo 17
    Configure
      Runner options
        [X] Windowed (virtual desktop)
        Virtual desktop resolution: (choose desired resolution)

from supermemo-wine.

alessivs avatar alessivs commented on June 3, 2024

Additional suggestion: define a keyboard shortcut at the window manager level; say, with xfce4-keyboard-settings, that would minimize the dock window upon click:

image

A refinement would be to detect the dock window instead of clicking on it , but it isn't simple.

from supermemo-wine.

alessivs avatar alessivs commented on June 3, 2024

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)

from supermemo-wine.

alessivs avatar alessivs commented on June 3, 2024

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.

from supermemo-wine.

Golddouble avatar Golddouble commented on June 3, 2024

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):
SM minimieren

Result: Works not better than CTRL+ALT+D (same behaviour)

So my favourite until now is "Use a Wine virtual desktop window".

from supermemo-wine.

alessivs avatar alessivs commented on June 3, 2024

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)

image

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!

Conclusion

Use either:

  1. A Wine desktop window. You can undecorate it automatically with Devilspie. A "desktop window" avoids bugs from interacting with not-so-collaborating window managers.
  2. Regular floating SuperMemo windows. The experience isn't the best, which is why I will come up with an alternative to enable minimization for floating windows (likely a script running in the background, analog to devilspie).

from supermemo-wine.

Golddouble avatar Golddouble commented on June 3, 2024

Here is another solution:
Right click onto the title bar and change Lutris window into full-screen mode:
Lutis Vollbild

What's the hook?
When I start SM again, Lutris window is again not in Full-screen mode.

from supermemo-wine.

alessivs avatar alessivs commented on June 3, 2024

   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))

from supermemo-wine.

Golddouble avatar Golddouble commented on June 3, 2024

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

devispie

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?

from supermemo-wine.

Golddouble avatar Golddouble commented on June 3, 2024

Thank you.
This works great. 👍

from supermemo-wine.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.