Merge branch 'master' into 'main'

GdkSurface: prevent popups from appearing offscreen in edge cases

See merge request GNOME/gtk!5320
This commit is contained in:
Jonas Ådahl 2023-09-30 15:03:33 +00:00
commit c86bc00330

View File

@ -254,7 +254,7 @@ maybe_flip_position (int bounds_pos,
*flipped = TRUE;
secondary = rect_pos + (1 - rect_sign) * rect_size / 2 - offset - (1 - surface_sign) * surface_size / 2;
if (secondary >= bounds_pos && secondary + surface_size <= bounds_pos + bounds_size)
if ((secondary >= bounds_pos && secondary + surface_size <= bounds_pos + bounds_size) || primary > bounds_pos + bounds_size)
return secondary;
*flipped = FALSE;