config.h, main.c, menu.c: fix SHOWSTICK configuration, add FONTLIST configuration, add AUTOSTICK and bump version to 0.2

This commit is contained in:
Iris Lightshard 2021-02-17 01:28:22 -05:00
parent f144036b01
commit 738217b9cd
Signed by: Iris Lightshard
GPG key ID: 3B7FBC22144E6398
3 changed files with 36 additions and 14 deletions

View file

@ -12,8 +12,8 @@
#define SMENUFGCOL 0x000000
#define SMENUBGCOL 0x1f9b92
// #define SHOWSTICK
// #define VIRTNOTIFY
//#define SHOWSTICK
#define VIRTNOTIFY
#define SHORTCUTMOD Mod4Mask
#define MODBITS (1<<6)
@ -43,3 +43,18 @@
#define LAUNCH_KEY XK_slash
#define AUTOSTICK {\
"XOsview",\
0\
}
#define FONTLIST {\
"*-lucidatypewriter-medium-*-12-*-75-*",\
"lucm.latin1.9",\
"blit",\
"*-lucidatypewriter-bold-*-14-*-75-*",\
"9x15bold",\
"fixed",\
"*",\
0\
}

13
main.c
View file

@ -19,7 +19,7 @@
char *version[] =
{
"ryudo version 0.1, Copyright (c) 1994-1996 David Hogan, (c) 2004 Russ Cox, (c) 2019 Derek Stevens", 0
"ryudo version 0.2\nCopyright (c) 1994-1996 David Hogan,\n(c) 2004 Russ Cox,\n(c) 2019-2021 Derek Stevens", 0
};
Display *dpy;
@ -58,16 +58,7 @@ Atom _rio_hold_mode;
Atom wm_state_fullscreen;
Atom wm_state;
char *fontlist[] = {
"*-lucidatypewriter-medium-*-12-*-75-*",
"lucm.latin1.9",
"blit",
"*-lucidatypewriter-bold-*-14-*-75-*",
"9x15bold",
"fixed",
"*",
0
};
char *fontlist[] = FONTLIST;
void
usage(void)

18
menu.c
View file

@ -16,6 +16,7 @@
#include <X11/Xutil.h>
#include "dat.h"
#include "fns.h"
#include "config.h"
Client *hiddenc[MAXHIDDEN];
@ -395,7 +396,12 @@ button2(int n)
void
switch_to_c(int n, Client *c)
{
if(c == 0)
#ifdef AUTOSTICK
static char *autostick[] = AUTOSTICK;
char **a = autostick;
#endif
if(c == 0)
return;
if(c->next)
@ -404,6 +410,15 @@ switch_to_c(int n, Client *c)
if(c->parent == DefaultRootWindow(dpy))
return;
#ifdef AUTOSTICK
while(*a){
if (strstr(c->class, *a) && c->virt >= 0) {
stick(c);
}
++a;
}
#endif
if(c->virt != virt && c->state == NormalState && c->virt >= 0){
XUnmapWindow(dpy, c->parent);
XUnmapWindow(dpy, c->window);
@ -423,6 +438,7 @@ switch_to_c(int n, Client *c)
setstate(c, NormalState);
if(currents[virt] == c)
active(c);
}
}
}