Merge branch 'main' into 'main'

textbuffer: Clear paste point override from empty middle clicks

Closes #5530

See merge request GNOME/gtk!6811
This commit is contained in:
Matthias Clasen 2024-08-22 18:11:05 +00:00
commit 0105da3238

View File

@ -3823,11 +3823,20 @@ gtk_text_buffer_paste_clipboard_finish (GObject *source,
ClipboardRequest *request_data = data;
GtkTextBuffer *src_buffer;
GtkTextIter start, end;
GtkTextMark *paste_point_override;
const GValue *value;
value = gdk_clipboard_read_value_finish (clipboard, result, NULL);
if (value == NULL)
return;
{
/* Clear paste point override from empty middle-click paste */
paste_point_override = gtk_text_buffer_get_mark (request_data->buffer,
"gtk_paste_point_override");
if (paste_point_override != NULL)
gtk_text_buffer_delete_mark (request_data->buffer, paste_point_override);
return;
}
src_buffer = g_value_get_object (value);