You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your ses
8000
sion.Dismiss alert
{{ message }}
Repository navigation
Sensor reports right-up and wrong real orientation on gnome while laptop mode #10
May be I am stupid, but after installing tablet mode with iio proxy it works quite well, but switching back to laptop mode actually making orientation wrong. Its a gnome thing for sure, but may be there is a way to tinker it?
Laptop mode -> Tablet mode = everything is fine, auto rotation works. Sensors reporting right up while in real landscape mode and normal while in portrait mode.
Tablet mode -> Laptop mode = sensors still reporting right up but gnome switching orientation to portrait so the screen is axtually portrait.
The other thing related to that is that in tablet mode there are two buttons on the keyboard still functioning for whatever reason - brightness up and down. This is kinda cool actually, but why volume buttons doesnt work in this case ?:)
changed the title [-]Right-up orientation and wrong real orientation on gnome[/-][+]Sensor reports right-up and wrong real orientation on gnome while laptop mode[/+]on Jun 16, 2026
The issue I've encountered is that the laptop's "native" rotation is portrait, i.e. it registers as a 1080x1920 display (rather than 1920x1080). Because of this, on Niri and with iio-niri, the "correct" rotation for laptop mode is right-up - the "right" side is actually the top of the laptop and it should be up.
You can try changing it to MXC_ORIENT_NORMAL or removing that if all together (in which case the laptop will rotate even in laptop mode).
Have you applied any other tweaks for screen rotation, e.g. BIOS tweaks or bootloader-level changes? This could explain why "right-up" isn't correct on your machine.
The thing is on KDE there is a setting to rotate the screen only in tablet mode and with it everything is fine. So only gnome being gnome I guess. But I will try your suggestion soon.
None of the other screen rotation methods were applied.
Also gonna report an issue with thermal tool install. There is something while building and copying the files from src folder to src folder. Need to look closer to pkgbuild. Also in near future.
I have checked, sensor are reporting “normal” position as default on laptop mode. Even without your suggestions. I think thats the reason , right-up rotation were never be a thing on gnome lap mode bc it works kinda different
I've been experimenting with the VBT patcher and I found that many users (myself included) prefer to have a horizontal boot logo and TTY console. This can be achieved by applying a hardware rotation via the VBT patcher (--rotation 1).
However, this currently breaks the logic in your patched iio-sensor-proxy. Since the proxy has hardcoded logic to rotate the MiniBook X panel (assuming it's always in portrait mode), applying a VBT rotation results in a double rotation in GNOME (the "upside down" laptop mode issue).
Question:
Would it be possible to modify the iio-sensor-proxy logic to check the native panel orientation reported by the kernel before applying the MiniBook-specific offset?
If the proxy could detect that the panel is already reporting a landscape orientation (due to a patched VBT), it could skip the internal 90°/270° correction. This would allow:
Horizontal BIOS/Boot logo (via VBT).
Horizontal TTY/Console (via VBT).
Perfect auto-rotation in GNOME/KDE without conflicts.
This would be the cleanest setup possible, as it removes the need for video=panel_orientation in GRUB and provides a seamless landscape experience from the moment the power button is pressed.
What do you think about making the proxy logic conditional based on the reported hardware orientation?
I’m seeing a related issue on a MiniBook X running Ubuntu 26.04 / GNOME, although I think part of what I found may be separate from the GNOME orientation issue here.
My desired behavior is basically the same as discussed above: tablet mode should use auto-rotation, but when returning to laptop mode I want the panel forced back to the normal landscape orientation.
While investigating, I found two lower-level things in the patched iio-sensor-proxy:
ClaimAccelerometer() was timing out when the MXC6655 driver was already polling. In mxc6655_set_polling(), if want_polling == state, it returned without sending the initial reading that the generic proxy waits for before completing the claim. I changed it so an existing TRUE polling state resends the current orientation, and ClaimAccelerometer() then returned immediately.
On my machine, ACPI/GMTR provides the expected thresholds 185 / 175 / 30, but compute_hinge_angle() only reaches about 150–155° when physically folded. Normal laptop mode is roughly 90–116°. As an experiment, forcing:
tablet_thresh = 140.0f;
laptop_thresh = 125.0f;
I also found that the existing pre-check skips hinge calculation based on the Y components, even though compute_hinge_angle() uses the X/Z projection. Changing that check to test X/Z magnitude made hinge reporting much more consistent when the device is tilted/wobbled during folding.
I’m not sure whether the 150–155° maximum is due to calibration, the hinge-angle reconstruction, or a hardware/firmware difference on my unit, so I’m not claiming the 140/125 values are the correct fix. I’m happy to test anything useful on my machine.
Separately, GNOME still does not return to the correct landscape orientation after unfolding, so that part still seems closely related to this issue.
@tonozawa1 do you mind trying #13 and seeing whether this fixes the orientation after unfolding? I haven't had a chance to test this other than some basic usage, I'm curious if it actually works for you.
Unfortunately the behavior is unchanged for me. Tablet mode works, but after unfolding back to laptop mode GNOME still leaves the display in the wrong orientation, and I still have to manually select Landscape Left.
So on my machine the kernel reports panel orientation 0 (normal), meaning PR #13 applies no compensation.
I think I found the cause for both of the issues you reported. GNOME likely didn't receive the final state after folding back, which should now be emitted unconditionally; there was also an error in the angle calculation which would explain why you're seeing the ~150 as maximum angle (if not, I can just add a setting for it).
Hopefully both are fixed in fbae02e (same PR), @tonozawa1 do you mind trying again (same PR)?
Hi @fstanis. Folding the
F7B1
keyboard by itself does not trigger tablet mode. With the device still folded, rotating the whole MiniBook 90° triggers Tablet mode (angle=315.9), followed about 1.7s later by Laptop mode (angle=81.8). libinput shows the corresponding state 1 → state 0. This means tablet-mode detection is still dependent on how the whole device is oriented relative to gravity, rather than only the hinge position.
Is this a new issue you're seeing? My last commit is meant to address this bit:
but after unfolding back to laptop mode GNOME still leaves the display in the wrong orientation, and I still have to manually select Landscape Left.
But now if I understand correctly, it's tablet mode that doesn't happen, not returning from it? Do you mind recording a video or writing step by step instructions to reproduce this?
Thanks — I retested this today with the latest PR and recorded both the Linux screen and the physical device.
I need to correct my previous observation: tablet mode itself appears to be working now.
What I see in the recording is:
Start in normal laptop mode.
Fold the keyboard fully behind the display.
Tablet mode engages correctly.
While in tablet mode, rotating the physical device causes the display to rotate as expected.
Unfold the keyboard back into normal laptop position.
The driver reports Laptop mode, but GNOME leaves the display in the last tablet orientation instead of restoring Landscape Left.
I still have to manually select Landscape Left afterward.
For example, the log shows:
Tablet mode (angle=293.9)
and later, when unfolding:
Laptop mode (angle=87.1)
So at least in this test, hinge/tablet detection looks much better after your angle fix. The remaining issue seems specifically related to the final orientation state when returning to laptop mode.
I'm attaching two recordings:
Linux screen recording showing GNOME/display behavior and the live log
Vision Pro recording showing the physical MiniBook at the same time
iio-sensor-proxy output
The Vision Pro recording makes it fairly clear that the machine is physically back in laptop mode while the display remains in the tablet orientation.
I've been testing the detect-drm branch (PR #13) on my MiniBook X N150 (Debian 13 / BIOS V2.51). Unfortunately, I haven't been able to get the correct orientation in Laptop Mode when using manual GRUB rotation.
My setup:
GRUB: video=DSI-1:panel_orientation=right_side_up (needed for horizontal boot/TTY).
Kernel: 6.12.86+deb13.
Display: card0-DSI-1.
The Problem:
The proxy doesn't seem to correctly compensate for the manual GRUB orientation, leading to "double rotations" or incorrect fixed states in Laptop Mode.
Manual Tests performed (modifying drv-mxc6655-accel.c):
I tried overriding the hardcoded MXC_ORIENT_RIGHT for Laptop Mode (mode != 1) with the following results:
Default (MXC_ORIENT_RIGHT): Screen is inverted (180°) when returning to Laptop Mode.
Set to MXC_ORIENT_NORMAL: Screen is vertical (90° Left).
Set to MXC_ORIENT_LEFT: Still incorrect orientation.
It seems that read_panel_orientation() via libdrm is returning 0 (Normal) on my unit, so the compensation logic isn't being triggered, even though the hardware/GRUB is actually rotated.
Additional observations:
monitor-sensor still only reports one accelerometer, which prevents the automatic "Laptop Mode" rotation lock from being reliable.
Every time I unfold the device, I have to manually set "Landscape" in GNOME settings.
Could we implement a way to override the laptop_mode orientation via an environment variable or a config file? This would help users with different GRUB/VBT setups.
Did I understand correctly that on Ubuntu 26 with the latest GNOME everything will work correctly, both tablet mode and the correct orientation when returning to laptop mode?
Could we implement a way to override the laptop_mode orientation via an environment variable or a config file? This would help users with different GRUB/VBT setups.
We investigated the remaining tablet -> laptop orientation problem on another MiniBook X. This part is a Mutter bug, not a hinge or SensorProxy state bug.
When laptop mode returns from tablet, Mutter forces the physical CRTC transform to normal regardless. On a portrait-native panel whose DRM orientation is right_side_up, that produces logical transform 1 and leaves the desktop sideways. SensorProxy is already correctly reporting right-up. Kernel params, vbt patches and changing the SensorProxy laptop orientation does not prevent this transition.
I'll go ahead and close this issue since it seems to have become a catch-all for various semi-related rotation issues and it's hard to keep track over what's fixed and what isn't. I suspect #24 will address most of the outstanding bugs - if you're still experiencing issues after we merge it, please open a new issue.
Activity
[-]Right-up orientation and wrong real orientation on gnome[/-][+]Sensor reports right-up and wrong real orientation on gnome while laptop mode[/+]fstanis commentedon Jun 21, 2026
The issue I've encountered is that the laptop's "native" rotation is portrait, i.e. it registers as a 1080x1920 display (rather than 1920x1080). Because of this, on Niri and with
iio-niri, the "correct" rotation for laptop mode is right-up - the "right" side is actually the top of the laptop and it should be up.The specific logic for that is here:
chuwi-minibook/iio-sensor-proxy/src/drv-mxc6655-accel.c
Lines 1051 to 1052 in 496dfe4
You can try changing it to
MXC_ORIENT_NORMALor removing thatifall together (in which case the laptop will rotate even in laptop mode).Have you applied any other tweaks for screen rotation, e.g. BIOS tweaks or bootloader-level changes? This could explain why "right-up" isn't correct on your machine.
bdy5n6bnbb-ops commentedon Jun 21, 2026
The thing is on KDE there is a setting to rotate the screen only in tablet mode and with it everything is fine. So only gnome being gnome I guess. But I will try your suggestion soon.
None of the other screen rotation methods were applied.
Also gonna report an issue with thermal tool install. There is something while building and copying the files from src folder to src folder. Need to look closer to pkgbuild. Also in near future.
bdy5n6bnbb-ops commentedon Jun 21, 2026
Thats actually total default on gnome
bdy5n6bnbb-ops commentedon Jun 21, 2026
I have checked, sensor are reporting “normal” position as default on laptop mode. Even without your suggestions. I think thats the reason , right-up rotation were never be a thing on gnome lap mode bc it works kinda different
bdy5n6bnbb-ops commentedon Jun 21, 2026
fstanis commentedon Jun 22, 2026
Is that last photo with the
new_orientset toMXC_ORIENT_RIGHTor default?bdy5n6bnbb-ops commentedon Jun 23, 2026
Default, but its RIGHT by default.
fstanis commentedon Jun 27, 2026
Could you try changing that line to
MXC_ORIENT_NORMALand see if that works?MXC_ORIENT_INVERTEDandMXC_ORIENT_LEFTare worth trying so we can figure out the correct default.victorewik commentedon Jul 13, 2026
I've been experimenting with the VBT patcher and I found that many users (myself included) prefer to have a horizontal boot logo and TTY console. This can be achieved by applying a hardware rotation via the VBT patcher (--rotation 1).
However, this currently breaks the logic in your patched iio-sensor-proxy. Since the proxy has hardcoded logic to rotate the MiniBook X panel (assuming it's always in portrait mode), applying a VBT rotation results in a double rotation in GNOME (the "upside down" laptop mode issue).
Question:
Would it be possible to modify the iio-sensor-proxy logic to check the native panel orientation reported by the kernel before applying the MiniBook-specific offset?
If the proxy could detect that the panel is already reporting a landscape orientation (due to a patched VBT), it could skip the internal 90°/270° correction. This would allow:
This would be the cleanest setup possible, as it removes the need for video=panel_orientation in GRUB and provides a seamless landscape experience from the moment the power button is pressed.
What do you think about making the proxy logic conditional based on the reported hardware orientation?
fstanis commentedon Jul 19, 2026
I think that's a great idea - I'll just need to check if / how the kernel exposes this (likely via DRM).
tonozawa1 commentedon Aug 9, 2026
I’m seeing a related issue on a MiniBook X running Ubuntu 26.04 / GNOME, although I think part of what I found may be separate from the GNOME orientation issue here.
My desired behavior is basically the same as discussed above: tablet mode should use auto-rotation, but when returning to laptop mode I want the panel forced back to the normal landscape orientation.
While investigating, I found two lower-level things in the patched iio-sensor-proxy:
ClaimAccelerometer() was timing out when the MXC6655 driver was already polling. In mxc6655_set_polling(), if want_polling == state, it returned without sending the initial reading that the generic proxy waits for before completing the claim. I changed it so an existing TRUE polling state resends the current orientation, and ClaimAccelerometer() then returned immediately.
On my machine, ACPI/GMTR provides the expected thresholds 185 / 175 / 30, but compute_hinge_angle() only reaches about 150–155° when physically folded. Normal laptop mode is roughly 90–116°. As an experiment, forcing:
tablet_thresh = 140.0f;
laptop_thresh = 125.0f;
gave me a clean:
Laptop mode (angle=116.4)
Tablet mode (angle=153.5)
Laptop mode (angle=109.3)
I also found that the existing pre-check skips hinge calculation based on the Y components, even though compute_hinge_angle() uses the X/Z projection. Changing that check to test X/Z magnitude made hinge reporting much more consistent when the device is tilted/wobbled during folding.
I’m not sure whether the 150–155° maximum is due to calibration, the hinge-angle reconstruction, or a hardware/firmware difference on my unit, so I’m not claiming the 140/125 values are the correct fix. I’m happy to test anything useful on my machine.
Separately, GNOME still does not return to the correct landscape orientation after unfolding, so that part still seems closely related to this issue.
fstanis commentedon Aug 9, 2026
@tonozawa1 do you mind trying #13 and seeing whether this fixes the orientation after unfolding? I haven't had a chance to test this other than some basic usage, I'm curious if it actually works for you.
tonozawa1 commentedon Aug 10, 2026
I tested PR #13 on Ubuntu 26.04 / GNOME.
It builds after adding:
libdrm_dep = dependency('libdrm')
to the top-level meson.build and installing libdrm-dev.
The PR detects:
MXC6655: DRM panel orientation 0, compensating sensor output by 0°, laptop mode reports orientation 3
Unfortunately the behavior is unchanged for me. Tablet mode works, but after unfolding back to laptop mode GNOME still leaves the display in the wrong orientation, and I still have to manually select Landscape Left.
So on my machine the kernel reports panel orientation 0 (normal), meaning PR #13 applies no compensation.
fstanis commentedon Aug 13, 2026
I think I found the cause for both of the issues you reported. GNOME likely didn't receive the final state after folding back, which should now be emitted unconditionally; there was also an error in the angle calculation which would explain why you're seeing the ~150 as maximum angle (if not, I can just add a setting for it).
Hopefully both are fixed in fbae02e (same PR), @tonozawa1 do you mind trying again (same PR)?
tonozawa1 commentedon Aug 13, 2026
Hi @fstanis. Folding the F7B1 keyboard by itself does not trigger tablet mode. With the device still folded, rotating the whole MiniBook 90° triggers Tablet mode (angle=315.9), followed about 1.7s later by Laptop mode (angle=81.8). libinput shows the corresponding state 1 → state 0. This means tablet-mode detection is still dependent on how the whole device is oriented relative to gravity, rather than only the hinge position.
fstanis commentedon Aug 15, 2026
Is this a new issue you're seeing? My last commit is meant to address this bit:
But now if I understand correctly, it's tablet mode that doesn't happen, not returning from it? Do you mind recording a video or writing step by step instructions to reproduce this?
tonozawa1 commentedon Aug 15, 2026
Thanks — I retested this today with the latest PR and recorded both the Linux screen and the physical device.
I need to correct my previous observation: tablet mode itself appears to be working now.
What I see in the recording is:
For example, the log shows:
Tablet mode (angle=293.9)
and later, when unfolding:
Laptop mode (angle=87.1)
So at least in this test, hinge/tablet detection looks much better after your angle fix. The remaining issue seems specifically related to the final orientation state when returning to laptop mode.
I'm attaching two recordings:
The Vision Pro recording makes it fairly clear that the machine is physically back in laptop mode while the display remains in the tablet orientation.
https://www.dropbox.com/scl/fo/6tp46p5lsky13ik8km80w/AAZifQ6hqpzIcUiJc0MenCs?rlkey=hh1w00mjrw49vfqymlxpx40v7&st=qakn0veu&dl=0
victorewik commentedon Aug 17, 2026
Hi @fstanis,
I've been testing the detect-drm branch (PR #13) on my MiniBook X N150 (Debian 13 / BIOS V2.51). Unfortunately, I haven't been able to get the correct orientation in Laptop Mode when using manual GRUB rotation.
My setup:
The Problem:
The proxy doesn't seem to correctly compensate for the manual GRUB orientation, leading to "double rotations" or incorrect fixed states in Laptop Mode.
Manual Tests performed (modifying drv-mxc6655-accel.c):
I tried overriding the hardcoded MXC_ORIENT_RIGHT for Laptop Mode (mode != 1) with the following results:
It seems that read_panel_orientation() via libdrm is returning 0 (Normal) on my unit, so the compensation logic isn't being triggered, even though the hardware/GRUB is actually rotated.
Additional observations:
Could we implement a way to override the laptop_mode orientation via an environment variable or a config file? This would help users with different GRUB/VBT setups.
nonFilterOne commentedon Aug 19, 2026
Did I understand correctly that on Ubuntu 26 with the latest GNOME everything will work correctly, both tablet mode and the correct orientation when returning to laptop mode?
fstanis commentedon Sep 13, 2026
Done in #20.
4leite commentedon Sep 16, 2026
We investigated the remaining tablet -> laptop orientation problem on another MiniBook X. This part is a Mutter bug, not a hinge or SensorProxy state bug.
When laptop mode returns from tablet, Mutter forces the physical CRTC transform to
normalregardless. On a portrait-native panel whose DRM orientation isright_side_up, that produces logical transform 1 and leaves the desktop sideways. SensorProxy is already correctly reportingright-up. Kernel params, vbt patches and changing the SensorProxy laptop orientation does not prevent this transition.The same bug is tracked upstream here:
https://gitlab.gnome.org/GNOME/mutter/-/issues/4650
There is also an open Mutter fix:
https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4898
fstanis commentedon Sep 17, 2026
Thank you - I updated iio-sensor-proxy.md to include this.
I'll go ahead and close this issue since it seems to have become a catch-all for various semi-related rotation issues and it's hard to keep track over what's fixed and what isn't. I suspect #24 will address most of the outstanding bugs - if you're still experiencing issues after we merge it, please open a new issue.