-
-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add 'is_needed' mixin filtering to AVSync, Audio, Clipboard, Encodings, FilePrint, Webcam and Windows * fix minor server issues where we assumed that the mixin would be present (windows, clipboard) * expose which mixins are loaded via 'xpra info' * don't set the 'clipboard-source' to one that doesn't have the mixin, * add missing flag to client webcam mixin caps, * remove av-sync caps from client audio mixin caps git-svn-id: https://xpra.org/svn/Xpra/trunk@24910 3bb7dfac-3a0b-4e04-842a-767bc560f471
- Loading branch information
Showing
13 changed files
with
85 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# This file is part of Xpra. | ||
# Copyright (C) 2010-2018 Antoine Martin <[email protected]> | ||
# Copyright (C) 2010-2020 Antoine Martin <[email protected]> | ||
# Xpra is released under the terms of the GNU GPL v2, or, at your option, any | ||
# later version. See the file COPYING for details. | ||
|
||
|
@@ -163,8 +163,10 @@ def get_audio_capabilities(self): | |
return caps | ||
|
||
def get_avsync_capabilities(self): | ||
if not self.av_sync: | ||
return {} | ||
return { | ||
"" : self.av_sync, | ||
"" : True, | ||
"delay.default" : max(0, DEFAULT_AV_SYNC_DELAY + AV_SYNC_DELTA), | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# -*- coding: utf-8 -*- | ||
# This file is part of Xpra. | ||
# Copyright (C) 2010-2018 Antoine Martin <[email protected]> | ||
# Copyright (C) 2010-2020 Antoine Martin <[email protected]> | ||
# Xpra is released under the terms of the GNU GPL v2, or, at your option, any | ||
# later version. See the file COPYING for details. | ||
|
||
|
@@ -19,6 +19,11 @@ | |
|
||
class AudioMixin(StubSourceMixin): | ||
|
||
@classmethod | ||
def is_needed(cls, caps): | ||
return caps.boolget("sound.send") or caps.boolget("sound.receive") | ||
|
||
|
||
def __init__(self): | ||
self.sound_properties = {} | ||
self.sound_source_plugin = "" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# -*- coding: utf-8 -*- | ||
# This file is part of Xpra. | ||
# Copyright (C) 2010-2019 Antoine Martin <[email protected]> | ||
# Copyright (C) 2010-2020 Antoine Martin <[email protected]> | ||
# Xpra is released under the terms of the GNU GPL v2, or, at your option, any | ||
# later version. See the file COPYING for details. | ||
|
||
|
@@ -16,6 +16,14 @@ | |
|
||
class AVSyncMixin(StubSourceMixin): | ||
|
||
@classmethod | ||
def is_needed(cls, caps): | ||
if not (caps.boolget("sound.send") or caps.boolget("sound.receive")): | ||
#no audio! | ||
return False | ||
return caps.boolget("av-sync") and caps.boolget("windows") | ||
|
||
|
||
def __init__(self): | ||
self.av_sync = False | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# -*- coding: utf-8 -*- | ||
# This file is part of Xpra. | ||
# Copyright (C) 2010-2019 Antoine Martin <[email protected]> | ||
# Copyright (C) 2010-2020 Antoine Martin <[email protected]> | ||
# Copyright (C) 2008 Nathaniel Smith <[email protected]> | ||
# Xpra is released under the terms of the GNU GPL v2, or, at your option, any | ||
# later version. See the file COPYING for details. | ||
|
@@ -22,8 +22,10 @@ | |
|
||
class ClipboardConnection(StubSourceMixin): | ||
|
||
def init_from(self, _protocol, _server): | ||
pass | ||
@classmethod | ||
def is_needed(cls, caps): | ||
return caps.boolget("clipboard") | ||
|
||
|
||
def init_state(self): | ||
self.clipboard_enabled = False | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# -*- coding: utf-8 -*- | ||
# This file is part of Xpra. | ||
# Copyright (C) 2011 Serviware (Arthur Huillet, <[email protected]>) | ||
# Copyright (C) 2010-2019 Antoine Martin <[email protected]> | ||
# Copyright (C) 2010-2020 Antoine Martin <[email protected]> | ||
# Xpra is released under the terms of the GNU GPL v2, or, at your option, any | ||
# later version. See the file COPYING for details. | ||
|
||
|
@@ -33,6 +33,11 @@ | |
""" | ||
class EncodingsMixin(StubSourceMixin): | ||
|
||
@classmethod | ||
def is_needed(cls, caps): | ||
return bool(caps.strtupleget("encodings")) | ||
|
||
|
||
def __init__(self): | ||
self.server_core_encodings = [] | ||
self.server_encodings = [] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# -*- coding: utf-8 -*- | ||
# This file is part of Xpra. | ||
# Copyright (C) 2010-2019 Antoine Martin <[email protected]> | ||
# Copyright (C) 2010-2020 Antoine Martin <[email protected]> | ||
# Xpra is released under the terms of the GNU GPL v2, or, at your option, any | ||
# later version. See the file COPYING for details. | ||
|
||
|
@@ -20,6 +20,11 @@ | |
|
||
class FilePrintMixin(FileTransferHandler, StubSourceMixin): | ||
|
||
@classmethod | ||
def is_needed(cls, caps): | ||
return bool(caps.boolget("file-transfer") or caps.boolget("printing")) | ||
|
||
|
||
def init_state(self): | ||
self.printers = {} | ||
self.printers_added = set() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# -*- coding: utf-8 -*- | ||
# This file is part of Xpra. | ||
# Copyright (C) 2010-2019 Antoine Martin <[email protected]> | ||
# Copyright (C) 2010-2020 Antoine Martin <[email protected]> | ||
# Xpra is released under the terms of the GNU GPL v2, or, at your option, any | ||
# later version. See the file COPYING for details. | ||
|
||
|
@@ -32,6 +32,12 @@ def valid_encodings(args): | |
""" | ||
class WebcamMixin(StubSourceMixin): | ||
|
||
@classmethod | ||
def is_needed(cls, caps): | ||
#the 'webcam' capability was only added in v4, | ||
#so we have to enabled the mixin: | ||
return True | ||
|
||
def __init__(self): | ||
self.webcam_enabled = False | ||
self.webcam_device = None | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# -*- coding: utf-8 -*- | ||
# This file is part of Xpra. | ||
# Copyright (C) 2010-2019 Antoine Martin <[email protected]> | ||
# Copyright (C) 2010-2020 Antoine Martin <[email protected]> | ||
# Copyright (C) 2008 Nathaniel Smith <[email protected]> | ||
# Xpra is released under the terms of the GNU GPL v2, or, at your option, any | ||
# later version. See the file COPYING for details. | ||
|
@@ -39,6 +39,11 @@ | |
""" | ||
class WindowsMixin(StubSourceMixin): | ||
|
||
@classmethod | ||
def is_needed(cls, caps): | ||
return caps.boolget("windows") | ||
|
||
|
||
def __init__(self): | ||
self.get_transient_for = None | ||
self.get_focus = None | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
# -*- coding: utf-8 -*- | ||
# This file is part of Xpra. | ||
# Copyright (C) 2011 Serviware (Arthur Huillet, <[email protected]>) | ||
# Copyright (C) 2010-2019 Antoine Martin <[email protected]> | ||
# Copyright (C) 2010-2020 Antoine Martin <[email protected]> | ||
# Copyright (C) 2008 Nathaniel Smith <[email protected]> | ||
# Xpra is released under the terms of the GNU GPL v2, or, at your option, any | ||
# later version. See the file COPYING for details. | ||
|
@@ -471,10 +471,11 @@ def get_transient_for(self, window): | |
|
||
|
||
def parse_hello_ui_window_settings(self, ss, _caps): | ||
framelog("parse_hello_ui_window_settings: client window_frame_sizes=%s", ss.window_frame_sizes) | ||
window_frame_sizes = getattr(ss, "window_frame_sizes", None) | ||
framelog("parse_hello_ui_window_settings: client window_frame_sizes=%s", window_frame_sizes) | ||
frame = None | ||
if ss.window_frame_sizes: | ||
frame = ss.window_frame_sizes.inttupleget("frame", (0, 0, 0, 0), 4, 4) | ||
if window_frame_sizes: | ||
frame = window_frame_sizes.inttupleget("frame", (0, 0, 0, 0), 4, 4) | ||
if self._wm: | ||
self._wm.set_default_frame_extents(frame) | ||
|
||
|