Blob Blame History Raw
From 2c390d60532437972c2d28fd70a54c07c71b74db Mon Sep 17 00:00:00 2001
From: Rui Matos <tiagomatos@gmail.com>
Date: Wed, 8 Apr 2015 15:08:16 +0200
Subject: [PATCH 10/12] 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 1f6b7f0..a36515b 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)
                         
@@ -72,7 +73,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.3.6