diff options
author | Jiří Techet <techet@gmail.com> | 2023-08-28 08:22:24 +1000 |
---|---|---|
committer | Jiří Techet <techet@gmail.com> | 2023-08-28 08:22:24 +1000 |
commit | 600a06571441f54ee5595ef1bc3169795d4353fb (patch) | |
tree | 3f9afb2dae1cf027c8ab1e1c7c9f2cb079fbdaea | |
parent | 5e2c44ecb87b123d0d8e8cf10c3474c8d98f02fd (diff) | |
download | scintilla-mirror-600a06571441f54ee5595ef1bc3169795d4353fb.tar.gz |
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.
-rw-r--r-- | doc/ScintillaHistory.html | 4 | ||||
-rwxr-xr-x | gtk/PlatGTK.cxx | 1 | ||||
-rwxr-xr-x | gtk/ScintillaGTK.cxx | 2 |
3 files changed, 7 insertions, 0 deletions
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html index c32dfdb5b..72a02b7a4 100644 --- a/doc/ScintillaHistory.html +++ b/doc/ScintillaHistory.html @@ -590,6 +590,10 @@ Released 26 July 2023. </li> <li> + For GTK on macOS, fix popup window behaviour by setting type hints. + <a href="https://sourceforge.net/p/scintilla/bugs/2401/">Bug #2401</a>. + </li> + <li> For Qt, allow parent window to handle context menu events by setting as ignored. <a href="https://sourceforge.net/p/scintilla/bugs/2395/">Bug #2395</a>. </li> 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); |