lxqt / lxqt-panel

The LXQt desktop panel
https://lxqt-project.org
GNU Lesser General Public License v2.1
179 stars 134 forks source link

Minimize All action in Show desktop widget panel plugin #1477

Closed dglent closed 3 years ago

dglent commented 3 years ago

Hello

When using KWin the show desktop widget doesn't minimize the pcman-fm windows. Instead the kwin command minimizeAll gives the expected behaviour.

Is it possible to add an option to the show desktop widget to use the 'minimize all' shortcut of kwin (Meta+Shift+D) ?

dglent commented 3 years ago

This seems to work :

qdbus org.kde.kglobalaccel /component/kwin org.kde.kglobalaccel.Component.invokeShortcut "MinimizeAll"
tsujan commented 3 years ago

@dglent The Show Desktop plugin has a shortcut but doesn't work just by invoking a shortcut. It uses KWindowSystem::setShowingDesktop() to show the desktop. The irony is that we use KWindowSystem (belonging to KF5) and it works fine with Openbox but not with KWin! I think that's a KWin issue.

Anyway, you could easily:

  1. Remove the KDE shortcut for MinimizeAll from KDE System Settings;
  2. Assign any shortcut to qdbus org.kde.kglobalaccel /component/kwin invokeShortcut "MinimizeAll" (as a command) in Global Actions Manager, and
  3. Remove Show Desktop from the panel.
dglent commented 3 years ago

Actually the shortcut is already available (provided by kglobalaccel5) I wanted to use the widget on the panel with the mouse Otherwise i can create a desktop entry with the above dbus command and add it in the place of the Show panel widget on the panel

tsujan commented 3 years ago

Actually the shortcut is already available (provided by kglobalaccel5)

That was why I told about removing it from KDE System Settings — in order to manage it with LXQt's Global Actions Manager.

I wanted to use the widget on the panel with the mouse

The problem is neither in Show Desktop nor in pcmanfm--qt but in KWin: pcmanfm-qt's windows are unfocused but not hidden. With Openbox, there is no problem.

Otherwise i can create a desktop entry with the above dbus command and add it in the place of the Show panel widget on the panel

Yes, that's also a possible workaround, although it's about minimizing, not hiding.

stefonarch commented 3 years ago
Assign any shortcut to `qdbus org.kde.kglobalaccel /component/kwin invokeShortcut "MinimizeAll"` (as a command) in Global Actions Manager,

Didn't manage to make that work. As a command it get's sanitized, and single components as dbus message doesn't work either.

tsujan commented 3 years ago

@stefonarch You first need to enable it in System Settings → Window Management → Kwin scripts → MinimizeAll. It works around the problem "Show Desktop" has with pcmanfm-qt.

tsujan commented 3 years ago

Actually, MinimizeAll is better than "Show Desktop" in another way too: Here, "Show Desktop" minimizes Conky too, while MinimizeAll ignores it (as it should).