Skip to content

Commit

Permalink
#1838: avoid triggering warnings if the server doesn't support the In…
Browse files Browse the repository at this point in the history
…putServer mixin: don't bother sending keyboard and pointer events

git-svn-id: https://xpra.org/svn/Xpra/trunk@19727 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Jun 26, 2018
1 parent 11c6a95 commit b8e70a2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/xpra/client/client_window_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ def get_mouse_event_wid(self, _x, _y):
return self._id

def do_motion_notify_event(self, event):
if self._client.readonly or self._client.server_readonly:
if self._client.readonly or self._client.server_readonly or not self._client.server_pointer:
return
pointer, modifiers, buttons = self._pointer_modifiers(event)
wid = self.get_mouse_event_wid(*pointer)
Expand All @@ -700,7 +700,7 @@ def _device_info(self, event):
return ""

def _button_action(self, button, event, depressed, *args):
if self._client.readonly or self._client.server_readonly:
if self._client.readonly or self._client.server_readonly or not self._client.server_pointer:
return
pointer, modifiers, buttons = self._pointer_modifiers(event)
wid = self.get_mouse_event_wid(*pointer)
Expand Down
10 changes: 10 additions & 0 deletions src/xpra/client/ui_client_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ def __init__(self):
self.server_lock = False
self.server_lock_toggle = False
self.server_window_filters = False
self.server_keyboard = True
self.server_pointer = True

self.client_supports_opengl = False
self.client_supports_sharing = False
Expand Down Expand Up @@ -310,13 +312,21 @@ def parse_server_capabilities(self):
self.server_sharing_toggle = c.boolget("sharing-toggle")
self.server_lock = c.boolget("lock")
self.server_lock_toggle = c.boolget("lock-toggle")
self.server_keyboard = c.boolget("keyboard", True)
self.server_pointer = c.boolget("pointer", True)
self.server_start_new_commands = c.boolget("start-new-commands")
self.server_commands_info = c.boolget("server-commands-info")
self.server_commands_signals = c.strlistget("server-commands-signals")
self.server_readonly = c.boolget("readonly")
if self.server_readonly and not self.readonly:
log.info("server is read only")
self.readonly = True
log.info("server_keyboard=%s", self.server_keyboard)
if not self.server_keyboard and self.keyboard_helper:
#swallow packets:
def nosend(*args):
pass
self.keyboard_helper.send = nosend

i = platform_name(self._remote_platform, c.strlistget("platform.linux_distribution") or c.strget("platform.release", ""))
r = self._remote_version
Expand Down
2 changes: 2 additions & 0 deletions src/xpra/server/server_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,8 @@ def make_hello(self, source):
"lock" : self.lock is not False,
"lock-toggle" : self.lock is None,
"windows" : server_features.windows,
"keyboard" : server_features.input_devices,
"pointer" : server_features.input_devices,
})
capabilities.update(flatten_dict(self.get_server_features(source)))
#this is a feature, but we would need the hello request
Expand Down

0 comments on commit b8e70a2

Please sign in to comment.