diff options
author | Papoteur <papoteur@mageia.org> | 2019-03-30 11:05:38 +0100 |
---|---|---|
committer | Papoteur <papoteur@mageia.org> | 2019-03-31 11:46:24 +0200 |
commit | ac5b9b4bbc1ffaba3e308c2c56c5c7dccd17e0c7 (patch) | |
tree | 8de5a90f9ac881f408b1fab143f4cfff4764df98 | |
parent | c43cf5480c37f8c5217cf7700e0ddd980be73e46 (diff) | |
download | mageiawelcome-ac5b9b4bbc1ffaba3e308c2c56c5c7dccd17e0c7.tar mageiawelcome-ac5b9b4bbc1ffaba3e308c2c56c5c7dccd17e0c7.tar.gz mageiawelcome-ac5b9b4bbc1ffaba3e308c2c56c5c7dccd17e0c7.tar.bz2 mageiawelcome-ac5b9b4bbc1ffaba3e308c2c56c5c7dccd17e0c7.tar.xz mageiawelcome-ac5b9b4bbc1ffaba3e308c2c56c5c7dccd17e0c7.zip |
Adjust size for Gnome Wayland usinf HiDPI (mag#24200)
-rw-r--r-- | qml/mageiawelcome.py | 19 |
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() |