Skip to content

Commit

Permalink
#3592 assume xdg-menu-update is supported
Browse files Browse the repository at this point in the history
  • Loading branch information
totaam committed Jul 26, 2023
1 parent a10c6eb commit 4dc21e8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 12 deletions.
2 changes: 1 addition & 1 deletion xpra/client/gui/ui_client_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ def make_hello(self):
log("skipped server uuid lookup", exc_info=True)
for x in (#generic feature flags:
"wants_events", "setting-change",
"xdg-menu-update", "mouse",
"mouse",
):
caps[x] = True
caps.setdefault("wants", []).append("events")
Expand Down
12 changes: 4 additions & 8 deletions xpra/server/mixins/child_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ def get_server_features(self, _source) -> Dict[str,Any]:
"exit-with-children" : self.exit_with_children,
"server-commands-signals" : COMMAND_SIGNALS,
"server-commands-info" : not WIN32 and not OSX,
"xdg-menu-update" : POSIX and not OSX,
}


Expand All @@ -154,19 +153,16 @@ def get_caps(self, source) -> Dict[str,Any]:
wants = getattr(source, "wants", [])
if "feature" in wants and getattr(source, "ui_client", False):
caps["xdg-menu"] = {}
if not source.xdg_menu_update:
log.warn("Warning: outdated client does not support xdg-menu update")
caps["subcommands"] = get_subcommands()
return caps


def send_initial_data(self, ss, caps:typedict, send_ui:bool, share_count:int) -> None:
if not getattr(ss, "xdg_menu", False):
return
if ss.xdg_menu_update:
#this method may block if the menus are still being loaded,
#so do it in a throw-away thread:
start_thread(self.send_xdg_menu_data, "send-xdg-menu-data", True, (ss,))
#this method may block if the menus are still being loaded,
#so do it in a throw-away thread:
start_thread(self.send_xdg_menu_data, "send-xdg-menu-data", True, (ss,))

def send_xdg_menu_data(self, ss) -> None:
if ss.is_closed():
Expand All @@ -179,7 +175,7 @@ def send_updated_menu(self, xdg_menu) -> None:
log("send_updated_menu(%s)", ellipsizer(xdg_menu))
for source in tuple(self._server_sources.values()):
#some sources don't have this attribute (ie: RFBSource does not):
if getattr(source, "xdg_menu_update", False):
if getattr(source, "send_setting_change", False):
source.send_setting_change("xdg-menu", xdg_menu or {})


Expand Down
3 changes: 0 additions & 3 deletions xpra/server/source/client_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ def init_state(self):
self.lock = False
self.control_commands : Tuple[str,...] = ()
self.xdg_menu = True
self.xdg_menu_update = False
self.bandwidth_limit = self.server_bandwidth_limit
self.soft_bandwidth_limit = self.bandwidth_limit
self.bandwidth_warnings = True
Expand Down Expand Up @@ -201,7 +200,6 @@ def parse_client_caps(self, c : typedict):
self.lock = c.boolget("lock")
self.control_commands = c.strtupleget("control_commands")
self.xdg_menu = c.boolget("xdg-menu", True)
self.xdg_menu_update = c.boolget("xdg-menu-update")
bandwidth_limit = c.intget("bandwidth-limit", 0)
server_bandwidth_limit = self.server_bandwidth_limit
if self.server_bandwidth_limit is None:
Expand Down Expand Up @@ -376,7 +374,6 @@ def get_features_info(self) -> Dict[str,Any]:
"lock" : bool(self.lock),
"share" : bool(self.share),
"xdg-menu" : bool(self.xdg_menu),
"xdg-menu-udpate" : bool(self.xdg_menu_update),
}
return info

Expand Down

0 comments on commit 4dc21e8

Please sign in to comment.