Codebase list xapp / 91a5852
all: Add debug topics. Favorites and status icon debugging messages can get overwhelming, so this lets one choose only those messages pertaining to whatever is being debugged. Similar to nemo, to get a list of topics you can do: XAPP_DEBUG=help <xapp_program> To enable these topics: XAPP_DEBUG=StatusIcon <xapp_program> Note you probably also need to enable the debugging log level as well, something like: XAPP_DEBUG=StatusIcon G_MESSAGES_DEBUG=all <xapp_program> Note: xapp-sn-watcher has a gsettings key to set G_MESSAGES_DEBUG. Michael Webster 3 years ago
13 changed file(s) with 327 addition(s) and 120 deletion(s). Raw diff Collapse all Expand all
00 #include "xapp-favorites.h"
11 #include "favorite-vfs-file-enumerator.h"
22 #include "favorite-vfs-file.h"
3
4 #define DEBUG_FLAG XAPP_DEBUG_FAVORITE_VFS
5 #include "xapp-debug.h"
36
47 typedef struct
58 {
00 #include "xapp-favorites.h"
11 #include "favorite-vfs-file.h"
22 #include "favorite-vfs-file-monitor.h"
3
4 #define DEBUG_FLAG XAPP_DEBUG_FAVORITE_VFS
5 #include "xapp-debug.h"
36
47 typedef struct
58 {
5356 // FavoriteVfsFileMonitor *monitor = FAVORITE_VFS_FILE_MONITOR (user_data);
5457 // FavoriteVfsFileMonitorPrivate *priv = favorite_vfs_file_monitor_get_instance_private (monitor);
5558
56 // g_debug ("real file changed: %s: %d", g_file_get_uri (file), event_type);
59 // DEBUG ("real file changed: %s: %d", g_file_get_uri (file), event_type);
5760
5861 // switch (event_type)
5962 // {
6265 // {
6366 // gchar *uri = g_file_get_uri (file);
6467
65 // g_debug ("Deleted: %s\n", uri);
68 // DEBUG ("Deleted: %s\n", uri);
6669
6770 // xapp_favorites_remove (xapp_favorites_get_default (), uri);
6871 // g_free (uri);
7477 // {
7578 // gchar *uri = g_file_get_uri (file);
7679
77 // g_debug ("Renamed: %s\n", uri);
80 // DEBUG ("Renamed: %s\n", uri);
7881
7982 // rename_favorite (file, other_file);
8083 // }
98101 // uri = path_to_fav_uri (info->display_name);
99102 // fav_file = g_file_new_for_uri (uri);
100103
101 // g_debug ("Changed: %s", uri);
104 // DEBUG ("Changed: %s", uri);
102105 // g_free (uri);
103106
104107 // g_file_monitor_emit_event (G_FILE_MONITOR (monitor),
166169 GFile *real_file;
167170 GError *error;
168171
169 g_debug ("Monitoring real file: %s\n", info->uri);
172 DEBUG ("Monitoring real file: %s\n", info->uri);
170173
171174 error = NULL;
172175 real_file = g_file_new_for_uri (info->uri);
33 #include "favorite-vfs-file.h"
44 #include "favorite-vfs-file-enumerator.h"
55 #include "favorite-vfs-file-monitor.h"
6
7 #define DEBUG_FLAG XAPP_DEBUG_FAVORITE_VFS
8 #include "xapp-debug.h"
69
710 #define FAVORITES_SCHEMA "org.x.apps.favorites"
811 #define FAVORITE_DCONF_METADATA_KEY "root-metadata"
13791382
13801383 new_file = g_object_new (FAVORITE_TYPE_VFS_FILE, NULL);
13811384
1382 g_debug ("FavoriteVfsFile new for uri: %s", uri);
1385 DEBUG ("FavoriteVfsFile new for uri: %s", uri);
13831386
13841387 FavoriteVfsFilePrivate *priv = favorite_vfs_file_get_instance_private (FAVORITE_VFS_FILE (new_file));
13851388
1515 'favorite-vfs-file.c',
1616 'favorite-vfs-file-enumerator.c',
1717 'favorite-vfs-file-monitor.c'
18 ]
19
20 xapp_debug = [
21 'xapp-debug.h',
22 'xapp-debug.c'
1823 ]
1924
2025 xapp_headers = [
9499 )
95100
96101 libxapp = library('xapp',
97 sources : xapp_headers + xapp_sources + xapp_enums + dbus_headers + favorite_vfs_sources,
102 sources : xapp_headers + xapp_sources + xapp_enums + dbus_headers + favorite_vfs_sources + xapp_debug,
98103 include_directories: [top_inc],
99104 version: meson.project_version(),
100105 soversion: '1',
0 /*
1 * xapp-debug: debug loggers for xapp
2 *
3 * Copyright (C) 2007 Collabora Ltd.
4 * Copyright (C) 2007 Nokia Corporation
5 * Copyright (C) 2010 Red Hat, Inc.
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 *
21 * Copied from nemo
22 */
23
24 #include <stdarg.h>
25
26 #include <glib.h>
27
28 #include "xapp-debug.h"
29
30 static DebugFlags flags = 0;
31 static gboolean initialized = FALSE;
32
33 static GDebugKey keys[] = {
34 { "GtkWindow", XAPP_DEBUG_WINDOW },
35 { "Favorites", XAPP_DEBUG_FAVORITES },
36 { "FavoriteVfs", XAPP_DEBUG_FAVORITE_VFS },
37 { "StatusIcon", XAPP_DEBUG_STATUS_ICON },
38 { "SnWatcher", XAPP_DEBUG_SN_WATCHER },
39 { "GtkModule", XAPP_DEBUG_MODULE},
40 { 0, }
41 };
42
43 static void
44 xapp_debug_set_flags_from_env (void)
45 {
46 guint nkeys;
47 const gchar *flags_string;
48
49 for (nkeys = 0; keys[nkeys].value; nkeys++);
50
51 flags_string = g_getenv ("XAPP_DEBUG");
52
53 if (flags_string)
54 xapp_debug_set_flags (g_parse_debug_string (flags_string, keys, nkeys));
55
56 initialized = TRUE;
57 }
58
59 void
60 xapp_debug_set_flags (DebugFlags new_flags)
61 {
62 flags |= new_flags;
63 initialized = TRUE;
64 }
65
66 gboolean
67 xapp_debug_flag_is_set (DebugFlags flag)
68 {
69 return flag & flags;
70 }
71
72 void
73 xapp_debug (DebugFlags flag,
74 const gchar *format,
75 ...)
76 {
77 va_list args;
78 va_start (args, format);
79 xapp_debug_valist (flag, format, args);
80 va_end (args);
81 }
82
83 void
84 xapp_debug_valist (DebugFlags flag,
85 const gchar *format,
86 va_list args)
87 {
88 if (G_UNLIKELY(!initialized))
89 xapp_debug_set_flags_from_env ();
90
91 if (flag & flags)
92 g_logv (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, format, args);
93 }
94
0 /*
1 * xapp-debug: debug loggers for xapp
2 *
3 * Copyright (C) 2007 Collabora Ltd.
4 * Copyright (C) 2007 Nokia Corporation
5 * Copyright (C) 2010 Red Hat, Inc.
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 *
21 * Copied from nemo
22 */
23
24 #ifndef __XAPP_DEBUG_H__
25 #define __XAPP_DEBUG_H__
26
27 #include <config.h>
28 #include <glib.h>
29
30 G_BEGIN_DECLS
31
32 typedef enum
33 {
34 XAPP_DEBUG_WINDOW = 1 << 1,
35 XAPP_DEBUG_FAVORITES = 1 << 2,
36 XAPP_DEBUG_FAVORITE_VFS = 1 << 3,
37 XAPP_DEBUG_STATUS_ICON = 1 << 4,
38 XAPP_DEBUG_SN_WATCHER = 1 << 5,
39 XAPP_DEBUG_MODULE = 1 << 6
40 } DebugFlags;
41
42 void xapp_debug_set_flags (DebugFlags flags);
43 gboolean xapp_debug_flag_is_set (DebugFlags flag);
44
45 void xapp_debug_valist (DebugFlags flag,
46 const gchar *format, va_list args);
47
48 void xapp_debug (DebugFlags flag, const gchar *format, ...)
49 G_GNUC_PRINTF (2, 3);
50
51 #ifdef DEBUG_FLAG
52
53 #define DEBUG(format, ...) \
54 xapp_debug (DEBUG_FLAG, "%s: %s: " format, G_STRFUNC, G_STRLOC, \
55 ##__VA_ARGS__)
56
57 #define DEBUGGING xapp_debug_flag_is_set(DEBUG_FLAG)
58
59 #endif /* DEBUG_FLAG */
60
61 #else /* ENABLE_DEBUG */
62
63 #ifdef DEBUG_FLAG
64
65 #define DEBUG(format, ...) \
66 G_STMT_START { } G_STMT_END
67
68 #define DEBUGGING 0
69
70 #endif /* DEBUG_FLAG */
71
72 G_END_DECLS
73
74 #endif /* __XAPP_DEBUG_H__ */
1818 #include "xapp-favorites.h"
1919 #include "favorite-vfs-file.h"
2020
21 #define DEBUG_FLAG XAPP_DEBUG_FAVORITES
22 #include "xapp-debug.h"
23
2124 #define FAVORITES_SCHEMA "org.x.apps.favorites"
2225 #define FAVORITES_KEY "list"
2326 #define SETTINGS_DELIMITER "::"
5558 XAppFavoriteInfo *
5659 xapp_favorite_info_copy (const XAppFavoriteInfo *info)
5760 {
58 // g_debug ("XAppFavoriteInfo: copy");
61 // DEBUG ("XAppFavoriteInfo: copy");
5962 g_return_val_if_fail (info != NULL, NULL);
6063
6164 XAppFavoriteInfo *_info = g_slice_dup (XAppFavoriteInfo, info);
7780 void
7881 xapp_favorite_info_free (XAppFavoriteInfo *info)
7982 {
80 g_debug ("XAppFavoriteInfo free (%s)", info->uri);
83 DEBUG ("XAppFavoriteInfo free (%s)", info->uri);
8184 g_return_if_fail (info != NULL);
8285
8386 g_free (info->uri);
124127 XAppFavorites *favorites = XAPP_FAVORITES (data);
125128
126129 XAppFavoritesPrivate *priv = xapp_favorites_get_instance_private (favorites);
127 g_debug ("XAppFavorites: list updated, emitting changed signal");
130 DEBUG ("XAppFavorites: list updated, emitting changed signal");
128131
129132 priv->changed_timer_id = 0;
130133 g_signal_emit (favorites, signals[CHANGED], 0);
203206 GFileInfo *info;
204207 GFile *file;
205208
206 g_debug ("Sync metadata: %s - Favorite? %d", uri, is_favorite);
209 DEBUG ("Sync metadata: %s - Favorite? %d", uri, is_favorite);
207210
208211 info = g_file_info_new ();
209212
263266 g_settings_set_strv (priv->settings, FAVORITES_KEY, (const gchar* const*) new_settings);
264267 g_signal_handler_unblock (priv->settings, priv->settings_listener_id);
265268
266 g_debug ("XAppFavorites: store_favorites: favorites saved");
269 DEBUG ("XAppFavorites: store_favorites: favorites saved");
267270
268271 g_strfreev (new_settings);
269272 }
306309
307310 g_strfreev (raw_list);
308311
309 g_debug ("XAppFavorites: load_favorite: favorites loaded (%d)", i);
312 DEBUG ("XAppFavorites: load_favorite: favorites loaded (%d)", i);
310313
311314 if (signal_changed)
312315 {
403406
404407 g_return_if_fail (real_uri != NULL);
405408
406 g_debug ("XAppFavorites: remove favorite: %s", real_uri);
409 DEBUG ("XAppFavorites: remove favorite: %s", real_uri);
407410
408411 // It may be orphaned for some reason.. even if it's not in gsettings, still try
409412 // to remove the favorite attribute.
411414
412415 if (!g_hash_table_remove (priv->infos, real_uri))
413416 {
414 g_debug ("XAppFavorites: remove_favorite: could not find favorite for uri '%s'", real_uri);
417 DEBUG ("XAppFavorites: remove_favorite: could not find favorite for uri '%s'", real_uri);
415418 g_free (real_uri);
416419 return;
417420 }
595598 // Check if it's there again, in case it was added while we were getting mimetype.
596599 if (g_hash_table_contains (priv->infos, uri))
597600 {
598 g_debug ("XAppFavorites: favorite for '%s' exists, ignoring", uri);
601 DEBUG ("XAppFavorites: favorite for '%s' exists, ignoring", uri);
599602 return;
600603 }
601604
610613
611614 g_hash_table_insert (priv->infos, (gpointer) g_strdup (uri), (gpointer) info);
612615
613 g_debug ("XAppFavorites: added favorite: %s", uri);
616 DEBUG ("XAppFavorites: added favorite: %s", uri);
614617
615618 deduplicate_display_names (favorites, priv->infos);
616619
643646
644647 if (error)
645648 {
646 g_debug ("XAppFavorites: problem trying to figure out content type for uri '%s': %s",
649 DEBUG ("XAppFavorites: problem trying to figure out content type for uri '%s': %s",
647650 uri, error->message);
648651 g_error_free (error);
649652 }
680683
681684 if (g_hash_table_contains (priv->infos, uri))
682685 {
683 g_debug ("XAppFavorites: favorite for '%s' exists, ignoring", uri);
686 DEBUG ("XAppFavorites: favorite for '%s' exists, ignoring", uri);
684687 return;
685688 }
686689
710713 {
711714 XAppFavoritesPrivate *priv = xapp_favorites_get_instance_private (favorites);
712715
713 g_debug ("XAppFavorites: init:");
716 DEBUG ("XAppFavorites: init:");
714717
715718 priv->settings = g_settings_new (FAVORITES_SCHEMA);
716719 priv->settings_listener_id = g_signal_connect (priv->settings,
727730 XAppFavorites *favorites = XAPP_FAVORITES (object);
728731 XAppFavoritesPrivate *priv = xapp_favorites_get_instance_private (favorites);
729732
730 g_debug ("XAppFavorites dispose (%p)", object);
733 DEBUG ("XAppFavorites dispose (%p)", object);
731734
732735 g_clear_object (&priv->settings);
733736 g_clear_pointer (&priv->infos, g_hash_table_destroy);
738741 static void
739742 xapp_favorites_finalize (GObject *object)
740743 {
741 g_debug ("XAppFavorites finalize (%p)", object);
744 DEBUG ("XAppFavorites finalize (%p)", object);
742745
743746 G_OBJECT_CLASS (xapp_favorites_parent_class)->finalize (object);
744747 }
848851 ret = g_list_reverse (data.items);
849852
850853 gchar *typestring = mimetypes ? g_strjoinv (", ", (gchar **) mimetypes) : NULL;
851 g_debug ("XAppFavorites: get_favorites returning list for mimetype '%s' (%d items)",
854 DEBUG ("XAppFavorites: get_favorites returning list for mimetype '%s' (%d items)",
852855 typestring, g_list_length (ret));
853856 g_free (typestring);
854857
872875
873876 n = g_hash_table_size (priv->infos);
874877
875 g_debug ("XAppFavorites: get_n_favorites returning number of items: %d.", n);
878 DEBUG ("XAppFavorites: get_n_favorites returning number of items: %d.", n);
876879
877880 return n;
878881 }
10101013 {
10111014 if (error)
10121015 {
1013 g_debug ("XAppFavorites: launch: error opening uri '%s': %s", uri, error->message);
1016 DEBUG ("XAppFavorites: launch: error opening uri '%s': %s", uri, error->message);
10141017 g_error_free (error);
10151018 }
10161019 }
1010 #include <gdk/gdkx.h>
1111 #include "xapp-gtk-window.h"
1212
13 #define DEBUG_FLAG XAPP_DEBUG_WINDOW
14 #include "xapp-debug.h"
15
1316 #define ICON_NAME_HINT "_NET_WM_XAPP_ICON_NAME"
1417 #define PROGRESS_HINT "_NET_WM_XAPP_PROGRESS"
1518 #define PROGRESS_PULSE_HINT "_NET_WM_XAPP_PROGRESS_PULSE"
7174 if (g_once_init_enter (&once_init_value))
7275 {
7376 running_x11 = GDK_IS_X11_DISPLAY(gdk_display_get_default());
74 g_debug ("XAppGtkWindow: is_x11_session: %s\n", running_x11 ? "TRUE" : "FALSE");
77 DEBUG ("XAppGtkWindow: is_x11_session: %s\n", running_x11 ? "TRUE" : "FALSE");
7578
7679 g_once_init_leave (&once_init_value, 1);
7780 }
22
33 #include "xapp-favorites.h"
44 #include "favorite-vfs-file.h"
5
6 #define DEBUG_FLAG XAPP_DEBUG_MODULE
7 #include "xapp-debug.h"
58
69 #define ICON_OVERRIDE_VAR "XAPP_FORCE_GTKWINDOW_ICON"
710
5659
5760 if (anti_recursion_ptr && anti_recursion_ptr == gtk_window_get_icon (window))
5861 {
59 g_debug ("Window icon notify received, but anti-recurse pointer hasn't changed, returning.");
62 DEBUG ("Window icon notify received, but anti-recurse pointer hasn't changed, returning.");
6063 return;
6164 }
6265
6467 {
6568 gboolean clear_pixbuf = FALSE;
6669
67 g_debug ("Window icon changed, forcing back to '%s'", forced_icon_str);
70 DEBUG ("Window icon changed, forcing back to '%s'", forced_icon_str);
6871
6972 g_signal_handlers_block_by_func (G_OBJECT (window), window_icon_changed, window);
7073
102105
103106 already_applied = 1;
104107
105 g_debug ("Realize overridden window (%p).", widget);
108 DEBUG ("Realize overridden window (%p).", widget);
106109
107110 const gchar *env_icon = g_getenv (ICON_OVERRIDE_VAR);
108111
121124 {
122125 (* original_window_unrealize) (widget);
123126
124 g_debug ("Unrealize overridden window (%p).", widget);
127 DEBUG ("Unrealize overridden window (%p).", widget);
125128
126129 g_signal_handlers_disconnect_by_func (widget, window_icon_changed, widget);
127130 }
134137 // I don't think these guards are necessary. This should only run once, but better off safe.
135138 if (!applied)
136139 {
137 g_debug ("XAPP_FORCE_GTKWINDOW_ICON found in environment, overriding the window icon with its contents");
140 DEBUG ("XAPP_FORCE_GTKWINDOW_ICON found in environment, overriding the window icon with its contents");
138141
139142 applied = TRUE;
140143
155158
156159 if (!applied)
157160 {
158 g_debug ("Adding a Favorites shortcut to GtkPlacesSideBars");
161 DEBUG ("Adding a Favorites shortcut to GtkPlacesSideBars");
159162
160163 applied = TRUE;
161164
168171 }
169172
170173 G_MODULE_EXPORT void gtk_module_init (gint *argc, gchar ***argv[]) {
171 g_debug ("Initializing XApp GtkModule");
174 DEBUG ("Initializing XApp GtkModule");
172175 // This won't instantiate XAppFavorites but will register the uri so
173176 // it can be used by apps (like pix which doesn't use the favorites api,
174177 // but just adds favorites:/// to its sidebar.)
1515 #include "xapp-status-icon.h"
1616 #include "xapp-status-icon-monitor.h"
1717 #include "xapp-statusicon-interface.h"
18
19 #define DEBUG_FLAG XAPP_DEBUG_STATUS_ICON
20 #include "xapp-debug.h"
1821
1922 #define MONITOR_NAME "org.x.StatusIconMonitor"
2023
8487 "name", &name,
8588 NULL);
8689
87 g_debug("XAppStatusIconMonitor: app name owner changed - name '%s' is now %s)",
90 DEBUG("App name owner changed - name '%s' is now %s)",
8891 name, owner != NULL ? "owned" : "unowned");
8992
9093 if (owner == NULL)
153156
154157 g_object_get (obj_mgr, "name", &name, NULL);
155158
156 g_debug("XAppStatusIconMonitor: Object manager added for new bus name: '%s'", name);
159 DEBUG("Object manager added for new bus name: '%s'", name);
157160
158161 g_signal_connect (obj_mgr,
159162 "notify::name-owner",
210213 }
211214 else
212215 {
213 g_debug ("XAppStatusIconMonitor: adding object manager failed, bus name '%s' is invalid", name);
216 DEBUG ("Adding object manager failed, bus name '%s' is invalid", name);
214217 }
215218
216219 g_strfreev (name_parts);
247250 /* the '.' at the end so we don't catch ourselves in this */
248251 if (g_str_has_prefix (str, STATUS_ICON_MATCH))
249252 {
250 g_debug ("XAppStatusIconMonitor: found new status icon app: %s", str);
253 DEBUG ("Found new status icon app: %s", str);
251254 add_object_manager_for_name (self, str);
252255 }
253256 }
261264 {
262265 XAppStatusIconMonitorPrivate *priv = xapp_status_icon_monitor_get_instance_private (self);
263266
264 g_debug("XAppStatusIconMonitor: looking for status icon apps on the bus");
267 DEBUG("Looking for status icon apps on the bus");
265268
266269 /* If there are no monitors (applets) already running when this is set up,
267270 * this won't find anything. The XAppStatusIcons will be in fallback mode,
314317 const gchar *old_owner;
315318 const gchar *new_owner;
316319
317 g_debug("XAppStatusIconMonitor: NameOwnerChanged signal received: %s)", sender_name);
320 DEBUG ("NameOwnerChanged signal received: %s)", sender_name);
318321
319322 g_variant_get (parameters, "(&s&s&s)", &name, &old_owner, &new_owner);
320323
329332 {
330333 XAppStatusIconMonitorPrivate *priv = xapp_status_icon_monitor_get_instance_private (self);
331334
332 g_debug ("XAppStatusIconMonitor: Adding NameOwnerChanged listener for status icon apps");
335 DEBUG ("Adding NameOwnerChanged listener for status icon apps");
333336
334337 priv->listener_id = g_dbus_connection_signal_subscribe (priv->connection,
335338 "org.freedesktop.DBus",
361364 {
362365 XAppStatusIconMonitor *self = XAPP_STATUS_ICON_MONITOR (user_data);
363366
364 g_debug ("XAppStatusIconMonitor: Name owned on bus: %s", name);
367 DEBUG ("Name owned on bus: %s", name);
365368
366369 add_name_listener (self);
367370 find_and_add_icons (self);
376379 XAppStatusIconMonitor *self = XAPP_STATUS_ICON_MONITOR (user_data);
377380 XAppStatusIconMonitorPrivate *priv = xapp_status_icon_monitor_get_instance_private (self);
378381
379 g_debug ("XAppStatusIconMonitor: Connected to bus: %s", name);
382 DEBUG ("Connected to bus: %s", name);
380383
381384 priv->connection = connection;
382385 }
392395 owned_name = g_strdup_printf ("%s.%s_%d", MONITOR_NAME, valid_app_name, unique_id++);
393396 g_free (valid_app_name);
394397
395 g_debug ("XAppStatusIconMonitor: Attempting to own name on bus: %s", owned_name);
398 DEBUG ("Attempting to own name on bus: %s", owned_name);
396399
397400 priv->owner_id = g_bus_own_name (G_BUS_TYPE_SESSION,
398401 owned_name,
423426 XAppStatusIconMonitor *self = XAPP_STATUS_ICON_MONITOR (object);
424427 XAppStatusIconMonitorPrivate *priv = xapp_status_icon_monitor_get_instance_private (self);
425428
426 g_debug ("XAppStatusIconMonitor dispose (%p)", object);
429 DEBUG ("XAppStatusIconMonitor dispose (%p)", object);
427430
428431 if (priv->connection != NULL)
429432 {
454457 static void
455458 xapp_status_icon_monitor_finalize (GObject *object)
456459 {
457 g_debug ("XAppStatusIconMonitor finalize (%p)", object);
460 DEBUG ("XAppStatusIconMonitor finalize (%p)", object);
458461
459462 G_OBJECT_CLASS (xapp_status_icon_monitor_parent_class)->dispose (object);
460463 }
1515 #include "xapp-status-icon.h"
1616 #include "xapp-statusicon-interface.h"
1717 #include "xapp-enums.h"
18
19 #define DEBUG_FLAG XAPP_DEBUG_STATUS_ICON
20 #include "xapp-debug.h"
1821
1922 #define FDO_DBUS_NAME "org.freedesktop.DBus"
2023 #define FDO_DBUS_PATH "/org/freedesktop/DBus"
270273 g_return_if_fail (XAPP_IS_STATUS_ICON (user_data));
271274 XAppStatusIcon *icon = XAPP_STATUS_ICON (user_data);
272275
273 g_debug ("XAppStatusIcon: Primary menu unmapped");
276 DEBUG ("Primary menu unmapped");
274277
275278 if (icon->priv->state == XAPP_STATUS_ICON_STATE_NATIVE)
276279 {
287290 g_return_if_fail (XAPP_IS_STATUS_ICON (user_data));
288291 XAppStatusIcon *icon = XAPP_STATUS_ICON (user_data);
289292
290 g_debug ("XAppStatusIcon: Secondary menu unmapped");
293 DEBUG ("Secondary menu unmapped");
291294
292295 if (icon->priv->state == XAPP_STATUS_ICON_STATE_NATIVE)
293296 {
311314 GdkRectangle win_rect;
312315 GdkGravity rect_anchor, menu_anchor;
313316
314 g_debug ("XAppStatusIcon: Popup menu on behalf of application");
317 DEBUG ("Popup menu on behalf of application");
315318
316319 if (!gtk_widget_get_realized (GTK_WIDGET (menu)))
317320 {
438441
439442 if (g_strcmp0 (name, "ButtonPress") == 0)
440443 {
441 g_debug ("XAppStatusIcon: received ButtonPress from monitor %s: "
444 DEBUG ("Received ButtonPress from monitor %s: "
442445 "pos:%d,%d , button: %s , time: %u , orientation: %s",
443446 g_dbus_method_invocation_get_sender (invocation),
444447 x, y, button_to_str (button), _time, panel_position_to_str (panel_position));
445448
446449 if (should_send_activate (icon, button))
447450 {
448 g_debug ("XAppStatusIcon: native sending 'activate' for %s button", button_to_str (button));
451 DEBUG ("Native sending 'activate' for %s button", button_to_str (button));
449452 g_signal_emit (icon, signals[ACTIVATE], 0,
450453 button,
451454 _time);
465468 else
466469 if (g_strcmp0 (name, "ButtonRelease") == 0)
467470 {
468 g_debug ("XAppStatusIcon: received ButtonRelease from monitor %s: "
471 DEBUG ("Received ButtonRelease from monitor %s: "
469472 "pos:%d,%d , button: %s , time: %u , orientation: %s",
470473 g_dbus_method_invocation_get_sender (invocation),
471474 x, y, button_to_str (button), _time, panel_position_to_str (panel_position));
508511 guint _time,
509512 XAppStatusIcon *icon)
510513 {
511 g_debug ("XAppStatusIcon: received Scroll from monitor %s: "
514 DEBUG ("Received Scroll from monitor %s: "
512515 "delta: %d , direction: %s , time: %u",
513516 g_dbus_method_invocation_get_sender (invocation),
514517 delta, direction_to_str (direction), _time);
605608 button = event->button.button;
606609 _time = event->button.time;
607610
608 g_debug ("XAppStatusIcon: GtkStatusIcon button-press-event with %s button", button_to_str (button));
611 DEBUG ("GtkStatusIcon button-press-event with %s button", button_to_str (button));
609612
610613 /* We always send 'activate' for a button that has no corresponding menu,
611614 * and for middle clicks. */
612615 if (should_send_activate (icon, button))
613616 {
614 g_debug ("XAppStatusIcon: GtkStatusIcon activated by %s button", button_to_str (button));
617 DEBUG ("GtkStatusIcon activated by %s button", button_to_str (button));
615618
616619 g_signal_emit (icon, signals[ACTIVATE], 0,
617620 button,
649652 button = event->button.button;
650653 _time = event->button.time;
651654
652 g_debug ("XAppStatusIcon: GtkStatusIcon button-release-event with %s button", button_to_str (button));
655 DEBUG ("GtkStatusIcon button-release-event with %s button", button_to_str (button));
653656
654657 /* Native icons can have two menus, so we must determine which to use based
655658 * on the gtk icon event's button. */
664667
665668 if (menu_to_use)
666669 {
667 g_debug ("XAppStatusIcon: GtkStatusIcon popup menu for %s button", button_to_str (button));
670 DEBUG ("GtkStatusIcon popup menu for %s button", button_to_str (button));
668671
669672 popup_menu (icon,
670673 GTK_MENU (menu_to_use),
694697 gpointer user_data)
695698 {
696699 XAppStatusIcon *self = XAPP_STATUS_ICON (user_data);
697 g_debug("XAppStatusIcon: NameOwnerChanged signal received, refreshing icon");
700 DEBUG("NameOwnerChanged signal received, refreshing icon");
698701
699702 refresh_icon (self);
700703 }
702705 static void
703706 add_name_listener (XAppStatusIcon *self)
704707 {
705 g_debug ("XAppStatusIcon: Adding NameOwnerChanged listener for status monitors");
708 DEBUG ("Adding NameOwnerChanged listener for status monitors");
706709
707710 self->priv->listener_id = g_dbus_connection_signal_subscribe (self->priv->connection,
708711 FDO_DBUS_NAME,
762765
763766 sync_skeleton (self);
764767
765 g_debug ("XAppStatusIcon: name acquired on dbus, syncing icon properties. State is now: %s",
768 DEBUG ("Name acquired on dbus, syncing icon properties. State is now: %s",
766769 state_to_str (self->priv->state));
767770 g_signal_emit (self, signals[STATE_CHANGED], 0, self->priv->state);
768771 }
784787 obj_server_finalized (gpointer data,
785788 GObject *object)
786789 {
787 g_debug ("XAppStatusIcon: Final icon removed, clearing object manager (%s)", g_get_prgname ());
790 DEBUG ("Final icon removed, clearing object manager (%s)", g_get_prgname ());
788791
789792 if (name_owner_id > 0)
790793 {
800803 {
801804 if (obj_server == NULL)
802805 {
803 g_debug ("XAppStatusIcon: New object manager for (%s)", g_get_prgname ());
806 DEBUG ("New object manager for (%s)", g_get_prgname ());
804807
805808 obj_server = g_dbus_object_manager_server_new (ICON_BASE_PATH);
806809 g_dbus_object_manager_server_set_connection (obj_server, self->priv->connection);
876879
877880 if (name_owner_id == 0)
878881 {
879 g_debug ("XAppStatusIcon: Attempting to own name on bus '%s'", owner_name);
882 DEBUG ("Attempting to own name on bus '%s'", owner_name);
880883 name_owner_id = g_bus_own_name_on_connection (self->priv->connection,
881884 owner_name,
882885 G_BUS_NAME_OWNER_FLAGS_DO_NOT_QUEUE,
939942 priv->state = XAPP_STATUS_ICON_STATE_NO_SUPPORT;
940943 }
941944
942 g_debug ("XAppStatusIcon fallback icon embedded_changed. State is now %s",
945 DEBUG ("Fallback icon embedded_changed. State is now %s",
943946 state_to_str (priv->state));
944947 g_signal_emit (self, signals[STATE_CHANGED], 0, priv->state);
945948 }
949952 {
950953 XAppStatusIconPrivate *priv = self->priv;
951954
952 g_debug ("XAppStatusIcon: falling back to GtkStatusIcon");
955 DEBUG ("Falling back to GtkStatusIcon");
953956
954957 remove_icon_path_from_bus (self);
955958
10011004 }
10021005 else
10031006 {
1004 g_debug ("XAppStatusIcon: attempt to ListNames cancelled");
1007 DEBUG ("Attempt to ListNames cancelled");
10051008 }
10061009
10071010 g_error_free (error);
10161019 {
10171020 if (g_str_has_prefix (str, STATUS_ICON_MONITOR_MATCH))
10181021 {
1019 g_debug ("XAppStatusIcon: Discovered active status monitor (%s)", str);
1022 DEBUG ("Discovered active status monitor (%s)", str);
10201023 found = TRUE;
10211024 }
10221025 }
10471050 look_for_status_applet (XAppStatusIcon *self)
10481051 {
10491052 // Check that there is at least one applet on DBUS
1050 g_debug("XAppStatusIcon: Looking for status monitors");
1053 DEBUG("Looking for status monitors");
10511054
10521055 cancellable_reset (self);
10531056
11121115 }
11131116 else
11141117 {
1115 g_debug ("XAppStatusIcon: Cancelled session bus acquire");
1118 DEBUG ("Cancelled session bus acquire");
11161119 }
11171120
11181121 g_error_free (error);
11271130 {
11281131 if (self->priv->connection == NULL)
11291132 {
1130 g_debug ("XAppStatusIcon: Connecting to session bus");
1133 DEBUG ("Connecting to session bus");
11311134
11321135 cancellable_reset (self);
11331136
12161219 self->priv->icon_size = FALLBACK_ICON_SIZE;
12171220 self->priv->icon_name = g_strdup (" ");
12181221
1219 g_debug ("XAppStatusIcon: init: application name: '%s'", self->priv->name);
1222 DEBUG ("Init: application name: '%s'", self->priv->name);
12201223
12211224 // Default to visible (the same behavior as GtkStatusIcon)
12221225 self->priv->visible = TRUE;
12341237 const gchar *path;
12351238 path = g_dbus_object_get_object_path (G_DBUS_OBJECT (self->priv->object_skeleton));
12361239
1237 g_debug ("XAppStatusIcon: removing interface at path '%s'", path);
1240 DEBUG ("Removing interface at path '%s'", path);
12381241
12391242 g_dbus_object_manager_server_unexport (obj_server, path);
12401243 self->priv->interface_skeleton = NULL;
12491252 {
12501253 XAppStatusIcon *self = XAPP_STATUS_ICON (object);
12511254
1252 g_debug ("XAppStatusIcon dispose (%p)", object);
1255 DEBUG ("XAppStatusIcon dispose (%p)", object);
12531256
12541257 g_free (self->priv->name);
12551258 g_free (self->priv->icon_name);
12861289 static void
12871290 xapp_status_icon_finalize (GObject *object)
12881291 {
1289 g_debug ("XAppStatusIcon finalize (%p)", object);
1292 DEBUG ("XAppStatusIcon finalize (%p)", object);
12901293
12911294 g_clear_object (&XAPP_STATUS_ICON (object)->priv->cancellable);
12921295
15211524 g_clear_pointer (&icon->priv->name, g_free);
15221525 icon->priv->name = g_strdup (name);
15231526
1524 g_debug ("XAppStatusIcon set_name: %s", name);
1527 DEBUG ("set_name: %s", name);
15251528
15261529 if (icon->priv->interface_skeleton)
15271530 {
15601563 g_clear_pointer (&icon->priv->icon_name, g_free);
15611564 icon->priv->icon_name = g_strdup (icon_name);
15621565
1563 g_debug ("XAppStatusIcon set_icon_name: %s", icon_name);
1566 DEBUG ("set_icon_name: %s", icon_name);
15641567
15651568 if (icon->priv->interface_skeleton)
15661569 {
15871590
15881591 if (icon->priv->interface_skeleton == NULL)
15891592 {
1590 g_debug ("XAppStatusIcon get_icon_size: %d (fallback)", FALLBACK_ICON_SIZE);
1593 DEBUG ("get_icon_size: %d (fallback)", FALLBACK_ICON_SIZE);
15911594
15921595 return FALLBACK_ICON_SIZE;
15931596 }
15961599
15971600 size = xapp_status_icon_interface_get_icon_size (icon->priv->interface_skeleton);
15981601
1599 g_debug ("XAppStatusIcon get_icon_size: %d", size);
1602 DEBUG ("get_icon_size: %d", size);
16001603
16011604 return size;
16021605 }
16231626 g_clear_pointer (&icon->priv->tooltip_text, g_free);
16241627 icon->priv->tooltip_text = g_strdup (tooltip_text);
16251628
1626 g_debug ("XAppStatusIcon set_tooltip_text: %s", tooltip_text);
1629 DEBUG ("set_tooltip_text: %s", tooltip_text);
16271630
16281631 if (icon->priv->interface_skeleton)
16291632 {
16551658 g_clear_pointer (&icon->priv->label, g_free);
16561659 icon->priv->label = g_strdup (label);
16571660
1658 g_debug ("XAppStatusIcon set_label: '%s'", label);
1661 DEBUG ("set_label: '%s'", label);
16591662
16601663 if (icon->priv->interface_skeleton)
16611664 {
16841687
16851688 icon->priv->visible = visible;
16861689
1687 g_debug ("XAppStatusIcon set_visible: %s", visible ? "TRUE" : "FALSE");
1690 DEBUG ("set_visible: %s", visible ? "TRUE" : "FALSE");
16881691
16891692 if (icon->priv->interface_skeleton)
16901693 {
17091712 {
17101713 g_return_val_if_fail (XAPP_IS_STATUS_ICON (icon), FALSE);
17111714
1712 g_debug ("XAppStatusIcon get_visible: %s", icon->priv->visible ? "TRUE" : "FALSE");
1715 DEBUG ("get_visible: %s", icon->priv->visible ? "TRUE" : "FALSE");
17131716
17141717 return icon->priv->visible;
17151718 }
17741777
17751778 g_clear_object (&icon->priv->primary_menu);
17761779
1777 g_debug ("XAppStatusIcon set_primary_menu: %p", menu);
1780 DEBUG ("set_primary_menu: %p", menu);
17781781
17791782 if (menu)
17801783 {
17981801 {
17991802 g_return_val_if_fail (XAPP_IS_STATUS_ICON (icon), NULL);
18001803
1801 g_debug ("XAppStatusIcon get_menu: %p", icon->priv->primary_menu);
1804 DEBUG ("get_menu: %p", icon->priv->primary_menu);
18021805
18031806 return icon->priv->primary_menu;
18041807 }
18261829
18271830 g_clear_object (&icon->priv->secondary_menu);
18281831
1829 g_debug ("XAppStatusIcon set_secondary_menu: %p", menu);
1832 DEBUG ("set_secondary_menu: %p", menu);
18301833
18311834 if (menu)
18321835 {
18501853 {
18511854 g_return_val_if_fail (XAPP_IS_STATUS_ICON (icon), NULL);
18521855
1853 g_debug ("XAppStatusIcon get_menu: %p", icon->priv->secondary_menu);
1856 DEBUG ("get_menu: %p", icon->priv->secondary_menu);
18541857
18551858 return icon->priv->secondary_menu;
18561859 }
19061909 {
19071910 g_return_val_if_fail (XAPP_IS_STATUS_ICON (icon), XAPP_STATUS_ICON_STATE_NO_SUPPORT);
19081911
1909 g_debug ("XAppStatusIcon get_state: %s", state_to_str (icon->priv->state));
1912 DEBUG ("get_state: %s", state_to_str (icon->priv->state));
19101913
19111914 return icon->priv->state;
19121915 }
19291932 g_return_if_fail (XAPP_IS_STATUS_ICON (icon));
19301933 gchar *old_meta;
19311934
1932 g_debug ("XAppStatusIcon set_metadata: '%s'", metadata);
1935 DEBUG ("set_metadata: '%s'", metadata);
19331936
19341937 if (g_strcmp0 (metadata, icon->priv->metadata) == 0)
19351938 {
19621965 GError *error;
19631966 gboolean found;
19641967
1965 g_debug("XAppStatusIcon: any_monitors: Looking for status monitors");
1968 DEBUG("Looking for status monitors");
19661969
19671970 error = NULL;
19681971 found = FALSE;
19961999 {
19972000 if (g_str_has_prefix (str, STATUS_ICON_MONITOR_MATCH))
19982001 {
1999 g_debug ("XAppStatusIcon: any_monitors: discovered active status monitor (%s)", str);
2002 DEBUG ("Discovered active status monitor (%s)", str);
20002003
20012004 found = TRUE;
20022005
20142017
20152018 if (error)
20162019 {
2017 g_warning ("XAppStatusIcon: any_monitors: Unable to check for monitors: %s", error->message);
2020 g_warning ("Unable to check for monitors: %s", error->message);
20182021 g_error_free (error);
20192022 }
20202023
2021 g_debug ("XAppStatusIcon: any_monitors: %s", found ? "TRUE" : "FALSE");
2024 DEBUG ("Monitors found: %s", found ? "TRUE" : "FALSE");
20222025
20232026 return found;
20242027 }
1515
1616 #include "sn-item-interface.h"
1717 #include "sn-item.h"
18
19 #define DEBUG_FLAG XAPP_DEBUG_SN_WATCHER
20 #include <libxapp/xapp-debug.h>
1821
1922 #define FALLBACK_ICON_SIZE 24
2023
162165 sn_item_dispose (GObject *object)
163166 {
164167 SnItem *item = SN_ITEM (object);
165 g_debug ("SnItem dispose (%p)", object);
168 DEBUG ("SnItem dispose (%p)", object);
166169
167170 if (item->png_path != NULL)
168171 {
195198 static void
196199 sn_item_finalize (GObject *object)
197200 {
198 g_debug ("SnItem finalize (%p)", object);
201 DEBUG ("SnItem finalize (%p)", object);
199202
200203 G_OBJECT_CLASS (sn_item_parent_class)->finalize (object);
201204 }
375378 cairo_surface_t *surface;
376379 gchar *filename, *save_filename;
377380
378 g_debug ("Trying to use icon pixmap for %s",
381 DEBUG ("Trying to use icon pixmap for %s",
379382 item->sortable_name);
380383
381384 surface = NULL;
412415 cairo_status_t status = CAIRO_STATUS_SUCCESS;
413416 status = cairo_surface_write_to_png (surface, save_filename);
414417
415 g_debug ("Saving tmp image file for '%s' to '%s'", item->sortable_name, save_filename);
418 DEBUG ("Saving tmp image file for '%s' to '%s'", item->sortable_name, save_filename);
416419
417420 if (status != CAIRO_STATUS_SUCCESS)
418421 {
424427 return;
425428 }
426429
427 g_debug ("No pixmaps to use");
430 DEBUG ("No pixmaps to use");
428431 xapp_status_icon_set_icon_name (item->status_icon, "image-missing");
429432 }
430433
491494 const gchar *icon_theme_path,
492495 const gchar *icon_name)
493496 {
494 g_debug ("Checking for icon name for %s - theme path: '%s', icon name: '%s'",
497 DEBUG ("Checking for icon name for %s - theme path: '%s', icon name: '%s'",
495498 item->sortable_name,
496499 icon_theme_path,
497500 icon_name);
580583 new_props->menu_path));
581584 g_object_ref_sink (item->menu);
582585
583 g_debug ("New menu for '%s'", item->sortable_name);
586 DEBUG ("New menu for '%s'", item->sortable_name);
584587
585588 if (item->is_ai && !item->should_activate)
586589 {
633636 new_props->tooltip_body);
634637
635638 xapp_status_icon_set_tooltip_text (item->status_icon, text);
636 g_debug ("Tooltip text for '%s' from ToolTip: %s",
639 DEBUG ("Tooltip text for '%s' from ToolTip: %s",
637640 item->sortable_name,
638641 text);
639642
641644 }
642645 else
643646 {
644 g_debug ("Tooltip text for '%s' from ToolTip: %s",
647 DEBUG ("Tooltip text for '%s' from ToolTip: %s",
645648 item->sortable_name,
646649 new_props->tooltip_heading);
647650
659662 capped_string = capitalize (new_props->title);
660663 xapp_status_icon_set_tooltip_text (item->status_icon, capped_string);
661664
662 g_debug ("Tooltip text for '%s' from Title: %s",
665 DEBUG ("Tooltip text for '%s' from Title: %s",
663666 item->sortable_name,
664667 capped_string);
665668
690693 xapp_status_icon_set_visible (item->status_icon, TRUE);
691694 }
692695
693 g_debug ("Status for '%s' is now '%s'", item->sortable_name, new_props->status);
696 DEBUG ("Status for '%s' is now '%s'", item->sortable_name, new_props->status);
694697 }
695698
696699 static gchar *
11051108 return;
11061109 }
11071110
1108 g_debug ("Sort name for '%s' is '%s'",
1111 DEBUG ("Sort name for '%s' is '%s'",
11091112 g_dbus_proxy_get_name (G_DBUS_PROXY (item->sn_item_proxy)),
11101113 sortable_name);
11111114
33
44 #include <libxapp/xapp-status-icon.h>
55 #include <libxapp/xapp-util.h>
6
7 #define DEBUG_FLAG XAPP_DEBUG_SN_WATCHER
8 #include <libxapp/xapp-debug.h>
9
610 #include <glib-unix.h>
711
812 #include "sn-watcher-interface.h"
913 #include "sn-item-interface.h"
1014 #include "sn-item.h"
1115
16
1217 #define XAPP_TYPE_SN_WATCHER xapp_sn_watcher_get_type ()
1318 G_DECLARE_FINAL_TYPE (XAppSnWatcher, xapp_sn_watcher, XAPP, SN_WATCHER, GtkApplication)
1419
5560 {
5661 if (watcher->shutdown_pending)
5762 {
58 g_debug ("A monitor appeared on the bus, cancelling shutdown\n");
63 DEBUG ("A monitor appeared on the bus, cancelling shutdown\n");
5964
6065 watcher->shutdown_pending = FALSE;
6166 g_application_hold (G_APPLICATION (watcher));
9196
9297 if (g_str_has_prefix (key, name))
9398 {
94 g_debug ("Client %s has exited, removing status icon", key);
99 DEBUG ("Client %s has exited, removing status icon", key);
95100 g_hash_table_remove (watcher->items, key);
96101
97102 update_published_items (watcher);
109114 {
110115 if (g_str_has_prefix (name, STATUS_ICON_MONITOR_PREFIX))
111116 {
112 g_debug ("Lost a monitor, checking for any more");
117 DEBUG ("Lost a monitor, checking for any more");
113118
114119 if (xapp_status_icon_any_monitors ())
115120 {
116 g_debug ("Still have a monitor, continuing");
121 DEBUG ("Still have a monitor, continuing");
117122
118123 return;
119124 }
120125 else
121126 {
122 g_debug ("Lost our last monitor, starting countdown\n");
127 DEBUG ("Lost our last monitor, starting countdown\n");
123128
124129 if (!watcher->shutdown_pending)
125130 {
153158
154159 g_variant_get (parameters, "(&s&s&s)", &name, &old_owner, &new_owner);
155160
156 g_debug("XAppSnWatcher: NameOwnerChanged signal received (n: %s, old: %s, new: %s", name, old_owner, new_owner);
161 DEBUG("NameOwnerChanged signal received (n: %s, old: %s, new: %s", name, old_owner, new_owner);
157162
158163 if (!name)
159164 {
173178 static void
174179 add_name_listener (XAppSnWatcher *watcher)
175180 {
176 g_debug ("XAppSnWatcher: Adding NameOwnerChanged listener for status monitor existence");
181 DEBUG ("Adding NameOwnerChanged listener for status monitor existence");
177182
178183 watcher->name_listener_id = g_dbus_connection_signal_subscribe (watcher->connection,
179184 FDO_DBUS_NAME,
194199 {
195200 XAppSnWatcher *watcher = XAPP_SN_WATCHER (user_data);
196201
197 g_debug ("Lost StatusNotifierWatcher name (maybe something replaced us), exiting immediately");
202 DEBUG ("Lost StatusNotifierWatcher name (maybe something replaced us), exiting immediately");
198203 g_application_quit (G_APPLICATION (watcher));
199204 }
200205
205210 {
206211 XAppSnWatcher *watcher = XAPP_SN_WATCHER (user_data);
207212
208 g_debug ("Name acquired on dbus");
213 DEBUG ("Name acquired on dbus");
209214 sn_watcher_interface_set_protocol_version (watcher->skeleton, 0);
210215 sn_watcher_interface_set_is_status_notifier_host_registered (watcher->skeleton,
211216 watcher->advertise_host);
288293
289294 temp_key = g_strdup_printf ("%s%s", temp_bname, temp_path);
290295
291 g_debug ("Key: '%s', busname '%s', path '%s'", temp_key, temp_bname, temp_path);
296 DEBUG ("Key: '%s', busname '%s', path '%s'", temp_key, temp_bname, temp_path);
292297
293298 *key = temp_key;
294299 *bus_name = temp_bname;
356361 {
357362 if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
358363 {
359 g_debug ("Could not create new status notifier proxy item for item at %s: %s",
364 DEBUG ("Could not create new status notifier proxy item for item at %s: %s",
360365 data->bus_name, error->message);
361366 }
362367
411416 {
412417 NewSnProxyData *data;
413418 error = NULL;
414 // g_debug ("Key: '%s'", key);
419 // DEBUG ("Key: '%s'", key);
415420
416421 data = g_slice_new0 (NewSnProxyData);
417422 data->watcher = watcher;
455460
456461 watcher->skeleton = sn_watcher_interface_skeleton_new ();
457462
458 g_debug ("XAppSnWatcher: exporting StatusNotifierWatcher dbus interface to %s", NOTIFICATION_WATCHER_PATH);
463 DEBUG ("Exporting StatusNotifierWatcher dbus interface to %s", NOTIFICATION_WATCHER_PATH);
459464
460465 g_signal_connect (watcher->skeleton,
461466 "handle-register-status-notifier-item",
485490 static gboolean
486491 on_interrupt (XAppSnWatcher *watcher)
487492 {
488 g_debug ("SIGINT - shutting down immediately");
493 DEBUG ("SIGINT - shutting down immediately");
489494
490495 g_application_quit (G_APPLICATION (watcher));
491496 return FALSE;
494499 static void
495500 continue_startup (XAppSnWatcher *watcher)
496501 {
497 g_debug ("Trying to acquire session bus connection");
502 DEBUG ("Trying to acquire session bus connection");
498503
499504 g_unix_signal_add (SIGINT, (GSourceFunc) on_interrupt, watcher);
500505 g_application_hold (G_APPLICATION (watcher));
572577 }
573578 else
574579 {
575 g_debug ("No active monitors, exiting in 30s");
580 DEBUG ("No active monitors, exiting in 30s");
576581 watcher->shutdown_pending = TRUE;
577582 }
578583 }
701706
702707 if (!should_start)
703708 {
704 g_debug ("XDG_CURRENT_DESKTOP is '%s' - not starting XApp's StatusNotifierWatcher service."
709 DEBUG ("XDG_CURRENT_DESKTOP is '%s' - not starting XApp's StatusNotifierWatcher service."
705710 "If you want to change this, add your desktop's name to the dconf org.x.apps.statusicon "
706711 "'status-notifier-enabled-desktops' setting key.", current_desktop);
707712 exit(0);