Skip to content

Commit

Permalink
#2351 don't enable network-state mixin for 'top' client
Browse files Browse the repository at this point in the history
git-svn-id: https://xpra.org/svn/Xpra/trunk@25161 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed Feb 6, 2020
1 parent 7b5c57c commit aa87212
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/xpra/client/gobject_client_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def __init__(self, opts):
#don't bother with many of these things for one-off commands:
for x in ("ui_client", "wants_aliases", "wants_encodings",
"wants_versions", "wants_features", "wants_sound", "windows",
"webcam", "keyboard", "mouse",
"webcam", "keyboard", "mouse", "network-state",
):
self.hello_extra[x] = False

Expand Down
5 changes: 4 additions & 1 deletion src/xpra/client/mixins/network_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ def cleanup(self):


def get_caps(self) -> dict:
caps = {"info-namespace" : True} #v4 servers assume this is always supported
caps = {
"network-state" : True,
"info-namespace" : True, #v4 servers assume this is always supported
}
#get socket speed if we have it:
pinfo = self._protocol.get_info()
device_info = pinfo.get("socket", {}).get("device", {})
Expand Down
8 changes: 7 additions & 1 deletion src/xpra/server/source/networkstate_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import os
import time

from xpra.util import envbool, envint, CLIENT_PING_TIMEOUT
from xpra.util import envbool, envint, typedict, CLIENT_PING_TIMEOUT
from xpra.os_util import monotonic_time, POSIX
from xpra.server.source.stub_source_mixin import StubSourceMixin
from xpra.log import Logger
Expand All @@ -20,6 +20,12 @@

class NetworkStateMixin(StubSourceMixin):

@classmethod
def is_needed(cls, caps : typedict) -> bool:
#the 'network-state' capability were only added in v4,
#so we have to enable the mixin by default:
return caps.boolget("network-state", True)

def init_state(self):
self.last_ping_echoed_time = 0
self.check_ping_echo_timers = {}
Expand Down

0 comments on commit aa87212

Please sign in to comment.