gjdwebserver-overlay/gui-wm/phosh/files/0004-lockscreen-manager-undo-transform-only-for-phones.patch

45 lines
1.8 KiB
Diff
Raw Normal View History

2021-06-17 15:02:06 +02:00
From 29f0773b1e60736c193b6e3118b5f93030a52bc5 Mon Sep 17 00:00:00 2001
From: Arnaud Ferraris <arnaud.ferraris@collabora.com>
Date: Tue, 27 Oct 2020 17:14:07 +0100
Subject: [PATCH 46/47] lockscreen-manager: undo transform only for phones
If the display is large enough to make the keypad usable even when
rotated, we should not try to rotate it back to the default orientation.
---
src/lockscreen-manager.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/lockscreen-manager.c b/src/lockscreen-manager.c
index dac21e8..cc09026 100644
--- a/src/lockscreen-manager.c
+++ b/src/lockscreen-manager.c
@@ -146,6 +146,7 @@ on_monitor_added (PhoshLockscreenManager *self,
static void
lockscreen_lock (PhoshLockscreenManager *self)
{
+ PhoshModeManager *mode_manager;
PhoshMonitor *primary_monitor;
PhoshWayland *wl = phosh_wayland_get_default ();
PhoshShell *shell = phosh_shell_get_default ();
@@ -156,9 +157,16 @@ lockscreen_lock (PhoshLockscreenManager *self)
primary_monitor = phosh_shell_get_primary_monitor (shell);
g_return_if_fail (primary_monitor);
- /* Undo any transform on the primary display so the keypad becomes usable */
+ mode_manager = phosh_shell_get_mode_manager(shell);
self->transform = phosh_shell_get_transform (shell);
- phosh_shell_set_transform (shell, PHOSH_MONITOR_TRANSFORM_NORMAL);
+
+ /*
+ * The lockscreen won't likely fit on phones, so we have to undo any transform
+ * on the primary display to make the keypad usable on such devices
+ */
+ if (phosh_mode_manager_get_device_type(mode_manager) == PHOSH_MODE_DEVICE_TYPE_PHONE) {
+ phosh_shell_set_transform (shell, PHOSH_MONITOR_TRANSFORM_NORMAL);
+ }
/* Listen for monitor changes */
g_signal_connect_object (monitor_manager, "monitor-added",
--
2.28.0