Update upstream source from tag 'upstream/2.0.7'
Update to upstream version '2.0.7'
with Debian dir e5db32f479b556dab089b4e31da879b9b5ee8758
Fabio Fantoni
3 years ago
0 | |
install_data(['80xapp-gtk3-module.sh'],
|
1 | |
install_dir: join_paths(get_option('sysconfdir'), 'X11', 'xinit', 'xinitrc.d'),
|
2 | |
install_mode: 'rwxr-xr-x'
|
3 | |
)
|
|
0 |
|
|
1 |
if not app_lib_only
|
|
2 |
install_data(['80xapp-gtk3-module.sh'],
|
|
3 |
install_dir: join_paths(get_option('sysconfdir'), 'X11', 'xinit', 'xinitrc.d'),
|
|
4 |
install_mode: 'rwxr-xr-x'
|
|
5 |
)
|
|
6 |
endif⏎
|
205 | 205 |
XAppFavoriteInfo *info = (XAppFavoriteInfo *) ptr_a;
|
206 | 206 |
const gchar *uri = (gchar *) ptr_b;
|
207 | 207 |
|
|
208 |
// GCompareFunc returns 0 when there's a match.
|
208 | 209 |
return g_strcmp0 (info->uri, uri);
|
209 | 210 |
}
|
210 | 211 |
|
|
251 | 252 |
{
|
252 | 253 |
added = g_list_prepend (added, new_info);
|
253 | 254 |
}
|
|
255 |
}
|
|
256 |
|
|
257 |
for (iter = removed; iter != NULL; iter = iter->next)
|
|
258 |
{
|
|
259 |
XAppFavoriteInfo *removed_info = (XAppFavoriteInfo *) iter->data;
|
|
260 |
|
|
261 |
GFile *file = _favorite_vfs_file_new_for_info (removed_info);
|
|
262 |
|
|
263 |
g_file_monitor_emit_event (G_FILE_MONITOR (monitor),
|
|
264 |
file,
|
|
265 |
NULL,
|
|
266 |
G_FILE_MONITOR_EVENT_DELETED);
|
|
267 |
g_file_monitor_emit_event (G_FILE_MONITOR (monitor),
|
|
268 |
file,
|
|
269 |
NULL,
|
|
270 |
G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT);
|
|
271 |
g_object_unref (file);
|
254 | 272 |
}
|
255 | 273 |
|
256 | 274 |
for (iter = added; iter != NULL; iter = iter->next)
|
|
270 | 288 |
g_object_unref (file);
|
271 | 289 |
}
|
272 | 290 |
|
273 | |
for (iter = removed; iter != NULL; iter = iter->next)
|
274 | |
{
|
275 | |
XAppFavoriteInfo *removed_info = (XAppFavoriteInfo *) iter->data;
|
276 | |
|
277 | |
GFile *file = _favorite_vfs_file_new_for_info (removed_info);
|
278 | |
|
279 | |
g_file_monitor_emit_event (G_FILE_MONITOR (monitor),
|
280 | |
file,
|
281 | |
NULL,
|
282 | |
G_FILE_MONITOR_EVENT_DELETED);
|
283 | |
g_file_monitor_emit_event (G_FILE_MONITOR (monitor),
|
284 | |
file,
|
285 | |
NULL,
|
286 | |
G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT);
|
287 | |
g_object_unref (file);
|
288 | |
}
|
289 | |
|
290 | 291 |
g_list_free (added);
|
291 | 292 |
g_list_free (removed);
|
292 | 293 |
|
146 | 146 |
install: true
|
147 | 147 |
)
|
148 | 148 |
|
149 | |
gtk3_module = shared_module(
|
150 | |
'xapp-gtk3-module', ['xapp-gtk3-module.c'],
|
151 | |
include_directories: [top_inc],
|
152 | |
dependencies: [gtk3_dep, libxapp_dep],
|
153 | |
install: true,
|
154 | |
install_dir: join_paths(gtk3_dep.get_pkgconfig_variable('libdir'),'gtk-3.0','modules')
|
155 | |
)⏎
|
|
149 |
if not app_lib_only
|
|
150 |
gtk3_module = shared_module(
|
|
151 |
'xapp-gtk3-module', ['xapp-gtk3-module.c'],
|
|
152 |
include_directories: [top_inc],
|
|
153 |
dependencies: [gtk3_dep, libxapp_dep],
|
|
154 |
install: true,
|
|
155 |
install_dir: join_paths(gtk3_dep.get_pkgconfig_variable('libdir'),'gtk-3.0','modules')
|
|
156 |
)
|
|
157 |
endif
|
401 | 401 |
real_uri = g_strdup (uri);
|
402 | 402 |
}
|
403 | 403 |
|
|
404 |
g_return_if_fail (real_uri != NULL);
|
|
405 |
|
404 | 406 |
g_debug ("XAppFavorites: remove favorite: %s", real_uri);
|
405 | 407 |
|
406 | 408 |
// It may be orphaned for some reason.. even if it's not in gsettings, still try
|
43 | 43 |
|
44 | 44 |
return g_strstr_len (contents, -1, "on-demand") != NULL;
|
45 | 45 |
}
|
|
46 |
|
|
47 |
// Copied from cinnamon:main.c
|
|
48 |
/**
|
|
49 |
* xapp_util_get_session_is_running:
|
|
50 |
*
|
|
51 |
* Check if the Session Manager is currently in the "Running" phase.
|
|
52 |
*
|
|
53 |
* Returns: %TRUE if the session is running.
|
|
54 |
*
|
|
55 |
* Since: 2.0
|
|
56 |
*/
|
|
57 |
gboolean
|
|
58 |
xapp_util_get_session_is_running (void)
|
|
59 |
{
|
|
60 |
GDBusConnection *session_bus;
|
|
61 |
GError *error;
|
|
62 |
GVariant *session_result;
|
|
63 |
gboolean session_running;
|
|
64 |
|
|
65 |
error = NULL;
|
|
66 |
|
|
67 |
session_bus = g_bus_get_sync (G_BUS_TYPE_SESSION,
|
|
68 |
NULL,
|
|
69 |
&error);
|
|
70 |
|
|
71 |
if (error != NULL)
|
|
72 |
{
|
|
73 |
g_critical ("Unable to determine if session is running, could not get session bus: %s\n", error->message);
|
|
74 |
g_clear_error (&error);
|
|
75 |
|
|
76 |
return FALSE;
|
|
77 |
}
|
|
78 |
|
|
79 |
session_result = g_dbus_connection_call_sync (session_bus,
|
|
80 |
"org.gnome.SessionManager",
|
|
81 |
"/org/gnome/SessionManager",
|
|
82 |
"org.gnome.SessionManager",
|
|
83 |
"IsSessionRunning",
|
|
84 |
NULL,
|
|
85 |
G_VARIANT_TYPE ("(b)"),
|
|
86 |
G_DBUS_CALL_FLAGS_NONE,
|
|
87 |
1000,
|
|
88 |
NULL,
|
|
89 |
&error);
|
|
90 |
|
|
91 |
if (session_result != NULL)
|
|
92 |
{
|
|
93 |
g_variant_get (session_result, "(b)", &session_running);
|
|
94 |
g_variant_unref (session_result);
|
|
95 |
}
|
|
96 |
else
|
|
97 |
{
|
|
98 |
session_running = FALSE;
|
|
99 |
g_clear_error (&error);
|
|
100 |
}
|
|
101 |
|
|
102 |
g_object_unref (session_bus);
|
|
103 |
|
|
104 |
return session_running;
|
|
105 |
}
|
5 | 5 |
G_BEGIN_DECLS
|
6 | 6 |
|
7 | 7 |
gboolean xapp_util_gpu_offload_supported (void);
|
|
8 |
gboolean xapp_util_get_session_is_running (void);
|
8 | 9 |
|
9 | 10 |
G_END_DECLS
|
10 | 11 |
#endif /* __XAPP_UTIL_H__ */
|
0 | 0 |
project('xapp',
|
1 | 1 |
'c',
|
2 | |
version : '2.0.6',
|
|
2 |
version : '2.0.7',
|
3 | 3 |
default_options : [ 'buildtype=debugoptimized' ],
|
4 | 4 |
)
|
5 | 5 |
|
2 | 2 |
#include <gtk/gtk.h>
|
3 | 3 |
|
4 | 4 |
#include <libxapp/xapp-status-icon.h>
|
|
5 |
#include <libxapp/xapp-util.h>
|
5 | 6 |
#include <glib-unix.h>
|
6 | 7 |
|
7 | 8 |
#include "sn-watcher-interface.h"
|
|
671 | 672 |
gboolean should_start;
|
672 | 673 |
int status;
|
673 | 674 |
|
674 | |
sleep (1);
|
|
675 |
if (xapp_util_get_session_is_running ())
|
|
676 |
{
|
|
677 |
// The session manager tries to restart this immediately in the event of a crash,
|
|
678 |
// and we need a small delay between instances of xapp-sn-watcher to allow dbus and
|
|
679 |
// status-notifier apps to cleanly process removal of the old one.
|
|
680 |
//
|
|
681 |
// Skip this at startup, as it would cause a delay during login, and there's no
|
|
682 |
// existing process to replace anyhow.
|
|
683 |
sleep (2);
|
|
684 |
}
|
675 | 685 |
|
676 | 686 |
current_desktop = g_getenv ("XDG_CURRENT_DESKTOP");
|
677 | 687 |
xapp_settings = g_settings_new (STATUS_ICON_SCHEMA);
|