From 5c2027d08a008fc63ebd0b8f162931cf3fcc393d Mon Sep 17 00:00:00 2001 From: Rui Matos Date: Wed, 8 Apr 2015 15:08:16 +0200 Subject: [PATCH 6/8] shell_extensions: SESSION_MODE extensions can't be enabled/disabled gnome-shell always enables this kind of extensions and doesn't allow disabling them so reflect that in the UI. --- gtweak/tweaks/tweak_group_shell_extensions.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gtweak/tweaks/tweak_group_shell_extensions.py b/gtweak/tweaks/tweak_group_shell_extensions.py index b791e4a..855ffe7 100644 --- a/gtweak/tweaks/tweak_group_shell_extensions.py +++ b/gtweak/tweaks/tweak_group_shell_extensions.py @@ -49,7 +49,8 @@ class _ShellExtensionTweak(Gtk.ListBoxRow, Tweak): sw = Gtk.Switch() sw.props.vexpand = False sw.props.valign = Gtk.Align.CENTER - sw.set_active(self._shell.extension_is_active(state, uuid)) + sw.set_active(self._shell.extension_is_active(state, uuid) or + ext.get("type") == GnomeShell.EXTENSION_TYPE["SESSION_MODE"]) sw.connect('notify::active', self._on_extension_toggled, uuid) self.hbox.pack_start(sw, False, False, 0) @@ -73,7 +74,8 @@ class _ShellExtensionTweak(Gtk.ListBoxRow, Tweak): if state == GnomeShell.EXTENSION_STATE["ENABLED"] or \ state == GnomeShell.EXTENSION_STATE["DISABLED"] or \ state == GnomeShell.EXTENSION_STATE["INITIALIZED"]: - sensitive = True + if ext.get("type") != GnomeShell.EXTENSION_TYPE["SESSION_MODE"]: + sensitive = True elif state == GnomeShell.EXTENSION_STATE["DOWNLOADING"]: info = _("Extension downloading") elif state == GnomeShell.EXTENSION_STATE["ERROR"]: -- 2.9.3