summaryrefslogtreecommitdiffstats
path: root/qml
diff options
context:
space:
mode:
Diffstat (limited to 'qml')
-rw-r--r--qml/mageiawelcome.py19
1 files changed, 7 insertions, 12 deletions
diff --git a/qml/mageiawelcome.py b/qml/mageiawelcome.py
index 6afbf45..9385072 100644
--- a/qml/mageiawelcome.py
+++ b/qml/mageiawelcome.py
@@ -44,18 +44,13 @@ class ConfList(QAbstractListModel):
if desktop == 'unknown':
desktop = os.getenv("XDG_CURRENT_DESKTOP")
self.screen_factor = 0.0
- if desktop == 'Gnome Wayland':
- """
- no effect, the value is stored elsewhere, didn't found it.
- from gi.repository.Gio import Settings
- gso = Settings.new("org.gnome.desktop.interface")
- val = gso.get_uint("scaling-factor")
- if val == 0:
- self.screen_factor = 1.0
- else:
- self.screen_factor = float(val)
- """
- pass
+ if desktop == 'Gnome Wayland':
+ import gi
+ gi.require_version('Gdk', '3.0')
+ from gi.repository.Gdk import Display
+ # pre-3.22, otherwise deprecated
+ #factor = Gdk.Screen.get_default().get_monitor_scale_factor(0)
+ self.screen_factor = Display.get_default().get_monitor(0).get_scale_factor()
# Search active network connections
net = QNetworkConfigurationManager()