From: Руслан Ижбулатов Date: Sat, 16 Jun 2018 18:24:56 +0000 (+0000) Subject: W32: Use correct hinstance values X-Git-Tag: archive/raspbian/4.4.1+ds1-2+rpi1^2~18^2~22^2~133^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=8a1106c6394805bfdd6d5a7e39d2f37a40959d61;p=gtk4.git W32: Use correct hinstance values According to the old new thing[0], we should use the instance handle of the GDK/GTK DLL when registering GDK-specific types in the system. Using the instance handle for the whole application in these circumstances is not an error, but can potentially clash with the types registered by the application itself. Also, extract window class icons from the GDK/GTK DLL, not from the application executable. [0]: https://blogs.msdn.microsoft.com/oldnewthing/20050418-59/?p=35873 --- diff --git a/gdk/win32/gdksurface-win32.c b/gdk/win32/gdksurface-win32.c index 8b3cfa15bd..ce10a17055 100644 --- a/gdk/win32/gdksurface-win32.c +++ b/gdk/win32/gdksurface-win32.c @@ -401,7 +401,7 @@ RegisterGdkClass (GdkSurfaceType wtype, GdkSurfaceTypeHint wtype_hint) wcl.lpfnWndProc = _gdk_win32_surface_procedure; wcl.cbClsExtra = 0; wcl.cbWndExtra = 0; - wcl.hInstance = _gdk_app_hmodule; + wcl.hInstance = _gdk_dll_hinstance; wcl.hIcon = 0; wcl.hIconSm = 0; @@ -410,7 +410,7 @@ RegisterGdkClass (GdkSurfaceType wtype, GdkSurfaceTypeHint wtype_hint) { gchar sLoc [MAX_PATH+1]; - if (0 != GetModuleFileName (_gdk_app_hmodule, sLoc, MAX_PATH)) + if (0 != GetModuleFileName (_gdk_dll_hinstance, sLoc, MAX_PATH)) { ExtractIconEx (sLoc, 0, &hAppIcon, &hAppIconSm, 1); @@ -682,7 +682,7 @@ _gdk_win32_display_create_surface_impl (GdkDisplay *display, window_width, window_height, hparent, NULL, - _gdk_app_hmodule, + _gdk_dll_hinstance, window); if (GDK_SURFACE_HWND (window) != hwndNew) { @@ -3176,7 +3176,7 @@ RegisterGdkDumbClass () wcl.lpfnWndProc = DefWindowProcW; wcl.cbClsExtra = 0; wcl.cbWndExtra = 0; - wcl.hInstance = _gdk_app_hmodule; + wcl.hInstance = _gdk_dll_hinstance; wcl.hIcon = 0; wcl.hIconSm = 0; wcl.lpszMenuName = NULL; @@ -3217,7 +3217,7 @@ ensure_snap_indicator_exists (GdkW32DragMoveResizeContext *context) 0, 0, NULL, NULL, - _gdk_app_hmodule, + _gdk_dll_hinstance, NULL); context->shape_indicator = handle;