From e5040b08ff832a39853315970ef8987551fa1daa Mon Sep 17 00:00:00 2001 From: Mike Gabriel Date: Tue, 18 Jun 2024 17:35:23 +0200 Subject: src/: Resize and position magnifier window. Place the magnifier window to the right part of this screen. This needs a follow up as we can now configure the position of the login prompt box via GSettings. Currently this only works for prompt box being on the left (default) part of the screen. --- src/arctica-greeter.vala | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/arctica-greeter.vala') diff --git a/src/arctica-greeter.vala b/src/arctica-greeter.vala index 92165b3..c86acdc 100644 --- a/src/arctica-greeter.vala +++ b/src/arctica-greeter.vala @@ -1980,6 +1980,19 @@ public class DBusServer : Object pMagnifierSocket.add_id (nId); } + if ((this.pGreeter.pMagnifierWindow != null) && (pMagnifierSocket != null) && bActive) + { + /* resize and position the magnifier window to be in the right part of the screen */ + debug ("Resizing and positioning Magnifier window."); + var pDisplay = this.pGreeter.main_window.get_display (); + var pMonitor = pDisplay.get_monitor_at_window (this.pGreeter.main_window.get_window ()); + Gdk.Rectangle cRect = pMonitor.get_geometry (); + int magnifier_width = 2 * cRect.width / 5; + int magnifier_height = 2 * cRect.height / 5; + this.pGreeter.pMagnifierWindow.move (cRect.x + cRect.width - cRect.width / 10 - magnifier_width, cRect.y + cRect.height / 5 + cRect.height / 10); + this.pGreeter.pMagnifierWindow.resize (magnifier_width, magnifier_height); + } + this.pGreeter.pMagnifierWindow.visible = bActive; } } -- cgit v1.2.3