From 600a06571441f54ee5595ef1bc3169795d4353fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jir=CC=8Ci=CC=81=20Techet?= Date: Mon, 28 Aug 2023 08:22:24 +1000 Subject: Bug [#2401]. gtk: Set type hint for GTK_WINDOW_POPUP windows Without setting the hint the popup windows lead to some obscure behavior on macOS when the main window is full screened, see https://gitlab.gnome.org/GNOME/gtk/-/issues/5716 https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/5778 while the solution from 5778 might be a sufficient workaround, setting the hints might be a good idea in general so the window manager knows better the purpose of these windows. --- gtk/PlatGTK.cxx | 1 + gtk/ScintillaGTK.cxx | 2 ++ 2 files changed, 3 insertions(+) (limited to 'gtk') diff --git a/gtk/PlatGTK.cxx b/gtk/PlatGTK.cxx index 0ff571369..b9e63c8ab 100755 --- a/gtk/PlatGTK.cxx +++ b/gtk/PlatGTK.cxx @@ -1622,6 +1622,7 @@ void ListBoxX::Create(Window &parent, int, Point, int, bool, Technology) { #endif wid = widCached = gtk_window_new(GTK_WINDOW_POPUP); + gtk_window_set_type_hint(GTK_WINDOW(wid), GDK_WINDOW_TYPE_HINT_POPUP_MENU); frame = gtk_frame_new(nullptr); gtk_widget_show(PWidget(frame)); diff --git a/gtk/ScintillaGTK.cxx b/gtk/ScintillaGTK.cxx index 20ab1f452..053202a06 100755 --- a/gtk/ScintillaGTK.cxx +++ b/gtk/ScintillaGTK.cxx @@ -673,6 +673,7 @@ void ScintillaGTK::Init() { /* create pre-edit window */ wPreedit = gtk_window_new(GTK_WINDOW_POPUP); + gtk_window_set_type_hint(GTK_WINDOW(PWidget(wPreedit)), GDK_WINDOW_TYPE_HINT_POPUP_MENU); wPreeditDraw = gtk_drawing_area_new(); GtkWidget *predrw = PWidget(wPreeditDraw); // No code inside the G_OBJECT macro #if GTK_CHECK_VERSION(3,0,0) @@ -1406,6 +1407,7 @@ void ScintillaGTK::Paste() { void ScintillaGTK::CreateCallTipWindow(PRectangle rc) { if (!ct.wCallTip.Created()) { ct.wCallTip = gtk_window_new(GTK_WINDOW_POPUP); + gtk_window_set_type_hint(GTK_WINDOW(PWidget(ct.wCallTip)), GDK_WINDOW_TYPE_HINT_TOOLTIP); ct.wDraw = gtk_drawing_area_new(); GtkWidget *widcdrw = PWidget(ct.wDraw); // // No code inside the G_OBJECT macro gtk_container_add(GTK_CONTAINER(PWidget(ct.wCallTip)), widcdrw); -- cgit v1.2.3