xpra icon
Bug tracker and wiki

Ticket #191: force-unmanage-window.patch

File force-unmanage-window.patch, 2.5 KB (added by Antoine Martin, 8 years ago)

force unmanage windows if we find that the composite window is gone

  • src/wimpiggy/window.py

    ### Eclipse Workspace Patch 1.0
    #P Xpra
     
    260260            self._composite = CompositeHelper(self.client_window, False, )  #self.composite_configure_event)
    261261            h = self._composite.connect("contents-changed", self._forward_contents_changed)
    262262            self._composite.connect("wimpiggy-configure-event", self.composite_configure_event)
     263            self._composite.connect("composite-destroyed", self.composite_destroyed_event)
    263264            self._damage_forward_handle = h
    264265            self._geometry = geometry_with_border(self.client_window)
    265266            self._managed = True
     
    285286                          event.border_width)
    286287        self.notify("geometry")
    287288
     289    def composite_destroyed_event(self, composite_window):
     290        #we could be here for two reasons:
     291        #1) we emitted "unmanaged" and ended up in composite.destroy() naturally
     292        #    and all is well
     293        #2) something went wrong and we destroyed the composite window, but without
     294        #    properly unamanaging this window...
     295        #so call unmanage again just in case
     296        self.unmanage()
     297
    288298    def composite_configure_event(self, composite_window, event):
    289299        log("BaseWindowModel.composite_configure_event(%s,%s)", composite_window, event)
    290300
  • src/wimpiggy/composite.py

     
    44# later version. See the file COPYING for details.
    55
    66import gobject
    7 from wimpiggy.util import one_arg_signal, AutoPropGObjectMixin
     7from wimpiggy.util import one_arg_signal, no_arg_signal, AutoPropGObjectMixin
    88from wimpiggy.error import trap
    99from wimpiggy.lowlevel import (
    1010           xcomposite_redirect_window,      #@UnresolvedImport
     
    2525class CompositeHelper(AutoPropGObjectMixin, gobject.GObject):
    2626    __gsignals__ = {
    2727        "contents-changed": one_arg_signal,
     28        "composite-destroyed": no_arg_signal,
    2829
    2930        "wimpiggy-damage-event": one_arg_signal,
    3031        "wimpiggy-unmap-event": one_arg_signal,
     
    6768        self.invalidate_pixmap()
    6869        remove_event_receiver(self._window, self)
    6970        self._window = None
     71        self.emit("composite-destroyed")
    7072
    7173    def acknowledge_changes(self):
    7274        if self._damage_handle is not None: