Skip to content

Commit

Permalink
if the desktop list is empty, don't touch the current configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Gallant (Ocelot) authored and Andrew Gallant (Ocelot) committed Aug 17, 2011
1 parent a30a456 commit 70478f2
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 23 deletions.
12 changes: 5 additions & 7 deletions config.py
Expand Up @@ -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

Expand Down
22 changes: 6 additions & 16 deletions pagermh/state.py
Expand Up @@ -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:
Expand Down Expand Up @@ -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

Expand All @@ -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()

0 comments on commit 70478f2

Please sign in to comment.