GSOD: Only react to shown buttons
This commit is contained in:
parent
84616e4617
commit
fc567497a9
11
src/alert.c
11
src/alert.c
|
@ -183,7 +183,6 @@ ShowAlert(const char *title,
|
||||||
Colormap cmap;
|
Colormap cmap;
|
||||||
int cnum, fh, x, y, ww, hh, bw, bh;
|
int cnum, fh, x, y, ww, hh, bw, bh;
|
||||||
char *str1, *str2, *str3, *p;
|
char *str1, *str2, *str3, *p;
|
||||||
KeyCode keycode;
|
|
||||||
int button;
|
int button;
|
||||||
char **missing_charset_list_return, *def_string_return;
|
char **missing_charset_list_return, *def_string_return;
|
||||||
int missing_charset_count_return;
|
int missing_charset_count_return;
|
||||||
|
@ -387,11 +386,11 @@ ShowAlert(const char *title,
|
||||||
for (; button == 0;)
|
for (; button == 0;)
|
||||||
{
|
{
|
||||||
XNextEvent(dd, &ev);
|
XNextEvent(dd, &ev);
|
||||||
|
|
||||||
switch (ev.type)
|
switch (ev.type)
|
||||||
{
|
{
|
||||||
case KeyPress:
|
case KeyPress:
|
||||||
keycode = XKeysymToKeycode(dd, XK_F1);
|
if (str1 && ev.xkey.keycode == XKeysymToKeycode(dd, XK_F1))
|
||||||
if (keycode == ev.xkey.keycode)
|
|
||||||
{
|
{
|
||||||
DRAW_BOX_IN(dd, gc, b1, 0, 0, bw, bh);
|
DRAW_BOX_IN(dd, gc, b1, 0, 0, bw, bh);
|
||||||
XSync(dd, False);
|
XSync(dd, False);
|
||||||
|
@ -400,8 +399,7 @@ ShowAlert(const char *title,
|
||||||
button = 1;
|
button = 1;
|
||||||
goto do_sync;
|
goto do_sync;
|
||||||
}
|
}
|
||||||
keycode = XKeysymToKeycode(dd, XK_F2);
|
if (str2 && ev.xkey.keycode == XKeysymToKeycode(dd, XK_F2))
|
||||||
if (keycode == ev.xkey.keycode)
|
|
||||||
{
|
{
|
||||||
DRAW_BOX_IN(dd, gc, b2, 0, 0, bw, bh);
|
DRAW_BOX_IN(dd, gc, b2, 0, 0, bw, bh);
|
||||||
XSync(dd, False);
|
XSync(dd, False);
|
||||||
|
@ -410,8 +408,7 @@ ShowAlert(const char *title,
|
||||||
button = 2;
|
button = 2;
|
||||||
goto do_sync;
|
goto do_sync;
|
||||||
}
|
}
|
||||||
keycode = XKeysymToKeycode(dd, XK_F3);
|
if (str3 && ev.xkey.keycode == XKeysymToKeycode(dd, XK_F3))
|
||||||
if (keycode == ev.xkey.keycode)
|
|
||||||
{
|
{
|
||||||
DRAW_BOX_IN(dd, gc, b3, 0, 0, bw, bh);
|
DRAW_BOX_IN(dd, gc, b3, 0, 0, bw, bh);
|
||||||
XSync(dd, False);
|
XSync(dd, False);
|
||||||
|
|
Loading…
Reference in New Issue