openbox/actions/shade.c \
openbox/actions/showdesktop.c \
openbox/actions/showmenu.c \
+ openbox/actions/toggledebug.c \
openbox/actions/unfocus.c \
openbox/actions.c \
openbox/actions.h \
action_growtoedge_startup();
action_if_startup();
action_focustobottom_startup();
+ action_toggledebug_startup();
}
void action_growtoedge_startup();
void action_if_startup();
void action_focustobottom_startup();
+void action_toggledebug_startup();
#endif
--- /dev/null
+#include "openbox/actions.h"
+#include "openbox/stacking.h"
+#include "openbox/debug.h"
+
+static gboolean run_func(ObActionsData *data, gpointer options);
+extern gboolean debug_show;
+
+void action_toggledebug_startup(void)
+{
+ actions_register("toggledebug",
+ NULL, NULL,
+ run_func,
+ NULL, NULL);
+}
+
+/* Always return FALSE because its not interactive */
+static gboolean run_func(ObActionsData *data, gpointer options)
+{
+ if (debug_show) ob_debug("Debug output turned %s\n", "off");
+ ob_debug_show_output(!debug_show);
+ if (debug_show) ob_debug("Debug output turned %s\n", "on");
+
+ return FALSE;
+}
#include <stdarg.h>
#include <stdio.h>
-static gboolean show;
+gboolean debug_show;
void ob_debug_show_output(gboolean enable)
{
- show = enable;
+ debug_show = enable;
}
void ob_debug(const gchar *a, ...)
{
va_list vl;
- if (show) {
+ if (debug_show) {
fprintf(stderr, "DEBUG: ");
va_start(vl, a);
vfprintf(stderr, a, vl);
g_assert(type < OB_DEBUG_TYPE_NUM);
- if (show && enabled_types[type]) {
+ if (debug_show && enabled_types[type]) {
switch (type) {
case OB_DEBUG_FOCUS:
fprintf(stderr, "FOCUS: ");