After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 787801 - Mutter should delay applying accelerometer orientation changes when its VT is not focussed
Mutter should delay applying accelerometer orientation changes when its VT is...
Status: RESOLVED OBSOLETE
Product: mutter
Classification: Core
Component: wayland
3.26.x
Other Linux
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2017-09-17 18:16 UTC by Hans de Goede
Modified: 2021-07-05 13:49 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Hans de Goede 2017-09-17 18:16:35 UTC
I've been running some tests of gnome 3.26 on a tablet with an accelerometer. There are several issues causing accelerometer triggered rotation to not work well. I've patches for most of these, I'm still debugging one more issues I will open another bug with the patches once I've debugged this last issue.

While working on this I've noticed another problem for which I need some input to help fix it.

When logged in as an user and triggering rotation changes by moving the tablet around its axis, the journal shows the following errors:

sep 17 19:52:12 localhost.localdomain gnome-shell[1343]: Failed to apply DRM plane transform 0: Permission denied

Which results in gdm's rotation being out of sync with the accelerometer reported orientation / the user session's orietentation.

I believe that the best way to fix this, is to behave as if rotation is locked while the VT on which mutter is running does not have the focus, and to call src/backends/meta-orientation-manager.c: sync_state() when we get the focus back.

I know that logind sends a dbus signal on both vt leave and enter, but I don't know where mutter catches this signal and how to hook up to it from meta-orientation-manager.c.

Note the same issue more or less applies to the x11 backend too, AFAIK Xrandr calls will fail when called when the Xserver does not have the active vt, but catching the VT changes there is going to be trickier and since gdm normally runs with the native kms backend I'm not sure if fixing this corner case is worth it for the x11 case.
Comment 1 Hans de Goede 2017-09-18 13:19:57 UTC
Ok, the other patches I was talking about are now submitted in bug 787836.
Comment 2 Bastien Nocera 2017-09-18 15:58:27 UTC
The logind property is proxied through org.gnome.SessionManager's SessionIsActive property. mutter is supposed to release the accelerometer when the session is inactive, and take it back when it is.

See the LightLevel handling in gnome-settings-daemon/plugins/power.
Comment 3 Carlos Garnacho 2017-09-18 17:25:58 UTC
FWIW VT-related suspend/resume code for wayland happens at:
https://git.gnome.org/browse/mutter/tree/src/backends/native/meta-backend-native.c#n677
https://git.gnome.org/browse/mutter/tree/src/backends/native/meta-backend-native.c#n692
https://git.gnome.org/browse/mutter/tree/src/backends/native/meta-launcher.c#n266

But nothing exists for the X11 paths AFAICS. I guess it makes sense to have paused/resumed as generic signals for both backends.
Comment 4 Hans de Goede 2017-09-19 10:25:22 UTC
(In reply to Carlos Garnacho from comment #3)
> FWIW VT-related suspend/resume code for wayland happens at:
> https://git.gnome.org/browse/mutter/tree/src/backends/native/meta-backend-
> native.c#n677
> https://git.gnome.org/browse/mutter/tree/src/backends/native/meta-backend-
> native.c#n692
> https://git.gnome.org/browse/mutter/tree/src/backends/native/meta-launcher.
> c#n266
> 
> But nothing exists for the X11 paths AFAICS. I guess it makes sense to have
> paused/resumed as generic signals for both backends.

Thanks, I will take a look at using the pause/resume stuff for the accelerometer triggered orientation. May be a while before I get around to this though ...
Comment 5 GNOME Infrastructure Team 2021-07-05 13:49:06 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version, then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a new ticket at
  https://gitlab.gnome.org/GNOME/mutter/-/issues/

Thank you for your understanding and your help.