diff --git a/hal/linux/UPowerClient.cpp b/hal/linux/UPowerClient.cpp index 816d223ec5e9..d5f5e1ca5268 100644 --- a/hal/linux/UPowerClient.cpp +++ b/hal/linux/UPowerClient.cpp @@ -167,9 +167,13 @@ void UPowerClient::BeginListening() { UpdateTrackedDevices(); }, [](GUniquePtr&& aError) { - g_warning( - "Failed to create DBus proxy for org.freedesktop.UPower: %s\n", - aError->message); + if (!g_error_matches(aError.get(), G_IO_ERROR, + G_IO_ERROR_CANCELLED)) { + g_warning( + "Failed to create DBus proxy for org.freedesktop.UPower: " + "%s\n", + aError->message); + } }); } @@ -275,9 +279,12 @@ void UPowerClient::UpdateTrackedDevices() { G_CALLBACK(DeviceChanged), this); }, [this](GUniquePtr&& aError) { - g_warning( - "Failed to enumerate devices of org.freedesktop.UPower: %s\n", - aError->message); + if (!g_error_matches(aError.get(), G_IO_ERROR, + G_IO_ERROR_CANCELLED)) { + g_warning( + "Failed to enumerate devices of org.freedesktop.UPower: %s\n", + aError->message); + } g_signal_connect(mUPowerProxy, "g-signal", G_CALLBACK(DeviceChanged), this); }); diff --git a/widget/gtk/MPRISServiceHandler.cpp b/widget/gtk/MPRISServiceHandler.cpp index d9d18944629c..458e22fb82d6 100644 --- a/widget/gtk/MPRISServiceHandler.cpp +++ b/widget/gtk/MPRISServiceHandler.cpp @@ -318,9 +318,11 @@ void g_bus_get_callback(GObject* aSourceObject, GAsyncResult* aRes, GDBusConnection* conn = g_bus_get_finish(aRes, getter_Transfers(error)); if (!conn) { - NS_WARNING(nsPrintfCString("Failure at g_bus_get_finish: %s", - error ? error->message : "Unknown Error") - .get()); + if (!IsCancelledGError(error.get())) { + NS_WARNING(nsPrintfCString("Failure at g_bus_get_finish: %s", + error ? error->message : "Unknown Error") + .get()); + } return; } diff --git a/widget/gtk/nsAppShell.cpp b/widget/gtk/nsAppShell.cpp index 8b2c8031088e..7b1fb20041f8 100644 --- a/widget/gtk/nsAppShell.cpp +++ b/widget/gtk/nsAppShell.cpp @@ -220,7 +220,7 @@ void nsAppShell::DBusConnectClientResponse(GObject* aObject, RefPtr proxyClient = dont_AddRef(g_dbus_proxy_new_finish(aResult, getter_Transfers(error))); if (!proxyClient) { - if (!g_error_matches(error.get(), G_IO_ERROR, G_IO_ERROR_CANCELLED)) { + if (!IsCancelledGError(error.get())) { NS_WARNING( nsPrintfCString("Failed to connect to client: %s\n", error->message) .get()); diff --git a/widget/gtk/nsUserIdleServiceGTK.cpp b/widget/gtk/nsUserIdleServiceGTK.cpp index e8741d108695..c556d8ff5847 100644 --- a/widget/gtk/nsUserIdleServiceGTK.cpp +++ b/widget/gtk/nsUserIdleServiceGTK.cpp @@ -196,9 +196,11 @@ class UserIdleServiceMutter : public UserIdleServiceImpl { }, [this](GUniquePtr&& aError) { mPollInProgress = false; - g_warning("Failed to call GetIdletime(): %s\n", - aError->message); - mUserIdleServiceGTK->RejectAndTryNextServiceCallback(); + if (!IsCancelledGError(aError.get())) { + g_warning("Failed to call GetIdletime(): %s\n", + aError->message); + mUserIdleServiceGTK->RejectAndTryNextServiceCallback(); + } }); } @@ -227,7 +229,9 @@ class UserIdleServiceMutter : public UserIdleServiceImpl { mUserIdleServiceGTK->AcceptServiceCallback(); }, [this](GUniquePtr&& aError) { - mUserIdleServiceGTK->RejectAndTryNextServiceCallback(); + if (!IsCancelledGError(aError.get())) { + mUserIdleServiceGTK->RejectAndTryNextServiceCallback(); + } }); return true; }