mate-desktop / mate-panel

MATE panel
https://mate-desktop.org
GNU General Public License v2.0
183 stars 115 forks source link

Wayland: Fix force-quit unsupported message dialog #1406

Closed lukefromdc closed 9 months ago

lukefromdc commented 9 months ago

For some reason "widget" is not being properly passed to this, so use NULL for the parent window This makes the "force-quit only available in x11" dialog work

raveit65 commented 9 months ago

That works, but is there no way to disable force-quit in add-to-panel dialog?

lukefromdc commented 9 months ago

Disabling a panel action button from appearing in the add to panel dialog won't prevent it from appearing on the panel if previously added in an x11 session. This problem also effects the logout button since that seems difficult to implement in wayland without a special logout manager program(these do exist but using one for this would mean depending on in in wayland builds.)

Originally the poweroff button and only the poweroff button was disabled from being added in wayland or with no session manager. It would render on the panel if previously added from an x11 session but was totally unresponsive. That isn't good behavior and would cause users to just wonder what is broken. Panel actions buttons are handled differently than applets, we don't have a .desktop file where we can simply list the supported platform and popup a dialog asking the user if they want to remove it. A lot of those dialogs can become a nuisance too, when the same panel configuration is used in both x11 and wayland

About logout: killing the compositor from inside the wayland session will return you to SDDM if the session was started from there, but that of course requires either knowing which compositor is in use or trying to guess and iterate through all of them. NOT sure if we want to go that route, as it would have to be reverted if we ever find (or a compositor ever adds) a way to save a session excluding perhaps the previous window positions.

I just found out today that killing the compositor to force a logout (rather like ending an IceWM session) can be made to work for a logout though. For some reason any VT switch (as when I tested killing the compositor from another VT) causes both SDDM and a wayland session started from it to "lose" the VTand not render on it. Wayfife started directly from a TTY can be VT switched out of and back, so that may be an SDDM issue.

Force-quit's problem is that the panel applet works by determining which window is under an exact spot on the monitor. Since Wayland compositors normally do not other than by portals expose a global map of what window is there (so as to block things like one app clickjacking another, this is difficult. This is why GIMP is supposed to be able to use a portal to get a color selection. I don't know enough about portals to write such code, and do not have that working with GIMP on wayland in my own install. If someone does I will be glad to test it and if it works move force-quit from unsupported to supported.