Skip to content

Commit

Permalink
Always ask for a new connection
Browse files Browse the repository at this point in the history
  • Loading branch information
sergio-costas committed Nov 7, 2023
1 parent fb90e7b commit 64c1676
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions packages/ubuntu_provision/lib/src/services/gdm_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,21 @@ import 'package:ubuntu_service/ubuntu_service.dart';
final log = Logger('dart_gdm_service');

class GdmService {
DBusClient? _connection;
bool _testing = false;

void setTesting() {
_testing = true;
}

Future<DBusClient> getClientConnection() async {
if (_connection == null) {
var gdmObject = DBusRemoteObject(DBusClient.system(),
name: 'org.gnome.DisplayManager',
path: DBusObjectPath('/org/gnome/DisplayManager/Manager'));
var response = await gdmObject.callMethod(
'org.gnome.DisplayManager.Manager', 'OpenSession', [],
replySignature: DBusSignature('s'));
var address = response.values[0].asString();
_connection = DBusClient(DBusAddress(address), messageBus: false);
}
return _connection!;
var gdmObject = DBusRemoteObject(DBusClient.system(),
name: 'org.gnome.DisplayManager',
path: DBusObjectPath('/org/gnome/DisplayManager/Manager'));
var response = await gdmObject.callMethod(
'org.gnome.DisplayManager.Manager', 'OpenSession', [],
replySignature: DBusSignature('s'));
var address = response.values[0].asString();
return DBusClient(DBusAddress(address), messageBus: false);
}

Future<DBusRemoteObject> getGreeter() async {
Expand Down

0 comments on commit 64c1676

Please sign in to comment.