diff options
author | Devin J. Pohly <djpohly@gmail.com> | 2017-10-10 12:01:18 -0500 |
---|---|---|
committer | Devin J. Pohly <djpohly@gmail.com> | 2018-02-25 21:53:24 -0600 |
commit | 626b0ae40c71b6c1e02ece79bf033432647381a6 (patch) | |
tree | 0c1e10fe2b7561a1df079f2184c052e5ccb993c3 | |
parent | d5275012b45149a2a6e94679609aacca478221ad (diff) | |
download | st-patched-626b0ae40c71b6c1e02ece79bf033432647381a6.tar.bz2 st-patched-626b0ae40c71b6c1e02ece79bf033432647381a6.tar.xz st-patched-626b0ae40c71b6c1e02ece79bf033432647381a6.zip |
Move window urgency handling entirely into x.c
This allows us to make xseturgency internal.
Signed-off-by: Devin J. Pohly <djpohly@gmail.com>
-rw-r--r-- | config.def.h | 2 | ||||
-rw-r--r-- | st.c | 5 | ||||
-rw-r--r-- | st.h | 1 | ||||
-rw-r--r-- | win.h | 3 | ||||
-rw-r--r-- | x.c | 8 |
5 files changed, 10 insertions, 9 deletions
diff --git a/config.def.h b/config.def.h index 877afab..dd94be2 100644 --- a/config.def.h +++ b/config.def.h | |||
@@ -60,7 +60,7 @@ unsigned int cursorthickness = 2; | |||
60 | * bell volume. It must be a value between -100 and 100. Use 0 for disabling | 60 | * bell volume. It must be a value between -100 and 100. Use 0 for disabling |
61 | * it | 61 | * it |
62 | */ | 62 | */ |
63 | static int bellvolume = 0; | 63 | int bellvolume = 0; |
64 | 64 | ||
65 | /* default TERM value */ | 65 | /* default TERM value */ |
66 | char termname[] = "st-256color"; | 66 | char termname[] = "st-256color"; |
@@ -2176,10 +2176,7 @@ tcontrolcode(uchar ascii) | |||
2176 | /* backwards compatibility to xterm */ | 2176 | /* backwards compatibility to xterm */ |
2177 | strhandle(); | 2177 | strhandle(); |
2178 | } else { | 2178 | } else { |
2179 | if (!(win.state & WIN_FOCUSED)) | 2179 | xbell(); |
2180 | xseturgency(1); | ||
2181 | if (bellvolume) | ||
2182 | xbell(bellvolume); | ||
2183 | } | 2180 | } |
2184 | break; | 2181 | break; |
2185 | case '\033': /* ESC */ | 2182 | case '\033': /* ESC */ |
@@ -246,6 +246,7 @@ extern int allowaltscreen; | |||
246 | extern unsigned int xfps; | 246 | extern unsigned int xfps; |
247 | extern unsigned int actionfps; | 247 | extern unsigned int actionfps; |
248 | extern unsigned int cursorthickness; | 248 | extern unsigned int cursorthickness; |
249 | extern int bellvolume; | ||
249 | extern unsigned int blinktimeout; | 250 | extern unsigned int blinktimeout; |
250 | extern char termname[]; | 251 | extern char termname[]; |
251 | extern const char *colorname[]; | 252 | extern const char *colorname[]; |
@@ -8,7 +8,7 @@ | |||
8 | void draw(void); | 8 | void draw(void); |
9 | void drawregion(int, int, int, int); | 9 | void drawregion(int, int, int, int); |
10 | 10 | ||
11 | void xbell(int); | 11 | void xbell(void); |
12 | void xclipcopy(void); | 12 | void xclipcopy(void); |
13 | void xclippaste(void); | 13 | void xclippaste(void); |
14 | void xhints(void); | 14 | void xhints(void); |
@@ -16,7 +16,6 @@ void xloadcols(void); | |||
16 | int xsetcolorname(int, const char *); | 16 | int xsetcolorname(int, const char *); |
17 | void xsettitle(char *); | 17 | void xsettitle(char *); |
18 | void xsetpointermotion(int); | 18 | void xsetpointermotion(int); |
19 | void xseturgency(int); | ||
20 | void xresize(int, int); | 19 | void xresize(int, int); |
21 | void xselpaste(void); | 20 | void xselpaste(void); |
22 | void xsetsel(char *, Time); | 21 | void xsetsel(char *, Time); |
@@ -94,6 +94,7 @@ static void xloadfonts(char *, double); | |||
94 | static void xunloadfont(Font *); | 94 | static void xunloadfont(Font *); |
95 | static void xunloadfonts(void); | 95 | static void xunloadfonts(void); |
96 | static void xsetenv(void); | 96 | static void xsetenv(void); |
97 | static void xseturgency(int); | ||
97 | 98 | ||
98 | static void expose(XEvent *); | 99 | static void expose(XEvent *); |
99 | static void visibility(XEvent *); | 100 | static void visibility(XEvent *); |
@@ -1521,9 +1522,12 @@ xseturgency(int add) | |||
1521 | } | 1522 | } |
1522 | 1523 | ||
1523 | void | 1524 | void |
1524 | xbell(int vol) | 1525 | xbell(void) |
1525 | { | 1526 | { |
1526 | XkbBell(xw.dpy, xw.win, vol, (Atom)NULL); | 1527 | if (!(win.state & WIN_FOCUSED)) |
1528 | xseturgency(1); | ||
1529 | if (bellvolume) | ||
1530 | XkbBell(xw.dpy, xw.win, bellvolume, (Atom)NULL); | ||
1527 | } | 1531 | } |
1528 | 1532 | ||
1529 | void | 1533 | void |