Issue #12357: Fix navigation popup positioning and dragging on Wayland

This commit is contained in:
balooii balooii 2026-03-07 08:17:52 +01:00 committed by Jehan
parent f33200fe8d
commit e0d70d4dc9
2 changed files with 16 additions and 3 deletions

View file

@ -312,6 +312,8 @@ gimp_navigation_editor_popup (GimpDisplayShell *shell,
/* Set poup screen */
gtk_window_set_screen (GTK_WINDOW (shell->nav_popup),
gtk_widget_get_screen (widget));
gtk_window_set_transient_for (GTK_WINDOW (shell->nav_popup),
GTK_WINDOW (gtk_widget_get_toplevel (widget)));
gimp_navigation_view_get_local_marker (view,
&view_marker_center_x,

View file

@ -387,10 +387,21 @@ gimp_navigation_view_motion_notify (GtkWidget *widget,
return FALSE;
}
gimp_navigation_view_move_to (nav_view,
mevent->x - nav_view->motion_offset_x,
mevent->y - nav_view->motion_offset_y);
/* Derive window-local coords from root coords and event_window's screen origin.
* This only makes a difference on Wayland, on other platforms the event coords
* are not local so this is a noop */
{
gint origin_x, origin_y;
gdouble mx, my;
gdk_window_get_origin (view->event_window, &origin_x, &origin_y);
mx = mevent->x_root - origin_x;
my = mevent->y_root - origin_y;
gimp_navigation_view_move_to (nav_view,
mx - nav_view->motion_offset_x,
my - nav_view->motion_offset_y);
}
gdk_event_request_motions (mevent);
return TRUE;