Progress Report July 10th - July 23rd
And so, another two weeks have passed. During these two weeks I was focused on fixing my previous code drops, as outlined in the previous post. I have gotten enough feedback from both of my mentors these past two weeks, so the first week was spent on rebasing my previous work and applying feedback. That took quite some time, but after two rounds, I finally believe we have the first part where we want it. I do expect a nit or two, still, since the latest round of MetaX11Display creation/destruction involved using GObject destructors, rather than meta_display_(close|free). But now that this is done, and MetaScreen is now properly disposed of, I could focus on my main objective - getting Mutter to work without X11.
After all the shoveling work was done, I started investigating what needed to be done so meta_x11_display_new () call could be avoided, and mutter could be started without crashing. First part involved couple of cosmetics, like renaming errors.c/h file to meta-x11-errors.c/h, as previous work involved moving these to MetaX11Display, and wrapping usage of CurrentTime, which is X11 global variable that reports time from X server. Second part was about adding a --no-x11 parameter, which can be used with --wayland parameter, so Mutter could be started without starting XWayland. Proper helpers for checking if it was started with --no-x11 were also added, and used where it seemed they were needed at the first glance.
There are still issues though, which need to be fixed before I can claim mutter can work without X11 being available. Workspace management, which was moved from MetaScreen into MetaDisplay, still heavily relies on X11 code for getting workspace names, count and layout from X11 Atoms. This needs to be carefully fixed, so it works good enough without X11, as well to apply current code paths when (if) X11 gets available after Mutter gets started. Per discussion with my mentors, we agreed on moving everything (once again) into a MetaWorkspaceManager, isolating X11 code paths and properly applying then when X11 gets available, while keeping the same features when X11 is always available.
Another issue is in the stack tracker. So far, we did not talk a lot on how we should approach this one, since there's a lot of X11 specifics. Then there's key grabbing, which is also all-X11, so we may as well move that to X11-only path. And at last, there's some GtkSettings usage, which will be simply moved to function and let libmutter user call the function when changing the GtkSetting mutter currently uses.
Some compositor-related work was already completed, since it manily needed some if's. Then, there was libstartup-notification code, which is X11 specific, but also used in Wayland world through private GTK protocol. This was worked around by moving libstartup-notification code into signal handlers that run when X11 "comes and goes". Last feature that was split was Bell (visual/sound notification) handling, where X11 specifics were moved to MetaX11Display.
This summarizes my work over these past two weeks. I do admit it is not much, but rebasing and applying more feedback takes time. From what I see, I am very close to my main GSoC goal. Work from these past two weeks can be found at