Skip to content

Commit

Permalink
to prevent window metadata loops, try to send the updated window stat…
Browse files Browse the repository at this point in the history
…e asap:

* as part of the unmap-window for iconification
* as part of the map-window for deiconification
* with a synthetic configure-window otherwise

git-svn-id: https://xpra.org/svn/Xpra/trunk@8661 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Feb 13, 2015
1 parent 82f97d5 commit 90aa2ba
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/xpra/client/gtk_base/gtk_client_window_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ def window_state_updated(self, widget, event):
#tell server, but wait a bit to try to prevent races:
def tell_server():
if self._iconified:
self.send("unmap-window", self._id, True)
self.send("unmap-window", self._id, True, self._window_state)
#calculate a good delay to prevent races causing minimize/unminimize loops:
delay = 150
spl = list(self._client.server_ping_latency)
Expand All @@ -288,6 +288,9 @@ def tell_server():
else:
self.process_map_event()
self.after_window_state_updated()
#if we have state updates, send them back to the server using a configure window packet:
if self._window_state:
self.process_configure_event()

def after_window_state_updated(self):
#this is here to make it easier to hook some code
Expand Down
6 changes: 5 additions & 1 deletion src/xpra/x11/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -712,16 +712,20 @@ def _process_map_window(self, proto, packet):

def _process_unmap_window(self, proto, packet):
wid = packet[1]
iconified = len(packet)>=3 and bool(packet[2])
window = self._id_to_window.get(wid)
if not window:
log("cannot map window %s: already removed!", wid)
return
if len(packet)>=4:
#optional window_state added in 0.15 to update flags
#during iconification events:
self._set_window_state(proto, wid, window, packet[3])
assert not window.is_OR()
windowlog("client unmapped window %s - %s", wid, window)
for ss in self._server_sources.values():
ss.unmap_window(wid, window)
window.unmap()
iconified = len(packet)>=3 and bool(packet[2])
if iconified and not window.get_property("iconic"):
window.set_property("iconic", True)
self._desktop_manager.hide_window(window)
Expand Down

0 comments on commit 90aa2ba

Please sign in to comment.