mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-02 17:26:17 +01:00
gwin32notificationbackend: Only warn once
Use a GOnce to make sure we only warn about notifications not being supported on Windows once, rather than on each attempted notification. Signed-off-by: Philip Withnall <withnall@endlessm.com> Helps: https://gitlab.gnome.org/GNOME/glib/issues/1234
This commit is contained in:
parent
fded2090e2
commit
39382c7889
@ -59,12 +59,18 @@ g_win32_notification_backend_send_notification (GNotificationBackend *backend,
|
||||
const gchar *id,
|
||||
GNotification *notification)
|
||||
{
|
||||
static gsize warned = 0;
|
||||
|
||||
/* FIXME: See https://bugzilla.gnome.org/show_bug.cgi?id=776583. This backend
|
||||
* exists purely to stop crashes when applications use g_notification*()
|
||||
* on Windows, by providing a dummy backend implementation. (The alternative
|
||||
* was to modify all of the backend call sites in g_notification*(), which
|
||||
* seemed less scalable.) */
|
||||
if (g_once_init_enter (&warned))
|
||||
{
|
||||
g_warning ("Notifications are not yet supported on Windows.");
|
||||
g_once_init_leave (&warned, 1);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
Reference in New Issue
Block a user