~ruther/dwl

396840cdf215b4affea28ac39f10f0011da94ed9 — Leonardo Hernández Hernández 1 year, 4 months ago a71b368
Revert "nuke CSDs, hopefully for good!"

The compositor must respond to the client requesting a change to the decoration
mode, it does not matter if the compositor chooses a different mode.

This reverts commit 9071ce6c848ce214939fb84f85ae77de86de88d7.
1 files changed, 28 insertions(+), 2 deletions(-)

M dwl.c
M dwl.c => dwl.c +28 -2
@@ 264,12 264,14 @@ static void destroylocksurface(struct wl_listener *listener, void *data);
static void destroynotify(struct wl_listener *listener, void *data);
static void destroysessionlock(struct wl_listener *listener, void *data);
static void destroysessionmgr(struct wl_listener *listener, void *data);
static void destroyxdeco(struct wl_listener *listener, void *data);
static Monitor *dirtomon(enum wlr_direction dir);
static void focusclient(Client *c, int lift);
static void focusmon(const Arg *arg);
static void focusstack(const Arg *arg);
static Client *focustop(Monitor *m);
static void fullscreennotify(struct wl_listener *listener, void *data);
static void getxdecomode(struct wl_listener *listener, void *data);
static void handlesig(int signo);
static void incnmaster(const Arg *arg);
static void inputdevice(struct wl_listener *listener, void *data);


@@ 741,8 743,13 @@ commitnotify(struct wl_listener *listener, void *data)
void
createdecoration(struct wl_listener *listener, void *data)
{
	struct wlr_xdg_toplevel_decoration_v1 *dec = data;
	wlr_xdg_toplevel_decoration_v1_set_mode(dec, WLR_XDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE);
	struct wlr_xdg_toplevel_decoration_v1 *wlr_deco = data;
	Decoration *d = wlr_deco->data = calloc(1, sizeof(*d));

	LISTEN(&wlr_deco->events.request_mode, &d->request_mode, getxdecomode);
	LISTEN(&wlr_deco->events.destroy, &d->destroy, destroyxdeco);

	getxdecomode(&d->request_mode, wlr_deco);
}

void


@@ 1124,6 1131,17 @@ destroysessionmgr(struct wl_listener *listener, void *data)
	wl_list_remove(&listener->link);
}

void
destroyxdeco(struct wl_listener *listener, void *data)
{
	struct wlr_xdg_toplevel_decoration_v1 *wlr_deco = data;
	Decoration *d = wlr_deco->data;

	wl_list_remove(&d->destroy.link);
	wl_list_remove(&d->request_mode.link);
	free(d);
}

Monitor *
dirtomon(enum wlr_direction dir)
{


@@ 1275,6 1293,14 @@ fullscreennotify(struct wl_listener *listener, void *data)
}

void
getxdecomode(struct wl_listener *listener, void *data)
{
	struct wlr_xdg_toplevel_decoration_v1 *wlr_deco = data;
	wlr_xdg_toplevel_decoration_v1_set_mode(wlr_deco,
			WLR_XDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE);
}

void
handlesig(int signo)
{
	if (signo == SIGCHLD) {

Do not follow this link