Skip to content

Commit

Permalink
since we share the same capture instance for all window models, don't…
Browse files Browse the repository at this point in the history
… ever clean it from the model, always do it only once from the shadow server code

git-svn-id: https://xpra.org/svn/Xpra/trunk@19175 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed May 3, 2018
1 parent 1c3470f commit 3e3b1da
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/xpra/server/shadow/gtk_shadow_server_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ def send_updated_screen_size(self):
def recreate_window_models(self):
#remove all existing models and re-create them:
for model in self._id_to_window.values():
model.close_capture()
self._remove_window(model)
self.cleanup_capture()
for model in self.makeRootWindowModels():
self._add_new_window(model)

Expand Down
14 changes: 10 additions & 4 deletions src/xpra/server/shadow/shadow_server_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ def init(self, opts):

def cleanup(self):
self.stop_refresh()
n = self.notifier
if n:
n.cleanup()
self.notifier = None
self.cleanup_notifier()
self.cleanup_capture()

def cleanup_capture(self):
capture = self.capture
if capture:
self.capture = None
Expand Down Expand Up @@ -106,6 +106,12 @@ def source_remove(self, *args):

############################################################################
# notifications
def cleanup_notifier(self):
n = self.notifier
if n:
self.notifier = None
n.cleanup()

def notify_setup_error(self, exception):
notifylog("notify_setup_error(%s)", exception)
notifylog.info("notification forwarding is not available")
Expand Down
10 changes: 0 additions & 10 deletions src/xpra/x11/shadow_x11_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,16 +157,6 @@ def __init__(self, root_window, capture=None):
def __repr__(self):
return "GTKX11RootWindowModel(%#x - %s - %s)" % (get_xwindow(self.window), self.geometry, self.capture)

def cleanup(self):
self.close_capture()
GTKRootWindowModel.cleanup(self)

def close_capture(self):
capture = self.capture
if self.capture:
self.capture = None
capture.clean()

def get_dimensions(self):
#used by get_window_info only
return self.geometry[2:4]
Expand Down

0 comments on commit 3e3b1da

Please sign in to comment.