talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit b4bbbb1b52d86d9cbddc0e853249fe4ff2e35cba
parent fe77dab59168c7139fb50bc173ae21efe416d65e
Author: paul <paul@claws-mail.org>
Date:   Tue, 22 Dec 2020 12:12:02 +0000

better check for X. thanks to Andreas Radke

Diffstat:
Msrc/main.c | 14+++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/main.c b/src/main.c @@ -1,6 +1,6 @@ /* * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client - * Copyright (C) 1999-2019 Hiroyuki Yamamoto and the Claws Mail team + * Copyright (C) 1999-2020 the Claws Mail team and Hiroyuki Yamamoto * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -51,10 +51,12 @@ #include "file_checker.h" #include "wizard.h" #ifdef HAVE_STARTUP_NOTIFICATION +#ifdef GDK_WINDOWING_X11 # define SN_API_NOT_YET_FROZEN # include <libsn/sn-launchee.h> # include <gdk/gdkx.h> #endif +#endif #ifdef HAVE_DBUS_GLIB #include <dbus/dbus-glib.h> @@ -1042,8 +1044,12 @@ int main(int argc, char *argv[]) lock_socket = prohibit_duplicate_launch(); if (lock_socket < 0) { #ifdef HAVE_STARTUP_NOTIFICATION - if(gtk_init_check(&argc, &argv) && !strcmp(g_getenv("XDG_SESSION_TYPE"), "x11")) +#ifdef GDK_WINDOWING_X11 + if (GDK_IS_X11_DISPLAY(gdk_display_get_default())) { + if (gtk_init_check(&argc, &argv)) startup_notification_complete(TRUE); + } +#endif #endif return 0; } @@ -1570,9 +1576,11 @@ int main(int argc, char *argv[]) static_mainwindow = mainwin; #ifdef HAVE_STARTUP_NOTIFICATION - if (!strcmp(g_getenv("XDG_SESSION_TYPE"), "x11")) +#ifdef GDK_WINDOWING_X11 + if (GDK_IS_X11_DISPLAY(gdk_display_get_default())) startup_notification_complete(FALSE); #endif +#endif #ifdef HAVE_LIBSM sc_session_manager_connect(mainwin); #endif