From: Marc-André Lureau Date: Tue, 23 Aug 2022 12:31:07 +0000 (+0400) Subject: gtk/win32: use gdk_win32_surface_get_handle X-Git-Tag: archive/raspbian/4.8.3+ds-2+rpi1~3^2~20^2~3^2~58^2~4 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=04ebec0fa7581ddfa5d815d2de0671b2b4e45445;p=gtk4.git gtk/win32: use gdk_win32_surface_get_handle As I propose to deprecate gdk_win32_surface_get_impl_hwnd() next, replace it with the alternative. The main difference between the two functions is that gdk_win32_surface_get_impl_hwnd() fails gracefully by returning NULL if the surface is not of the win32 implementation. All the surfaces should be native surfaces here, and the existing code doesn't seem to deal with NULL case anyway. Signed-off-by: Marc-André Lureau --- diff --git a/gtk/gtkimcontextime.c b/gtk/gtkimcontextime.c index adb122f2c6..91eb726a24 100644 --- a/gtk/gtkimcontextime.c +++ b/gtk/gtkimcontextime.c @@ -256,7 +256,7 @@ gtk_im_context_ime_set_client_widget (GtkIMContext *context, if (surface != NULL) { - HWND hwnd = gdk_win32_surface_get_impl_hwnd (surface); + HWND hwnd = gdk_win32_surface_get_handle (surface); HIMC himc = ImmGetContext (hwnd); if (himc) { @@ -418,7 +418,7 @@ gtk_im_context_ime_reset (GtkIMContext *context) if (!context_ime->client_surface) return; - hwnd = gdk_win32_surface_get_impl_hwnd (context_ime->client_surface); + hwnd = gdk_win32_surface_get_handle (context_ime->client_surface); himc = ImmGetContext (hwnd); if (!himc) return; @@ -453,7 +453,7 @@ get_utf8_preedit_string (GtkIMContextIME *context_ime, if (!context_ime->client_surface) return g_strdup (""); - hwnd = gdk_win32_surface_get_impl_hwnd (context_ime->client_surface); + hwnd = gdk_win32_surface_get_handle (context_ime->client_surface); himc = ImmGetContext (hwnd); if (!himc) return g_strdup (""); @@ -512,7 +512,7 @@ get_pango_attr_list (GtkIMContextIME *context_ime, const char *utf8str) if (!context_ime->client_surface) return attrs; - hwnd = gdk_win32_surface_get_impl_hwnd (context_ime->client_surface); + hwnd = gdk_win32_surface_get_handle (context_ime->client_surface); himc = ImmGetContext (hwnd); if (!himc) return attrs; @@ -655,7 +655,7 @@ gtk_im_context_ime_focus_in (GtkIMContext *context) return; } - hwnd = gdk_win32_surface_get_impl_hwnd (toplevel); + hwnd = gdk_win32_surface_get_handle (toplevel); himc = ImmGetContext (hwnd); if (!himc) return; @@ -780,7 +780,7 @@ gtk_im_context_ime_set_cursor_location (GtkIMContext *context, if (!context_ime->client_surface) return; - hwnd = gdk_win32_surface_get_impl_hwnd (context_ime->client_surface); + hwnd = gdk_win32_surface_get_handle (context_ime->client_surface); himc = ImmGetContext (hwnd); if (!himc) return; @@ -811,7 +811,7 @@ gtk_im_context_ime_set_use_preedit (GtkIMContext *context, HWND hwnd; HIMC himc; - hwnd = gdk_win32_surface_get_impl_hwnd (context_ime->client_surface); + hwnd = gdk_win32_surface_get_handle (context_ime->client_surface); himc = ImmGetContext (hwnd); if (!himc) return; @@ -844,7 +844,7 @@ gtk_im_context_ime_set_preedit_font (GtkIMContext *context) if (!(context_ime->client_widget && context_ime->client_surface)) return; - hwnd = gdk_win32_surface_get_impl_hwnd (context_ime->client_surface); + hwnd = gdk_win32_surface_get_handle (context_ime->client_surface); himc = ImmGetContext (hwnd); if (!himc) return; @@ -955,10 +955,10 @@ gtk_im_context_ime_message_filter (GdkWin32Display *display, return retval; toplevel = context_ime->client_surface; - if (gdk_win32_surface_get_impl_hwnd (toplevel) != msg->hwnd) + if (gdk_win32_surface_get_handle (toplevel) != msg->hwnd) return retval; - hwnd = gdk_win32_surface_get_impl_hwnd (context_ime->client_surface); + hwnd = gdk_win32_surface_get_handle (context_ime->client_surface); himc = ImmGetContext (hwnd); if (!himc) return retval;