Skip to content

Commit

Permalink
handle vfb resizing
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@12986 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Jul 12, 2016
1 parent 544d047 commit 3fc190e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/xpra/server/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -1965,7 +1965,7 @@ def lost_window(self, wid, window):
return
self.send("lost-window", wid)

def move_resize_window(self, wid, window, x, y, ww, wh, resize_counter):
def move_resize_window(self, wid, window, x, y, ww, wh, resize_counter=0):
"""
The server detected that the application window has been moved and/or resized,
we forward it if the client supports this type of event.
Expand Down
24 changes: 21 additions & 3 deletions src/xpra/x11/desktop_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

from xpra.util import updict
from xpra.platform.gui import get_wm_name
from xpra.gtk_common.gobject_util import one_arg_signal
from xpra.gtk_common.gobject_util import one_arg_signal, no_arg_signal
from xpra.gtk_common.error import xswallow
from xpra.x11.gtk2.models.model_stub import WindowModelStub
from xpra.x11.gtk2.gdk_bindings import (
Expand Down Expand Up @@ -44,6 +44,7 @@ class DesktopModel(WindowModelStub, WindowDamageHandler):
__gsignals__ = {}
__gsignals__.update(WindowDamageHandler.__common_gsignals__)
__gsignals__.update({
"resized" : no_arg_signal,
"client-contents-changed" : one_arg_signal,
})

Expand Down Expand Up @@ -101,7 +102,7 @@ def uses_XShm(self):
def get_property(self, prop):
if prop=="xid":
return self.client_window.xid
if prop=="title":
elif prop=="title":
return get_wm_name() or "xpra desktop"
elif prop=="client-machine":
return socket.gethostname()
Expand All @@ -115,9 +116,12 @@ def get_property(self, prop):
return gobject.GObject.get_property(self, prop)

def _screen_size_changed(self, screen):
screenlog("screen size changed: %s", screen)
w, h = screen.get_width(), screen.get_height()
screenlog("screen size changed: new size %ix%i", w, h)
screenlog("root window geometry=%s", self.client_window.get_geometry())
self.invalidate_pixmap()
self.update_size_hints(screen)
self.emit("resized")

def update_size_hints(self, screen):
w, h = screen.get_width(), screen.get_height()
Expand Down Expand Up @@ -194,6 +198,20 @@ def load_existing_windows(self):
windowlog("adding root window model %s", model)
X11ServerBase._add_new_window_common(self, model)
model.managed_connect("client-contents-changed", self._contents_changed)
model.managed_connect("resized", self._window_resized_signaled)


def _window_resized_signaled(self, window, *args):
#the vfb has been resized
wid = self._window_to_id[window]
x, y, w, h = window.get_geometry()
if window.mapped_at:
x, y = window.mapped_at[:2]
window.mapped_at = (x, y, w, h)
windowlog.warn("window_resized_signaled(%s) mapped at=%s", window, window.mapped_at)
for ss in self._server_sources.values():
ss.move_resize_window(wid, window, x, y, w, h)
ss.damage(wid, window, 0, 0, w, h)


def send_initial_windows(self, ss, sharing=False):
Expand Down

0 comments on commit 3fc190e

Please sign in to comment.