From 5ff7c3431b0dabe59cfd02af084deacdde45bd27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A0=D1=83=D1=81=D0=BB=D0=B0=D0=BD=20=D0=98=D0=B6=D0=B1?= =?UTF-8?q?=D1=83=D0=BB=D0=B0=D1=82=D0=BE=D0=B2?= Date: Mon, 27 May 2019 23:51:38 +0000 Subject: [PATCH] GDK W32: Don't handle WM_ACTIVATE for popup windows Popups can't be active or inactive, so emitting GDK events in response to WM_ACTIVATE makes no sense for these kinds of GDK surfaces. The jury is still out on whether we should block (return 0) or ignore (don't return anything) this message. Blocking WM_NCACTIVATE (which we currently ignore) is definitely not an option - it completely breaks input somehow. --- gdk/win32/gdkevents-win32.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/gdk/win32/gdkevents-win32.c b/gdk/win32/gdkevents-win32.c index 126177e4e5..1a8b86c335 100644 --- a/gdk/win32/gdkevents-win32.c +++ b/gdk/win32/gdkevents-win32.c @@ -3430,6 +3430,16 @@ gdk_event_translate (MSG *msg, (LOWORD (msg->wParam) == WA_INACTIVE ? "INACTIVE" : "???"))), HIWORD (msg->wParam) ? " minimized" : "", (HWND) msg->lParam)); + if (window->surface_type == GDK_SURFACE_POPUP) + { + /* Popups cannot be activated or de-activated - + * they only support keyboard focus, which GTK + * will handle for us. + */ + *ret_valp = 0; + return_val = TRUE; + break; + } /* We handle mouse clicks for modally-blocked windows under WM_MOUSEACTIVATE, * but we still need to deal with alt-tab, or with SetActiveWindow() type * situations.