Skip to content

Commit 7e99683

Browse files
committed
Install: Wrap portal call in try block (#70)
1 parent c3f5be7 commit 7e99683

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/install.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,12 @@ def get_button_layout():
157157
)
158158

159159
args = GLib.Variant('(ss)', ('org.gnome.desktop.wm.preferences', 'button-layout'))
160-
button_layout = portal.call_sync('org.freedesktop.portal.Settings.ReadOne', args, Gio.DBusCallFlags.NONE, -1, None)
160+
161+
try:
162+
button_layout = portal.call_sync('org.freedesktop.portal.Settings.ReadOne', args, Gio.DBusCallFlags.NONE, -1, None)
163+
except GLib.GError:
164+
print(_("Could not grab window control settings from desktop portal, falling back to default"))
165+
button_layout = None
161166

162167
if button_layout:
163168
return button_layout[0]

0 commit comments

Comments
 (0)