Changeset 173

Show
Ignore:
Timestamp:
05/12/08 15:29:57 (8 months ago)
Author:
poillubo
Message:

* moved the initialization of the current desktop from PycaWM.create_desktops to PycaWM._init (like in PycaWM.create_focuses/placements)
* moved PycaWM.create_desktops before PycaWM.create_cursors so the cursors won't need to be freed if wm quits because the of incorrect number of desktops

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/pycawm/pycawm.py

    r170 r173  
    107107        # intern and cache the atoms 
    108108        atomsdb.build_db(self.display) 
     109        # create the virtual desktops 
     110        self.create_desktops(nb_desktops) 
     111        # current desktop is always the first one 
     112        self.current_desktop = self.desktops[0] 
    109113        # create all the cursors 
    110114        self.create_cursors() 
    111         # create the virtual desktops 
    112         self.create_desktops(nb_desktops) 
    113115        self.root.change_attributes(cursor=self.cursors[self.state,], 
    114116                                    event_mask=(X.ColormapChangeMask | 
     
    244246            raise SystemExit(-1) 
    245247 
    246         first_desktop = Desktop(self) 
    247         for _ in xrange(nb_desktops - 1): 
     248        for _ in xrange(nb_desktops): 
    248249            Desktop(self) 
    249  
    250         # first desktop is the current desktop 
    251         self.current_desktop = first_desktop 
    252250 
    253251    def add_key(self, shortcut, *funs):