mirror of
https://git.code.sf.net/p/quake/newtree
synced 2024-11-24 21:12:27 +00:00
I decided to apply Bruce's sound/focus patch as is after all.
This commit is contained in:
parent
6c04ad09f8
commit
0fbfd46be0
1 changed files with 11 additions and 0 deletions
|
@ -67,6 +67,7 @@
|
||||||
#include "joystick.h"
|
#include "joystick.h"
|
||||||
#include "keys.h"
|
#include "keys.h"
|
||||||
#include "qargs.h"
|
#include "qargs.h"
|
||||||
|
#include "sound.h"
|
||||||
#include "sys.h"
|
#include "sys.h"
|
||||||
#include "view.h"
|
#include "view.h"
|
||||||
|
|
||||||
|
@ -86,6 +87,8 @@ static float mouse_x, mouse_y;
|
||||||
static float old_mouse_x, old_mouse_y;
|
static float old_mouse_x, old_mouse_y;
|
||||||
static int p_mouse_x, p_mouse_y;
|
static int p_mouse_x, p_mouse_y;
|
||||||
|
|
||||||
|
static float save_volume = -1, save_bgmvolume = -1;
|
||||||
|
|
||||||
#define KEY_MASK (KeyPressMask | KeyReleaseMask)
|
#define KEY_MASK (KeyPressMask | KeyReleaseMask)
|
||||||
#define MOUSE_MASK (ButtonPressMask | ButtonReleaseMask | PointerMotionMask)
|
#define MOUSE_MASK (ButtonPressMask | ButtonReleaseMask | PointerMotionMask)
|
||||||
#define FOCUS_MASK (FocusChangeMask)
|
#define FOCUS_MASK (FocusChangeMask)
|
||||||
|
@ -348,12 +351,20 @@ static void
|
||||||
event_focusout (XEvent * event)
|
event_focusout (XEvent * event)
|
||||||
{
|
{
|
||||||
XAutoRepeatOn (x_disp);
|
XAutoRepeatOn (x_disp);
|
||||||
|
save_volume = volume->value;
|
||||||
|
save_bgmvolume = bgmvolume->value;
|
||||||
|
volume->value = 0;
|
||||||
|
bgmvolume->value = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
event_focusin (XEvent * event)
|
event_focusin (XEvent * event)
|
||||||
{
|
{
|
||||||
XAutoRepeatOff (x_disp);
|
XAutoRepeatOff (x_disp);
|
||||||
|
if (save_volume != -1)
|
||||||
|
volume->value = save_volume;
|
||||||
|
if (save_bgmvolume != -1)
|
||||||
|
bgmvolume->value = save_bgmvolume;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in a new issue