Signed-off-by: Rémi Bernon rbernon@codeweavers.com --- dlls/winemac.drv/ime.c | 32 +++++++++++++++++++------------- dlls/winemac.drv/keyboard.c | 23 +++++++++++++---------- dlls/winemac.drv/mouse.c | 23 ++++++++++++++--------- 3 files changed, 46 insertions(+), 32 deletions(-)
diff --git a/dlls/winemac.drv/ime.c b/dlls/winemac.drv/ime.c index dabe6654f98..a8e114457ad 100644 --- a/dlls/winemac.drv/ime.c +++ b/dlls/winemac.drv/ime.c @@ -1384,6 +1384,23 @@ BOOL WINAPI ImeInquire(LPIMEINFO lpIMEInfo, LPWSTR lpszUIClass, LPCWSTR lpszOpti
/* Interfaces to other parts of the Mac driver */
+static void send_keyboard_char(HWND hwnd, int scan, int flags) +{ + SERVER_START_REQ(send_hardware_message) + { + req->win = wine_server_user_handle(hwnd); + req->flags = 0; + req->input.type = INPUT_KEYBOARD; + req->input.kbd.vkey = 0; + req->input.kbd.scan = scan; + req->input.kbd.flags = flags; + req->input.kbd.time = 0; + req->input.kbd.info = 0; + wine_server_call(req); + } + SERVER_END_REQ; +} + /*********************************************************************** * macdrv_im_set_text */ @@ -1415,22 +1432,11 @@ void macdrv_im_set_text(const macdrv_event *event) event->im_set_text.cursor_pos, !event->im_set_text.complete); else { - INPUT input; CFIndex i; - - input.type = INPUT_KEYBOARD; - input.ki.wVk = 0; - input.ki.time = 0; - input.ki.dwExtraInfo = 0; - for (i = 0; i < length; i++) { - input.ki.wScan = chars[i]; - input.ki.dwFlags = KEYEVENTF_UNICODE; - __wine_send_input(hwnd, &input); - - input.ki.dwFlags = KEYEVENTF_UNICODE | KEYEVENTF_KEYUP; - __wine_send_input(hwnd, &input); + send_keyboard_char(hwnd, chars[i], KEYEVENTF_UNICODE); + send_keyboard_char(hwnd, chars[i], KEYEVENTF_UNICODE | KEYEVENTF_KEYUP); } }
diff --git a/dlls/winemac.drv/keyboard.c b/dlls/winemac.drv/keyboard.c index aed4ff0d6e4..45848c3b28e 100644 --- a/dlls/winemac.drv/keyboard.c +++ b/dlls/winemac.drv/keyboard.c @@ -918,18 +918,21 @@ void macdrv_compute_keyboard_layout(struct macdrv_thread_data *thread_data) */ static void macdrv_send_keyboard_input(HWND hwnd, WORD vkey, WORD scan, DWORD flags, DWORD time) { - INPUT input; - TRACE_(key)("hwnd %p vkey=%04x scan=%04x flags=%04x\n", hwnd, vkey, scan, flags);
- input.type = INPUT_KEYBOARD; - input.ki.wVk = vkey; - input.ki.wScan = scan; - input.ki.dwFlags = flags; - input.ki.time = time; - input.ki.dwExtraInfo = 0; - - __wine_send_input(hwnd, &input); + SERVER_START_REQ(send_hardware_message) + { + req->win = wine_server_user_handle(hwnd); + req->flags = 0; + req->input.type = INPUT_KEYBOARD; + req->input.kbd.vkey = vkey; + req->input.kbd.scan = scan; + req->input.kbd.flags = flags; + req->input.kbd.time = time; + req->input.kbd.info = 0; + wine_server_call(req); + } + SERVER_END_REQ; }
diff --git a/dlls/winemac.drv/mouse.c b/dlls/winemac.drv/mouse.c index dd6443fe1ba..2d7a0b592a9 100644 --- a/dlls/winemac.drv/mouse.c +++ b/dlls/winemac.drv/mouse.c @@ -157,15 +157,20 @@ static void send_mouse_input(HWND hwnd, macdrv_window cocoa_window, UINT flags, SERVER_END_REQ; }
- input.type = INPUT_MOUSE; - input.mi.dx = x; - input.mi.dy = y; - input.mi.mouseData = mouse_data; - input.mi.dwFlags = flags; - input.mi.time = time; - input.mi.dwExtraInfo = 0; - - __wine_send_input(top_level_hwnd, &input); + SERVER_START_REQ(send_hardware_message) + { + req->win = wine_server_user_handle(top_level_hwnd); + req->flags = 0; + req->input.type = INPUT_MOUSE; + req->input.mouse.x = x; + req->input.mouse.y = y; + req->input.mouse.data = mouse_data; + req->input.mouse.flags = flags; + req->input.mouse.time = time; + req->input.mouse.info = 0; + wine_server_call(req); + } + SERVER_END_REQ; }