diff --git a/gdk/gdksurface.c b/gdk/gdksurface.c index bcdff00db3..052ec0030a 100644 --- a/gdk/gdksurface.c +++ b/gdk/gdksurface.c @@ -256,7 +256,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;