added fakefullscreenclient

This commit is contained in:
2025-04-10 02:58:19 +02:00
parent 7f27da9ac4
commit 4e9714417e
3 changed files with 110 additions and 1 deletions

23
dwl.c
View File

@@ -137,7 +137,7 @@ typedef struct {
#endif
unsigned int bw;
uint32_t tags;
int isfloating, isurgent, isfullscreen;
int isfloating, isurgent, isfullscreen, isfakefullscreen;
uint32_t resize; /* configure serial of a pending resize */
} Client;
@@ -322,6 +322,7 @@ static void run(char *startup_cmd);
static void setcursor(struct wl_listener *listener, void *data);
static void setcursorshape(struct wl_listener *listener, void *data);
static void setfloating(Client *c, int floating);
static void setfakefullscreen(Client *c, int fullscreen);
static void setfullscreen(Client *c, int fullscreen);
static void setlayout(const Arg *arg);
static void setmfact(const Arg *arg);
@@ -336,6 +337,7 @@ static void tagmon(const Arg *arg);
static void tile(Monitor *m);
static void togglefloating(const Arg *arg);
static void togglefullscreen(const Arg *arg);
static void togglefakefullscreen(const Arg *arg);
static void toggletag(const Arg *arg);
static void toggleview(const Arg *arg);
static void unlocksession(struct wl_listener *listener, void *data);
@@ -2191,6 +2193,17 @@ requeststartdrag(struct wl_listener *listener, void *data)
wlr_data_source_destroy(event->drag->source);
}
void
setfakefullscreen(Client *c, int fullscreen)
{
c->isfakefullscreen = fullscreen;
if (!c->mon)
return;
if (c->isfullscreen)
setfullscreen(c, 0);
client_set_fullscreen(c, fullscreen);
}
void
requestmonstate(struct wl_listener *listener, void *data)
{
@@ -2755,6 +2768,14 @@ togglefullscreen(const Arg *arg)
setfullscreen(sel, !sel->isfullscreen);
}
void
togglefakefullscreen(const Arg *arg)
{
Client *sel = focustop(selmon);
if (sel)
setfakefullscreen(sel, !sel->isfakefullscreen);
}
void
toggletag(const Arg *arg)
{