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
22008f7f
Commit
22008f7f
authored
Nov 20, 2013
by
Huw Davies
Committed by
Alexandre Julliard
Nov 20, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winemac: Update the thread's active_keyboard_layout on keyboard change.
parent
f344d7a2
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
50 additions
and
34 deletions
+50
-34
cocoa_app.m
dlls/winemac.drv/cocoa_app.m
+16
-18
cocoa_event.m
dlls/winemac.drv/cocoa_event.m
+1
-0
keyboard.c
dlls/winemac.drv/keyboard.c
+25
-14
macdrv.h
dlls/winemac.drv/macdrv.h
+1
-0
macdrv_cocoa.h
dlls/winemac.drv/macdrv_cocoa.h
+3
-1
macdrv_main.c
dlls/winemac.drv/macdrv_main.c
+4
-1
No files found.
dlls/winemac.drv/cocoa_app.m
View file @
22008f7f
...
...
@@ -374,15 +374,15 @@ int macdrv_err_on;
-
(
void
)
keyboardSelectionDidChange
{
TISInputSourceRef
inputSource
;
TISInputSourceRef
inputSource
Layout
;
inputSourceIsInputMethodValid
=
FALSE
;
inputSource
=
TISCopyCurrentKeyboardLayoutInputSource
();
if
(
inputSource
)
inputSource
Layout
=
TISCopyCurrentKeyboardLayoutInputSource
();
if
(
inputSource
Layout
)
{
CFDataRef
uchr
;
uchr
=
TISGetInputSourceProperty
(
inputSource
,
uchr
=
TISGetInputSourceProperty
(
inputSource
Layout
,
kTISPropertyUnicodeKeyLayoutData
);
if
(
uchr
)
{
...
...
@@ -393,6 +393,7 @@ int macdrv_err_on;
event
->
keyboard_changed
.
keyboard_type
=
self
.
keyboardType
;
event
->
keyboard_changed
.
iso_keyboard
=
(
KBGetLayoutType
(
self
.
keyboardType
)
==
kKeyboardISO
);
event
->
keyboard_changed
.
uchr
=
CFDataCreateCopy
(
NULL
,
uchr
);
event
->
keyboard_changed
.
input_source
=
TISCopyCurrentKeyboardInputSource
();
if
(
event
->
keyboard_changed
.
uchr
)
{
...
...
@@ -407,7 +408,7 @@ int macdrv_err_on;
macdrv_release_event
(
event
);
}
CFRelease
(
inputSource
);
CFRelease
(
inputSource
Layout
);
}
}
...
...
@@ -2218,31 +2219,28 @@ void macdrv_window_rejected_focus(const macdrv_event *event)
}
/***********************************************************************
* macdrv_get_
keyboard_layout
* macdrv_get_
input_source_info
*
* Returns the keyboard layout uchr data.
* Returns the keyboard layout uchr data
, keyboard type and input source
.
*/
CFDataRef
macdrv_copy_keyboard_layout
(
CGEventSourceKeyboardType
*
keyboard_type
,
int
*
is_iso
)
void
macdrv_get_input_source_info
(
CFDataRef
*
uchr
,
CGEventSourceKeyboardType
*
keyboard_type
,
int
*
is_iso
,
TISInputSourceRef
*
input_source
)
{
__block
CFDataRef
result
=
NULL
;
OnMainThread
(
^
{
TISInputSourceRef
inputSource
;
TISInputSourceRef
inputSource
Layout
;
inputSource
=
TISCopyCurrentKeyboardLayoutInputSource
();
if
(
inputSource
)
inputSource
Layout
=
TISCopyCurrentKeyboardLayoutInputSource
();
if
(
inputSource
Layout
)
{
CFDataRef
uchr
=
TISGetInputSourceProperty
(
inputSource
,
CFDataRef
data
=
TISGetInputSourceProperty
(
inputSourceLayout
,
kTISPropertyUnicodeKeyLayoutData
);
result
=
CFDataCreateCopy
(
NULL
,
uchr
);
CFRelease
(
inputSource
);
*
uchr
=
CFDataCreateCopy
(
NULL
,
data
);
CFRelease
(
inputSource
Layout
);
*
keyboard_type
=
[
WineApplicationController
sharedController
].
keyboardType
;
*
is_iso
=
(
KBGetLayoutType
(
*
keyboard_type
)
==
kKeyboardISO
);
*
input_source
=
TISCopyCurrentKeyboardInputSource
();
}
});
return
result
;
}
/***********************************************************************
...
...
dlls/winemac.drv/cocoa_event.m
View file @
22008f7f
...
...
@@ -641,6 +641,7 @@ void macdrv_release_event(macdrv_event *event)
break
;
case
KEYBOARD_CHANGED
:
CFRelease
(
event
->
keyboard_changed
.
uchr
);
CFRelease
(
event
->
keyboard_changed
.
input_source
);
break
;
case
QUERY_EVENT
:
macdrv_release_query
(
event
->
query_event
.
query
);
...
...
dlls/winemac.drv/keyboard.c
View file @
22008f7f
...
...
@@ -555,6 +555,28 @@ static void update_layout_list(void)
}
/***********************************************************************
* macdrv_get_hkl_from_source
*
* Find the HKL associated with a given input source.
*/
HKL
macdrv_get_hkl_from_source
(
TISInputSourceRef
input
)
{
struct
layout
*
layout
;
HKL
ret
=
0
;
EnterCriticalSection
(
&
layout_list_section
);
update_layout_list
();
layout
=
get_layout_from_source
(
input
);
if
(
layout
)
ret
=
layout
->
hkl
;
LeaveCriticalSection
(
&
layout_list_section
);
return
ret
;
}
/***********************************************************************
* macdrv_compute_keyboard_layout
*/
void
macdrv_compute_keyboard_layout
(
struct
macdrv_thread_data
*
thread_data
)
...
...
@@ -1027,6 +1049,7 @@ void macdrv_keyboard_changed(const macdrv_event *event)
thread_data
->
keyboard_layout_uchr
=
CFDataCreateCopy
(
NULL
,
event
->
keyboard_changed
.
uchr
);
thread_data
->
keyboard_type
=
event
->
keyboard_changed
.
keyboard_type
;
thread_data
->
iso_keyboard
=
event
->
keyboard_changed
.
iso_keyboard
;
thread_data
->
active_keyboard_layout
=
macdrv_get_hkl_from_source
(
event
->
keyboard_changed
.
input_source
);
thread_data
->
dead_key_state
=
0
;
macdrv_compute_keyboard_layout
(
thread_data
);
...
...
@@ -1327,22 +1350,10 @@ INT CDECL macdrv_GetKeyNameText(LONG lparam, LPWSTR buffer, INT size)
*/
HKL
CDECL
macdrv_GetKeyboardLayout
(
DWORD
thread_id
)
{
if
(
!
thread_id
||
thread_id
==
GetCurrentThreadId
())
{
struct
macdrv_thread_data
*
thread_data
=
macdrv_thread_data
();
if
(
thread_data
&&
thread_data
->
active_keyboard_layout
)
return
thread_data
->
active_keyboard_layout
;
}
else
if
(
thread_id
&&
thread_id
!=
GetCurrentThreadId
())
FIXME
(
"couldn't return keyboard layout for thread %04x
\n
"
,
thread_id
);
/* FIXME: Use TISGetInputSourceProperty() and kTISPropertyInputSourceLanguages
* to get input source language ID string. Use
* CFLocaleGetWindowsLocaleCodeFromLocaleIdentifier() to convert that
* to a Windows locale ID and from there to a layout handle.
*/
return
get_locale_keyboard_layout
();
return
macdrv_init_thread_data
()
->
active_keyboard_layout
;
}
...
...
dlls/winemac.drv/macdrv.h
View file @
22008f7f
...
...
@@ -178,6 +178,7 @@ extern void macdrv_compute_keyboard_layout(struct macdrv_thread_data *thread_dat
extern
void
macdrv_keyboard_changed
(
const
macdrv_event
*
event
)
DECLSPEC_HIDDEN
;
extern
void
macdrv_key_event
(
HWND
hwnd
,
const
macdrv_event
*
event
)
DECLSPEC_HIDDEN
;
extern
void
macdrv_hotkey_press
(
const
macdrv_event
*
event
)
DECLSPEC_HIDDEN
;
extern
HKL
macdrv_get_hkl_from_source
(
TISInputSourceRef
input_source
)
DECLSPEC_HIDDEN
;
extern
void
macdrv_displays_changed
(
const
macdrv_event
*
event
)
DECLSPEC_HIDDEN
;
...
...
dlls/winemac.drv/macdrv_cocoa.h
View file @
22008f7f
...
...
@@ -241,6 +241,7 @@ typedef struct macdrv_event {
CFDataRef
uchr
;
CGEventSourceKeyboardType
keyboard_type
;
int
iso_keyboard
;
TISInputSourceRef
input_source
;
}
keyboard_changed
;
struct
{
int
button
;
...
...
@@ -411,7 +412,8 @@ extern int macdrv_send_text_input_event(int pressed, unsigned int flags, int rep
/* keyboard */
extern
CFDataRef
macdrv_copy_keyboard_layout
(
CGEventSourceKeyboardType
*
keyboard_type
,
int
*
is_iso
)
DECLSPEC_HIDDEN
;
extern
void
macdrv_get_input_source_info
(
CFDataRef
*
uchr
,
CGEventSourceKeyboardType
*
keyboard_type
,
int
*
is_iso
,
TISInputSourceRef
*
input_source
)
DECLSPEC_HIDDEN
;
extern
CFArrayRef
macdrv_create_input_source_list
(
void
)
DECLSPEC_HIDDEN
;
extern
const
CFStringRef
macdrv_input_source_input_key
DECLSPEC_HIDDEN
;
extern
const
CFStringRef
macdrv_input_source_type_key
DECLSPEC_HIDDEN
;
...
...
dlls/winemac.drv/macdrv_main.c
View file @
22008f7f
...
...
@@ -255,6 +255,7 @@ static void set_queue_display_fd(int fd)
struct
macdrv_thread_data
*
macdrv_init_thread_data
(
void
)
{
struct
macdrv_thread_data
*
data
=
macdrv_thread_data
();
TISInputSourceRef
input_source
;
if
(
data
)
return
data
;
...
...
@@ -270,7 +271,9 @@ struct macdrv_thread_data *macdrv_init_thread_data(void)
ExitProcess
(
1
);
}
data
->
keyboard_layout_uchr
=
macdrv_copy_keyboard_layout
(
&
data
->
keyboard_type
,
&
data
->
iso_keyboard
);
macdrv_get_input_source_info
(
&
data
->
keyboard_layout_uchr
,
&
data
->
keyboard_type
,
&
data
->
iso_keyboard
,
&
input_source
);
data
->
active_keyboard_layout
=
macdrv_get_hkl_from_source
(
input_source
);
CFRelease
(
input_source
);
macdrv_compute_keyboard_layout
(
data
);
set_queue_display_fd
(
macdrv_get_event_queue_fd
(
data
->
queue
));
...
...
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