Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
8d361bd4
Commit
8d361bd4
authored
Mar 23, 2003
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Properly initialize keyboard auto-repeat for all X connections.
parent
4fd679b0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
17 deletions
+25
-17
keyboard.c
dlls/x11drv/keyboard.c
+2
-17
x11drv_main.c
dlls/x11drv/x11drv_main.c
+22
-0
x11drv.h
include/x11drv.h
+1
-0
No files found.
dlls/x11drv/keyboard.c
View file @
8d361bd4
...
...
@@ -58,9 +58,6 @@ WORD keyc2vkey[256], keyc2scan[256];
static
LPBYTE
pKeyStateTable
;
static
int
NumLockMask
,
AltGrMask
;
/* mask in the XKeyEvent state */
static
int
kcControl
,
kcAlt
,
kcShift
,
kcNumLock
,
kcCapsLock
;
/* keycodes */
#ifdef HAVE_XKB
static
int
is_xkb
,
xkb_opcode
,
xkb_event
,
xkb_error
;
#endif
static
char
KEYBOARD_MapDeadKeysym
(
KeySym
keysym
);
...
...
@@ -1124,7 +1121,7 @@ X11DRV_KEYBOARD_DetectLayout (void)
if
((
keysym
<
0x8000
)
&&
(
keysym
!=
' '
))
{
#ifdef HAVE_XKB
if
(
!
is
_xkb
||
!
XkbTranslateKeySym
(
display
,
&
keysym
,
0
,
&
ckey
[
i
],
1
,
NULL
))
if
(
!
use
_xkb
||
!
XkbTranslateKeySym
(
display
,
&
keysym
,
0
,
&
ckey
[
i
],
1
,
NULL
))
#endif
{
TRACE
(
"XKB could not translate keysym %ld
\n
"
,
keysym
);
...
...
@@ -1200,9 +1197,6 @@ X11DRV_KEYBOARD_DetectLayout (void)
*/
void
X11DRV_InitKeyboard
(
BYTE
*
key_state_table
)
{
#ifdef HAVE_XKB
int
xkb_major
=
XkbMajorVersion
,
xkb_minor
=
XkbMinorVersion
;
#endif
Display
*
display
=
thread_display
();
KeySym
*
ksp
;
XModifierKeymap
*
mmp
;
...
...
@@ -1217,15 +1211,6 @@ void X11DRV_InitKeyboard( BYTE *key_state_table )
pKeyStateTable
=
key_state_table
;
wine_tsx11_lock
();
#ifdef HAVE_XKB
is_xkb
=
XkbQueryExtension
(
display
,
&
xkb_opcode
,
&
xkb_event
,
&
xkb_error
,
&
xkb_major
,
&
xkb_minor
);
if
(
is_xkb
)
{
/* we have XKB, approximate Windows behaviour */
XkbSetDetectableAutoRepeat
(
display
,
True
,
NULL
);
}
#endif
XDisplayKeycodes
(
display
,
&
min_keycode
,
&
max_keycode
);
ksp
=
XGetKeyboardMapping
(
display
,
min_keycode
,
max_keycode
+
1
-
min_keycode
,
&
keysyms_per_keycode
);
...
...
@@ -1291,7 +1276,7 @@ void X11DRV_InitKeyboard( BYTE *key_state_table )
if
((
keysym
<
0x8000
)
&&
(
keysym
!=
' '
))
{
#ifdef HAVE_XKB
if
(
!
is
_xkb
||
!
XkbTranslateKeySym
(
display
,
&
keysym
,
0
,
&
ckey
[
i
],
1
,
NULL
))
if
(
!
use
_xkb
||
!
XkbTranslateKeySym
(
display
,
&
keysym
,
0
,
&
ckey
[
i
],
1
,
NULL
))
#endif
{
/* FIXME: query what keysym is used as Mode_switch, fill XKeyEvent
...
...
dlls/x11drv/x11drv_main.c
View file @
8d361bd4
...
...
@@ -33,6 +33,9 @@
#endif
#include <X11/cursorfont.h>
#include "ts_xlib.h"
#ifdef HAVE_XKB
#include <X11/XKBlib.h>
#endif
#include "winbase.h"
#include "wine/winbase16.h"
...
...
@@ -59,6 +62,7 @@ unsigned int screen_depth;
Window
root_window
;
DWORD
desktop_tid
=
0
;
int
dxgrab
,
usedga
,
usexvidmode
;
int
use_xkb
=
1
;
int
use_take_focus
=
1
;
int
managed_mode
=
1
;
int
client_side_with_core
=
1
;
...
...
@@ -318,6 +322,20 @@ static void process_attach(void)
}
else
screen_depth
=
DefaultDepthOfScreen
(
screen
);
/* check for Xkb extension */
#ifdef HAVE_XKB
if
(
use_xkb
)
{
int
xkb_opcode
,
xkb_event
,
xkb_error
;
int
xkb_major
=
XkbMajorVersion
,
xkb_minor
=
XkbMinorVersion
;
use_xkb
=
XkbQueryExtension
(
display
,
&
xkb_opcode
,
&
xkb_event
,
&
xkb_error
,
&
xkb_major
,
&
xkb_minor
);
if
(
use_xkb
)
/* we have XKB, approximate Windows behaviour */
XkbSetDetectableAutoRepeat
(
display
,
True
,
NULL
);
}
#endif
/* Initialize OpenGL */
X11DRV_OpenGL_Init
(
display
);
...
...
@@ -427,6 +445,10 @@ struct x11drv_thread_data *x11drv_init_thread_data(void)
if
(
!
(
data
->
xim
=
XOpenIM
(
data
->
display
,
NULL
,
NULL
,
NULL
)))
WARN
(
"Can't open input method
\n
"
);
#ifdef HAVE_XKB
if
(
use_xkb
)
XkbSetDetectableAutoRepeat
(
data
->
display
,
True
,
NULL
);
#endif
if
(
synchronous
)
XSynchronize
(
data
->
display
,
True
);
wine_tsx11_unlock
();
if
(
wine_server_fd_to_handle
(
ConnectionNumber
(
data
->
display
),
GENERIC_READ
|
SYNCHRONIZE
,
...
...
include/x11drv.h
View file @
8d361bd4
...
...
@@ -358,6 +358,7 @@ extern unsigned int screen_width;
extern
unsigned
int
screen_height
;
extern
unsigned
int
screen_depth
;
extern
unsigned
int
text_caps
;
extern
int
use_xkb
;
extern
int
use_take_focus
;
extern
int
managed_mode
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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