summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormac <ra@afu.re>2025-08-28 11:03:40 -0400
committermac <ra@afu.re>2025-08-28 11:03:40 -0400
commit1bdeb27902fddb025d03498d4d5a9027c8ac1f51 (patch)
tree2d928d4f396c33fc06c55b1b053b6188a98bbae8
parent59a7f3f43eadc1ecbfc039b69618f9f5554d794f (diff)
remove simple_scratchpad patch
-rw-r--r--config.def.h2
-rw-r--r--config.def.h.rej12
-rw-r--r--dwl.c34
-rw-r--r--simple_scratchpad.c68
4 files changed, 2 insertions, 114 deletions
diff --git a/config.def.h b/config.def.h
index 3d4906a..2190342 100644
--- a/config.def.h
+++ b/config.def.h
@@ -154,8 +154,6 @@ static const Key keys[] = {
{ MODKEY, XKB_KEY_q, killclient, {0} },
{ MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Q, spawn, {.v = (const char*[]){ "sysact", NULL }} },
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Return, addscratchpad, {0} },
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_grave, togglescratchpad, {0} },
diff --git a/config.def.h.rej b/config.def.h.rej
deleted file mode 100644
index 9d830f1..0000000
--- a/config.def.h.rej
+++ /dev/null
@@ -1,12 +0,0 @@
---- config.def.h
-+++ config.def.h
-@@ -136,6 +136,9 @@ static const Key keys[] = {
- { MODKEY, XKB_KEY_Return, zoom, {0} },
- { MODKEY, XKB_KEY_Tab, view, {0} },
- { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_C, killclient, {0} },
-+ { MODKEY|WLR_MODIFIER_SHIFT, XKB_KEY_Z, addscratchpad, {0} },
-+ { MODKEY|WLR_MODIFIER_CTRL, XKB_KEY_z, togglescratchpad, {0} },
-+ { MODKEY, XKB_KEY_z, removescratchpad, {0} },
- { MODKEY, XKB_KEY_t, setlayout, {.v = &layouts[0]} },
- { MODKEY, XKB_KEY_f, setlayout, {.v = &layouts[1]} },
- { MODKEY, XKB_KEY_m, setlayout, {.v = &layouts[2]} },
diff --git a/dwl.c b/dwl.c
index 72810e0..a662911 100644
--- a/dwl.c
+++ b/dwl.c
@@ -144,7 +144,6 @@ struct Client {
int isfloating, isurgent, isfullscreen;
int isterm, noswallow;
uint32_t resize; /* configure serial of a pending resize */
- struct wl_list link_temp;
pid_t pid;
Client *swallowing; /* client being hidden */
Client *swallowedby;
@@ -262,7 +261,6 @@ typedef struct {
} SessionLock;
/* function declarations */
-static void addscratchpad(const Arg *arg);
static void applybounds(Client *c, struct wlr_box *bbox);
static void applyrules(Client *c);
static void arrange(Monitor *m);
@@ -359,7 +357,6 @@ static void printstatus(void);
static void powermgrsetmode(struct wl_listener *listener, void *data);
static void quit(const Arg *arg);
static void rendermon(struct wl_listener *listener, void *data);
-static void removescratchpad(const Arg *arg);
static void requestdecorationmode(struct wl_listener *listener, void *data);
static void requeststartdrag(struct wl_listener *listener, void *data);
static void requestmonstate(struct wl_listener *listener, void *data);
@@ -389,7 +386,6 @@ static void togglefullscreen(const Arg *arg);
static void togglegaps(const Arg *arg);
static void toggleswallow(const Arg *arg);
static void toggleautoswallow(const Arg *arg);
-static void togglescratchpad(const Arg *arg);
static void toggletag(const Arg *arg);
static void toggleview(const Arg *arg);
static void unlocksession(struct wl_listener *listener, void *data);
@@ -503,9 +499,6 @@ static struct wl_listener new_session_lock = {.notify = locksession};
static struct zdwl_ipc_manager_v2_interface dwl_manager_implementation = {.release = dwl_ipc_manager_release, .get_output = dwl_ipc_manager_get_output};
static struct zdwl_ipc_output_v2_interface dwl_output_implementation = {.release = dwl_ipc_output_release, .set_tags = dwl_ipc_output_set_tags, .set_layout = dwl_ipc_output_set_layout, .set_client_tags = dwl_ipc_output_set_client_tags};
-static struct wl_list scratchpad_clients;
-static int scratchpad_visible = 1;
-
#ifdef XWAYLAND
static void activatex11(struct wl_listener *listener, void *data);
static void associatex11(struct wl_listener *listener, void *data);
@@ -525,8 +518,6 @@ static struct wlr_xwayland *xwayland;
/* attempt to encapsulate suck into one file */
#include "client.h"
-#include "simple_scratchpad.c"
-
/* function implementations */
void
applybounds(Client *c, struct wlr_box *bbox)
@@ -1433,20 +1424,10 @@ void
destroynotify(struct wl_listener *listener, void *data)
{
/* Called when the xdg_toplevel is destroyed. */
- Client *sc, *c = wl_container_of(listener, c, destroy);
+ Client *c = wl_container_of(listener, c, destroy);
wl_list_remove(&c->destroy.link);
wl_list_remove(&c->set_title.link);
wl_list_remove(&c->fullscreen.link);
- /* Check if destroyed client was part of scratchpad_clients
- * and clean it from the list if so. */
- if (c && wl_list_length(&scratchpad_clients) > 0) {
- wl_list_for_each(sc, &scratchpad_clients, link_temp) {
- if (sc == c) {
- wl_list_remove(&c->link_temp);
- break;
- }
- }
- }
#ifdef XWAYLAND
if (c->type != XDGShell) {
wl_list_remove(&c->activate.link);
@@ -2743,21 +2724,11 @@ setcursorshape(struct wl_listener *listener, void *data)
void
setfloating(Client *c, int floating)
{
- Client *sc, *p = client_get_parent(c);
+ Client *p = client_get_parent(c);
c->isfloating = floating;
/* If in floating layout do not change the client's layer */
if (!c->mon || !client_surface(c)->mapped || !c->mon->lt[c->mon->sellt]->arrange)
return;
- /* Check if unfloated client was part of scratchpad_clients
- * and remove it from scratchpad_clients list if so */
- if (!floating && wl_list_length(&scratchpad_clients) > 0) {
- wl_list_for_each(sc, &scratchpad_clients, link_temp) {
- if (sc == c) {
- wl_list_remove(&c->link_temp);
- break;
- }
- }
- }
wlr_scene_node_reparent(&c->scene->node, layers[c->isfullscreen ||
(p && p->isfullscreen) ? LyrFS
: c->isfloating ? LyrFloat : LyrTile]);
@@ -2987,7 +2958,6 @@ setup(void)
*/
wl_list_init(&clients);
wl_list_init(&fstack);
- wl_list_init(&scratchpad_clients);
xdg_shell = wlr_xdg_shell_create(dpy, 6);
wl_signal_add(&xdg_shell->events.new_toplevel, &new_xdg_toplevel);
diff --git a/simple_scratchpad.c b/simple_scratchpad.c
deleted file mode 100644
index 26d6b66..0000000
--- a/simple_scratchpad.c
+++ /dev/null
@@ -1,68 +0,0 @@
-/* ************************************************************************** */
-/* */
-/* ::: :::::::: */
-/* simple_scratchpad.c :+: :+: :+: */
-/* +:+ +:+ +:+ */
-/* By: jmakkone <jmakkone@student.hive.fi> +#+ +:+ +#+ */
-/* +#+#+#+#+#+ +#+ */
-/* Created: 2024/12/19 19:35:02 by jmakkone #+# #+# */
-/* Updated: 2025/01/04 13:35:50 by jmakkone ### ########.fr */
-/* */
-/* ************************************************************************** */
-
-void
-addscratchpad(const Arg *arg)
-{
- Client *cc, *c = focustop(selmon);
-
- if (!c)
- return;
- /* Check if the added client is already a scratchpad client */
- wl_list_for_each(cc, &scratchpad_clients, link_temp) {
- if (cc == c)
- return;
- }
- if (!c->isfloating) {
- setfloating(c, 1);
- }
- wl_list_insert(&scratchpad_clients, &c->link_temp);
-}
-
-void
-togglescratchpad(const Arg *arg)
-{
- Client *c;
- Monitor *m = selmon;
-
- scratchpad_visible = !scratchpad_visible;
- if (scratchpad_visible) {
- wl_list_for_each(c, &scratchpad_clients, link_temp) {
- c->mon = m;
- c->tags = m->tagset[m->seltags];
- arrange(m);
- focusclient(c, 1);
- }
- } else {
- wl_list_for_each(c, &scratchpad_clients, link_temp) {
- c->tags = 0;
- focusclient(focustop(m), 1);
- arrange(m);
- }
- }
-}
-
-void
-removescratchpad(const Arg *arg)
-{
- Client *sc, *c = focustop(selmon);
-
- if (c && wl_list_length(&scratchpad_clients) > 0) {
- /* Check if c is in scratchpad_clients */
- wl_list_for_each(sc, &scratchpad_clients, link_temp) {
- if (sc == c) {
- wl_list_remove(&c->link_temp);
- break;
- }
- }
- }
-}