Basic fullscreen

This commit is contained in:
Stivvo 2020-09-04 12:44:09 +02:00 committed by Guido Cella
parent 0f48c9552e
commit 0f04c76387

11
dwl.c
View file

@ -102,6 +102,7 @@ typedef struct {
struct wl_listener map; struct wl_listener map;
struct wl_listener unmap; struct wl_listener unmap;
struct wl_listener destroy; struct wl_listener destroy;
struct wl_listener fullscreen;
struct wlr_box geom; /* layout-relative, includes border */ struct wlr_box geom; /* layout-relative, includes border */
Monitor *mon; Monitor *mon;
#ifdef XWAYLAND #ifdef XWAYLAND
@ -222,6 +223,7 @@ static void cursorframe(struct wl_listener *listener, void *data);
static void destroylayersurfacenotify(struct wl_listener *listener, void *data); static void destroylayersurfacenotify(struct wl_listener *listener, void *data);
static void destroynotify(struct wl_listener *listener, void *data); static void destroynotify(struct wl_listener *listener, void *data);
static void destroyxdeco(struct wl_listener *listener, void *data); static void destroyxdeco(struct wl_listener *listener, void *data);
static void fullscreenotify(struct wl_listener *listener, void *data);
static Monitor *dirtomon(int dir); static Monitor *dirtomon(int dir);
static void focusclient(Client *c, int lift); static void focusclient(Client *c, int lift);
static void focusmon(const Arg *arg); static void focusmon(const Arg *arg);
@ -909,6 +911,9 @@ createnotify(struct wl_listener *listener, void *data)
wl_signal_add(&xdg_surface->events.unmap, &c->unmap); wl_signal_add(&xdg_surface->events.unmap, &c->unmap);
c->destroy.notify = destroynotify; c->destroy.notify = destroynotify;
wl_signal_add(&xdg_surface->events.destroy, &c->destroy); wl_signal_add(&xdg_surface->events.destroy, &c->destroy);
wl_signal_add(&xdg_surface->toplevel->events.request_fullscreen, &c->fullscreen);
c->fullscreen.notify = fullscreenotify;
} }
void void
@ -1037,6 +1042,12 @@ destroyxdeco(struct wl_listener *listener, void *data)
free(d); free(d);
} }
void
fullscreenotify(struct wl_listener *listener, void *data) {
Client *c = wl_container_of(listener, c, fullscreen);
wlr_xdg_toplevel_set_fullscreen(c->surface.xdg, true);
}
Monitor * Monitor *
dirtomon(int dir) dirtomon(int dir)
{ {