Commit a2285112 authored by Guido Gunther's avatar Guido Gunther

lockscreen-manager: Undo rotation when locking the screen

This makes sure we don't leave the user with a screen that can't be
unlocked.

Closes: #73Signed-off-by: Guido Gunther's avatarGuido Günther <guido.gunther@puri.sm>
parent c370a8f9
Pipeline #50624 passed with stages
in 12 minutes and 37 seconds
......@@ -47,6 +47,7 @@ typedef struct {
gint timeout; /* timeout in seconds before screen locks */
gboolean locked;
gint64 active_time; /* when lock was activated (in us) */
gint rotation; /* the shell rotation before locking */
} PhoshLockscreenManagerPrivate;
......@@ -65,6 +66,9 @@ lockscreen_unlock_cb (PhoshLockscreenManager *self, PhoshLockscreen *lockscreen)
PhoshShell *shell = phosh_shell_get_default ();
PhoshMonitorManager *monitor_manager = phosh_shell_get_monitor_manager (shell);
phosh_shell_rotate_display (shell, priv->rotation);
priv->rotation = 0;
g_return_if_fail (PHOSH_IS_LOCKSCREEN (lockscreen));
g_return_if_fail (lockscreen == PHOSH_LOCKSCREEN (priv->lockscreen));
......@@ -151,6 +155,10 @@ lockscreen_lock (PhoshLockscreenManager *self)
primary_monitor = phosh_shell_get_primary_monitor (shell);
g_return_if_fail (primary_monitor);
/* Undo any rotation so the keypad becomes usable */
priv->rotation = phosh_shell_get_rotation (shell);
phosh_shell_rotate_display (shell, 0);
/* Listen for monitor changes */
g_signal_connect_object (monitor_manager, "monitor-added",
G_CALLBACK (on_monitor_added),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment