Changeset 137

Show
Ignore:
Timestamp:
01/29/08 17:44:59 (1 year ago)
Author:
poillubo
Message:

* the steps were wrongly numbered in the default config
* coding style compliance
* handled the WM_CLASS atom directly in the Client class

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/conf/config-example.py

    r134 r137  
    159159add_post_hook(pika.button_press_reply, launch_app_on_click) 
    160160 
    161 # 4- Set more stuff 
     161# 5- Set more stuff 
    162162 
    163163# PycaWM has a special internal method to automatically set a wallpaper. 
     
    178178pika.set_placements(['SmartPlacement', 'CascadePlacement']) 
    179179 
    180 # 5- Add some plugins 
     180# 6- Add some plugins 
    181181 
    182182# PycaWM can be easily extended by plugins. 
     
    221221pika.add_plugin(RemoteREPL) 
    222222 
    223 # 6- Theme 
     223# 7- Theme 
    224224pika.theme.menu.sub_menu.dx = -42 
    225225 
    226 # 7- Last things to do... 
     226# 8- Last things to do... 
    227227 
    228228# Manage all the existing clients connected to the wm display. 
  • trunk/pycawm/client.py

    r134 r137  
    110110            if self.window == client.transient_for: 
    111111                self.transient_clients.append(client) 
     112        # we cannot access the WM_CLASS strings while the client is in 
     113        # withdrawn state (ICCCM 4.1.2.5) 
     114        self.resource_class = '' 
     115        self.resource_name = '' 
    112116        self.name = self.window.get_wm_name() 
    113117        self.geometry = self.window.get_geometry() 
     
    500504                self.wm.place_client(self) 
    501505            self.map() 
     506        # the client is in iconic/normal state here, we can now access 
     507        # the WM_CLASS strings 
     508        wm_class = self.window.get_wm_class() 
     509        if wm_class is not None: 
     510            self.resource_name, self.resource_class = wm_class 
    502511        # do the client matching here 
    503512        for client_p, funs in self.matches.iteritems(): 
  • trunk/pycawm/menu.py

    r136 r137  
    147147            self.grab_active() 
    148148        self.display.sync() 
    149         self.used = (x != pointer.root_x or y != pointer.root_y) 
     149        self.can_be_closed = (x != pointer.root_x or y != pointer.root_y) 
    150150 
    151151    def get_good_menu(self, window): 
     
    214214 
    215215        # elghinn bug corrected =) 
    216         if (not self.used and event.event_x == -1 
    217             and event.event_y == -1): 
    218             return 
    219  
    220         self.used = True 
     216        if (not self.can_be_closed and event.event_x == -1 and 
     217            event.event_y == -1): 
     218            return 
     219 
     220        self.can_be_closed = True 
    221221 
    222222        if self.child is not None: 
     
    377377    @good_menu 
    378378    def button_release_reply(self, _, event): 
    379         if not self.used: 
     379        if not self.can_be_closed: 
    380380            return 
    381381