Merge pull request #636 from ids1024/xdg-decoration

wayland: Fix use of xdg-decoration protocol
This commit is contained in:
Bartosz Taudul 2023-10-09 23:56:42 +02:00 committed by GitHub
commit 93537dff33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -537,12 +537,6 @@ static void RegistryGlobal( void*, struct wl_registry* reg, uint32_t name, const
{ {
s_decoration = (zxdg_decoration_manager_v1*)wl_registry_bind( reg, name, &zxdg_decoration_manager_v1_interface, 1 ); s_decoration = (zxdg_decoration_manager_v1*)wl_registry_bind( reg, name, &zxdg_decoration_manager_v1_interface, 1 );
} }
else if( strcmp( interface, zxdg_toplevel_decoration_v1_interface.name ) == 0 )
{
s_tldec = (zxdg_toplevel_decoration_v1*)wl_registry_bind( reg, name, &zxdg_toplevel_decoration_v1_interface, 1 );
zxdg_toplevel_decoration_v1_add_listener( s_tldec, &decorationListener, nullptr );
zxdg_toplevel_decoration_v1_set_mode( s_tldec, ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE );
}
} }
static void RegistryGlobalRemove( void*, struct wl_registry* reg, uint32_t name ) static void RegistryGlobalRemove( void*, struct wl_registry* reg, uint32_t name )
@ -703,7 +697,9 @@ Backend::Backend( const char* title, const std::function<void()>& redraw, RunQue
if( s_decoration ) if( s_decoration )
{ {
zxdg_decoration_manager_v1_get_toplevel_decoration( s_decoration, s_toplevel ); s_tldec = zxdg_decoration_manager_v1_get_toplevel_decoration( s_decoration, s_toplevel );
zxdg_toplevel_decoration_v1_add_listener( s_tldec, &decorationListener, nullptr );
zxdg_toplevel_decoration_v1_set_mode( s_tldec, ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE );
wl_display_roundtrip( s_dpy ); wl_display_roundtrip( s_dpy );
} }