-
-
Notifications
You must be signed in to change notification settings - Fork 320
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed detection of gnome-shell backend if dbus service is not stared
- Loading branch information
Showing
1 changed file
with
9 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
/* | ||
Peek Copyright (c) 2017-2018 by Philipp Wolfer <[email protected]> | ||
This file is part of Peek. | ||
Copyright (c) 2017-2018, 2021 by Philipp Wolfer <[email protected]> | ||
Copyright (c) 2021 Andreas Dangel <[email protected]> | ||
This software is licensed under the GNU General Public License | ||
(version 3 or later). See the LICENSE file in this distribution. | ||
*/ | ||
|
@@ -100,6 +101,12 @@ namespace Peek.Recording { | |
BusType.SESSION, | ||
"org.freedesktop.DBus", | ||
"/org/freedesktop/DBus"); | ||
try { | ||
// The service might need to get started before being available | ||
dbus.start_service_by_name (DBUS_NAME, 0); | ||
} catch (DBusError e) { | ||
return false; | ||
} | ||
return dbus.name_has_owner (DBUS_NAME); | ||
} catch (DBusError e) { | ||
stderr.printf ("Error: %s\n", e.message); | ||
|