diff --git a/patches/odbc32-fixes/0005-odbc32-SQLColAttributeW-support-fallback-function.patch b/patches/odbc32-fixes/0005-odbc32-SQLColAttributeW-support-fallback-function.patch deleted file mode 100644 index d94f8ace..00000000 --- a/patches/odbc32-fixes/0005-odbc32-SQLColAttributeW-support-fallback-function.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 8002ebd60de0c6d9eb718eb58599a41823b3d930 Mon Sep 17 00:00:00 2001 -From: Alistair Leslie-Hughes -Date: Fri, 12 Jul 2024 14:19:22 +1000 -Subject: [PATCH] odbc32: SQLColAttributeW support fallback function - ---- - dlls/odbc32/proxyodbc.c | 24 ++++++++++++++++++++++++ - 1 file changed, 24 insertions(+) - -diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c -index 4f23c761f5a..5ead68700df 100644 ---- a/dlls/odbc32/proxyodbc.c -+++ b/dlls/odbc32/proxyodbc.c -@@ -5893,6 +5893,21 @@ static SQLRETURN col_attribute_unix_w( struct statement *stmt, SQLUSMALLINT col, - return ret; - } - -+static SQLINTEGER map_odbc3_to_2(SQLINTEGER fieldid) -+{ -+ switch( fieldid ) -+ { -+ case SQL_DESC_COUNT: -+ return SQL_COLUMN_COUNT; -+ case SQL_DESC_NULLABLE: -+ return SQL_COLUMN_NULLABLE; -+ case SQL_DESC_NAME: -+ return SQL_COLUMN_NAME; -+ default: -+ return fieldid; -+ } -+} -+ - static SQLRETURN col_attribute_win32_w( struct statement *stmt, SQLUSMALLINT col, SQLUSMALLINT field_id, - SQLPOINTER char_attr, SQLSMALLINT buflen, SQLSMALLINT *retlen, - SQLLEN *num_attr ) -@@ -5900,7 +5915,16 @@ static SQLRETURN col_attribute_win32_w( struct statement *stmt, SQLUSMALLINT col - if (stmt->hdr.win32_funcs->SQLColAttributeW) - return stmt->hdr.win32_funcs->SQLColAttributeW( stmt->hdr.win32_handle, col, field_id, char_attr, buflen, - retlen, num_attr ); -+ else if(stmt->hdr.win32_funcs->SQLColAttributesW) -+ { -+ /* ODBC v2 */ -+ field_id = map_odbc3_to_2(field_id); -+ return stmt->hdr.win32_funcs->SQLColAttributesW( stmt->hdr.win32_handle, col, field_id, -+ char_attr, buflen, retlen, -+ num_attr ); -+ } - if (stmt->hdr.win32_funcs->SQLColAttribute) FIXME( "Unicode to ANSI conversion not handled\n" ); -+ - return SQL_ERROR; - } - --- -2.43.0 - diff --git a/patches/odbc32-fixes/0006-odbc32-SQLGetDiagRec-W-handle-fallback-function.patch b/patches/odbc32-fixes/0006-odbc32-SQLGetDiagRec-W-handle-fallback-function.patch deleted file mode 100644 index eec7d4af..00000000 --- a/patches/odbc32-fixes/0006-odbc32-SQLGetDiagRec-W-handle-fallback-function.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 397d95d8e50299f949ac73b0cc245f5fe66cacae Mon Sep 17 00:00:00 2001 -From: Alistair Leslie-Hughes -Date: Fri, 12 Jul 2024 14:29:17 +1000 -Subject: [PATCH] odbc32: SQLGetDiagRec/W handle fallback function - ---- - dlls/odbc32/proxyodbc.c | 34 +++++++++++++++++++++++++++++++--- - 1 file changed, 31 insertions(+), 3 deletions(-) - -diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c -index 5ead68700df..97c4cac8e31 100644 ---- a/dlls/odbc32/proxyodbc.c -+++ b/dlls/odbc32/proxyodbc.c -@@ -2672,7 +2672,21 @@ SQLRETURN WINAPI SQLGetDiagRec(SQLSMALLINT HandleType, SQLHANDLE Handle, SQLSMAL - } - else if (obj->win32_handle) - { -- ret = get_diag_rec_win32_a( HandleType, obj, RecNumber, SqlState, NativeError, MessageText, BufferLength, -+ /* ODBC v2.0 */ -+ if (obj->win32_funcs->SQLError) -+ { -+ if (HandleType == SQL_HANDLE_ENV) -+ ret = obj->win32_funcs->SQLError(obj->win32_handle, SQL_NULL_HDBC, SQL_NULL_HSTMT, -+ SqlState, NativeError, MessageText, BufferLength, TextLength); -+ else if (HandleType == SQL_HANDLE_DBC) -+ ret = obj->win32_funcs->SQLError(SQL_NULL_HENV, obj->win32_handle, SQL_NULL_HSTMT, -+ SqlState, NativeError, MessageText, BufferLength, TextLength); -+ else if (HandleType == SQL_HANDLE_STMT) -+ ret = obj->win32_funcs->SQLError(SQL_NULL_HENV, SQL_NULL_HDBC, obj->win32_handle, -+ SqlState, NativeError, MessageText, BufferLength, TextLength); -+ } -+ else -+ ret = get_diag_rec_win32_a( HandleType, obj, RecNumber, SqlState, NativeError, MessageText, BufferLength, - TextLength ); - } - -@@ -6187,9 +6201,23 @@ static SQLRETURN get_diag_rec_win32_w( SQLSMALLINT type, struct object *obj, SQL - SQLSMALLINT *retlen ) - { - if (obj->win32_funcs->SQLGetDiagRecW) -- return obj->win32_funcs->SQLGetDiagRecW( type, obj->win32_handle, rec_num, state, native_err, msg, buflen, -- retlen ); -+ return obj->win32_funcs->SQLGetDiagRecW( type, obj->win32_handle, rec_num, state, native_err, -+ msg, buflen, retlen ); -+ else if (obj->win32_funcs->SQLErrorW) -+ { -+ /* ODBC v2 */ -+ if (type == SQL_HANDLE_ENV) -+ return obj->win32_funcs->SQLErrorW(obj->win32_handle, SQL_NULL_HDBC, SQL_NULL_HSTMT, -+ state, native_err, msg, buflen, retlen); -+ else if (type == SQL_HANDLE_DBC) -+ return obj->win32_funcs->SQLErrorW(SQL_NULL_HENV, obj->win32_handle, SQL_NULL_HSTMT, -+ state, native_err, msg, buflen, retlen); -+ else if (type == SQL_HANDLE_STMT) -+ return obj->win32_funcs->SQLErrorW(SQL_NULL_HENV, SQL_NULL_HDBC, obj->win32_handle, -+ state, native_err, msg, buflen, retlen); -+ } - if (obj->win32_funcs->SQLGetDiagRec) FIXME( "Unicode to ANSI conversion not handled\n" ); -+ - return SQL_ERROR; - } - --- -2.43.0 - diff --git a/patches/odbc32-fixes/0014-odbc32-SQLColAttributesW-support-ODBC-v2.0.patch b/patches/odbc32-fixes/0014-odbc32-SQLColAttributesW-support-ODBC-v2.0.patch index f313fcc5..e227da7a 100644 --- a/patches/odbc32-fixes/0014-odbc32-SQLColAttributesW-support-ODBC-v2.0.patch +++ b/patches/odbc32-fixes/0014-odbc32-SQLColAttributesW-support-ODBC-v2.0.patch @@ -1,30 +1,32 @@ -From 7fd12044418fbd610b920961db964ff0acd098f4 Mon Sep 17 00:00:00 2001 +From 6b7448e5ebdc0b16f3af606a62e2ca465f3ae026 Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Wed, 17 Jul 2024 22:03:03 +1000 Subject: [PATCH] odbc32: SQLColAttributesW support ODBC v2.0 --- - dlls/odbc32/proxyodbc.c | 22 +++++++++++++++++++--- - 1 file changed, 19 insertions(+), 3 deletions(-) + dlls/odbc32/proxyodbc.c | 18 ++++++++++++++++-- + 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/dlls/odbc32/proxyodbc.c b/dlls/odbc32/proxyodbc.c -index b2bf2a7d58c..f7a6535db37 100644 +index 71c853013fd..b5c0edb119e 100644 --- a/dlls/odbc32/proxyodbc.c +++ b/dlls/odbc32/proxyodbc.c -@@ -5973,11 +5973,27 @@ static SQLRETURN col_attribute_win32_w( struct statement *stmt, SQLUSMALLINT col +@@ -6195,6 +6195,8 @@ static SQLRETURN col_attribute_win32_w( struct statement *stmt, SQLUSMALLINT col + SQLPOINTER char_attr, SQLSMALLINT buflen, SQLSMALLINT *retlen, + SQLLEN *num_attr ) + { ++ SQLRETURN ret = SQL_ERROR; ++ + if (stmt->hdr.win32_funcs->SQLColAttributeW) + return stmt->hdr.win32_funcs->SQLColAttributeW( stmt->hdr.win32_handle, col, field_id, char_attr, buflen, retlen, num_attr ); - else if(stmt->hdr.win32_funcs->SQLColAttributesW) - { -+ SQLRETURN ret; -+ - /* ODBC v2 */ - field_id = map_odbc3_to_2(field_id); -- return stmt->hdr.win32_funcs->SQLColAttributesW( stmt->hdr.win32_handle, col, field_id, -- char_attr, buflen, retlen, -- num_attr ); -+ ret = stmt->hdr.win32_funcs->SQLColAttributesW( stmt->hdr.win32_handle, col, field_id, -+ char_attr, buflen, retlen, num_attr ); -+ +@@ -6237,11 +6239,23 @@ static SQLRETURN col_attribute_win32_w( struct statement *stmt, SQLUSMALLINT col + return SQL_ERROR; + } + +- return stmt->hdr.win32_funcs->SQLColAttributesW( stmt->hdr.win32_handle, col, field_id, char_attr, buflen, ++ ret = stmt->hdr.win32_funcs->SQLColAttributesW( stmt->hdr.win32_handle, col, field_id, char_attr, buflen, + retlen, num_attr ); + /* Convert back for ODBC3 drivers */ + if (num_attr && field_id == SQL_COLUMN_TYPE && + ((struct environment*)(stmt->hdr.parent))->attr_version == SQL_OV_ODBC2 && @@ -37,11 +39,13 @@ index b2bf2a7d58c..f7a6535db37 100644 + else if (*num_attr == SQL_TIMESTAMP) + *num_attr = SQL_TYPE_TIMESTAMP; + } -+ -+ return ret; } - if (stmt->hdr.win32_funcs->SQLColAttribute) FIXME( "Unicode to ANSI conversion not handled\n" ); +- return SQL_ERROR; ++ return ret; + } + + /************************************************************************* -- 2.43.0 diff --git a/patches/setupapi-DriverStoreFindDriverPackageW/0001-setupapi-Add-stub-for-DriverStoreFindDriverPackageW.patch b/patches/setupapi-DriverStoreFindDriverPackageW/0001-setupapi-Add-stub-for-DriverStoreFindDriverPackageW.patch deleted file mode 100644 index 7d88742e..00000000 --- a/patches/setupapi-DriverStoreFindDriverPackageW/0001-setupapi-Add-stub-for-DriverStoreFindDriverPackageW.patch +++ /dev/null @@ -1,131 +0,0 @@ -From 49f12af6d899f3a44f0619c059c59bf8b57be59f Mon Sep 17 00:00:00 2001 -From: Fabian Maurer -Date: Wed, 8 Nov 2023 22:01:59 +0100 -Subject: [PATCH] setupapi: Add stub for DriverStoreFindDriverPackageW - -Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=45455 ---- - dlls/setupapi/query.c | 10 ++++++ - dlls/setupapi/setupapi.spec | 1 + - dlls/setupapi/tests/query.c | 67 +++++++++++++++++++++++++++++++++++++ - 3 files changed, 78 insertions(+) - -diff --git a/dlls/setupapi/query.c b/dlls/setupapi/query.c -index 88efea17473..24f0537fe9c 100644 ---- a/dlls/setupapi/query.c -+++ b/dlls/setupapi/query.c -@@ -732,6 +732,16 @@ BOOL WINAPI SetupGetInfDriverStoreLocationW( - return FALSE; - } - -+HRESULT WINAPI DriverStoreFindDriverPackageW(const WCHAR *path_in, void *unk2, void *unk3, DWORD flags, void *unk5, WCHAR *path_out, DWORD *path_size) -+{ -+ FIXME("%s, %p, %p, %lu, %p, %p, %p, %lu stub!\n", debugstr_w(path_in), unk2, unk3, flags, unk5, path_out, path_size, path_size ? *path_size : 0); -+ if (!path_in || !path_out || !path_size || *path_size < MAX_PATH) -+ return E_INVALIDARG; -+ -+ wcscpy(path_out, path_in); -+ return S_OK; -+} -+ - BOOL WINAPI SetupQueryInfVersionInformationA(SP_INF_INFORMATION *info, UINT index, const char *key, char *buff, - DWORD size, DWORD *req_size) - { -diff --git a/dlls/setupapi/setupapi.spec b/dlls/setupapi/setupapi.spec -index 74f430a415f..6a392f687f8 100644 ---- a/dlls/setupapi/setupapi.spec -+++ b/dlls/setupapi/setupapi.spec -@@ -208,6 +208,7 @@ - @ stub DelimStringToMultiSz - @ stub DestroyTextFileReadBuffer - @ stdcall DoesUserHavePrivilege(wstr) -+@ stdcall DriverStoreFindDriverPackageW(ptr ptr ptr long ptr ptr ptr) - @ stdcall DuplicateString(wstr) - @ stdcall EnablePrivilege(wstr long) - @ stub ExtensionPropSheetPageProc -diff --git a/dlls/setupapi/tests/query.c b/dlls/setupapi/tests/query.c -index f7aeba41153..864c8d6939b 100644 ---- a/dlls/setupapi/tests/query.c -+++ b/dlls/setupapi/tests/query.c -@@ -513,6 +513,72 @@ static void test_SetupGetTargetPath(void) - DeleteFileA(inf_filename); - } - -+static void test_DriverStoreFindDriverPackageW(void) -+{ -+ HMODULE library; -+ HRESULT result; -+ WCHAR buffer[500]; -+ DWORD len; -+ HRESULT (WINAPI *pDriverStoreFindDriverPackageW)(const WCHAR*, void*, void*, DWORD, void*, WCHAR*, DWORD*); -+ -+ library = LoadLibraryA("setupapi.dll"); -+ ok(library != NULL, "Failed to load setupapi.dll\n"); -+ if (!library) return; -+ -+ pDriverStoreFindDriverPackageW = (void *)GetProcAddress(library, "DriverStoreFindDriverPackageW"); -+ if (!pDriverStoreFindDriverPackageW) -+ { -+ win_skip("Can't find DriverStoreFindDriverPackageW\n"); -+ return; -+ } -+ -+ len = ARRAY_SIZE(buffer); -+ -+ /* No invalid parameters, with flags */ -+ result = pDriverStoreFindDriverPackageW(L"c:\\nonexistent.inf", 0, 0, 9, 0, buffer, &len); -+ todo_wine -+ ok(result == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), "Got %lx\n", result); -+ -+ /* No invalid parameters, no flags */ -+ result = pDriverStoreFindDriverPackageW(L"c:\\nonexistent.inf", 0, 0, 0, 0, buffer, &len); -+ if (sizeof(void *) == 4) -+ todo_wine -+ ok(result == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), "Got %lx\n", result); -+ else -+ todo_wine -+ ok(result == E_INVALIDARG, "Got %lx\n", result); /* Win64 needs flags 0x9, or it gives invalid parameter */ -+ -+ /* Invalid parameter tests */ -+ -+ result = pDriverStoreFindDriverPackageW(L"c:\\nonexistent.inf", 0, 0, 9, 0, 0, &len); -+ ok(result == E_INVALIDARG, "Got %lx\n", result); -+ -+ result = pDriverStoreFindDriverPackageW(0, 0, 0, 9, 0, buffer, &len); -+ ok(result == E_INVALIDARG, "Got %lx\n", result); -+ -+ result = pDriverStoreFindDriverPackageW(L"", 0, 0, 9, 0, buffer, &len); -+ todo_wine -+ ok(result == HRESULT_FROM_WIN32(ERROR_INVALID_NAME) /* win7 */ || result == E_INVALIDARG /* win10 */, "Got %lx\n", result); -+ -+ result = pDriverStoreFindDriverPackageW(L"c:\\nonexistent.inf", 0, 0, 9, 0, buffer, 0); -+ ok(result == E_INVALIDARG, "Got %lx\n", result); -+ -+ /* Tests with different length parameter */ -+ -+ len = 0; -+ result = pDriverStoreFindDriverPackageW(L"c:\\nonexistent.inf", 0, 0, 9, 0, buffer, &len); -+ ok(result == E_INVALIDARG, "Got %lx\n", result); -+ -+ len = 259; -+ result = pDriverStoreFindDriverPackageW(L"c:\\nonexistent.inf", 0, 0, 9, 0, buffer, &len); -+ ok(result == E_INVALIDARG, "Got %lx\n", result); -+ -+ len = 260; -+ result = pDriverStoreFindDriverPackageW(L"c:\\nonexistent.inf", 0, 0, 9, 0, buffer, &len); -+ todo_wine -+ ok(result == HRESULT_FROM_WIN32(ERROR_FILE_NOT_FOUND), "Got %lx\n", result); -+} -+ - START_TEST(query) - { - get_directories(); -@@ -521,4 +587,5 @@ START_TEST(query) - test_SetupGetSourceFileLocation(); - test_SetupGetSourceInfo(); - test_SetupGetTargetPath(); -+ test_DriverStoreFindDriverPackageW(); - } --- -2.43.0 - diff --git a/patches/setupapi-DriverStoreFindDriverPackageW/definition b/patches/setupapi-DriverStoreFindDriverPackageW/definition deleted file mode 100644 index 60b72203..00000000 --- a/patches/setupapi-DriverStoreFindDriverPackageW/definition +++ /dev/null @@ -1,3 +0,0 @@ -Fixes: [45455] setupapi: Add stub for DriverStoreFindDriverPackageW - -# https://gitlab.winehq.org/wine/wine/-/merge_requests/4343 diff --git a/patches/winex11-CandidateWindowPos/0001-winex11.drv-Update-a-candidate-window-s-position-wit.patch b/patches/winex11-CandidateWindowPos/0001-winex11.drv-Update-a-candidate-window-s-position-wit.patch deleted file mode 100644 index 9df4f3bd..00000000 --- a/patches/winex11-CandidateWindowPos/0001-winex11.drv-Update-a-candidate-window-s-position-wit.patch +++ /dev/null @@ -1,216 +0,0 @@ -From bc61fb352dd93ec249aecd7f57bd7b712d1ba651 Mon Sep 17 00:00:00 2001 -From: Felix Yan -Date: Tue, 23 Sep 2014 23:22:17 +0800 -Subject: [PATCH] winex11.drv: Update a candidate window's position with - over-the-spot style. (try 2) - -In the current implementation, the candidate window position of a input -method is fixed because XNSpotLocation isn't updated after an input -context (XIC) is created in X11DRV_CreateIC(). -X11DRV_UpdateCandidatePos() in this patch updates the position. You can -see the change of a position with ibus, scim or fcitx when input style -is set to "over the spot" in the registry key: - -[HKEY_CURRENT_USER\Software\Wine\X11 Driver] -"InputStyle"="OverTheSpot" - -This patch was based on the original work by Muneyuki Noguchi, and -received a lot of help from Sebastian Lackner. ---- - dlls/win32u/driver.c | 7 ++++ - dlls/win32u/input.c | 4 +++ - dlls/winex11.drv/init.c | 1 + - dlls/winex11.drv/x11drv.h | 1 + - dlls/winex11.drv/xim.c | 70 +++++++++++++++++++++++++++++++++++++++ - include/wine/gdi_driver.h | 2 ++ - 6 files changed, 85 insertions(+) - -diff --git a/dlls/win32u/driver.c b/dlls/win32u/driver.c -index e22a457d6d6..1b47c285787 100644 ---- a/dlls/win32u/driver.c -+++ b/dlls/win32u/driver.c -@@ -907,6 +907,11 @@ static struct opengl_funcs *nulldrv_wine_get_wgl_driver( UINT version ) - return (void *)-1; - } - -+static void nulldrv_UpdateCandidatePos( HWND hwnd, const RECT *caret_rect ) -+{ -+ -+} -+ - static void nulldrv_ThreadDetach( void ) - { - } -@@ -1287,6 +1292,7 @@ static const struct user_driver_funcs lazy_load_driver = - loaderdrv_VulkanInit, - /* opengl support */ - nulldrv_wine_get_wgl_driver, -+ nulldrv_UpdateCandidatePos, - /* thread management */ - nulldrv_ThreadDetach, - }; -@@ -1370,6 +1376,7 @@ void __wine_set_user_driver( const struct user_driver_funcs *funcs, UINT version - SET_USER_FUNC(SystemParametersInfo); - SET_USER_FUNC(VulkanInit); - SET_USER_FUNC(wine_get_wgl_driver); -+ SET_USER_FUNC(UpdateCandidatePos); - SET_USER_FUNC(ThreadDetach); - #undef SET_USER_FUNC - -diff --git a/dlls/win32u/input.c b/dlls/win32u/input.c -index 04532e7d015..43257ccf947 100644 ---- a/dlls/win32u/input.c -+++ b/dlls/win32u/input.c -@@ -2340,6 +2340,8 @@ BOOL set_caret_pos( int x, int y ) - r.left = x; - r.top = y; - display_caret( hwnd, &r ); -+ if (user_driver->pUpdateCandidatePos) -+ user_driver->pUpdateCandidatePos( hwnd, &r ); - NtUserSetSystemTimer( hwnd, SYSTEM_TIMER_CARET, caret.timeout ); - } - return ret; -@@ -2377,6 +2379,8 @@ BOOL WINAPI NtUserShowCaret( HWND hwnd ) - if (ret && hidden == 1) /* hidden was 1 so it's now 0 */ - { - display_caret( hwnd, &r ); -+ if (user_driver->pUpdateCandidatePos) -+ user_driver->pUpdateCandidatePos( hwnd, &r ); - NtUserSetSystemTimer( hwnd, SYSTEM_TIMER_CARET, caret.timeout ); - } - return ret; -diff --git a/dlls/winex11.drv/init.c b/dlls/winex11.drv/init.c -index e3b3a3e2557..b30f4e48144 100644 ---- a/dlls/winex11.drv/init.c -+++ b/dlls/winex11.drv/init.c -@@ -427,6 +427,7 @@ static const struct user_driver_funcs x11drv_funcs = - .pSystemParametersInfo = X11DRV_SystemParametersInfo, - .pVulkanInit = X11DRV_VulkanInit, - .pwine_get_wgl_driver = X11DRV_wine_get_wgl_driver, -+ .pUpdateCandidatePos = X11DRV_UpdateCandidatePos, - .pThreadDetach = X11DRV_ThreadDetach, - }; - -diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h -index c308f54adb3..030dca910b8 100644 ---- a/dlls/winex11.drv/x11drv.h -+++ b/dlls/winex11.drv/x11drv.h -@@ -253,6 +253,7 @@ extern void X11DRV_WindowPosChanged( HWND hwnd, HWND insert_after, UINT swp_flag - struct window_surface *surface ); - extern BOOL X11DRV_SystemParametersInfo( UINT action, UINT int_param, void *ptr_param, - UINT flags ); -+extern void X11DRV_UpdateCandidatePos( HWND hwnd, const RECT *caret_rect ); - extern void X11DRV_ThreadDetach(void); - - /* X11 driver internal functions */ -diff --git a/dlls/winex11.drv/xim.c b/dlls/winex11.drv/xim.c -index c6a93eb5e16..786a089160f 100644 ---- a/dlls/winex11.drv/xim.c -+++ b/dlls/winex11.drv/xim.c -@@ -36,6 +36,7 @@ - #include "x11drv.h" - #include "imm.h" - #include "wine/debug.h" -+#include "wine/server.h" - - WINE_DEFAULT_DEBUG_CHANNEL(xim); - -@@ -410,6 +411,49 @@ void xim_thread_attach( struct x11drv_thread_data *data ) - XRegisterIMInstantiateCallback( display, NULL, NULL, NULL, xim_open, (XPointer)data ); - } - -+/*********************************************************************** -+ * X11DRV_UpdateCandidatePos -+ */ -+void X11DRV_UpdateCandidatePos( HWND hwnd, const RECT *caret_rect ) -+{ -+ if (input_style & XIMPreeditPosition) -+ { -+ struct x11drv_win_data *data; -+ HWND parent; -+ -+ for (parent = hwnd; parent && parent != NtUserGetDesktopWindow(); parent = NtUserGetAncestor( parent, GA_PARENT )) -+ { -+ if (!(data = get_win_data( parent ))) continue; -+ if (data->xic) -+ { -+ XVaNestedList preedit; -+ XPoint xpoint; -+ POINT pt; -+ -+ pt.x = caret_rect->left; -+ pt.y = caret_rect->bottom; -+ -+ if (hwnd != data->hwnd) -+ NtUserMapWindowPoints( hwnd, data->hwnd, &pt, 1, 0 /* per-monitor DPI */ ); -+ -+ if (NtUserGetWindowLongW( data->hwnd, GWL_EXSTYLE ) & WS_EX_LAYOUTRTL) -+ pt.x = data->client_rect.right - data->client_rect.left - 1 - pt.x; -+ -+ xpoint.x = pt.x + data->client_rect.left - data->whole_rect.left; -+ xpoint.y = pt.y + data->client_rect.top - data->whole_rect.top; -+ -+ preedit = XVaCreateNestedList( 0, XNSpotLocation, &xpoint, NULL ); -+ if (preedit) -+ { -+ XSetICValues( data->xic, XNPreeditAttributes, preedit, NULL ); -+ XFree( preedit ); -+ } -+ } -+ release_win_data( data ); -+ } -+ } -+} -+ - static BOOL xic_destroy( XIC xic, XPointer user, XPointer arg ) - { - struct x11drv_win_data *data; -@@ -463,6 +507,32 @@ static XIC xic_create( XIM xim, HWND hwnd, Window win ) - XFree( preedit ); - XFree( status ); - -+ if (xic != NULL && (input_style & XIMPreeditPosition)) -+ { -+ SERVER_START_REQ( set_caret_info ) -+ { -+ req->flags = 0; /* don't set anything */ -+ req->handle = 0; -+ req->x = 0; -+ req->y = 0; -+ req->hide = 0; -+ req->state = 0; -+ if (!wine_server_call_err( req )) -+ { -+ HWND hwnd; -+ RECT r; -+ -+ hwnd = wine_server_ptr_handle( reply->full_handle ); -+ r.left = reply->old_rect.left; -+ r.top = reply->old_rect.top; -+ r.right = reply->old_rect.right; -+ r.bottom = reply->old_rect.bottom; -+ X11DRV_UpdateCandidatePos( hwnd, &r ); -+ } -+ } -+ SERVER_END_REQ; -+ } -+ - return xic; - } - -diff --git a/include/wine/gdi_driver.h b/include/wine/gdi_driver.h -index 61c9342d50f..4bed824e437 100644 ---- a/include/wine/gdi_driver.h -+++ b/include/wine/gdi_driver.h -@@ -344,6 +344,8 @@ struct user_driver_funcs - UINT (*pVulkanInit)(UINT,void *,const struct vulkan_driver_funcs **); - /* opengl support */ - struct opengl_funcs * (*pwine_get_wgl_driver)(UINT); -+ /* IME functions */ -+ void (*pUpdateCandidatePos)(HWND, const RECT *); - /* thread management */ - void (*pThreadDetach)(void); - }; --- -2.43.0 - diff --git a/patches/winex11-CandidateWindowPos/definition b/patches/winex11-CandidateWindowPos/definition deleted file mode 100644 index da9ba408..00000000 --- a/patches/winex11-CandidateWindowPos/definition +++ /dev/null @@ -1 +0,0 @@ -Fixes: [30938] Update a XIM candidate position when cursor location changes diff --git a/staging/upstream-commit b/staging/upstream-commit index 346bf29e..87123729 100644 --- a/staging/upstream-commit +++ b/staging/upstream-commit @@ -1 +1 @@ -ba66d9c71519176bd499eb846ed11fb0ea421118 +6e15604c48acd63dd8095a4ce2fd011cb3be96db