Delete quitfullscreen()

quitfullscreen() was replicating the functionalities of setfullscreen(c,
0)

Reusing setfullscreen() in quitfullscreen() leads to a 3 line function,
which is useless since quitfullscreen() is used once anyway
This commit is contained in:
Stivvo 2020-10-14 15:46:35 +02:00
parent a2ed3d45bb
commit 0ad8473a57

24
dwl.c
View File

@ -217,7 +217,6 @@ static void motionabsolute(struct wl_listener *listener, void *data);
static void motionnotify(uint32_t time); static void motionnotify(uint32_t time);
static void motionrelative(struct wl_listener *listener, void *data); static void motionrelative(struct wl_listener *listener, void *data);
static void moveresize(const Arg *arg); static void moveresize(const Arg *arg);
static void quitfullscreen(Client *c);
static void pointerfocus(Client *c, struct wlr_surface *surface, static void pointerfocus(Client *c, struct wlr_surface *surface,
double sx, double sy, uint32_t time); double sx, double sy, uint32_t time);
static void quit(const Arg *arg); static void quit(const Arg *arg);
@ -579,24 +578,6 @@ createmon(struct wl_listener *listener, void *data)
sgeom = *wlr_output_layout_get_box(output_layout, NULL); sgeom = *wlr_output_layout_get_box(output_layout, NULL);
} }
void
quitfullscreen(Client *c)
{
wl_list_for_each(c, &clients, link) {
if (c->isfullscreen && VISIBLEON(c, c->mon)) {
#ifdef XWAYLAND
if (c->type == X11Managed)
wlr_xwayland_surface_set_fullscreen(c->surface.xwayland, false);
else
#endif
wlr_xdg_toplevel_set_fullscreen(c->surface.xdg, false);
c->bw = borderpx;
resize(c, c->prevx, c->prevy, c->prevwidth, c->prevheight, 0);
c->isfullscreen = 0;
}
}
}
void void
createnotify(struct wl_listener *listener, void *data) createnotify(struct wl_listener *listener, void *data)
{ {
@ -608,11 +589,14 @@ createnotify(struct wl_listener *listener, void *data)
if (xdg_surface->role != WLR_XDG_SURFACE_ROLE_TOPLEVEL) if (xdg_surface->role != WLR_XDG_SURFACE_ROLE_TOPLEVEL)
return; return;
wl_list_for_each(c, &clients, link)
if (c->isfullscreen && VISIBLEON(c, c->mon))
setfullscreen(c, 0);
/* Allocate a Client for this surface */ /* Allocate a Client for this surface */
c = xdg_surface->data = calloc(1, sizeof(*c)); c = xdg_surface->data = calloc(1, sizeof(*c));
c->surface.xdg = xdg_surface; c->surface.xdg = xdg_surface;
c->bw = borderpx; c->bw = borderpx;
quitfullscreen(c);
/* Tell the client not to try anything fancy */ /* Tell the client not to try anything fancy */
wlr_xdg_toplevel_set_tiled(c->surface.xdg, WLR_EDGE_TOP | wlr_xdg_toplevel_set_tiled(c->surface.xdg, WLR_EDGE_TOP |