fix toggle.h stuff

This commit is contained in:
speedie 2022-12-15 21:45:21 +01:00
parent 47e657a52e
commit d6100ede9e
6 changed files with 39 additions and 5 deletions

View file

@ -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

View file

@ -7,6 +7,4 @@
#include "statusbar-powerline.h"
#include "title-basic.h"
#include "title.h"
#if USESYSTRAY
#include "systray.h"
#endif

View file

@ -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;
}

View file

@ -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

View file

@ -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);

View file

@ -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