Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
da9fc418
Commit
da9fc418
authored
May 05, 2021
by
Rémi Bernon
Committed by
Alexandre Julliard
May 05, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Factor ActivateKeyboardLayout previous layout logic.
Signed-off-by:
Rémi Bernon
<
rbernon@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
db901b91
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
24 deletions
+20
-24
driver.c
dlls/user32/driver.c
+3
-3
input.c
dlls/user32/input.c
+7
-6
user_private.h
dlls/user32/user_private.h
+1
-1
keyboard.c
dlls/winemac.drv/keyboard.c
+5
-5
keyboard.c
dlls/winex11.drv/keyboard.c
+4
-9
No files found.
dlls/user32/driver.c
View file @
da9fc418
...
...
@@ -187,9 +187,9 @@ void USER_unload_driver(void)
* These are fallbacks for entry points that are not implemented in the real driver.
*/
static
HK
L
CDECL
nulldrv_ActivateKeyboardLayout
(
HKL
layout
,
UINT
flags
)
static
BOO
L
CDECL
nulldrv_ActivateKeyboardLayout
(
HKL
layout
,
UINT
flags
)
{
return
(
HKL
)
~
0
;
/* use default implementation */
return
TRUE
;
}
static
void
CDECL
nulldrv_Beep
(
void
)
...
...
@@ -487,7 +487,7 @@ static USER_DRIVER null_driver =
* Each entry point simply loads the real driver and chains to it.
*/
static
HK
L
CDECL
loaderdrv_ActivateKeyboardLayout
(
HKL
layout
,
UINT
flags
)
static
BOO
L
CDECL
loaderdrv_ActivateKeyboardLayout
(
HKL
layout
,
UINT
flags
)
{
return
load_driver
()
->
pActivateKeyboardLayout
(
layout
,
flags
);
}
...
...
dlls/user32/input.c
View file @
da9fc418
...
...
@@ -1330,13 +1330,14 @@ HKL WINAPI ActivateKeyboardLayout( HKL layout, UINT flags )
return
0
;
}
if
((
old_layout
=
USER_Driver
->
pActivateKeyboardLayout
(
layout
,
flags
))
!=
(
HKL
)
~
0
)
{
if
(
old_layout
)
info
->
kbd_layout
=
layout
;
return
old_layout
;
}
if
(
!
USER_Driver
->
pActivateKeyboardLayout
(
layout
,
flags
))
return
0
;
return
get_locale_kbd_layout
();
old_layout
=
info
->
kbd_layout
;
info
->
kbd_layout
=
layout
;
if
(
!
old_layout
)
return
get_locale_kbd_layout
();
return
old_layout
;
}
/**********************************************************************
...
...
dlls/user32/user_private.h
View file @
da9fc418
...
...
@@ -62,7 +62,7 @@ enum wine_internal_message
typedef
struct
tagUSER_DRIVER
{
/* keyboard functions */
HKL
(
CDECL
*
pActivateKeyboardLayout
)(
HKL
,
UINT
);
BOOL
(
CDECL
*
pActivateKeyboardLayout
)(
HKL
,
UINT
);
void
(
CDECL
*
pBeep
)(
void
);
INT
(
CDECL
*
pGetKeyNameText
)(
LONG
,
LPWSTR
,
INT
);
HKL
(
CDECL
*
pGetKeyboardLayout
)(
DWORD
);
...
...
dlls/winemac.drv/keyboard.c
View file @
da9fc418
...
...
@@ -1163,16 +1163,16 @@ void macdrv_process_text_input(UINT vkey, UINT scan, UINT repeat, const BYTE *ke
/***********************************************************************
* ActivateKeyboardLayout (MACDRV.@)
*/
HK
L
CDECL
macdrv_ActivateKeyboardLayout
(
HKL
hkl
,
UINT
flags
)
BOO
L
CDECL
macdrv_ActivateKeyboardLayout
(
HKL
hkl
,
UINT
flags
)
{
HKL
oldHkl
=
0
;
BOOL
ret
=
FALSE
;
struct
macdrv_thread_data
*
thread_data
=
macdrv_init_thread_data
();
struct
layout
*
layout
;
TRACE
(
"hkl %p flags %04x
\n
"
,
hkl
,
flags
);
if
(
hkl
==
thread_data
->
active_keyboard_layout
)
return
hkl
;
return
TRUE
;
EnterCriticalSection
(
&
layout_list_section
);
update_layout_list
();
...
...
@@ -1183,7 +1183,7 @@ HKL CDECL macdrv_ActivateKeyboardLayout(HKL hkl, UINT flags)
{
if
(
macdrv_select_input_source
(
layout
->
input_source
))
{
oldHkl
=
thread_data
->
active_keyboard_layout
;
ret
=
TRUE
;
if
(
thread_data
->
keyboard_layout_uchr
)
CFRelease
(
thread_data
->
keyboard_layout_uchr
);
...
...
@@ -1199,7 +1199,7 @@ HKL CDECL macdrv_ActivateKeyboardLayout(HKL hkl, UINT flags)
}
LeaveCriticalSection
(
&
layout_list_section
);
return
oldHkl
;
return
ret
;
}
...
...
dlls/winex11.drv/keyboard.c
View file @
da9fc418
...
...
@@ -1930,9 +1930,8 @@ BOOL CDECL X11DRV_UnloadKeyboardLayout(HKL hkl)
/***********************************************************************
* ActivateKeyboardLayout (X11DRV.@)
*/
HK
L
CDECL
X11DRV_ActivateKeyboardLayout
(
HKL
hkl
,
UINT
flags
)
BOO
L
CDECL
X11DRV_ActivateKeyboardLayout
(
HKL
hkl
,
UINT
flags
)
{
HKL
oldHkl
=
0
;
struct
x11drv_thread_data
*
thread_data
=
x11drv_init_thread_data
();
FIXME
(
"%p, %04x: semi-stub!
\n
"
,
hkl
,
flags
);
...
...
@@ -1940,22 +1939,18 @@ HKL CDECL X11DRV_ActivateKeyboardLayout(HKL hkl, UINT flags)
{
SetLastError
(
ERROR_CALL_NOT_IMPLEMENTED
);
FIXME
(
"KLF_SETFORPROCESS not supported
\n
"
);
return
0
;
return
FALSE
;
}
if
(
!
match_x11_keyboard_layout
(
hkl
))
{
SetLastError
(
ERROR_CALL_NOT_IMPLEMENTED
);
FIXME
(
"setting keyboard of different locales not supported
\n
"
);
return
0
;
return
FALSE
;
}
oldHkl
=
thread_data
->
kbd_layout
;
if
(
!
oldHkl
)
oldHkl
=
get_locale_kbd_layout
();
thread_data
->
kbd_layout
=
hkl
;
return
oldHkl
;
return
TRUE
;
}
...
...
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