Skip to content

Commit

Permalink
#976: we must also scale coordinates from "configure-override-redirec…
Browse files Browse the repository at this point in the history
…t" packets! (and improve debug logging)

git-svn-id: https://xpra.org/svn/Xpra/trunk@11058 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Oct 27, 2015
1 parent 4047db2 commit 8b6cb7c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 16 deletions.
8 changes: 5 additions & 3 deletions src/xpra/client/gtk_base/gtk_client_window_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -943,15 +943,17 @@ def resize(self, w, h, resize_counter=0):
self._set_backing_size(w, h)

def move_resize(self, x, y, w, h, resize_counter=0):
geomlog("move_resize%s", (x, y, w, h, resize_counter))
geomlog("window %i move_resize%s", self._id, (x, y, w, h, resize_counter))
w = max(1, w)
h = max(1, h)
self._resize_counter = resize_counter
window = self.get_window()
if window.get_position()==(x, y):
geomlog("unchanged position %ix%i, using resize(%i, %i)", x, y, w, h)
#same location, just resize:
if self._size!=(w, h):
if self._size==(w, h):
geomlog("window unchanged")
else:
geomlog("unchanged position %ix%i, using resize(%i, %i)", x, y, w, h)
self.resize(w, h)
return
#we have to move:
Expand Down
31 changes: 18 additions & 13 deletions src/xpra/client/ui_client_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2382,30 +2382,30 @@ def _process_new_tray(self, packet):
self._window_to_id[tray] = wid

def _process_window_move_resize(self, packet):
(wid, x, y, w, h) = packet[1:6]
x = self.sx(x)
y = self.sy(y)
w = max(1, self.sx(w))
h = max(1, self.sy(h))
wid, x, y, w, h = packet[1:6]
ax = self.sx(x)
ay = self.sy(y)
aw = max(1, self.sx(w))
ah = max(1, self.sy(h))
resize_counter = -1
if len(packet)>4:
resize_counter = packet[4]
window = self._id_to_window.get(wid)
geomlog("_process_window_resized moving / resizing window %s (id=%s) to %s", window, wid, (x, y, w, h))
geomlog("_process_window_move_resize%s moving / resizing window %s (id=%s) to %s", packet[1:], window, wid, (ax, ay, aw, ah))
if window:
window.move_resize(x, y, w, h, resize_counter)
window.move_resize(ax, ay, aw, ah, resize_counter)

def _process_window_resized(self, packet):
(wid, w, h) = packet[1:4]
w = max(1, self.sx(w))
h = max(1, self.sy(h))
wid, w, h = packet[1:4]
aw = max(1, self.sx(w))
ah = max(1, self.sy(h))
resize_counter = -1
if len(packet)>4:
resize_counter = packet[4]
window = self._id_to_window.get(wid)
geomlog("_process_window_resized resizing window %s (id=%s) to %s", window, wid, (w,h))
geomlog("_process_window_resized%s resizing window %s (id=%s) to %s", packet[1:], window, wid, (aw,ah))
if window:
window.resize(w, h, resize_counter)
window.resize(aw, ah, resize_counter)

def _process_draw(self, packet):
self._draw_queue.put(packet)
Expand Down Expand Up @@ -2565,7 +2565,12 @@ def _process_window_icon(self, packet):
def _process_configure_override_redirect(self, packet):
wid, x, y, w, h = packet[1:6]
window = self._id_to_window[wid]
window.move_resize(x, y, w, h, -1)
ax = self.sx(x)
ay = self.sy(y)
aw = max(1, self.sx(w))
ah = max(1, self.sy(h))
geomlog("_process_configure_override_redirect%s move resize window %s (id=%s) to %s", packet[1:], window, wid, (ax,ay,aw,ah))
window.move_resize(ax, ay, aw, ah, -1)

def _process_lost_window(self, packet):
wid = packet[1]
Expand Down

0 comments on commit 8b6cb7c

Please sign in to comment.