From 9d5115a9ee3ec86c47412c30dff1c7d67f0be51d Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Thu, 6 Apr 2023 09:14:54 +1000 Subject: [PATCH] Rebase against b5bc026798c127d5bb4c471d94f7fb5e32b4861c. --- ...te-a-candidate-window-s-position-wit.patch | 23 +++++++------- ...missing-thread-data-in-X11DRV_get_ic.patch | 30 +++++++++---------- staging/upstream-commit | 2 +- 3 files changed, 28 insertions(+), 27 deletions(-) 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 index b50b30e3..b32308a0 100644 --- 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 @@ -1,4 +1,4 @@ -From c7e30e022ebe93ed29114af743c63898bc15c04d Mon Sep 17 00:00:00 2001 +From 322b0ade65ffd9f5e8cfdcd7faaaf5a3826c9ce4 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 @@ -90,7 +90,7 @@ index 2d056a359ef..eb57a2fcffb 100644 }; diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h -index fcae7bbc9df..77b4c1a3b81 100644 +index d5b0855035b..85a20c1e7c5 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 @@ -102,7 +102,7 @@ index fcae7bbc9df..77b4c1a3b81 100644 /* X11 driver internal functions */ diff --git a/dlls/winex11.drv/xim.c b/dlls/winex11.drv/xim.c -index 9f238e0cb83..2bda8ffc65f 100644 +index b7f5f696ba5..51fb6bdff62 100644 --- a/dlls/winex11.drv/xim.c +++ b/dlls/winex11.drv/xim.c @@ -34,6 +34,7 @@ @@ -113,8 +113,8 @@ index 9f238e0cb83..2bda8ffc65f 100644 WINE_DEFAULT_DEBUG_CHANNEL(xim); -@@ -459,6 +460,49 @@ static BOOL xic_destroy( XIC xic, XPointer user, XPointer arg ) - return TRUE; +@@ -432,6 +433,49 @@ void xim_thread_attach( struct x11drv_thread_data *data ) + else XRegisterIMInstantiateCallback( display, NULL, NULL, NULL, xim_open, (XPointer)data ); } +/*********************************************************************** @@ -122,7 +122,7 @@ index 9f238e0cb83..2bda8ffc65f 100644 + */ +void X11DRV_UpdateCandidatePos( HWND hwnd, const RECT *caret_rect ) +{ -+ if (ximStyle & XIMPreeditPosition) ++ if (input_style & XIMPreeditPosition) + { + struct x11drv_win_data *data; + HWND parent; @@ -160,14 +160,14 @@ index 9f238e0cb83..2bda8ffc65f 100644 + } +} + - XIC X11DRV_CreateIC( XIM xim, HWND hwnd, struct x11drv_win_data *data ) + static BOOL xic_destroy( XIC xic, XPointer user, XPointer arg ) { - XICCallback destroy = {.callback = xic_destroy, .client_data = (XPointer)hwnd}; -@@ -492,5 +536,31 @@ XIC X11DRV_CreateIC( XIM xim, HWND hwnd, struct x11drv_win_data *data ) + struct x11drv_win_data *data; +@@ -485,6 +529,32 @@ static XIC xic_create( XIM xim, HWND hwnd, Window win ) XFree( preedit ); XFree( status ); -+ if (xic != NULL && (ximStyle & XIMPreeditPosition)) ++ if (xic != NULL && (input_style & XIMPreeditPosition)) + { + SERVER_START_REQ( set_caret_info ) + { @@ -195,8 +195,9 @@ index 9f238e0cb83..2bda8ffc65f 100644 + return xic; } + diff --git a/include/wine/gdi_driver.h b/include/wine/gdi_driver.h -index 52bfaaefbfd..8afb19fd6ec 100644 +index 1ffaa409c72..219eb75d3de 100644 --- a/include/wine/gdi_driver.h +++ b/include/wine/gdi_driver.h @@ -334,6 +334,8 @@ struct user_driver_funcs diff --git a/patches/winex11-ime-check-thread-data/0001-winex11.drv-handle-missing-thread-data-in-X11DRV_get_ic.patch b/patches/winex11-ime-check-thread-data/0001-winex11.drv-handle-missing-thread-data-in-X11DRV_get_ic.patch index d97128cf..50bc1eb2 100644 --- a/patches/winex11-ime-check-thread-data/0001-winex11.drv-handle-missing-thread-data-in-X11DRV_get_ic.patch +++ b/patches/winex11-ime-check-thread-data/0001-winex11.drv-handle-missing-thread-data-in-X11DRV_get_ic.patch @@ -1,8 +1,7 @@ -From b7dca610d1814659749106e97812beb2a795bace Mon Sep 17 00:00:00 2001 +From 1c2414373f49a227fe25d5fee1a50c6c0a023fac Mon Sep 17 00:00:00 2001 From: Enrico Horn Date: Sat, 21 Apr 2018 02:40:37 +0200 -Subject: [PATCH resend] winex11.drv: handle missing thread data in X11DRV_get_ic -To: wine-devel@winehq.org +Subject: [PATCH] winex11.drv: handle missing thread data in X11DRV_get_ic Hi, This patch fixes a crash in winex11.drv when loading IME. @@ -38,25 +37,26 @@ Backtrace: Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=46263 Signed-off-by: Enrico Horn --- - dlls/winex11.drv/window.c | 5 +++++ - 1 file changed, 5 insertions(+) + dlls/winex11.drv/window.c | 2 -- + dlls/winex11.drv/xim.c | 5 +++++ + 2 files changed, 5 insertions(+), 2 deletions(-) -diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c -index 7a3b340e19a..7dce6816ad7 100644 ---- a/dlls/winex11.drv/window.c -+++ b/dlls/winex11.drv/window.c -@@ -2034,6 +2034,11 @@ XIC X11DRV_get_ic( HWND hwnd ) +diff --git a/dlls/winex11.drv/xim.c b/dlls/winex11.drv/xim.c +index 51fb6bdff62..c6d6882735f 100644 +--- a/dlls/winex11.drv/xim.c ++++ b/dlls/winex11.drv/xim.c +@@ -564,6 +564,11 @@ XIC X11DRV_get_ic( HWND hwnd ) XIM xim; - XIC ret = 0; + XIC ret; + if (!x11drv_thread_data()) + { + release_win_data( data ); + return NULL; + } - if (data) - { - x11drv_thread_data()->last_xic_hwnd = hwnd; + if (!(data = get_win_data( hwnd ))) return 0; + x11drv_thread_data()->last_xic_hwnd = hwnd; + if (!(ret = data->xic) && (xim = x11drv_thread_data()->xim)) -- -2.19.1 +2.40.0 diff --git a/staging/upstream-commit b/staging/upstream-commit index f2d08e16..27e0b914 100644 --- a/staging/upstream-commit +++ b/staging/upstream-commit @@ -1 +1 @@ -64cca153292833151d1adeb185252ca57e2d1625 +b5bc026798c127d5bb4c471d94f7fb5e32b4861c