summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErkin Bahceci <erkinbah@gmail.com>2009-03-29 14:30:38 -0500
committerErkin Bahceci <erkinbah@gmail.com>2009-03-29 14:30:38 -0500
commitaa6559724b6b37c7a50ad89f08fe6f8412bce27a (patch)
tree8a6f880035061466752eb2949c89957061adf1b5
parent63fb415ab7239e20429cf25788c94baf39540a7a (diff)
downloadccsm-aa6559724b6b37c7a50ad89f08fe6f8412bce27a.tar.gz
ccsm-aa6559724b6b37c7a50ad89f08fe6f8412bce27a.tar.bz2
Track compizconfig changes.
-rw-r--r--ccm/Conflicts.py3
-rw-r--r--ccm/Utils.py20
-rwxr-xr-xccsm3
3 files changed, 10 insertions, 16 deletions
diff --git a/ccm/Conflicts.py b/ccm/Conflicts.py
index 7fb709d..5f6f01f 100644
--- a/ccm/Conflicts.py
+++ b/ccm/Conflicts.py
@@ -88,8 +88,7 @@ class ActionConflict (Conflict):
if not settings:
for plugin in self.Setting.Plugin.Context.Plugins.values ():
if plugin.Enabled:
- pluginActions = GetSettings(plugin, displayOnly=True,
- types=self.ActionTypes)
+ pluginActions = GetSettings(plugin, types=self.ActionTypes)
if len(setting.Info) and setting.Info[0] and plugin is not setting.Plugin:
settings.extend(ExcludeInternal(pluginActions))
diff --git a/ccm/Utils.py b/ccm/Utils.py
index 16f8e83..d7fc256 100644
--- a/ccm/Utils.py
+++ b/ccm/Utils.py
@@ -58,6 +58,10 @@ def getScreens():
screens.append(i)
return screens
+def getDefaultScreen():
+ display = gtk.gdk.display_get_default()
+ return display.get_default_screen().get_number()
+
def protect_markup_dict (dict_):
return dict((k, protect_pango_markup (v)) for (k, v) in dict_.iteritems())
@@ -383,7 +387,7 @@ PluginKeyFunc = operator.attrgetter('ShortDesc')
def HasOnlyType (settings, stype):
return settings and not [s for s in settings if s.Type != stype]
-def GetSettings(group, displayOnly=False, types=None):
+def GetSettings(group, types=None):
def TypeFilter (settings, types):
for setting in settings:
@@ -391,19 +395,11 @@ def GetSettings(group, displayOnly=False, types=None):
yield setting
if types:
- display = TypeFilter(group.Display.itervalues(), types)
- else:
- display = group.Display.itervalues()
-
- if displayOnly:
- return display
-
- if types:
- screen = TypeFilter(group.Screens[CurrentScreenNum].itervalues(), types)
+ screen = TypeFilter(group.Screen.itervalues(), types)
else:
- screen = group.Screens[CurrentScreenNum].itervalues()
+ screen = group.Screen.itervalues()
- return itertools.chain(screen, display)
+ return screen
# Support python 2.4
try:
diff --git a/ccsm b/ccsm
index 6e0a2c6..f46be37 100755
--- a/ccsm
+++ b/ccsm
@@ -122,8 +122,7 @@ if options.plugin:
if options.category:
category = options.category
-screens = ccm.getScreens()
-context = compizconfig.Context(screens)
+context = compizconfig.Context(ccm.getDefaultScreen())
GlobalUpdater.SetContext (context)
mainWin = ccm.MainWin(context, plugin, category)
if dbusObj is not None: