mirror of
https://github.com/labwc/labwc.git
synced 2026-03-17 05:33:47 -04:00
chase: handle xdg new toplevel event
https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4345
This commit is contained in:
parent
3b2ab4a48e
commit
d2579a0088
2 changed files with 9 additions and 13 deletions
|
|
@ -229,7 +229,7 @@ struct server {
|
||||||
struct wlr_xdg_shell *xdg_shell;
|
struct wlr_xdg_shell *xdg_shell;
|
||||||
struct wlr_layer_shell_v1 *layer_shell;
|
struct wlr_layer_shell_v1 *layer_shell;
|
||||||
|
|
||||||
struct wl_listener new_xdg_surface;
|
struct wl_listener new_xdg_toplevel;
|
||||||
struct wl_listener new_layer_surface;
|
struct wl_listener new_layer_surface;
|
||||||
|
|
||||||
struct wl_listener kde_server_decoration;
|
struct wl_listener kde_server_decoration;
|
||||||
|
|
|
||||||
20
src/xdg.c
20
src/xdg.c
|
|
@ -743,19 +743,14 @@ xdg_activation_handle_request(struct wl_listener *listener, void *data)
|
||||||
* to help the popups find their parent nodes
|
* to help the popups find their parent nodes
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
xdg_surface_new(struct wl_listener *listener, void *data)
|
xdg_toplevel_new(struct wl_listener *listener, void *data)
|
||||||
{
|
{
|
||||||
struct server *server =
|
struct server *server =
|
||||||
wl_container_of(listener, server, new_xdg_surface);
|
wl_container_of(listener, server, new_xdg_toplevel);
|
||||||
struct wlr_xdg_surface *xdg_surface = data;
|
struct wlr_xdg_toplevel *xdg_toplevel = data;
|
||||||
|
struct wlr_xdg_surface *xdg_surface = xdg_toplevel->base;
|
||||||
|
|
||||||
/*
|
assert(xdg_surface->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL);
|
||||||
* We deal with popups in xdg-popup.c and layers.c as they have to be
|
|
||||||
* treated differently
|
|
||||||
*/
|
|
||||||
if (xdg_surface->role != WLR_XDG_SURFACE_ROLE_TOPLEVEL) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
wlr_xdg_surface_ping(xdg_surface);
|
wlr_xdg_surface_ping(xdg_surface);
|
||||||
|
|
||||||
|
|
@ -850,8 +845,9 @@ xdg_shell_init(struct server *server)
|
||||||
wlr_log(WLR_ERROR, "unable to create the XDG shell interface");
|
wlr_log(WLR_ERROR, "unable to create the XDG shell interface");
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
server->new_xdg_surface.notify = xdg_surface_new;
|
|
||||||
wl_signal_add(&server->xdg_shell->events.new_surface, &server->new_xdg_surface);
|
server->new_xdg_toplevel.notify = xdg_toplevel_new;
|
||||||
|
wl_signal_add(&server->xdg_shell->events.new_toplevel, &server->new_xdg_toplevel);
|
||||||
|
|
||||||
server->xdg_activation = wlr_xdg_activation_v1_create(server->wl_display);
|
server->xdg_activation = wlr_xdg_activation_v1_create(server->wl_display);
|
||||||
if (!server->xdg_activation) {
|
if (!server->xdg_activation) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue