Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Christian Rauch
xserver
Commits
5f5b9ed1
Commit
5f5b9ed1
authored
Oct 08, 2000
by
Keith Packard
Browse files
kdrive: Add timeout to screen switching to avoid unintentional flipping
parent
fb8b5827
Changes
1
Hide whitespace changes
Inline
Side-by-side
hw/kdrive/src/kinput.c
View file @
5f5b9ed1
...
...
@@ -21,7 +21,7 @@
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $XFree86: xc/programs/Xserver/hw/kdrive/kinput.c,v 1.
8
2000/10/06 05:5
4:09
keithp Exp $ */
/* $XFree86: xc/programs/Xserver/hw/kdrive/kinput.c,v 1.
9
2000/10/06
22:
05:5
3
keithp Exp $ */
#include
"kdrive.h"
#include
"inputstr.h"
...
...
@@ -45,6 +45,8 @@ static int kdBellPitch;
static
int
kdBellDuration
;
static
int
kdLeds
;
static
Bool
kdInputEnabled
;
static
Bool
kdOffScreen
;
static
unsigned
long
kdOffScreenTime
;
static
KdMouseMatrix
kdMouseMatrix
=
{
1
,
0
,
0
,
0
,
1
,
0
...
...
@@ -1371,11 +1373,18 @@ KdCursorOffScreen(ScreenPtr *ppScreen, int *x, int *y)
{
ScreenPtr
pScreen
=
*
ppScreen
;
int
n
;
CARD32
ms
;
if
(
kdDisableZaphod
||
screenInfo
.
numScreens
<=
1
)
return
FALSE
;
if
(
*
x
<
0
||
*
y
<
0
)
{
ms
=
GetTimeInMillis
();
if
(
kdOffScreen
&&
(
int
)
(
ms
-
kdOffScreenTime
)
<
1000
)
return
FALSE
;
kdOffScreen
=
TRUE
;
kdOffScreenTime
=
ms
;
n
=
pScreen
->
myNum
-
1
;
if
(
n
<
0
)
n
=
screenInfo
.
numScreens
-
1
;
...
...
@@ -1389,6 +1398,12 @@ KdCursorOffScreen(ScreenPtr *ppScreen, int *x, int *y)
}
else
if
(
*
x
>=
pScreen
->
width
||
*
y
>=
pScreen
->
height
)
{
ms
=
GetTimeInMillis
();
if
(
kdOffScreen
&&
(
int
)
(
ms
-
kdOffScreenTime
)
<
1000
)
return
FALSE
;
kdOffScreen
=
TRUE
;
kdOffScreenTime
=
ms
;
n
=
pScreen
->
myNum
+
1
;
if
(
n
>=
screenInfo
.
numScreens
)
n
=
0
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment