Compare commits

...

1 Commits

Author SHA1 Message Date
Chun-wei Fan
8b49ebe34f gdkevents-win32.c: Avoid crash in SetTimer()
Since we only support a single GdkDisplay for Windows, make use of it to
ensure we always obtain a proper GdkDisplay to check whether a modal
operation is in progress.

This should fix issue #7147.
2024-11-11 12:53:39 +08:00

View File

@@ -1365,7 +1365,9 @@ modal_timer_proc (HWND hwnd,
DWORD time)
{
int arbitrary_limit = 10;
GdkWin32Display *display = GDK_WIN32_DISPLAY (gdk_surface_get_display (GDK_SURFACE (id)));
/* todo: if we support multiple GdkDisplay's on Windows? */
GdkWin32Display *display = GDK_WIN32_DISPLAY (gdk_display_get_default ());
while (display->display_surface_record->modal_operation_in_progress != GDK_WIN32_MODAL_OP_NONE &&
g_main_context_pending (NULL) &&