mate-desktop / caja

Caja, the file manager for the MATE desktop
https://mate-desktop.org/
Other
265 stars 143 forks source link

Wayland support for navigation windows #1716

Closed lukefromdc closed 1 year ago

lukefromdc commented 1 year ago

Note that the desktop requires a complete desktop canvas rewrite, so for now we have functional navigation windows in native Wayland.

Tested in current Wayfire and seems to mostly work save that the desktop is not displayed. A possibly wayfire-specific issue is caja navigation and spatial windows being harder to move and resize than most other windows when "prefer client side decoration" is set. If "prefer server side decoration" is set all windows behave the same in this regard including caja navigation and spatial windows

Note that wayfire's wayfire.ini file can be set to prefer server side or client side decoration.

Most windows can be moved and resized with just the mouse in CSD but not Caja for some reason. The prefs and backgrounds and emblems dialogs can be dragged and resized in CSD wayfire but not navigation and spatial windows (both tested and otherwise work).Nemo windows are draggable in CSD but these are GtkApplication windows, that's mostly to support things like global menus in gnome-shell (and by extension in Cinnamon if supported there) as far as I was able find from the docs.

Super-left mouse button drags and super-right mouse button resizes any window in either SSD or CSD in Wayfire. In SSD, all windows can be dragged with the mouse, no windows (of any app) can be resized without super-mouse right button.

File copying, moving between directories, and even setting backgrounds from the backgrounds and emblems dialog all work.

No visible change in x11 behavior, one piece of apparently obsolete code concerning the type to search entry boxes had to be removed as it was in Nemo to allow setting a toplevel for these transient windows. Otherwise in wayland you get a bunch of warnings

mbkma commented 1 year ago

I will test this later today. Would be awesome! Then we almost have the all desktop apps on Wayland, right? I think only the control center is missing.

mbkma commented 1 year ago

For me is it not working at the moment. In X11 the bottom ~20px of the screen gets black with this PR after caja -q. Other than that caja behaves regularly in X11. In Wayfire when running caja or caja --no-desktop nothing happens (I get right to a new command prompt, without caja launching). I launched wayfire in a TTY.

6.3.3-1-MANJARO Wayfire 0.7.5

lukefromdc commented 1 year ago

Thanks for testing, there is no way for one person to find all the workflows on this. Will try your change now. We cannot have any regressions or new bugs in x11. Note that I could not duplicate the black bar on caja --quit, so if you can retest this after I commit your change it would be appreciated

lukefromdc commented 1 year ago

Tested your change and it didn't create any problems on my end. Splitting out x11 handlng here also reduces the risk of users gettting issues with deskop size updates on changing monitor resolution etc on x11. No doubt when we get a desktop canvas working for wayland we'll find issues there that need to be addressed.

I was able to add it to the initial commit and then reapply the second commit, then force-push

lukefromdc commented 1 year ago

Note that in order to successfully launch caja under wayland in a new tty, it is sometimes necessary to start wayfire with dbus-launch wayfire and wait until the background chosen for the wayfire session appears. Caja can then be run from a terminal.

Note that with the latest updates to wayfire and gtk-layer-shell installed, and possibly from having run wayfire with dbus-launch before since last boot, I did just get caja to show up immediately in a wayfire session. Try dbus-launch wayfire if this isn't working though. If that still doesn't work we need to find out what is different on your end. So far dbus-launch wayfire is always necessary to run mate-panel in wayfire on my setup

mbkma commented 1 year ago

Maybe somebody with a 2k or 4k monitor can test if caja works as expected in the X11 session since I noticed some scale variables being dropped. @lukefromdc I could not find in the docs why we do not need the scaling anymore. Could you explain?

lukefromdc commented 1 year ago

Every single place I removed scaling variables when running under Wayland was because testing showed double-scaling in wayland. It looks like Wayland does more scaling for you by default than x11 does, there are a LOT of differences,

I normally use the x11 session and have tested it both with window-scaling=1 and with window-scaling=2, but remember that's one tester and one machine on one distro.

A note on moving windows in wayfire: for some reason I have not been able to find, when client-side decoration is "favored" by wayfire caja navigation or spatial windows can only be moved with super- and resized with super while most other windows work normally.

Nemo can be resized and moved normally in wayland CSD but I have NOT been able to find the difference. So do Pluma and mate-terminal windows. In wayfire with "prefer server side" decoration the windows can be moved and resized more normally (though none regardless of contents or app can be resized from bottom or sides and seem to be undecorated there).

raveit65 commented 1 year ago

Maybe somebody with a 2k or 4k monitor can test if caja works as expected in the X11 session since I noticed some scale variables being dropped.

I will test this PR on x11 with hidpi resolution. Sorry, i don't have a wayfire setup anymore.

lukefromdc commented 1 year ago

That's fine, it's another hidpi x11 test we need

lukefromdc commented 1 year ago

For the future, I saw somewhere that rendering a desktop on wayland requires using GtkLayerShell to keep it on the bottom. I have no idea how to do that. Experiments with trying to get a simple desktop window to open with a background and fullscreen have gotten nowhere. That would be another PR though so is on another local branch not this one.

lukefromdc commented 1 year ago

@raveit65 do you still want to test this at hidpi on x11 or should I proceed to merge this?

lukefromdc commented 1 year ago

There can be issues with applying or reversing "open each folder in it's own window" (spatial mode preference) when running caja simultaniously under x11 and Wayland, but I had spatial mode working in both. Purpose was to see if the CSD move/resize issue was navigation window specific. It's not, and apparently it's a common issue with wayland compositors now.