From d6100ede9ef75a7790c98f3ba6035a495604f994 Mon Sep 17 00:00:00 2001 From: speedie Date: Thu, 15 Dec 2022 21:45:21 +0100 Subject: [PATCH] fix toggle.h stuff --- bar/items.c | 2 -- bar/items.h | 2 -- bar/statusbar.c | 2 ++ bar/systray.c | 20 ++++++++++++++++++++ bar/systray.h | 7 +++++++ speedwm.c | 11 ++++++++++- 6 files changed, 39 insertions(+), 5 deletions(-) diff --git a/bar/items.c b/bar/items.c index 51295cf..9e7e4ea 100644 --- a/bar/items.c +++ b/bar/items.c @@ -8,6 +8,4 @@ #include "statusbar-powerline.c" /* Include powerline status bar */ #include "title-basic.c" /* Include basic title */ #include "title.c" /* Include title */ -#if USESYSTRAY #include "systray.c" /* Include systray */ -#endif diff --git a/bar/items.h b/bar/items.h index 5150dba..03a62aa 100644 --- a/bar/items.h +++ b/bar/items.h @@ -7,6 +7,4 @@ #include "statusbar-powerline.h" #include "title-basic.h" #include "title.h" -#if USESYSTRAY #include "systray.h" -#endif diff --git a/bar/statusbar.c b/bar/statusbar.c index abd172f..f83ff8f 100644 --- a/bar/statusbar.c +++ b/bar/statusbar.c @@ -176,6 +176,7 @@ click_status(Bar *bar, Arg *arg, BarClickArg *a) int click_status_text(Arg *arg, int rel_x, char *text) { + #if USEMOUSE int i = -1; int x = 0; char ch; @@ -194,6 +195,7 @@ click_status_text(Arg *arg, int rel_x, char *text) clickstatusn = ch; } } + #endif return ClkStatusText; } diff --git a/bar/systray.c b/bar/systray.c index 599da91..288094b 100644 --- a/bar/systray.c +++ b/bar/systray.c @@ -1,3 +1,4 @@ +#if USESYSTRAY static Systray *systray = NULL; static unsigned long systrayorientation = _NET_SYSTEM_TRAY_ORIENTATION_HORZ; @@ -181,3 +182,22 @@ wintosystrayicon(Window w) for (i = systray->icons; i && i->win != w; i = i->next); return i; } +#else +int +width_systray(Bar *bar, BarWidthArg *a) +{ + return 1; +} + +int +draw_systray(Bar *bar, BarDrawArg *a) +{ + return 0; +} + +int +click_systray(Bar *bar, Arg *arg, BarClickArg *a) +{ + return 1; +} +#endif diff --git a/bar/systray.h b/bar/systray.h index 27edc8e..e5411c8 100644 --- a/bar/systray.h +++ b/bar/systray.h @@ -1,3 +1,4 @@ +#if USESYSTRAY #define SYSTEM_TRAY_REQUEST_DOCK 0 #define _NET_SYSTEM_TRAY_ORIENTATION_HORZ 0 @@ -37,3 +38,9 @@ static void resizerequest(XEvent *e); static void updatesystrayicongeom(Client *i, int w, int h); static void updatesystrayiconstate(Client *i, XPropertyEvent *ev); static Client *wintosystrayicon(Window w); +#endif + +/* bar integration */ +static int width_systray(Bar *bar, BarWidthArg *a); +static int draw_systray(Bar *bar, BarDrawArg *a); +static int click_systray(Bar *bar, Arg *arg, BarClickArg *a); diff --git a/speedwm.c b/speedwm.c index 2db870d..5958685 100644 --- a/speedwm.c +++ b/speedwm.c @@ -4357,11 +4357,14 @@ propertynotify(XEvent *e) if (c == c->mon->sel && !selmon->hidetitle) drawbaritems(c->mon); } + #if USEWINICON else if (ev->atom == netatom[NetWMIcon]) { updateicon(c); if (c == c->mon->sel) drawbaritems(c->mon); - } if (ev->atom == netatom[NetWMWindowType]) + } + #endif + if (ev->atom == netatom[NetWMWindowType]) updatewindowtype(c); if (ev->atom == motifatom) updatemotifhints(c); @@ -5159,6 +5162,12 @@ toggleopacity(const Arg *arg) { for (Client* c = m->clients; c; c = c->next) opacity(c, (fadewindows && c != selmon->sel) ? inactiveopacity : activeopacity); } +#else +void +toggleopacity(const Arg *arg) +{ + return; +} #endif void