From 70478f268161a96c87aa83aa6de1f5e8ee5a7c49 Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Wed, 17 Aug 2011 00:05:25 -0400 Subject: [PATCH] if the desktop list is empty, don't touch the current configuration --- config.py | 12 +++++------- pagermh/state.py | 22 ++++++---------------- 2 files changed, 11 insertions(+), 23 deletions(-) diff --git a/config.py b/config.py index 1c9554b..452dd20 100644 --- a/config.py +++ b/config.py @@ -8,15 +8,13 @@ # GENERAL CONFIGURATION ####################### -# A list of desktop names that will be made available -desktops = ['1', '2', '3', '4', '5', '6'] +# A list of desktop names that will be made available. +# If this list is empty, the desktop setup (i.e., the names and number of them) +# will not be modified on startup. +desktops = [] +#desktops = ['1', '2', '3', '4', '5', '6'] # desktops = map(str, range(1, 10)) -# If this is true, then the desktop names above will overwrite any existing -# desktops upon startup. This can get annoying if you stop and then run the -# pager. -force_desktops = False - # Whether to show desktop names below each mini-desktop picture show_desk_names = True diff --git a/pagermh/state.py b/pagermh/state.py index bfb3b13..c6edb95 100644 --- a/pagermh/state.py +++ b/pagermh/state.py @@ -37,11 +37,12 @@ gtk_root.set_events(gtk.gdk.PROPERTY_CHANGE_MASK | gtk.gdk.KEY_PRESS_MASK) # Initial setup -ewmh.set_desktop_names_checked(conn, root, config.desktops).check() -ewmh.set_desktop_layout_checked(conn, root, ewmh.Orientation.Horz, - len(config.desktops), 1, - ewmh.StartingCorner.TopLeft).check() -ewmh.request_number_of_desktops_checked(conn, len(config.desktops)).check() +if config.desktops: + ewmh.set_desktop_names_checked(conn, root, config.desktops).check() + ewmh.set_desktop_layout_checked(conn, root, ewmh.Orientation.Horz, + len(config.desktops), 1, + ewmh.StartingCorner.TopLeft).check() + ewmh.request_number_of_desktops_checked(conn, len(config.desktops)).check() # Is this a horizontal or vertical pager? if config.width > config.height: @@ -110,16 +111,6 @@ def update_monitor_area(): for x, y, xscreen in sorted(screenpos): xtophys.append(xscreen) -# def cb_keypress(widget, e): - # print 'hey-oh' - -def cb_keypress(event): - print 'hey-oh' - print event.type - print '-' * 80 - sys.stdout.flush() - return gtk.gdk.FILTER_CONTINUE - def cb_prop_change(widget, e): global activewin, desk_names, desk_num, desktop, stacking, visibles @@ -145,6 +136,5 @@ def cb_prop_change(widget, e): ewmh.set_desktop_names_checked(conn, root, names).check() desk_names = ewmh.get_desktop_names(conn, root).reply() - update_monitor_area()