New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wayland support #991
Wayland support #991
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested this under Wayfire, it did in fact build and run under both X and wayland. Had trouble on x11 with some out-of-process applets not showing up on x11, not being successfully addable, and showing a 1px vertical line where they were supposed to be. Trash, CpuFreq, sensors, and volume control applet all were affected. Worse yet, having run this corrupted the panel configuration so it was necessary both to roll back the panel version AND to reset the panel (lots of fun with a heavily customized panel) to get back proper x11 rendering. This though also happened with the last Wayland support branch, and can be evaded by testing only as a different user.
Now to Wayland results: I have an old version of Wayfire installed, from March 2018 and that's what I tested with on wayland. Panel started up fine, and x11-only applets simply didn't load and brought up the delete/don't delete dialog. Had a problem with the panel rendering partway across the screen when a smaller secondary monitor was hooked up, but that could have been a wayfire issue just as easily. Also menus rendered out of position and some could not be popped back down. Again, this is NOT one of the compositors mentioned in the test instructions, but I had it installed and ready to go, and the panel DID run, even though a lot of applets are not yet wayland-ready.
Not one of the problem applets on x11 should be wayland-incompatable once ported to in-process, in fact all applets in-process would have entirely prevented that bug and only in-process can be used in wayland as we don't have Xembed thus don't have GtkPlug and GtkSocket.
Lots more to do but nice work, again this does in fact run on both wayland and X11, however rough at the moment.
The configuration corruption ideally would be the FIRST thing fixed here, as it makes testing very difficult. Trying to run wayfire as another user did not work for me, I thought I had copied over the necessary files but I got a hard freeze. |
Hmm... it seems there are issues even on master when switching between out-of-process applets and in-process applets. Now on master in X11 I can't get fish or clock to show up (even after compiling with both in-process and out-of-process, uninstalling, installing and resetting). |
Here is what I have found (all this applies to master with
I'm not sure if this is the same or related issue as the one you're running into. I'll continue to look into this. |
I have no confirmed that something is indeed broken on this branch in a way it is not broken on master. out-of-process applets don't work on X11 even when compiled without |
Fixed it. One stray |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The last commit entirely fixed the out of process applets on x11, throwing open the door for full-on wayland testing. Starts and runs under my old (march 2018) wayfire install, though menu and calendar positions are wrong with that compositor. Wayfire of that age might simply not properly support gtk-layer-shell's features for all I know, but it does in fact run and the menu, in-process clock, and some other applets such as the shut down applet come up fine.
Lots more to do, but this does in fact run on Wayland WITHOUT apparently breaking anything on x11
95862df
to
b2244b2
Compare
All menus should be positioned correctly (update GTK layer shell if not), but calendar is not currently implemented as a popup or layer surface, so it is out of place. Also the drawer applet appears to spawn temporary toplevels, which get attached to the edge of the screen like normal toplevels. |
Main menu on bottom panel opens flush w bottom of screen on bottom panel, as does panel context menu. Looks like panel struts do not work or are not yet implemented (or replaced if this is x11-only). Might be an anchor point issue in the menu popup function doing this though Menus on top panel mostly in right place, with exception of main menu's context menu, which came up out of position with a menubar NOT all the way to the left: menu context menu was offset down and to the left. Menus can be closed by clicking on a menuitem or by clicking on the rest of the panel. Panel still comes up short with two monitors connected, secondary monitor smaller resolution than primary. This might be a Wayfire issue on my end passing a wrong monitor dimension to the panel |
This change fixes menus on bottom panels but causes menus on top panels to render level with the top screen edge instead of the panel edge. Also at least on X11 a menu button on a vertical panel at the top or bottom of the panel will have the menu offset from the top or bottom screen edge (or edge of a separate horizontal panel) by the width of the panel: in panel-menu-button.c panel_menu_button_popup_menu Replace
with
Thus here and in all other instances of gtk_menu_popup_at_widget we may need to detect the position of the panel. |
This is actually enough function on wayland to merge and polish later, as it is the difference between not running on wayland and minimal usability on wayland (you can read the time, launch applications, etc). We can worry about the calendar position, a wayland tray for SNI indicators and (the BIGGIE) a wncklet replacement integrated with a wayland compositor later. Ideally we would handle the menu position now, but that could be another PR, especially as it might be complex. |
Correct popup placement is supposed to be handled entirly by gtk-layer-shell without modification to the app (in this case, MATE Panel). Some (and possibly all) of these issues are bugs in wlroots and Wayfire. I'll test in Mir to check (Mir is far from perfect currently, but at least it tends to not have the same bugs as wlroots). Its hard to tell exactly what you're observing from description alone. Anything you screenshot I'll be sure to test on both Rootston and Mir, and give an analysis of who's at fault. EDIT: Screenshots of expected behavior from X11 are also useful. You don't have to screenshot anything in particular, but if you want to make sure I test something specific, thats the way. |
I've started a document to track all the issues related to MATE panel Wayland support, and where they need to be fixed: https://oasis.sandstorm.io/shared/F7QcAtod2QaYEv7n5vLzqcYHa1Sw71OQFxxi3n6fj5x |
I notice we now have a merge conflict, that will need to be fixed |
heads up: Red Hat is indication they are de facto deprecating Xorg itself, saying it is about to go into "hard maintainance mode." https://www.phoronix.com/scan.php?page=news_item&px=X.Org-Maintenance-Mode-Quickly "Once we are done with this we expect X.org to go into hard maintenance mode fairly quickly. The reality is that X.org is basically maintained by us and thus once we stop paying attention to it there is unlikely to be any major new releases coming out and there might even be some bitrot setting in over time" This means we may need to move Wayland development up as a priority, as the "bitrot" warning implies we may be looking at corner case distros that can't build X at all not that far down the road. |
The merge conflict is gone as shown both here and in a local test merge. Test build went fine, ran fine in Xorg, behavior in wayland same as last build: sure as heck it has come a long way from being unable to run. |
from https://blogs.gnome.org/uraeus/2019/06/24/on-the-road-to-fedora-workstation-31/
https://access.redhat.com/support/policy/updates/errata/#Full_Support_Phase Beside from this i think a plan will always have a delay. |
I like to setups a VM with a wayland-compositor for real testing. |
I normally start wayfire from another TTY, usually first ctrl-alt-F2 to TTY2, then login, then just run wayfire (which is what I have been testing with) |
As I said in the original comment, there are a number of ways to get a Mir compositor with layer shell support (needed to run MATE panel). The simplest of which is to run |
I am on a heavily modified Debian Unstable install, do not have snap support installed, and don't plan to install it. No problem if this helps others test this, we all have our ways of doing things and in fact it is good if each tester is using different compositors and different install methods, as this helps catch corner case bugs. Thanks-we've got one more way people can test this |
I never used snap. No idea how this works :/ |
AFAIK, Caja crashes on Wayland. You might get it working in XWwayland, but on Mir XWayland support is still sketchy. It's the next thing I'm going to look into porting to Wayland, though it will be a big job. If you wanted Mir but not the Snap, you could build the |
Ok, than it doesn't make sence for the moment to start a wayland compositor with Mate session from login manager.
I am using fedora , might be a good idea to start building a RPM package. Btw. my problem with snap is that i don't know how to use it. |
I do in fact have caja working on Xwayland in wayfire, and have also run it on xwayland in Weston. Even caja --force-desktop works, though there is the problem that the xwayland desktop window does not get forced to the bottom of the window stack. None the less, I have more than once had a wayfire/mate-panel/caja with desktop session running, a very rough early prototype for a MATE+ compiz replacement. Porting Caja itself to wayland would indeed be the next big step, and it will probably require a new desktop canvas. GNOME decided to ignore that and entirely dump support for icons on the desktop, something we simply cannot do. |
That's Mir, but it doesn't have the layer shell stuff yet. That's why I mention building from the
https://docs.snapcraft.io/installing-snap-on-fedora. You'll want to enable classic snaps (these are snaps that have access to the filesystem, instead of being restricted to their own environment). Then just |
I'm not convinced the Wayland port would require rewriting the desktop. Gnome dropped it because they want to do that sort of stuff in-process in the shell, but with Layer Shell we can (and probably should) continue to render the background and icons with roughly the same architecture as on X. |
That's very good news, I thought the desktop would be the second worst problem after a replacment for what libwnck does in Xorg |
Just pulled and built today's version of this, no new problems. Also used a new wayfire install, the wayfire bugs with menu position (panel struts ignored, a WM issue presumably) are still there but presumably out of the scope of this PR. An interesting problem with the clock: the calendar window was not only way out of position but decorated. Looks like wayfire DOES use layer shell though, as attempting to run the panel on weston gets warnings gets a failure to render the panel with this warning (as we would expect): |
This sway patch gets this working on sway: |
I've installed snap but something goes wrong with running mate-wayland in qemu VM.
Looks like virtio graphic driver for qemu VMs isn't supported? Sorry, i am unable to test PR. |
offtopic on I noticed today that libXxf86misc-devel is dropped from fedora rawhide (f31).
In result i have to build mate-settings-demon, mate-screensaver and mate-control-center without it. |
Ok, i have the panel running in rootston window. :) Do i have to re-compile the panel after updating gtk-layer-shell to latest version? |
Using
Again, i have no idea what should happen here normally :) |
Normally what happens is stdout shows about the same thing, but instead of errors there are more Mir messages, and then a new X11 window appears with Mate panel running on Mir inside. It appears there's some problem with graphics drivers running Mir inside the VM. I'll look into it. |
I've reproduced running normal Mir (not from a snap) in an Ubutnu 18.04 VM. I opened an issue in Mir (canonical/mir#914) and will be looking into it. |
My results with rootston window:
menubar applet (3 menus), single-menu-applet (main-menu):
panel-launcher, panel-action-button, execute-application-applet:
fish applet:
drawer applet, clock applet:
Last but important point, It seems that same compiled panel with X11/wayland runs fine under X11 :) So, what are your plans? I don't think you want to fix all those issues in this PR. |
I forgot, thanks a lot for this first implementation ;) |
There are gravitation bugs, but I think they're more subtle than what you see in Rootston. The Wayland compositor is supposed to keep popups from going off screen, which Rootston does not last I checked. I think ddvault was working on that, but if any popups go partly or completely off screen it's a compositor issue, and probably wont happen in Mir. The gravitation bugs that are in MATE panel are that popups tend to cover up their applets instead of appearing outside the panel. I'm not sure if the bug is in how gtk-layer-shell interprets GTK's popup position, or if GTK is positioning them wrong on X and there's some X-specific functionality to fix it. Seeing as this is somewhat usable and doesn't break existing functionality, I would prefer to merge this and make fixes in future PRs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM for a first wayland implementation.
The panel can build with wayland and X11 backends enabled, and there isn't a different to previous behaviour when running under X11.
Mentioned issues under wayland can fixed later in new single PRs.
Looks ready to go for me.
@lukefromdc |
Yes, I think we should merge this and fix the wayland-only issues as we go. After all, current master does not work with wayland at all, and this is a development version |
@luispabon thanks for testing it out! I think you're actually seeing correct behavior. There's currently no background app, so you're just seeing Mir's default black. There should be a panel somewhere, but it might be empty. Depending on your GTK theme it may even be solid black and blend into the background. Try right clicking near the top or bottom of the Mir-on-X window. You can also run If you still have problems feel free to open an issue on https://github.com/wmww/mate-wayland-snap. I know I haven't been super clear about where what issues should be reported. |
Thank you @wmww, indeed running the pannel is what I needed to do 👍 |
This is the PR we've all been waiting for. The one that finally adds full Wayland support to the panel. You can test this without even building from source (see the Mir section of 'To run')
Based on
#983,#984,#985,#986,#988,#989,#990To build
You'll need to compile and install GTK Layer Shell. After that run
./autogen.sh --with-in-process-applets=all --enable-wayland --enable-x11
and make and install. Installing is required if the build that is currently installed did not have--with-in-process-applets=all
. If you don't install it will try to use out-of-process applets, which fail on Wayland.To run
First, you'll need a Wayland compositor that supports Layer Shell.
mate-wayland
snap is built from a branch of Mir with Layer Shell. It also comes with a copy mate-panel compiled from the same commits as are in this branch.sudo snap install --edge --classic mate-wayland
mate-wayland
mate-wayland.mirco
If compiling the panel yourself, once you have a compositor with Layer Shell support you'll want to run mate-panel in it. To do this, run
WAYLAND_DISPLAY=wayland-0 ./mate-panel
. That's assuming your Wayland compositor is running onwayland-0
which I think is a safe assumption if it's the only compositor running.