Browse Source

Move window urgency handling entirely into x.c

This allows us to make xseturgency internal.

Signed-off-by: Devin J. Pohly <djpohly@gmail.com>
master
Devin J. Pohly 7 years ago
parent
commit
626b0ae40c
5 changed files with 10 additions and 9 deletions
  1. +1
    -1
      config.def.h
  2. +1
    -4
      st.c
  3. +1
    -0
      st.h
  4. +1
    -2
      win.h
  5. +6
    -2
      x.c

+ 1
- 1
config.def.h View File

@ -60,7 +60,7 @@ unsigned int cursorthickness = 2;
* bell volume. It must be a value between -100 and 100. Use 0 for disabling * bell volume. It must be a value between -100 and 100. Use 0 for disabling
* it * it
*/ */
static int bellvolume = 0;
int bellvolume = 0;
/* default TERM value */ /* default TERM value */
char termname[] = "st-256color"; char termname[] = "st-256color";


+ 1
- 4
st.c View File

@ -2176,10 +2176,7 @@ tcontrolcode(uchar ascii)
/* backwards compatibility to xterm */ /* backwards compatibility to xterm */
strhandle(); strhandle();
} else { } else {
if (!(win.state & WIN_FOCUSED))
xseturgency(1);
if (bellvolume)
xbell(bellvolume);
xbell();
} }
break; break;
case '\033': /* ESC */ case '\033': /* ESC */


+ 1
- 0
st.h View File

@ -246,6 +246,7 @@ extern int allowaltscreen;
extern unsigned int xfps; extern unsigned int xfps;
extern unsigned int actionfps; extern unsigned int actionfps;
extern unsigned int cursorthickness; extern unsigned int cursorthickness;
extern int bellvolume;
extern unsigned int blinktimeout; extern unsigned int blinktimeout;
extern char termname[]; extern char termname[];
extern const char *colorname[]; extern const char *colorname[];


+ 1
- 2
win.h View File

@ -8,7 +8,7 @@
void draw(void); void draw(void);
void drawregion(int, int, int, int); void drawregion(int, int, int, int);
void xbell(int);
void xbell(void);
void xclipcopy(void); void xclipcopy(void);
void xclippaste(void); void xclippaste(void);
void xhints(void); void xhints(void);
@ -16,7 +16,6 @@ void xloadcols(void);
int xsetcolorname(int, const char *); int xsetcolorname(int, const char *);
void xsettitle(char *); void xsettitle(char *);
void xsetpointermotion(int); void xsetpointermotion(int);
void xseturgency(int);
void xresize(int, int); void xresize(int, int);
void xselpaste(void); void xselpaste(void);
void xsetsel(char *, Time); void xsetsel(char *, Time);


+ 6
- 2
x.c View File

@ -94,6 +94,7 @@ static void xloadfonts(char *, double);
static void xunloadfont(Font *); static void xunloadfont(Font *);
static void xunloadfonts(void); static void xunloadfonts(void);
static void xsetenv(void); static void xsetenv(void);
static void xseturgency(int);
static void expose(XEvent *); static void expose(XEvent *);
static void visibility(XEvent *); static void visibility(XEvent *);
@ -1521,9 +1522,12 @@ xseturgency(int add)
} }
void 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 void


Loading…
Cancel
Save