update to wlr_xdg_decoration

wlr_server_decoration is obsolete
This commit is contained in:
Leonardo Hernandez Hernandez 2022-02-03 08:54:46 -06:00
parent f85d8e79d0
commit fadceac5fa
No known key found for this signature in database
GPG Key ID: E538897EE11B9624

17
dwl.c
View File

@ -34,7 +34,6 @@
#include <wlr/types/wlr_primary_selection.h>
#include <wlr/types/wlr_primary_selection_v1.h>
#include <wlr/types/wlr_screencopy_v1.h>
#include <wlr/types/wlr_server_decoration.h>
#include <wlr/types/wlr_seat.h>
#include <wlr/types/wlr_viewporter.h>
#include <wlr/types/wlr_virtual_keyboard_v1.h>
@ -255,6 +254,7 @@ static void motionabsolute(struct wl_listener *listener, void *data);
static void motionnotify(uint32_t time);
static void motionrelative(struct wl_listener *listener, void *data);
static void moveresize(const Arg *arg);
static void newdecoration(struct wl_listener *listener, void *data);
static void outputmgrapply(struct wl_listener *listener, void *data);
static void outputmgrapplyortest(struct wlr_output_configuration_v1 *config, int test);
static void outputmgrtest(struct wl_listener *listener, void *data);
@ -313,6 +313,7 @@ static struct wlr_compositor *compositor;
static struct wlr_xdg_shell *xdg_shell;
static struct wlr_xdg_activation_v1 *activation;
static struct wlr_xdg_decoration_manager_v1 *decoration;
static struct wl_list clients; /* tiling order */
static struct wl_list fstack; /* focus order */
static struct wl_list stack; /* stacking z-order */
@ -349,6 +350,7 @@ static struct wl_listener new_virtual_keyboard = {.notify = virtualkeyboard};
static struct wl_listener new_output = {.notify = createmon};
static struct wl_listener new_xdg_surface = {.notify = createnotify};
static struct wl_listener new_layer_shell_surface = {.notify = createlayersurface};
static struct wl_listener new_xdg_decoration = {.notify = newdecoration};
static struct wl_listener output_mgr_apply = {.notify = outputmgrapply};
static struct wl_listener output_mgr_test = {.notify = outputmgrtest};
static struct wl_listener request_activate = {.notify = urgent};
@ -1456,6 +1458,13 @@ moveresize(const Arg *arg)
}
}
void
newdecoration(struct wl_listener *listener, void *data)
{
wlr_xdg_toplevel_decoration_v1_set_mode(data,
WLR_XDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE);
}
void
outputmgrapply(struct wl_listener *listener, void *data)
{
@ -2065,10 +2074,8 @@ setup(void)
wl_signal_add(&xdg_shell->events.new_surface, &new_xdg_surface);
/* Use decoration protocols to negotiate server-side decorations */
wlr_server_decoration_manager_set_default_mode(
wlr_server_decoration_manager_create(dpy),
WLR_SERVER_DECORATION_MANAGER_MODE_SERVER);
wlr_xdg_decoration_manager_v1_create(dpy);
decoration = wlr_xdg_decoration_manager_v1_create(dpy);
wl_signal_add(&decoration->events.new_toplevel_decoration, &new_xdg_decoration);
/*
* Creates a cursor, which is a wlroots utility for tracking the cursor