aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDevin J. Pohly <djpohly@gmail.com>2017-10-10 12:01:18 -0500
committerDevin J. Pohly <djpohly@gmail.com>2018-02-25 21:53:24 -0600
commit626b0ae40c71b6c1e02ece79bf033432647381a6 (patch)
tree0c1e10fe2b7561a1df079f2184c052e5ccb993c3
parentd5275012b45149a2a6e94679609aacca478221ad (diff)
downloadst-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.h2
-rw-r--r--st.c5
-rw-r--r--st.h1
-rw-r--r--win.h3
-rw-r--r--x.c8
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 */
63static int bellvolume = 0; 63int bellvolume = 0;
64 64
65/* default TERM value */ 65/* default TERM value */
66char termname[] = "st-256color"; 66char termname[] = "st-256color";
diff --git a/st.c b/st.c
index f1f7bc1..df43fac 100644
--- a/st.c
+++ b/st.c
@@ -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 */
diff --git a/st.h b/st.h
index 9ece72f..ad94351 100644
--- a/st.h
+++ b/st.h
@@ -246,6 +246,7 @@ extern int allowaltscreen;
246extern unsigned int xfps; 246extern unsigned int xfps;
247extern unsigned int actionfps; 247extern unsigned int actionfps;
248extern unsigned int cursorthickness; 248extern unsigned int cursorthickness;
249extern int bellvolume;
249extern unsigned int blinktimeout; 250extern unsigned int blinktimeout;
250extern char termname[]; 251extern char termname[];
251extern const char *colorname[]; 252extern const char *colorname[];
diff --git a/win.h b/win.h
index ea45e60..dee0b7f 100644
--- a/win.h
+++ b/win.h
@@ -8,7 +8,7 @@
8void draw(void); 8void draw(void);
9void drawregion(int, int, int, int); 9void drawregion(int, int, int, int);
10 10
11void xbell(int); 11void xbell(void);
12void xclipcopy(void); 12void xclipcopy(void);
13void xclippaste(void); 13void xclippaste(void);
14void xhints(void); 14void xhints(void);
@@ -16,7 +16,6 @@ void xloadcols(void);
16int xsetcolorname(int, const char *); 16int xsetcolorname(int, const char *);
17void xsettitle(char *); 17void xsettitle(char *);
18void xsetpointermotion(int); 18void xsetpointermotion(int);
19void xseturgency(int);
20void xresize(int, int); 19void xresize(int, int);
21void xselpaste(void); 20void xselpaste(void);
22void xsetsel(char *, Time); 21void xsetsel(char *, Time);
diff --git a/x.c b/x.c
index 426ca28..5b3c97b 100644
--- a/x.c
+++ b/x.c
@@ -94,6 +94,7 @@ static void xloadfonts(char *, double);
94static void xunloadfont(Font *); 94static void xunloadfont(Font *);
95static void xunloadfonts(void); 95static void xunloadfonts(void);
96static void xsetenv(void); 96static void xsetenv(void);
97static void xseturgency(int);
97 98
98static void expose(XEvent *); 99static void expose(XEvent *);
99static void visibility(XEvent *); 100static void visibility(XEvent *);
@@ -1521,9 +1522,12 @@ xseturgency(int add)
1521} 1522}
1522 1523
1523void 1524void
1524xbell(int vol) 1525xbell(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
1529void 1533void