aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJan Dolinar <dolik.rce@gmail.com>2021-11-21 17:03:13 +0100
committerJan Dolinar <dolik.rce@gmail.com>2021-11-21 17:03:13 +0100
commit12b95b0365aea7f6d766a5dc08a84582c91f02d5 (patch)
treeb7745463adbc8e707547a247c4817bb600f7d5e0
parent6e63cf025c291ad9a36c634b9cad4a1b48d3aeef (diff)
downloadscintilla-mirror-12b95b0365aea7f6d766a5dc08a84582c91f02d5.tar.gz
Bug [#2296] Fix multi-monitor widget positioning on wayland
-rw-r--r--doc/ScintillaHistory.html6
-rwxr-xr-xgtk/PlatGTK.cxx11
2 files changed, 17 insertions, 0 deletions
diff --git a/doc/ScintillaHistory.html b/doc/ScintillaHistory.html
index 190820625..8d1d707f7 100644
--- a/doc/ScintillaHistory.html
+++ b/doc/ScintillaHistory.html
@@ -564,6 +564,7 @@
</tr><tr>
<td>Michael Neuroth</td>
<td>Arne Scheffler</td>
+ <td>Jan DolinĂ¡r</td>
</tr>
</table>
<h2>Releases</h2>
@@ -597,6 +598,11 @@
On Win32 prevent potential memory leaks for Korean language input.
<a href="https://sourceforge.net/p/scintilla/bugs/2295/">Bug #2295</a>.
</li>
+ <li>
+ On GTK using Wayland, display autocompletion with window on a secondary monitor.
+ <a href="https://sourceforge.net/p/scintilla/bugs/2296/">Bug #2296</a>,
+ <a href="https://sourceforge.net/p/scintilla/bugs/2261/">Bug #2261</a>.
+ </li>
</ul>
<h3>
<a href="https://www.scintilla.org/scintilla514.zip">Release 5.1.4</a>
diff --git a/gtk/PlatGTK.cxx b/gtk/PlatGTK.cxx
index 770334a92..97b345bac 100755
--- a/gtk/PlatGTK.cxx
+++ b/gtk/PlatGTK.cxx
@@ -23,6 +23,9 @@
#include <gdk/gdk.h>
#include <gtk/gtk.h>
#include <gdk/gdkkeysyms.h>
+#if defined(GDK_WINDOWING_WAYLAND)
+#include <gdk/gdkwayland.h>
+#endif
#include "ScintillaTypes.h"
#include "ScintillaMessages.h"
@@ -1181,6 +1184,14 @@ GdkRectangle MonitorRectangleForWidget(GtkWidget *wid) noexcept {
GdkDisplay *pdisplay = gtk_widget_get_display(wid);
GdkMonitor *monitor = gdk_display_get_monitor_at_window(pdisplay, wnd);
gdk_monitor_get_geometry(monitor, &rcScreen);
+#if defined(GDK_WINDOWING_WAYLAND)
+ if (GDK_IS_WAYLAND_DISPLAY(pdisplay)) {
+ // The GDK behavior on Wayland is not self-consistent, we must correct the display coordinates to match
+ // the coordinate space used in gtk_window_move. See also https://sourceforge.net/p/scintilla/bugs/2296/
+ rcScreen.x = 0;
+ rcScreen.y = 0;
+ }
+#endif
#else
GdkScreen *screen = gtk_widget_get_screen(wid);
const gint monitor_num = gdk_screen_get_monitor_at_window(screen, wnd);