Changeset 214

Show
Ignore:
Timestamp:
05/05/2008 05:17:45 PM (8 months ago)
Author:
petli
Message:

Withdrawing windows proxied by CompositeProxy? didn't work at all, really. One reason turned out to be a bug which must have been there since the dawn of plwm, but never triggered until now.

Location:
trunk/plwm
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/plwm/composite.py

    r212 r214  
    312312 
    313313    def _proxy_withdraw(self): 
     314        # Move window back to be an immediate child of root 
     315        g = self._proxy.get_geometry() 
     316 
     317        self._proxy.change_attributes(event_mask = 0) 
     318 
     319        self._window.configure(border_width = g.border_width) 
     320        self._window.reparent(self._screen.root, g.x, g.y) 
     321 
    314322        self._screen.remove_proxy_window(self._proxy) 
    315323        self._proxy.destroy() 
  • trunk/plwm/wmanager.py

    r212 r214  
    15841584        """ 
    15851585 
     1586        sys.stderr.write('X protocol error:\n%s\n' % err) 
     1587         
    15861588        if isinstance(err, error.BadWindow) or isinstance(err, error.BadDrawable): 
    1587             self.remove_window(err.resource_id, 1) 
     1589            # The error can't be handled immediately, as the error 
     1590            # handler must not call any Xlib methods.  Solve this by 
     1591            # queing up the error object on the event queue and 
     1592            # checking for this in the event handler just below. 
     1593 
     1594            # The event queue doesn't care about us putting an XError 
     1595            # there, it just returns it to us. 
     1596 
     1597            self.events.put_event(err) 
    15881598 
    15891599 
     
    16001610 
    16011611        # debug('verbose_event', 'handling %s', event) 
     1612 
     1613        # Continuation of the error handling hack: check if this is a 
     1614        # window error and if so remove it 
     1615        if isinstance(event, error.BadWindow) or isinstance(event, error.BadDrawable): 
     1616            self.remove_window(event.resource_id, 1) 
     1617            return 
     1618 
    16021619 
    16031620        grabbed = self.dispatch.handle_event(event)