Skip to content

Commit

Permalink
Update wlroots to v0.18
Browse files Browse the repository at this point in the history
  • Loading branch information
emersion committed Nov 26, 2023
1 parent 51b871e commit a6e32c6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ stb_dep = dependency('stb')

wlroots_dep = dependency(
'wlroots',
version: ['>= 0.17.0', '< 0.18.0'],
version: ['>= 0.18.0', '< 0.19.0'],
fallback: ['wlroots', 'wlroots'],
default_options: ['default_library=static', 'examples=false', 'xwayland=enabled', 'backends=libinput', 'renderers=[]', 'allocators=[]', 'session=enabled'],
)
Expand Down
22 changes: 9 additions & 13 deletions src/wlserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1177,7 +1177,8 @@ bool wlsession_init( void ) {
if ( BIsNested() )
return true;

wlserver.wlr.session = wlr_session_create( wlserver.display );
auto loop = wl_display_get_event_loop( wlserver.display );
wlserver.wlr.session = wlr_session_create( loop );
if ( wlserver.wlr.session == nullptr )
{
wl_log.errorf( "Failed to create session" );
Expand Down Expand Up @@ -1265,7 +1266,7 @@ gamescope_xwayland_server_t::gamescope_xwayland_server_t(wl_display *display)

update_output_info();

wlr_output_create_global(output);
wlr_output_create_global(output, wlserver.display);
}

gamescope_xwayland_server_t::~gamescope_xwayland_server_t()
Expand Down Expand Up @@ -1344,15 +1345,10 @@ static void xdg_toplevel_destroy(struct wl_listener *listener, void *data) {
wlserver_surface->xdg_surface = nullptr;
}

void xdg_surface_new(struct wl_listener *listener, void *data)
void xdg_toplevel_new(struct wl_listener *listener, void *data)
{
struct wlr_xdg_surface *xdg_surface = (struct wlr_xdg_surface *)data;

if (xdg_surface->role != WLR_XDG_SURFACE_ROLE_TOPLEVEL)
{
wl_log.infof("Not top level surface.");
return;
}
struct wlr_xdg_toplevel *xdg_toplevel = (struct wlr_xdg_toplevel *)data;
struct wlr_xdg_surface *xdg_surface = xdg_toplevel->base;

wlserver_wl_surface_info *wlserver_surface = get_wl_surface_info(xdg_surface->surface);
if (!wlserver_surface)
Expand All @@ -1377,7 +1373,7 @@ void xdg_surface_new(struct wl_listener *listener, void *data)
wlserver_xdg_surface_info* xdg_surface_info = &window->xdg().surface;
xdg_surface_info->main_surface = xdg_surface->surface;
xdg_surface_info->win = window.get();
xdg_surface_info->xdg_toplevel = xdg_surface->toplevel;
xdg_surface_info->xdg_toplevel = xdg_toplevel;

wlserver_surface->xdg_surface = xdg_surface_info;

Expand Down Expand Up @@ -1468,8 +1464,8 @@ bool wlserver_init( void ) {
wl_log.infof("Unable to create XDG shell interface");
return false;
}
wlserver.new_xdg_surface.notify = xdg_surface_new;
wl_signal_add(&wlserver.xdg_shell->events.new_surface, &wlserver.new_xdg_surface);
wlserver.new_xdg_toplevel.notify = xdg_toplevel_new;
wl_signal_add(&wlserver.xdg_shell->events.new_toplevel, &wlserver.new_xdg_toplevel);

int result = -1;
int display_slot = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/wlserver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ struct wlserver_t {
struct wl_listener new_input_method;

struct wlr_xdg_shell *xdg_shell;
struct wl_listener new_xdg_surface;
struct wl_listener new_xdg_toplevel;
std::vector<std::shared_ptr<steamcompmgr_win_t>> xdg_wins;
std::atomic<bool> xdg_dirty;
std::mutex xdg_commit_lock;
Expand Down

0 comments on commit a6e32c6

Please sign in to comment.