mirror of
https://github.com/edu4rdshl/gnome-shell.git
synced 2026-07-17 23:24:51 +00:00
st/clipboard: Check for errors when creating MetaSelectionSourceMemory
depends on !3551 Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3161>
This commit is contained in:
parent
8e21eb4c60
commit
77af504930
1 changed files with 10 additions and 1 deletions
|
|
@ -297,6 +297,7 @@ st_clipboard_set_content (StClipboard *clipboard,
|
|||
{
|
||||
MetaSelectionType selection_type;
|
||||
MetaSelectionSource *source;
|
||||
g_autoptr (GError) error = NULL;
|
||||
|
||||
g_return_if_fail (ST_IS_CLIPBOARD (clipboard));
|
||||
g_return_if_fail (meta_selection != NULL);
|
||||
|
|
@ -305,7 +306,15 @@ st_clipboard_set_content (StClipboard *clipboard,
|
|||
if (!convert_type (type, &selection_type))
|
||||
return;
|
||||
|
||||
source = meta_selection_source_memory_new (mimetype, bytes);
|
||||
source = meta_selection_source_memory_new (mimetype, bytes, &error);
|
||||
|
||||
if (!source)
|
||||
{
|
||||
g_warning ("Failed to create new MetaSelectionSourceMemory: %s",
|
||||
error->message);
|
||||
return;
|
||||
}
|
||||
|
||||
meta_selection_set_owner (meta_selection, selection_type, source);
|
||||
g_object_unref (source);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue