tMove window urgency handling entirely into x.c - st - [fork] customized build … | |
git clone git://src.adamsgaard.dk/st | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit 626b0ae40c71b6c1e02ece79bf033432647381a6 | |
parent d5275012b45149a2a6e94679609aacca478221ad | |
Author: Devin J. Pohly <[email protected]> | |
Date: Tue, 10 Oct 2017 12:01:18 -0500 | |
Move window urgency handling entirely into x.c | |
This allows us to make xseturgency internal. | |
Signed-off-by: Devin J. Pohly <[email protected]> | |
Diffstat: | |
M config.def.h | 2 +- | |
M st.c | 5 +---- | |
M st.h | 1 + | |
M win.h | 3 +-- | |
M x.c | 8 ++++++-- | |
5 files changed, 10 insertions(+), 9 deletions(-) | |
--- | |
diff --git a/config.def.h b/config.def.h | |
t@@ -60,7 +60,7 @@ unsigned int cursorthickness = 2; | |
* bell volume. It must be a value between -100 and 100. Use 0 for disabling | |
* it | |
*/ | |
-static int bellvolume = 0; | |
+int bellvolume = 0; | |
/* default TERM value */ | |
char termname[] = "st-256color"; | |
diff --git a/st.c b/st.c | |
t@@ -2176,10 +2176,7 @@ tcontrolcode(uchar ascii) | |
/* backwards compatibility to xterm */ | |
strhandle(); | |
} else { | |
- if (!(win.state & WIN_FOCUSED)) | |
- xseturgency(1); | |
- if (bellvolume) | |
- xbell(bellvolume); | |
+ xbell(); | |
} | |
break; | |
case '\033': /* ESC */ | |
diff --git a/st.h b/st.h | |
t@@ -246,6 +246,7 @@ extern int allowaltscreen; | |
extern unsigned int xfps; | |
extern unsigned int actionfps; | |
extern unsigned int cursorthickness; | |
+extern int bellvolume; | |
extern unsigned int blinktimeout; | |
extern char termname[]; | |
extern const char *colorname[]; | |
diff --git a/win.h b/win.h | |
t@@ -8,7 +8,7 @@ | |
void draw(void); | |
void drawregion(int, int, int, int); | |
-void xbell(int); | |
+void xbell(void); | |
void xclipcopy(void); | |
void xclippaste(void); | |
void xhints(void); | |
t@@ -16,7 +16,6 @@ void xloadcols(void); | |
int xsetcolorname(int, const char *); | |
void xsettitle(char *); | |
void xsetpointermotion(int); | |
-void xseturgency(int); | |
void xresize(int, int); | |
void xselpaste(void); | |
void xsetsel(char *, Time); | |
diff --git a/x.c b/x.c | |
t@@ -94,6 +94,7 @@ static void xloadfonts(char *, double); | |
static void xunloadfont(Font *); | |
static void xunloadfonts(void); | |
static void xsetenv(void); | |
+static void xseturgency(int); | |
static void expose(XEvent *); | |
static void visibility(XEvent *); | |
t@@ -1521,9 +1522,12 @@ xseturgency(int add) | |
} | |
void | |
-xbell(int vol) | |
+xbell(void) | |
{ | |
- XkbBell(xw.dpy, xw.win, vol, (Atom)NULL); | |
+ if (!(win.state & WIN_FOCUSED)) | |
+ xseturgency(1); | |
+ if (bellvolume) | |
+ XkbBell(xw.dpy, xw.win, bellvolume, (Atom)NULL); | |
} | |
void |