schedule a configure on maximize request

see maximizenotify() for more info
This commit is contained in:
Leonardo Hernández Hernández 2022-04-16 15:51:13 -05:00
parent 4a2e761914
commit dc7709a00e
No known key found for this signature in database
GPG key ID: E538897EE11B9624

16
dwl.c
View file

@ -104,6 +104,7 @@ typedef struct {
} surface; } surface;
struct wl_listener commit; struct wl_listener commit;
struct wl_listener map; struct wl_listener map;
struct wl_listener maximize;
struct wl_listener unmap; struct wl_listener unmap;
struct wl_listener destroy; struct wl_listener destroy;
struct wl_listener set_title; struct wl_listener set_title;
@ -233,6 +234,7 @@ static void keypressmod(struct wl_listener *listener, void *data);
static void killclient(const Arg *arg); static void killclient(const Arg *arg);
static void maplayersurfacenotify(struct wl_listener *listener, void *data); static void maplayersurfacenotify(struct wl_listener *listener, void *data);
static void mapnotify(struct wl_listener *listener, void *data); static void mapnotify(struct wl_listener *listener, void *data);
static void maximizenotify(struct wl_listener *listener, void *data);
static void monocle(Monitor *m); static void monocle(Monitor *m);
static void motionabsolute(struct wl_listener *listener, void *data); static void motionabsolute(struct wl_listener *listener, void *data);
static void motionnotify(uint32_t time); static void motionnotify(uint32_t time);
@ -840,6 +842,8 @@ createnotify(struct wl_listener *listener, void *data)
LISTEN(&xdg_surface->toplevel->events.set_title, &c->set_title, updatetitle); LISTEN(&xdg_surface->toplevel->events.set_title, &c->set_title, updatetitle);
LISTEN(&xdg_surface->toplevel->events.request_fullscreen, &c->fullscreen, LISTEN(&xdg_surface->toplevel->events.request_fullscreen, &c->fullscreen,
fullscreennotify); fullscreennotify);
LISTEN(&xdg_surface->toplevel->events.request_maximize, &c->maximize,
maximizenotify);
c->isfullscreen = 0; c->isfullscreen = 0;
} }
@ -1254,6 +1258,18 @@ mapnotify(struct wl_listener *listener, void *data)
c->mon->un_map = 1; c->mon->un_map = 1;
} }
void
maximizenotify(struct wl_listener *listener, void *data)
{
/* This event is raised when a client would like to maximize itself,
* typically because the user clicked on the maximize button on
* client-side decorations. dwl doesn't support maximization, but
* to conform to xdg-shell protocol we still must send a configure.
* wlr_xdg_surface_schedule_configure() is used to send an empty reply. */
Client *c = wl_container_of(listener, c, maximize);
wlr_xdg_surface_schedule_configure(c->surface.xdg);
}
void void
monocle(Monitor *m) monocle(Monitor *m)
{ {