Changeset 140

Show
Ignore:
Timestamp:
01/20/2003 02:55:56 PM (6 years ago)
Author:
mwm
Message:

Fix the bug where panes was resizing subwindows as well as windows by
dispatching ConfigRequest? from the screen instead of the client.

Add the latest tweaks to plpwm.py.

Location:
trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/examples/plpwm.py

    r139 r140  
    11#!/usr/bin/python 
    2 # $Id: plpwm.py,v 1.30 2002-10-04 22:42:57 mwm Exp $ 
     2# $Id: plpwm.py,v 1.31 2003-01-20 20:55:56 mwm Exp $ 
    33# 
    44# plpwm.py -- Exemple PLWM window manager configuration with panes. 
     
    499499    pane.horizontal_split(24. / 29.) 
    500500    wm.panes_number(6) 
    501     pane = wm.panes_list[8] 
    502     pane.vertical_split() 
    503501    wm.panes_goto(0) 
    504502    wm.panes_restore() 
  • trunk/plwm/panes.py

    r128 r140  
    1 # $Id: panes.py,v 1.17 2002-04-07 17:49:24 mwm Exp $ 
     1# $Id: panes.py,v 1.18 2003-01-20 20:55:56 mwm Exp $ 
    22# 
    33# panes.py -- Handle panes (sometimes known as "frames") 
     
    152152 
    153153        wmanager.debug('panesScreen', 'Initializing screen %d', my.number) 
     154        my.dispatch.add_handler(X.ConfigureRequest, my.panes_configure) 
    154155        pane = Pane(my, 0, 0, my.root_width, my.root_height) 
    155156        my.panes_fullscreen(pane) 
     
    169170            else: pane.y = my.modewindow_mw.height 
    170171         
     172    def panes_configure(my, event): 
     173        "A window changed, so pass it on to my pane." 
     174 
     175        w = my.get_window(event.window) 
     176        if w: 
     177            if event.value_mask & (X.CWX | X.CWY | X.CWWidth | X.CWHeight): 
     178                w.panes_pane.place_window(w) 
     179            if event.value_mask & X.CWStackMode and event.stack_mode == X.Above \ 
     180               and my.allow_self_changes(w): 
     181                w.panes_pane.add_window(my) 
     182 
    171183 
    172184class panesClient: 
     
    193205            pane = filter(lambda p, m=my.screen: p.screen == m, my.wm.panes_list)[0] 
    194206        pane.add_window(my) 
    195         my.dispatch.add_handler(X.ConfigureRequest, my.panes_configure) 
    196207        my.dispatch.add_handler(X.UnmapNotify, my.panes_unmap) 
    197208        my.dispatch.add_handler(X.DestroyNotify, my.panes_unmap) 
    198209        my.dispatch.add_handler(wmevents.RemoveClient, my.panes_unmap) 
    199210 
    200     def panes_configure(my, event): 
    201         "The window changed, so pass it on to my pane." 
    202  
    203         if my.panes_pane: 
    204             w = my.screen.get_window(event.window) 
    205             if not w: return 
    206             if event.value_mask & (X.CWX | X.CWY | X.CWWidth | X.CWHeight): 
    207                 my.panes_pane.place_window(my) 
    208             if event.value_mask & X.CWStackMode and event.stack_mode == X.Above \ 
    209                and my.screen.allow_self_changes(w): 
    210                 my.panes_pane.add_window(my) 
    211              
    212211    def panes_unmap(my, event): 
    213212        "The window is going away or gone - make sure it's not taking up a pane" 
     
    297296        x, y, width, height = window.keep_on_screen(x, y, width, height) 
    298297 
     298        wmanager.debug('Pane-configure', 'Resizing window from %d, %d to %d, %d' % 
     299                       (window.width, window.height, width, height)) 
    299300        window.moveresize(x, y, width, height) 
    300301