summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xwss44
1 files changed, 26 insertions, 18 deletions
diff --git a/wss b/wss
index 7bce0eb..5589481 100755
--- a/wss
+++ b/wss
@@ -31,6 +31,7 @@
import pygtk, gtk, glib
import wnck
+import datetime
SCALE=50
BORDER=3
@@ -38,10 +39,13 @@ DELAY=500
class WSS:
def cb_hide(self, data=None):
+ print datetime.datetime.now(), "cb hide"
+ print
self.window.hide()
return False
def cb_update(self, widget, data=None):
+ print datetime.datetime.now(), "cb update"
workspace = self.screen.get_active_workspace()
if self.previous is not None:
self.label.set_markup("<span size='xx-large'>%s</span>"%(workspace.get_name()))
@@ -52,32 +56,37 @@ class WSS:
self.paint()
self.window.queue_draw()
+ print datetime.datetime.now(), 'show'
self.window.show()
self.previous = workspace
def get_layout(self):
wsposmap = {}
- if self.layout is None:
- wss = self.screen.get_workspaces()
- maxrow = 0
- maxcol = 0
- for ws in wss:
- r = ws.get_layout_row()
- c = ws.get_layout_column()
- if r > maxrow: maxrow = r
- if c > maxcol: maxcol = c
- wsposmap[ws.get_number()] = (r,c)
- w = self.screen.get_width()
- h = self.screen.get_height()
-
- self.layout = (w, h, maxrow+1, maxcol+1)
- self.wsposmap = wsposmap
- return self.layout
+
+ wss = self.screen.get_workspaces()
+ maxrow = 0
+ maxcol = 0
+ for ws in wss:
+ r = ws.get_layout_row()
+ c = ws.get_layout_column()
+ if r > maxrow: maxrow = r
+ if c > maxcol: maxcol = c
+ wsposmap[ws.get_number()] = (r,c)
+ w = self.screen.get_width()
+ h = self.screen.get_height()
+
+ layout = (w, h, maxrow+1, maxcol+1)
+ self.wsposmap = wsposmap
+ return layout
def setup_table(self):
- if self.table is not None: return
width, height, rows, cols = self.get_layout()
+ if self.table is not None:
+ for area in self.areainfo:
+ area.set_size_request(width/SCALE+2, height/SCALE+2)
+ return
+
table = gtk.Table(rows, cols, True)
table.set_col_spacings(BORDER)
table.set_row_spacings(BORDER)
@@ -191,7 +200,6 @@ class WSS:
self.previous = None
self.table = None
self.cells = None
- self.layout = None
self.areainfo = None
self.timerid = None