Merge branch 'matthiasc/for-main' into 'main'

wayland: Don't crash during DND with Cairo renderer

See merge request GNOME/gtk!5612
This commit is contained in:
Matthias Clasen 2023-03-08 01:46:43 +00:00
commit cdc008763b
2 changed files with 11 additions and 2 deletions

View File

@ -561,6 +561,12 @@ gdk_wayland_surface_attach_image (GdkSurface *surface,
/* Attach this new buffer to the surface */
wl_surface_attach (impl->display_server.wl_surface,
_gdk_wayland_shm_surface_get_wl_buffer (cairo_surface),
0, 0);
if ((impl->pending_buffer_offset_x || impl->pending_buffer_offset_y) &&
wl_surface_get_version (impl->display_server.wl_surface) >=
WL_SURFACE_OFFSET_SINCE_VERSION)
wl_surface_offset (impl->display_server.wl_surface,
impl->pending_buffer_offset_x,
impl->pending_buffer_offset_y);
impl->pending_buffer_offset_x = 0;

View File

@ -6354,6 +6354,9 @@ gtk_text_drag_drop (GtkDropTarget *dest,
drop_position = gtk_text_find_position (self, x + priv->scroll_offset);
str = g_value_get_string (value);
if (str == NULL)
str = "";
if (priv->truncate_multiline)
length = truncate_multiline (str);
else