make OPACITY and TRANSPARENTLIST optional (must be used together), bump version to 1.2.0

This commit is contained in:
Iris Lightshard 2021-11-16 21:25:43 -07:00
parent 30a50ad90e
commit 4d0f0f62da
Signed by: Iris Lightshard
GPG key ID: 3B7FBC22144E6398
4 changed files with 8 additions and 3 deletions

View file

@ -365,6 +365,7 @@ int isterminalwindow(Client* c) {
return 0; return 0;
} }
#if defined(OPACITY) && defined(TRANSPARENTLIST)
int istransparent(Client* c) { int istransparent(Client* c) {
static char* transnames[] = TRANSPARENTLIST; static char* transnames[] = TRANSPARENTLIST;
char** t = transnames; char** t = transnames;
@ -377,6 +378,7 @@ int istransparent(Client* c) {
} }
return 0; return 0;
} }
#endif
void ensureactive() { void ensureactive() {
if (!current) if (!current)

View file

@ -3,7 +3,8 @@
**********************/ **********************/
/*************** /***************
* LOOK & FEEL * [All of these are required options] * LOOK & FEEL * [All of these are required options except OPACITY and
*TRANSPARENTLIST]
**************/ **************/
/* Border colors */ /* Border colors */
@ -38,7 +39,7 @@
#define SMENUBGCOL 0x1F9B92 #define SMENUBGCOL 0x1F9B92
/* You must use a compositor (eg xcompmgr, picom) for the next 2 settings /* You must use a compositor (eg xcompmgr, picom) for the next 2 settings
* to have any effect! * to have any effect, and each setting doesn't work without the other
*/ */
/* From 0 - 255, the opacity of windows marked 'transparent' */ /* From 0 - 255, the opacity of windows marked 'transparent' */

View file

@ -283,6 +283,7 @@ void newwindow(XCreateWindowEvent* e) {
if (c->parent == None) if (c->parent == None)
c->parent = c->screen->root; c->parent = c->screen->root;
} }
#if defined(OPACITY) && defined(TRANSPARENTLIST)
if (istransparent(c)) { if (istransparent(c)) {
/* We need to set the atom on both the window and its parent */ /* We need to set the atom on both the window and its parent */
const Atom alpha_atom = XInternAtom(dpy, "_NET_WM_WINDOW_OPACITY", 0); const Atom alpha_atom = XInternAtom(dpy, "_NET_WM_WINDOW_OPACITY", 0);
@ -306,6 +307,7 @@ void newwindow(XCreateWindowEvent* e) {
(unsigned char*)&opacity, (unsigned char*)&opacity,
1); 1);
} }
#endif
if (kbLaunch) { if (kbLaunch) {
usleep(100000); usleep(100000);

2
main.c
View file

@ -21,7 +21,7 @@
#include "patchlevel.h" #include "patchlevel.h"
char* version[] = { char* version[] = {
"ryudo version 1.1.0\nCopyright (c) 1994-1996 David Hogan,\n(c) 2004 Russ " "ryudo version 1.2.0\nCopyright (c) 1994-1996 David Hogan,\n(c) 2004 Russ "
"Cox,\n(c) 2019-2021 Derek Stevens", "Cox,\n(c) 2019-2021 Derek Stevens",
0}; 0};