Codebase list xapp / a82ac95
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
8 changed file(s) with 109 addition(s) and 30 deletion(s). Raw diff Collapse all Expand all
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
205205 XAppFavoriteInfo *info = (XAppFavoriteInfo *) ptr_a;
206206 const gchar *uri = (gchar *) ptr_b;
207207
208 // GCompareFunc returns 0 when there's a match.
208209 return g_strcmp0 (info->uri, uri);
209210 }
210211
251252 {
252253 added = g_list_prepend (added, new_info);
253254 }
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);
254272 }
255273
256274 for (iter = added; iter != NULL; iter = iter->next)
270288 g_object_unref (file);
271289 }
272290
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
290291 g_list_free (added);
291292 g_list_free (removed);
292293
146146 install: true
147147 )
148148
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
401401 real_uri = g_strdup (uri);
402402 }
403403
404 g_return_if_fail (real_uri != NULL);
405
404406 g_debug ("XAppFavorites: remove favorite: %s", real_uri);
405407
406408 // It may be orphaned for some reason.. even if it's not in gsettings, still try
4343
4444 return g_strstr_len (contents, -1, "on-demand") != NULL;
4545 }
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 }
55 G_BEGIN_DECLS
66
77 gboolean xapp_util_gpu_offload_supported (void);
8 gboolean xapp_util_get_session_is_running (void);
89
910 G_END_DECLS
1011 #endif /* __XAPP_UTIL_H__ */
00 project('xapp',
11 'c',
2 version : '2.0.6',
2 version : '2.0.7',
33 default_options : [ 'buildtype=debugoptimized' ],
44 )
55
22 #include <gtk/gtk.h>
33
44 #include <libxapp/xapp-status-icon.h>
5 #include <libxapp/xapp-util.h>
56 #include <glib-unix.h>
67
78 #include "sn-watcher-interface.h"
671672 gboolean should_start;
672673 int status;
673674
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 }
675685
676686 current_desktop = g_getenv ("XDG_CURRENT_DESKTOP");
677687 xapp_settings = g_settings_new (STATUS_ICON_SCHEMA);