rev |
line source |
al@19848
|
1 From a7d3b40a79a7a16c1f5d50d2bd466570258dae29 Mon Sep 17 00:00:00 2001
|
al@19848
|
2 From: =?UTF-8?q?Ball=C3=B3=20Gy=C3=B6rgy?= <ballogyor@gmail.com>
|
al@19848
|
3 Date: Sun, 22 Jan 2017 01:09:59 +0100
|
al@19848
|
4 Subject: [PATCH] Use GApplication for unique app handling
|
al@19848
|
5
|
al@19848
|
6 Remove libunique dependency, and use glib >= 2.28.0 to handle unique apps both for GTK+ 2 and 3.
|
al@19848
|
7 ---
|
al@19848
|
8 Makefile.am | 6 ------
|
al@19848
|
9 configure.ac | 7 +------
|
al@19848
|
10 lxclipboard/main.vala | 16 +---------------
|
al@19848
|
11 lxpolkit/main.vala | 16 +---------------
|
al@19848
|
12 4 files changed, 3 insertions(+), 42 deletions(-)
|
al@19848
|
13
|
al@19848
|
14 diff --git a/Makefile.am b/Makefile.am
|
al@19848
|
15 index c2e1fe8..e3a3b97 100644
|
al@19848
|
16 --- a/Makefile.am
|
al@19848
|
17 +++ b/Makefile.am
|
al@19848
|
18 @@ -90,9 +90,6 @@ if USE_GTK3
|
al@19848
|
19 lxclipboard_lxclipboard_VALAFLAGS += --define USE_GTK3
|
al@19848
|
20 else
|
al@19848
|
21 lxclipboard_lxclipboard_VALAFLAGS += --define USE_GTK2
|
al@19848
|
22 -lxclipboard_lxclipboard_VALAFLAGS += --pkg unique-1.0
|
al@19848
|
23 -lxclipboard_lxclipboard_CPPFLAGS += $(UNIQUE_CFLAGS)
|
al@19848
|
24 -lxclipboard_lxclipboard_LDADD += $(UNIQUE_LIBS)
|
al@19848
|
25 endif
|
al@19848
|
26
|
al@19848
|
27 lxpolkit_lxpolkit_vala_SOURCES = \
|
al@19848
|
28 @@ -137,9 +134,6 @@ if USE_GTK3
|
al@19848
|
29 lxpolkit_lxpolkit_VALAFLAGS += --define USE_GTK3
|
al@19848
|
30 else
|
al@19848
|
31 lxpolkit_lxpolkit_VALAFLAGS += --define USE_GTK2
|
al@19848
|
32 -lxpolkit_lxpolkit_VALAFLAGS += --pkg unique-1.0
|
al@19848
|
33 -lxpolkit_lxpolkit_CPPFLAGS += $(UNIQUE_CFLAGS)
|
al@19848
|
34 -lxpolkit_lxpolkit_LDADD += $(UNIQUE_LIBS)
|
al@19848
|
35 endif
|
al@19848
|
36
|
al@19848
|
37 lxsession_db_lxsession_db_SOURCES = \
|
al@19848
|
38 diff --git a/configure.ac b/configure.ac
|
al@19848
|
39 index 06ddbb3..9126f4d 100644
|
al@19848
|
40 --- a/configure.ac
|
al@19848
|
41 +++ b/configure.ac
|
al@19848
|
42 @@ -45,7 +45,7 @@ PKG_CHECK_MODULES(X11, [x11])
|
al@19848
|
43 AC_SUBST(X11_CFLAGS)
|
al@19848
|
44 AC_SUBST(X11_LIBS)
|
al@19848
|
45
|
al@19848
|
46 -PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.6.0])
|
al@19848
|
47 +PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.28.0])
|
al@19848
|
48 AC_SUBST(GLIB_CFLAGS)
|
al@19848
|
49 AC_SUBST(GLIB_LIBS)
|
al@19848
|
50
|
al@19848
|
51 @@ -79,11 +79,6 @@ else
|
al@19848
|
52 CFLAGS="$CFLAGS -D USE_GTK2"
|
al@19848
|
53 gtk_modules="gtk+-2.0 >= 2.6.0"
|
al@19848
|
54 VALA_GTK_LIBS="gtk+-2.0"
|
al@19848
|
55 -
|
al@19848
|
56 - PKG_CHECK_MODULES(UNIQUE, [unique-1.0])
|
al@19848
|
57 - AC_SUBST(UNIQUE_CFLAGS)
|
al@19848
|
58 - AC_SUBST(UNIQUE_LIBS)
|
al@19848
|
59 -
|
al@19848
|
60 fi
|
al@19848
|
61 PKG_CHECK_MODULES(GTK, [$gtk_modules])
|
al@19848
|
62 AC_SUBST(GTK_CFLAGS)
|
al@19848
|
63 diff --git a/lxclipboard/main.vala b/lxclipboard/main.vala
|
al@19848
|
64 index bee4044..3d4a8d7 100644
|
al@19848
|
65 --- a/lxclipboard/main.vala
|
al@19848
|
66 +++ b/lxclipboard/main.vala
|
al@19848
|
67 @@ -17,9 +17,6 @@
|
al@19848
|
68 * MA 02110-1301, USA.
|
al@19848
|
69 */
|
al@19848
|
70 using Gtk;
|
al@19848
|
71 -#if USE_GTK2
|
al@19848
|
72 -using Unique;
|
al@19848
|
73 -#endif
|
al@19848
|
74
|
al@19848
|
75 namespace Lxsession
|
al@19848
|
76 {
|
al@19848
|
77 @@ -28,17 +25,7 @@ namespace Lxsession
|
al@19848
|
78 public static int main(string[] args)
|
al@19848
|
79 {
|
al@19848
|
80 Gtk.init (ref args);
|
al@19848
|
81 -#if USE_GTK2
|
al@19848
|
82 - Unique.App app = new Unique.App("org.lxde.lxclipboard", null);
|
al@19848
|
83 -
|
al@19848
|
84 - if(app.is_running)
|
al@19848
|
85 - {
|
al@19848
|
86 - message("lxclipboard is already running. Existing");
|
al@19848
|
87 - return 0;
|
al@19848
|
88 - }
|
al@19848
|
89 -#endif
|
al@19848
|
90 -# if USE_GTK3
|
al@19848
|
91 - Gtk.Application app = new Gtk.Application (
|
al@19848
|
92 + GLib.Application app = new GLib.Application (
|
al@19848
|
93 "org.lxde.lxclipboard",
|
al@19848
|
94 GLib.ApplicationFlags.FLAGS_NONE);
|
al@19848
|
95 app.register ();
|
al@19848
|
96 @@ -48,7 +35,6 @@ namespace Lxsession
|
al@19848
|
97 message("lxclipboard is already running. Existing");
|
al@19848
|
98 return 0;
|
al@19848
|
99 }
|
al@19848
|
100 -#endif
|
al@19848
|
101
|
al@19848
|
102 clipboard_start ();
|
al@19848
|
103
|
al@19848
|
104 diff --git a/lxpolkit/main.vala b/lxpolkit/main.vala
|
al@19848
|
105 index c0d6ae2..50c3cb7 100644
|
al@19848
|
106 --- a/lxpolkit/main.vala
|
al@19848
|
107 +++ b/lxpolkit/main.vala
|
al@19848
|
108 @@ -17,9 +17,6 @@
|
al@19848
|
109 * MA 02110-1301, USA.
|
al@19848
|
110 */
|
al@19848
|
111 using Gtk;
|
al@19848
|
112 -#if USE_GTK2
|
al@19848
|
113 -using Unique;
|
al@19848
|
114 -#endif
|
al@19848
|
115
|
al@19848
|
116 const string GETTEXT_PACKAGE = "lxsession";
|
al@19848
|
117
|
al@19848
|
118 @@ -33,17 +30,7 @@ namespace Lxsession
|
al@19848
|
119 Intl.bind_textdomain_codeset(GETTEXT_PACKAGE, "utf-8");
|
al@19848
|
120
|
al@19848
|
121 Gtk.init (ref args);
|
al@19848
|
122 -#if USE_GTK2
|
al@19848
|
123 - Unique.App app = new Unique.App("org.lxde.lxpolkit", null);
|
al@19848
|
124 -
|
al@19848
|
125 - if(app.is_running)
|
al@19848
|
126 - {
|
al@19848
|
127 - message(_("lxpolkit is already running. Existing"));
|
al@19848
|
128 - return 0;
|
al@19848
|
129 - }
|
al@19848
|
130 -#endif
|
al@19848
|
131 -# if USE_GTK3
|
al@19848
|
132 - Gtk.Application app = new Gtk.Application (
|
al@19848
|
133 + GLib.Application app = new GLib.Application (
|
al@19848
|
134 "org.lxde.lxpolkit",
|
al@19848
|
135 GLib.ApplicationFlags.FLAGS_NONE);
|
al@19848
|
136 app.register ();
|
al@19848
|
137 @@ -53,7 +40,6 @@ namespace Lxsession
|
al@19848
|
138 message(_("lxpolkit is already running. Existing"));
|
al@19848
|
139 return 0;
|
al@19848
|
140 }
|
al@19848
|
141 -#endif
|
al@19848
|
142
|
al@19848
|
143 policykit_agent_init();
|
al@19848
|
144
|
al@19848
|
145 --
|
al@19848
|
146 2.11.0
|
al@19848
|
147
|