Browse Source

Add debugging info to systray.

upstream/xfce4-panel-4.10.1
Nick Schermer 12 years ago
parent
commit
1d17c4d20a
  1. 1
      common/panel-debug.c
  2. 3
      common/panel-debug.h
  3. 30
      plugins/systray/systray-box.c
  4. 5
      plugins/systray/systray-manager.c
  5. 2
      plugins/systray/systray-manager.h
  6. 9
      plugins/systray/systray-socket.c
  7. 7
      plugins/systray/systray.c

1
common/panel-debug.c

@ -47,6 +47,7 @@ static const GDebugKey panel_debug_keys[] =
{ "tasklist", PANEL_DEBUG_TASKLIST },
{ "base-window", PANEL_DEBUG_BASE_WINDOW },
{ "applicationsmenu", PANEL_DEBUG_APPLICATIONSMENU },
{ "systray", PANEL_DEBUG_SYSTRAY },
{ "gdb", PANEL_DEBUG_GDB },
{ "valgrind", PANEL_DEBUG_VALGRIND }
};

3
common/panel-debug.h

@ -35,7 +35,8 @@ typedef enum
PANEL_DEBUG_BASE_WINDOW = 1 << 9,
PANEL_DEBUG_APPLICATIONSMENU = 1 << 10,
PANEL_DEBUG_GDB = 1 << 11, /* run plugin in gdb */
PANEL_DEBUG_VALGRIND = 1 << 12 /* run plugin in valgrind */
PANEL_DEBUG_VALGRIND = 1 << 12, /* run plugin in valgrind */
PANEL_DEBUG_SYSTRAY = 1 << 13
}
PanelDebugFlag;

30
plugins/systray/systray-box.c

@ -31,7 +31,7 @@
#include <gtk/gtk.h>
#include <libxfce4panel/libxfce4panel.h>
#include <common/panel-private.h>
#include <common/panel-xfconf.h>
#include <common/panel-debug.h>
#include "systray-box.h"
#include "systray-socket.h"
@ -321,6 +321,10 @@ systray_box_size_request (GtkWidget *widget,
}
}
panel_debug_filtered (PANEL_DEBUG_SYSTRAY,
"requested cells=%g, rows=%d, row_size=%d, children=%d",
cells, rows, row_size, box->n_visible_children);
if (cells > 0.00)
{
cols = cells / (gdouble) rows;
@ -356,6 +360,10 @@ systray_box_size_request (GtkWidget *widget,
/* emit property if changed */
if (box->n_hidden_childeren != n_hidden_childeren)
{
panel_debug_filtered (PANEL_DEBUG_SYSTRAY,
"hidden children changed (%d -> %d)",
n_hidden_childeren, box->n_hidden_childeren);
box->n_hidden_childeren = n_hidden_childeren;
g_object_notify (G_OBJECT (box), "has-hidden");
}
@ -391,9 +399,13 @@ systray_box_size_allocate (GtkWidget *widget,
border = GTK_CONTAINER (widget)->border_width;
alloc_size = box->horizontal ? widget->allocation.height : widget->allocation.width;
alloc_size = box->horizontal ? allocation->height : allocation->width;
systray_box_size_get_max_child_size (box, alloc_size, &rows, &row_size, &offset);
panel_debug_filtered (PANEL_DEBUG_SYSTRAY, "allocate rows=%d, row_size=%d, w=%d, h=%d, horiz=%s",
rows, row_size, allocation->width, allocation->height,
PANEL_DEBUG_BOOL (box->horizontal));
/* get allocation bounds */
x_start = allocation->x + border;
x_end = allocation->x + allocation->width - border;
@ -505,6 +517,11 @@ systray_box_size_allocate (GtkWidget *widget,
/* we overflow the number of rows, restart
* allocation with 1px smaller icons */
row_size--;
panel_debug_filtered (PANEL_DEBUG_SYSTRAY,
"y overflow (%d > %d), restart with row_size=%d",
y, y_end, row_size);
goto restart_allocation;
}
}
@ -518,6 +535,11 @@ systray_box_size_allocate (GtkWidget *widget,
/* we overflow the number of rows, restart
* allocation with 1px smaller icons */
row_size--;
panel_debug_filtered (PANEL_DEBUG_SYSTRAY,
"x overflow (%d > %d), restart with row_size=%d",
x, x_end, row_size);
goto restart_allocation;
}
}
@ -532,6 +554,10 @@ systray_box_size_allocate (GtkWidget *widget,
y += row_size * ratio + SPACING;
}
panel_debug_filtered (PANEL_DEBUG_SYSTRAY, "allocated %s at (%d,%d;%d,%d)",
systray_socket_get_name (XFCE_SYSTRAY_SOCKET (child)),
child_alloc.x, child_alloc.y, child_alloc.width, child_alloc.height);
gtk_widget_size_allocate (child, &child_alloc);
}
}

5
plugins/systray/systray-manager.c

@ -36,6 +36,7 @@
#include <gtk/gtk.h>
#include <common/panel-private.h>
#include <common/panel-debug.h>
#include <libxfce4panel/libxfce4panel.h>
#include <libxfce4util/libxfce4util.h>
@ -387,6 +388,8 @@ systray_manager_register (SystrayManager *manager,
gdk_display_add_client_message_filter (display,
gdk_atom_intern ("_NET_SYSTEM_TRAY_MESSAGE_DATA", FALSE),
systray_manager_handle_client_message_message_data, manager);
panel_debug (PANEL_DEBUG_SYSTRAY, "registered manager on screen %d", screen_number);
}
else
{
@ -468,6 +471,8 @@ systray_manager_unregister (SystrayManager *manager)
manager->invisible = NULL;
gtk_widget_destroy (invisible);
g_object_unref (G_OBJECT (invisible));
panel_debug (PANEL_DEBUG_SYSTRAY, "unregistered manager");
}

2
plugins/systray/systray-manager.h

@ -67,7 +67,5 @@ void systray_manager_unregister (SystrayManager *manag
void systray_manager_set_orientation (SystrayManager *manager,
GtkOrientation orientation);
gchar *systray_manager_get_application_name (GtkWidget *socket) G_GNUC_MALLOC;
#endif /* !__SYSTRAY_MANAGER_H__ */

9
plugins/systray/systray-socket.c

@ -35,7 +35,10 @@
#include <gtk/gtk.h>
#include <libxfce4panel/libxfce4panel.h>
#include <common/panel-private.h>
#include <common/panel-debug.h>
#include "systray-socket.h"
@ -152,6 +155,12 @@ systray_socket_realize (GtkWidget *widget)
socket->parent_relative_bg || socket->is_composited);
gtk_widget_set_double_buffered (widget, socket->parent_relative_bg);
panel_debug_filtered (PANEL_DEBUG_SYSTRAY,
"socket %s (composited=%s, relative-bg=%s",
systray_socket_get_name (socket),
PANEL_DEBUG_BOOL (socket->is_composited),
PANEL_DEBUG_BOOL (socket->parent_relative_bg));
}

7
plugins/systray/systray.c

@ -26,6 +26,7 @@
#include <common/panel-private.h>
#include <common/panel-xfconf.h>
#include <common/panel-utils.h>
#include <common/panel-debug.h>
#include <exo/exo.h>
#include "systray.h"
@ -809,6 +810,9 @@ systray_plugin_icon_added (SystrayManager *manager,
systray_plugin_names_update_icon (icon, plugin);
gtk_container_add (GTK_CONTAINER (plugin->box), icon);
gtk_widget_show (icon);
panel_debug_filtered (PANEL_DEBUG_SYSTRAY, "added %s icon",
systray_socket_get_name (XFCE_SYSTRAY_SOCKET (icon)));
}
@ -825,6 +829,9 @@ systray_plugin_icon_removed (SystrayManager *manager,
/* remove the icon from the box */
gtk_container_remove (GTK_CONTAINER (plugin->box), icon);
panel_debug_filtered (PANEL_DEBUG_SYSTRAY, "removed %s icon",
systray_socket_get_name (XFCE_SYSTRAY_SOCKET (icon)));
}

Loading…
Cancel
Save