app, libgimp*: window handle on Windows have the type HANDLE.

Instead of passing a guint32, pass the proper type, since our the HANDLE type
can be 64-bit on Windows (according to links I found).
I was hoping it might be the reason for the breakage under Windows, though I
also found Microsoft documentation saying that the 64-bit handle can be safely
truncated: https://learn.microsoft.com/en-us/windows/win32/winprog64/interprocess-communication?redirectedfrom=MSDN

Nevertheless I'd appreciate testing again from NikcDC or anyone else, as I
reactivated setting transient between processes on Windows.

Note that I also pass the proper types on X11 now (Window), even though guint32
worked fine. Better be thorough.
This commit is contained in:
Jehan 2023-08-14 18:10:41 +02:00
parent 73e6d4b76c
commit 9a57ab54e9
3 changed files with 64 additions and 42 deletions

View file

@ -1130,20 +1130,20 @@ gimp_widget_set_handle_on_mapped (GtkWidget *widget,
#ifdef GDK_WINDOWING_WIN32
if (GDK_IS_WIN32_WINDOW (surface))
{
guint32 id;
HANDLE id;
id = GPOINTER_TO_INT (GDK_WINDOW_HWND (gtk_widget_get_window (GTK_WIDGET (widget))));
handle = g_bytes_new (&id, sizeof (guint32));
id = GDK_WINDOW_HWND (gtk_widget_get_window (GTK_WIDGET (widget)));
handle = g_bytes_new (&id, sizeof (HANDLE));
}
#endif
#ifdef GDK_WINDOWING_X11
if (GDK_IS_X11_WINDOW (surface))
{
guint32 id;
Window id;
id = GDK_WINDOW_XID (gtk_widget_get_window (GTK_WIDGET (widget)));
handle = g_bytes_new (&id, sizeof (guint32));
handle = g_bytes_new (&id, sizeof (Window));
}
#endif
#ifdef GDK_WINDOWING_WAYLAND