mirror of
https://codeberg.org/dwl/dwl.git
synced 2025-10-28 18:44:17 +00:00
disallow clients to resize themselves
Closes: https://github.com/djpohly/dwl/issues/337
This commit is contained in:
parent
c3f041e980
commit
b419e38006
12
dwl.c
12
dwl.c
@ -114,6 +114,7 @@ typedef struct {
|
|||||||
struct wl_listener maximize;
|
struct wl_listener maximize;
|
||||||
struct wl_listener unmap;
|
struct wl_listener unmap;
|
||||||
struct wl_listener destroy;
|
struct wl_listener destroy;
|
||||||
|
struct wl_listener resize;
|
||||||
struct wl_listener set_title;
|
struct wl_listener set_title;
|
||||||
struct wl_listener fullscreen;
|
struct wl_listener fullscreen;
|
||||||
struct wlr_box prev; /* layout-relative, includes border */
|
struct wlr_box prev; /* layout-relative, includes border */
|
||||||
@ -279,6 +280,7 @@ static void quitsignal(int signo);
|
|||||||
static void rendermon(struct wl_listener *listener, void *data);
|
static void rendermon(struct wl_listener *listener, void *data);
|
||||||
static void requeststartdrag(struct wl_listener *listener, void *data);
|
static void requeststartdrag(struct wl_listener *listener, void *data);
|
||||||
static void resize(Client *c, struct wlr_box geo, int interact);
|
static void resize(Client *c, struct wlr_box geo, int interact);
|
||||||
|
static void resizenotify(struct wl_listener *listener, void *data);
|
||||||
static void run(char *startup_cmd);
|
static void run(char *startup_cmd);
|
||||||
static Client *selclient(void);
|
static Client *selclient(void);
|
||||||
static void setcursor(struct wl_listener *listener, void *data);
|
static void setcursor(struct wl_listener *listener, void *data);
|
||||||
@ -984,6 +986,7 @@ createnotify(struct wl_listener *listener, void *data)
|
|||||||
c->bw = borderpx;
|
c->bw = borderpx;
|
||||||
|
|
||||||
LISTEN(&xdg_surface->events.map, &c->map, mapnotify);
|
LISTEN(&xdg_surface->events.map, &c->map, mapnotify);
|
||||||
|
LISTEN(&xdg_surface->toplevel->events.request_resize, &c->resize, resizenotify);
|
||||||
LISTEN(&xdg_surface->events.unmap, &c->unmap, unmapnotify);
|
LISTEN(&xdg_surface->events.unmap, &c->unmap, unmapnotify);
|
||||||
LISTEN(&xdg_surface->events.destroy, &c->destroy, destroynotify);
|
LISTEN(&xdg_surface->events.destroy, &c->destroy, destroynotify);
|
||||||
LISTEN(&xdg_surface->toplevel->events.set_title, &c->set_title, updatetitle);
|
LISTEN(&xdg_surface->toplevel->events.set_title, &c->set_title, updatetitle);
|
||||||
@ -1131,6 +1134,7 @@ destroynotify(struct wl_listener *listener, void *data)
|
|||||||
wl_list_remove(&c->map.link);
|
wl_list_remove(&c->map.link);
|
||||||
wl_list_remove(&c->unmap.link);
|
wl_list_remove(&c->unmap.link);
|
||||||
wl_list_remove(&c->destroy.link);
|
wl_list_remove(&c->destroy.link);
|
||||||
|
wl_list_remove(&c->resize.link);
|
||||||
wl_list_remove(&c->set_title.link);
|
wl_list_remove(&c->set_title.link);
|
||||||
wl_list_remove(&c->fullscreen.link);
|
wl_list_remove(&c->fullscreen.link);
|
||||||
#ifdef XWAYLAND
|
#ifdef XWAYLAND
|
||||||
@ -1886,6 +1890,13 @@ resize(Client *c, struct wlr_box geo, int interact)
|
|||||||
c->geom.height - 2 * c->bw);
|
c->geom.height - 2 * c->bw);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
resizenotify(struct wl_listener *listener, void *data)
|
||||||
|
{
|
||||||
|
Client *c = wl_container_of(listener, c, resize);
|
||||||
|
resize(c, c->geom, 0);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
run(char *startup_cmd)
|
run(char *startup_cmd)
|
||||||
{
|
{
|
||||||
@ -2679,6 +2690,7 @@ createnotifyx11(struct wl_listener *listener, void *data)
|
|||||||
LISTEN(&xsurface->events.unmap, &c->unmap, unmapnotify);
|
LISTEN(&xsurface->events.unmap, &c->unmap, unmapnotify);
|
||||||
LISTEN(&xsurface->events.request_activate, &c->activate, activatex11);
|
LISTEN(&xsurface->events.request_activate, &c->activate, activatex11);
|
||||||
LISTEN(&xsurface->events.request_configure, &c->configure, configurex11);
|
LISTEN(&xsurface->events.request_configure, &c->configure, configurex11);
|
||||||
|
LISTEN(&xsurface->events.request_resize, &c->resize, resizenotify);
|
||||||
LISTEN(&xsurface->events.set_hints, &c->set_hints, sethints);
|
LISTEN(&xsurface->events.set_hints, &c->set_hints, sethints);
|
||||||
LISTEN(&xsurface->events.set_title, &c->set_title, updatetitle);
|
LISTEN(&xsurface->events.set_title, &c->set_title, updatetitle);
|
||||||
LISTEN(&xsurface->events.destroy, &c->destroy, destroynotify);
|
LISTEN(&xsurface->events.destroy, &c->destroy, destroynotify);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user