diff options
author | Jan Dolinar <dolik.rce@gmail.com> | 2021-11-21 17:03:13 +0100 |
---|---|---|
committer | Jan Dolinar <dolik.rce@gmail.com> | 2021-11-21 17:03:13 +0100 |
commit | 12b95b0365aea7f6d766a5dc08a84582c91f02d5 (patch) | |
tree | b7745463adbc8e707547a247c4817bb600f7d5e0 /gtk | |
parent | 6e63cf025c291ad9a36c634b9cad4a1b48d3aeef (diff) | |
download | scintilla-mirror-12b95b0365aea7f6d766a5dc08a84582c91f02d5.tar.gz |
Bug [#2296] Fix multi-monitor widget positioning on wayland
Diffstat (limited to 'gtk')
-rwxr-xr-x | gtk/PlatGTK.cxx | 11 |
1 files changed, 11 insertions, 0 deletions
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); |