Skip to content

Commit

Permalink
Fixed detection of gnome-shell backend if dbus service is not stared
Browse files Browse the repository at this point in the history
  • Loading branch information
phw committed Dec 11, 2021
1 parent 008d153 commit b4957d1
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/recording/gnome-shell-dbus-recorder.vala
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.
*/
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit b4957d1

Please sign in to comment.