Skip to content

Commit

Permalink
#3592 make more assumptions about client caps
Browse files Browse the repository at this point in the history
* transparency is supported unless specified otherwise
* 'encoding.packet' feature
  • Loading branch information
totaam committed Aug 26, 2023
1 parent 15a72ea commit 990c902
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 15 deletions.
20 changes: 8 additions & 12 deletions xpra/server/server_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -564,18 +564,14 @@ def add_encoding_caps(d):
for k,v in self.get_encoding_info().items():
k = "encodings" if not k else f"encodings.{k}"
d[k] = v
if server_source.encodings_packet:
#we can send it later,
#when the init thread has finished:
def send_encoding_caps():
d = {}
add_encoding_caps(d)
#make sure the 'hello' packet goes out first:
self.idle_add(server_source.send_async, "encodings", d)
self.after_threaded_init(send_encoding_caps)
else:
self.wait_for_threaded_init()
add_encoding_caps(capabilities)
#we can send it later,
#when the init thread has finished:
def send_encoding_caps():
d = {}
add_encoding_caps(d)
#make sure the 'hello' packet goes out first:
self.idle_add(server_source.send_async, "encodings", d)
self.after_threaded_init(send_encoding_caps)
#check for mmap:
if getattr(self, "mmap_size", 0)==0:
self.after_threaded_init(server_source.print_encoding_info)
Expand Down
2 changes: 0 additions & 2 deletions xpra/server/source/encodings.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ def init_state(self) -> None:
self.encoding = "" #the default encoding for all windows
self.encodings : tuple[str,...] = () #all the encodings supported by the client
self.core_encodings : tuple[str,...] = ()
self.encodings_packet = False #supports delayed encodings initialization?
self.window_icon_encodings : tuple[str,...] = ()
self.rgb_formats : tuple[str,...] = ("RGB",)
self.encoding_options = typedict()
Expand Down Expand Up @@ -262,7 +261,6 @@ def parse_batch_int(value, varname):
self.vrefresh = c.intget("vrefresh", -1)

#encodings:
self.encodings_packet = c.boolget("encodings.packet", False)
self.encodings = c.strtupleget("encodings")
self.core_encodings = c.strtupleget("encodings.core", self.encodings)
log("encodings=%s, core_encodings=%s", self.encodings, self.core_encodings)
Expand Down
2 changes: 1 addition & 1 deletion xpra/server/window/window_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ def __init__(self,
self.rgb_lz4 : bool = use("lz4") and encoding_options.boolget("rgb_lz4", False) #server and client support lz4 pixel compression
self.client_render_size = encoding_options.get("render-size")
self.client_bit_depth : int = encoding_options.intget("bit-depth", 24)
self.supports_transparency : bool = HAS_ALPHA and encoding_options.boolget("transparency")
self.supports_transparency : bool = HAS_ALPHA and encoding_options.boolget("transparency", True)
self.full_frames_only : bool = self.is_tray or encoding_options.boolget("full_frames_only")
self.client_refresh_encodings : tuple[str, ...] = encoding_options.strtupleget("auto_refresh_encodings")
self.max_soft_expired : int = max(0, min(100, encoding_options.intget("max-soft-expired", MAX_SOFT_EXPIRED)))
Expand Down

0 comments on commit 990c902

Please sign in to comment.