-
Notifications
You must be signed in to change notification settings - Fork 53
/
main.vala
72 lines (59 loc) · 1.57 KB
/
main.vala
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
using Gtk;
int main (string[] args) {
Intl.bindtextdomain( Config.GETTEXT_PACKAGE, Config.LOCALEDIR );
Intl.bind_textdomain_codeset( Config.GETTEXT_PACKAGE, "UTF-8" );
Intl.textdomain( Config.GETTEXT_PACKAGE );
Gtk.init (ref args);
var id = GLib.Environment.get_variable("DESKTOP_AUTOSTART_ID");
var app = new Unique.App ("id.or.blankonlinux.Manokwari", id);
if (app.is_running ()) {
stdout.printf ("Manokwari is already running.\n");
return 0;
}
PanelSessionManager.getInstance ();
Bus.own_name(
BusType.SESSION,
"org.gnome.Panel",
0,
() => {},
() => {},
() => {
stderr.printf ("Unable to claim Panel from gnome-session");
}
);
// Shell
var shell = new PanelShell();
// Desktop
var d = new PanelDesktop ();
d.show ();
// Window
var w = new PanelWindowHost ();
w.show();
var menu_box = new PanelMenuBox();
// SIGNALS
w.menu_clicked.connect (() => {
if (menu_box.visible) {
menu_box.try_hide ();
} else {
// Otherwise we want to show it
menu_box.show ();
}
});
w.dialog_opened.connect (() => {
if (menu_box.visible) {
menu_box.try_hide ();
}
});
d.desktop_clicked.connect (() => {
if (menu_box.visible) {
menu_box.try_hide ();
}
});
w.windows_visible.connect (() => {
if (menu_box.visible) {
menu_box.try_hide ();
}
});
Gtk.main ();
return 0;
}