Changeset 200

Show
Ignore:
Timestamp:
03/06/2008 12:37:45 AM (10 months ago)
Author:
mwm
Message:

Add code to catch ConfigureNotify? changes to a screen. For now, the screen filters
out anything that's not a size change, and passes size changes on to the window
managers handle_screen_resize, which passes it on to mixin's wm_screen_resize.
Multiscreen/Xinerama systems may want to know about other events, but I expect
to filter those at the root screens (whatever those become with Xinerama support),
so that mixins wont' break when we add those. Mixins that want more control can
always catch the ConfigureNotify? themselves.

Location:
trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/examples/plpwm.py

    r198 r200  
    11#!/usr/bin/env python 
    2 # $Id: plpwm.py,v 1.46 2008-02-29 06:39:39 funkiedamouse Exp $ 
     2# $Id: plpwm.py,v 1.44 2007/07/14 09:19:34 mwm Exp $ 
    33# 
    44# plpwm.py -- Example PLWM window manager configuration with panes. 
     
    6161    C_a = input.InputKeyHandler._begin 
    6262    C_e = input.InputKeyHandler._end 
    63     C_y = input.InputKeyHandler._paste_selection 
     63    C_y = input.InputKeyHandler._paste 
    6464    c_p = input.InputKeyHandler._history_up 
    6565    c_n = input.InputKeyHandler._history_down 
     
    9191        "install the panes key map, menus, and try to restore my config." 
    9292 
    93         auto_restore(my, PaneKeys(my).menus.find('paneconfigmenus')) 
     93        my.panekeys = PaneKeys(my) 
     94        auto_restore(my, my.panekeys.menus.find('paneconfigmenus')) 
    9495 
    9596 
     
    105106    panes_maxsize_gravity = X.NorthWestGravity 
    106107 
     108    def __wm_screen_resize__(my): 
     109        "install the panes key map, menus, and try to restore my config." 
     110 
     111        auto_restore(my, my.panekeys.menus.find('paneconfigmenus')) 
     112        
    107113 
    108114class paneWindow(input.inputWindow): 
  • trunk/plwm/wmanager.py

    r198 r200  
    1 # $Id: wmanager.py,v 1.29 2008-02-29 06:39:39 funkiedamouse Exp $ 
     1# $Id: wmanager.py,v 1.28 2006/09/17 04:07:51 mwm Exp $ 
    22# 
    33# wmanager.py -- core window manager functionality 
     
    868868        # Track screen changes 
    869869        self.dispatch.add_system_handler(X.EnterNotify, self.handle_screen_enter) 
     870        self.dispatch.add_system_handler(X.ConfigureNotify, self.handle_screen_change) 
    870871 
    871872        call_inits(self.__class__, '__screen_client_init__', self) 
     
    11151116            self.wm.current_screen = self 
    11161117 
     1118    def handle_screen_change(self, event): 
     1119        """The screen changed geometry. Cool.""" 
     1120 
     1121        if event.window == self.root and \ 
     1122               (self.root_full_width != event.width or \ 
     1123                self.root_full_height != event.height): 
     1124 
     1125            self.root_full_width = self.root_width = event.width  
     1126            self.root_full_height = self.root_height = event.height 
     1127            self.wm.handle_screen_resize(event) 
    11171128 
    11181129    def system(self, cmd, fg = 0, evt = None, redirect = None): 
     
    15631574 
    15641575 
     1576    def handle_screen_resize(self, event): 
     1577        # The default window manager does nada; but let mixins know 
     1578 
     1579        call_inits(self.__class__, '__wm_screen_resize__', self) 
     1580 
    15651581    def set_current_client(self, client, time = X.CurrentTime, force_focus = 0): 
    15661582        """Set the current client to CLIENT, occuring at the X event