Skip to content

Commit

Permalink
wlserver: Add comment about perf of wlserver_get_xdg_shell_windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua-Ashton committed Jan 25, 2023
1 parent 2cbbbb3 commit ecee87b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/wlserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1697,6 +1697,16 @@ void wlserver_set_xwayland_server_mode( size_t idx, int w, int h, int refresh )
wl_log.infof("Updating mode for xwayland server #%zu: %dx%d@%d", idx, w, h, refresh);
}

// Definitely not very efficient if we end up with
// a lot of Wayland windows in the future.
//
// Lots of atomic reference stuff will happen whenever
// this is called with a lot of windows.
// May want to change this down the line.
//
// Given we are only expecting like 1-2 xdg-shell
// windows for our current usecases (Waydroid, etc)
// I think this is reasonable for now.
std::vector<std::shared_ptr<steamcompmgr_win_t>> wlserver_get_xdg_shell_windows()
{
std::unique_lock lock(g_wlserver_xdg_shell_windows_lock);
Expand Down

3 comments on commit ecee87b

@ruineka
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this functional with these commits? I was curious and tested using Waydroid with this and the server connects into gamescope-0 successfully, but when I go to show the UI gamescope crashes with

wlserver: [types/xdg_shell/wlr_xdg_surface.c:387] new xdg_surface 0x5584bea60490 (res 0x5584be9ab8b0)
terminate called after throwing an instance of 'std::bad_variant_access'
what():  std::get: wrong index for variant
(EE) failed to read Wayland events: Broken pipe
(EE) failed to read Wayland events: Broken pipe

@Joshua-Ashton
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a little bit more needed I have yet to upstream yet.

@ruineka
Copy link

@ruineka ruineka commented on ecee87b Jan 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a little bit more needed I have yet to upstream yet.

That would make sense, if you need any testing I'd be willing to lend a hand. I didn't even think of the possibility of using Waydroid in this fashion, but after tinkering with it a bit I'm convinced that this could be a great experience.

Please sign in to comment.