[mutter/wip/carlosg/issue-598: 4/4] x11: Do not warn on cancelled X11 selection sources
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/carlosg/issue-598: 4/4] x11: Do not warn on cancelled X11 selection sources
- Date: Wed, 15 May 2019 13:14:28 +0000 (UTC)
commit 9e82f9af25cf1ca9f2f082279a59af0b556562b5
Author: Carlos Garnacho <carlosg gnome org>
Date: Mon May 13 12:44:30 2019 +0200
x11: Do not warn on cancelled X11 selection sources
This shouldn't happen frequently, but is just a sign that the source is
being replaced by something else. Just keep the warning for other possible
error situations.
Also, plug the potential GError leak.
Closes: https://gitlab.gnome.org/GNOME/mutter/issues/598
src/x11/meta-x11-selection.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/x11/meta-x11-selection.c b/src/x11/meta-x11-selection.c
index 5b87c424c..882b43297 100644
--- a/src/x11/meta-x11-selection.c
+++ b/src/x11/meta-x11-selection.c
@@ -249,7 +249,7 @@ source_new_cb (GObject *object,
MetaSelection *selection = data->selection;
MetaSelectionType selection_type = data->selection_type;
MetaX11Display *x11_display = data->x11_display;
- GError *error = NULL;
+ g_autoptr (GError) error = NULL;
source = meta_selection_source_x11_new_finish (res, &error);
if (source)
@@ -257,7 +257,7 @@ source_new_cb (GObject *object,
meta_selection_set_owner (selection, selection_type, source);
g_set_object (&x11_display->selection.owners[selection_type], source);
}
- else
+ else if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
{
g_warning ("Could not create selection source for X11: %s",
error->message);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]