about summary refs log tree commit diff
diff options
context:
space:
mode:
authorYour Name <you@example.com>2020-10-21 23:57:43 +0100
committerYour Name <you@example.com>2020-10-21 23:57:43 +0100
commit8606560d411fd626523d7b7a6d19085b35c5ab9c (patch)
treed1e183582672307753217e584c8cd5ea8c823314
parentRemoved keyhandling functionality (diff)
downloaddwm-8606560d411fd626523d7b7a6d19085b35c5ab9c.tar.gz
dwm-8606560d411fd626523d7b7a6d19085b35c5ab9c.tar.bz2
dwm-8606560d411fd626523d7b7a6d19085b35c5ab9c.zip
fixed signal func calling bug
-rw-r--r--config.h42
-rw-r--r--dwm.c55
2 files changed, 53 insertions, 44 deletions
diff --git a/config.h b/config.h
index dc270f9..4a7321d 100644
--- a/config.h
+++ b/config.h
@@ -138,48 +138,6 @@ static Button buttons[] = {
 	{ ClkTagBar,            MODKEY,         Button3,        toggletag,      {0} },
 };
 
-void
-setlayoutex(const Arg *arg)
-{
-        setlayout(&((Arg) { .v = &layouts[arg->i] }));
-}
-
-void
-viewex(const Arg *arg)
-{
-        view(&((Arg) { .ui = 1 << (arg->ui - 1)}));
-}
-
-void
-viewall(const Arg *arg)
-{
-        view(&((Arg){.ui = ~0}));
-}
-
-void
-toggleviewex(const Arg *arg)
-{
-        toggleview(&((Arg) { .ui = 1 << (arg->ui - 1)}));
-}
-
-void
-tagex(const Arg *arg)
-{
-        tag(&((Arg) { .ui = 1 << (arg->ui - 1)}));
-}
-
-void
-toggletagex(const Arg *arg)
-{
-        toggletag(&((Arg) { .ui = 1 << (arg->ui - 1)}));
-}
-
-void
-tagall(const Arg *arg)
-{
-        tag(&((Arg){.ui = ~0}));
-}
-
 /* signal definitions */
 /* signum must be greater than 0 */
 /* trigger signals using `xsetroot -name "fsignal:<signame> [<type> <value>]"` */
diff --git a/dwm.c b/dwm.c
index bf4f942..13eb462 100644
--- a/dwm.c
+++ b/dwm.c
@@ -157,6 +157,13 @@ static void arrange(Monitor *m);
 static void arrangemon(Monitor *m);
 static void attach(Client *c);
 static void attachstack(Client *c);
+void setlayoutex(const Arg *arg);
+void viewex(const Arg *arg);
+void viewall(const Arg *arg);
+void toggleviewex(const Arg *arg);
+void tagex(const Arg *arg);
+void toggletagex(const Arg *arg);
+void tagall(const Arg *arg);
 static int fake_signal(void);
 static void buttonpress(XEvent *e);
 static void checkotherwm(void);
@@ -1020,6 +1027,48 @@ keypress(XEvent *e)
 			keys[i].func(&(keys[i].arg));
 }**/
 
+void
+setlayoutex(const Arg *arg)
+{
+        setlayout(&((Arg) { .v = &layouts[arg->i] }));
+}
+
+void
+viewex(const Arg *arg)
+{
+        view(&((Arg) { .ui = 1 << (arg->ui - 1)}));
+}
+
+void
+viewall(const Arg *arg)
+{
+        view(&((Arg){.ui = ~0}));
+}
+
+void
+toggleviewex(const Arg *arg)
+{
+        toggleview(&((Arg) { .ui = 1 << (arg->ui - 1)}));
+}
+
+void
+tagex(const Arg *arg)
+{
+        tag(&((Arg) { .ui = 1 << (arg->ui - 1)}));
+}
+
+void
+toggletagex(const Arg *arg)
+{
+        toggletag(&((Arg) { .ui = 1 << (arg->ui - 1)}));
+}
+
+void
+tagall(const Arg *arg)
+{
+        tag(&((Arg){.ui = ~0}));
+}
+
 int
 fake_signal(void)
 {
@@ -1052,8 +1101,10 @@ fake_signal(void)
                         // Check if a signal was found, and if so handle it
                         for (i = 0; i < LENGTH(signals); i++)
                                 if (strncmp(str_sig, signals[i].sig, len_str_sig) == 0 && signals[i].func)
-                                        signals[i].func(&(arg));
-
+                                {
+                                    signals[i].func(&(arg));
+                                    return 1;
+                                }
                         // A fake signal was sent
                         return 1;
                 }