Skip to content
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

Add support for Mutter 44 #1570

Merged
merged 11 commits into from Apr 23, 2023
Merged

Add support for Mutter 44 #1570

merged 11 commits into from Apr 23, 2023

Conversation

tintou
Copy link
Member

@tintou tintou commented Mar 8, 2023

Closes #1569

@bobby285271
Copy link
Member

🙃 Ah so the change is larger than I expected, how do we get_ui_scaling_factor these days? The corresponding MR seems to be https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2718, which is doing treewide changes like

-  MetaBackend *backend = meta_get_backend ();
+  MetaDisplay *display = meta_x11_display_get_display (x11_display);
+  MetaContext *context = meta_display_get_context (display);
+  MetaBackend *backend = meta_context_get_backend (context);

@tintou
Copy link
Member Author

tintou commented Mar 9, 2023

Basically, for the scale_factor, we have to take into account the fact that each display can have a different scale factor and that it can be a floating value (which we do not like at elementary but that's something upstream wanted)

@davidmhewitt
Copy link
Member

davidmhewitt commented Mar 26, 2023

This builds now, but I have done no testing whatsoever, I've been developing in a docker container and haven't even tried running it 😅

It will need thorough testing in the following areas as significant parts of code have been refactored, if it even runs without crashing:

  • The scaling and animations of all UI elements in both LoDPI and HiDPI displays, especially with multiple monitors.
  • Thorough testing of all multitasking view drag/drop elements and animations
  • The detection of added/removed monitors or changed monitor config and the resulting scale of UI elements
  • Hotcorners
  • Keymap switching
  • Modal elements of the UI (screensaver, PIP, alt+tab switcher, Multitasking View, etc...)
  • Notification positioning
  • Screenshot filenames
  • Accessibility features (dwell click, pointer locator)
  • Gesture animations

@bobby285271
Copy link
Member

I managed to build a VM.

Screenshots

It looks like it crashes at https://github.com/elementary/gala/blob/62375b5/src/InternalUtils.vala#L361 with Can't create a GtkStyleContext without a display connection

@davidmhewitt
Copy link
Member

Can't create a GtkStyleContext without a display connection

That sounds like the error you get when you try to start Gala in Wayland mode, which isn't supported yet.

@bobby285271
Copy link
Member

Hmmm weird, journal says it's X11 window and compositing manager

XDG_SESSION_TYPE is also x11

@davidmhewitt
Copy link
Member

davidmhewitt commented Mar 26, 2023

I can reproduce this crash on Fedora 38 beta with Mutter 44, definitely in X11 mode. But not with Mutter 42 on elementary OS.

This is the same problem we have with Gala+Wayland though in that it's failing because we're trying to use GTK code inside the compositor, which isn't really ideal.

@davidmhewitt
Copy link
Member

@bobby285271 I've had some initial success with Mutter 44 and this branch, but it's a bit hacky:

https://github.com/elementary/gala/tree/davidmhewitt/init-later

@bobby285271
Copy link
Member

bobby285271 commented Mar 27, 2023

Nice that seems to work, still saw some issues at a quick glance though (did not do a proper testing yet)

I circled them in the screenshot

@davidmhewitt
Copy link
Member

Yes, I expected some scaling/positioning issues like this after having modified so much of the scaling and positioning code. There will be some maths I've done wrong somewhere 😅

I'll try and test and fix this some more over the next few days.

The missing icon in your screenshot (number 2), is probably caused by the gresource being removed:
https://github.com/elementary/gala/pull/1570/files#diff-f95a8510ab53a5e21d9e4a306b12f76fc79086143aa8989c13effed889bec144R16-R18

Was there a reason for this @tintou ?

@tintou
Copy link
Member Author

tintou commented Mar 27, 2023

Sorry that's a leftover of glib-compile-resources not working under Fedora docker image (my host is too old) so I had to remove it to build it locally

@tintou
Copy link
Member Author

tintou commented Mar 27, 2023

@davidmhewitt Are there changes that we can start backporting to reduce the diff of this MR?

@davidmhewitt
Copy link
Member

@tintou Yes, probably. I'll start some work on that this week.

lib/Utils.vala Outdated Show resolved Hide resolved
plugins/maskcorners/Main.vala Outdated Show resolved Hide resolved
@davidmhewitt
Copy link
Member

@bobby285271 @decathorpe I think this branch is in a pretty good state for Mutter 44 support now. I'll continue to separate out of a few of the changes and test and merge them separately, but I don't expect too many changes between this and the final version of our Mutter 44 support if you wanted to start some testing on your respective distros! 😉

@bobby285271

This comment was marked as resolved.

@davidmhewitt
Copy link
Member

@bobby285271 Could you check whether that issue happens with the Adwaita stylesheet? We're not really in control of the sizing of these titlebars in Gala, so this may be a stylesheet issue.

@bobby285271
Copy link
Member

Ah yeah it looks fine in Adwaita stylesheet 👍

@davidmhewitt
Copy link
Member

Stylesheet issue opened here: elementary/stylesheet#1253

@davidmhewitt davidmhewitt marked this pull request as ready for review April 15, 2023 11:40
@meisenzahl meisenzahl mentioned this pull request Apr 16, 2023
2 tasks
@tintou
Copy link
Member Author

tintou commented Apr 20, 2023

@davidmhewitt I've rebased this MR, you might want to check it again 🙂

@davidmhewitt
Copy link
Member

@tintou All looking good, thanks for cleaning up the commits!

I've tested this branch on Mutter 42 on elementary 7 and Mutter 44 on Fedora 38 and it all seems to be working great.

@tintou tintou enabled auto-merge (rebase) April 23, 2023 12:25
@tintou tintou disabled auto-merge April 23, 2023 12:27
@tintou tintou merged commit f618027 into master Apr 23, 2023
4 checks passed
@tintou tintou deleted the tintou/mutter-44 branch April 23, 2023 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support mutter 44 / libmutter-12
3 participants