-
-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy pathDBusWingpanelManager.vala
More file actions
56 lines (45 loc) · 1.93 KB
/
DBusWingpanelManager.vala
File metadata and controls
56 lines (45 loc) · 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*
* Copyright 2024 elementary, Inc. (https://elementary.io)
* SPDX-License-Identifier: GPL-2.0-or-later
*/
[DBus (name = "io.elementary.gala.WingpanelInterface")]
public class GreeterCompositor.DBusWingpanelManager : GLib.Object {
private static DBusWingpanelManager? instance;
private static WindowManager wm;
private WingpanelManager background_manager;
private FocusManager focus_manager;
[DBus (visible = false)]
public static void init (WindowManager _wm) {
wm = _wm;
Bus.own_name (BusType.SESSION, "io.elementary.gala.WingpanelInterface", BusNameOwnerFlags.NONE,
(connection) => {
if (instance == null)
instance = new DBusWingpanelManager ();
try {
connection.register_object ("/io/elementary/gala/WingpanelInterface", instance);
} catch (Error e) {
warning (e.message);
}
},
() => {},
() => warning ("Could not acquire name")
);
}
public signal void state_changed (BackgroundState state, uint animation_duration);
public void initialize (int monitor, int panel_height) throws GLib.Error {
background_manager = new WingpanelManager (wm, panel_height);
background_manager.state_changed.connect ((state, animation_duration) => {
state_changed (state, animation_duration);
});
focus_manager = new FocusManager (wm.get_display ());
}
public bool begin_grab_focused_window (int x, int y, int button, uint time, uint state) throws GLib.Error {
return focus_manager.begin_grab_focused_window (x, y, button, time, state);
}
public void remember_focused_window () throws GLib.Error {
focus_manager.remember_focused_window ();
}
public void restore_focused_window () throws GLib.Error {
focus_manager.restore_focused_window ();
}
}