mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-22 12:31:10 +00:00
[x11] Warp the mouse when it touches a barrier
It seems that the mouse escaping the barriers requires some combination of hitting two at once, and holding your mouth just right (something about sliding the mouse up and down one barrier near the other). However, sending the mouse back to the center of the screen when it touches a barrier makes such sliding impossible. This seems to fix #38
This commit is contained in:
parent
203e490be0
commit
cb45fe7034
1 changed files with 36 additions and 29 deletions
|
@ -688,32 +688,6 @@ in_x11_send_focus_event (int gain)
|
|||
IE_Send_Event (&event);
|
||||
}
|
||||
|
||||
static void
|
||||
event_focusout (XEvent *event)
|
||||
{
|
||||
if (x_have_focus) {
|
||||
x_have_focus = false;
|
||||
in_x11_send_focus_event (0);
|
||||
if (in_snd_block) {
|
||||
S_BlockSound ();
|
||||
CDAudio_Pause ();
|
||||
}
|
||||
X11_RestoreGamma ();
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
event_focusin (XEvent *event)
|
||||
{
|
||||
in_x11_send_focus_event (1);
|
||||
x_have_focus = true;
|
||||
if (in_snd_block) {
|
||||
S_UnblockSound ();
|
||||
CDAudio_Resume ();
|
||||
}
|
||||
VID_UpdateGamma ();
|
||||
}
|
||||
|
||||
static void
|
||||
center_pointer (void)
|
||||
{
|
||||
|
@ -1044,9 +1018,7 @@ xi_barrier_hit (void *event)
|
|||
return;
|
||||
}
|
||||
|
||||
if (!x11_have_pointer || !input_grabbed) {
|
||||
XIBarrierReleasePointer (x_disp, be.deviceid, be.barrier, be.eventid);
|
||||
}
|
||||
center_pointer ();
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -1157,6 +1129,41 @@ in_x11_setup_barriers (int xpos, int ypos, int xlen, int ylen)
|
|||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
event_focusout (XEvent *event)
|
||||
{
|
||||
if (x_have_focus) {
|
||||
x_have_focus = false;
|
||||
#ifdef HAVE_XFIXES
|
||||
in_x11_remove_barriers ();
|
||||
#endif
|
||||
in_x11_send_focus_event (0);
|
||||
if (in_snd_block) {
|
||||
S_BlockSound ();
|
||||
CDAudio_Pause ();
|
||||
}
|
||||
X11_RestoreGamma ();
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
event_focusin (XEvent *event)
|
||||
{
|
||||
in_x11_send_focus_event (1);
|
||||
x_have_focus = true;
|
||||
if (in_snd_block) {
|
||||
S_UnblockSound ();
|
||||
CDAudio_Resume ();
|
||||
}
|
||||
if (input_grabbed) {
|
||||
#ifdef HAVE_XFIXES
|
||||
in_x11_setup_barriers (x11_aw.xpos, x11_aw.ypos,
|
||||
x11_aw.xlen, x11_aw.ylen);
|
||||
#endif
|
||||
}
|
||||
VID_UpdateGamma ();
|
||||
}
|
||||
|
||||
static void
|
||||
in_x11_grab_input (void *data, int grab)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue