all repos — openbox @ 5be0a82a353b67160142134de1cc51fa31d72759

openbox fork - make it a bit more like ryudo

use ob_debug for any debug printing and only display the output when its a debug build or when --debug is passed to it
Dana Jansens danakj@orodu.net
commit

5be0a82a353b67160142134de1cc51fa31d72759

parent

230abdc5a0848cd05dc3a007826a2a6b8a73c0a5

M configure.acconfigure.ac

@@ -1,5 +1,5 @@

AC_PREREQ([2.54]) -AC_INIT([openbox], [3.0-alpha2], [http://bugzilla.icculus.org]) +AC_INIT([openbox], [3.0-alpha2a-ex-plus], [http://bugzilla.icculus.org]) AM_INIT_AUTOMAKE AC_CONFIG_SRCDIR([kernel/openbox.c])

@@ -84,7 +84,8 @@ use_gtk="no"

AC_MSG_WARN([disabling build of the configuration tool]) ] ) -AM_CONDITIONAL(OBCONF, [test "$use_gtk" = "yes" && test "$use_glade" = "yes"]) +#AM_CONDITIONAL(OBCONF, [test "$use_gtk" = "yes" && test "$use_glade" = "yes"]) +AM_CONDITIONAL(OBCONF, [false]) # Check for session management X11_SM
M openbox/action.copenbox/action.c

@@ -1,3 +1,4 @@

+#include "debug.h" #include "client.h" #include "focus.h" #include "moveresize.h"

@@ -576,7 +577,6 @@ act->func == action_desktop_left ||

act->func == action_desktop_up || act->func == action_desktop_down) { if ((n = parse_find_node("wrap", node->xmlChildrenNode))) { - g_message("WRAP %d", parse_bool(doc, n)); act->data.desktopdir.wrap = parse_bool(doc, n); } } else if (act->func == action_send_to_desktop_right ||
M openbox/client.copenbox/client.c

@@ -1,3 +1,4 @@

+#include "debug.h" #include "client.h" #include "dock.h" #include "xerror.h"

@@ -216,7 +217,7 @@ }

XFree(wmhint); } - g_message("Managing window: %lx", window); + ob_debug("Managing window: %lx\n", window); /* choose the events we want to receive on the CLIENT window */ attrib_set.event_mask = CLIENT_EVENTMASK;

@@ -322,7 +323,7 @@ client_set_list();

dispatch_client(Event_Client_Mapped, self, 0, 0); - g_message("Managed window 0x%lx (%s)", window, self->class); + ob_debug("Managed window 0x%lx (%s)\n", window, self->class); } void client_unmanage_all()

@@ -343,7 +344,7 @@ {

guint j; GSList *it; - g_message("Unmanaging window: %lx (%s)", self->window, self->class); + ob_debug("Unmanaging window: %lx (%s)\n", self->window, self->class); dispatch_client(Event_Client_Destroy, self, 0, 0); g_assert(self != NULL);

@@ -434,7 +435,7 @@ XMapWindow(ob_display, self->window);

} - g_message("Unmanaged window 0x%lx", self->window); + ob_debug("Unmanaged window 0x%lx\n", self->window); /* free all data allocated in the client struct */ g_slist_free(self->transients);

@@ -1098,7 +1099,6 @@ if (self->frame) client_shade(self, FALSE);

else self->shaded = FALSE; } if (!(self->functions & OB_CLIENT_FUNC_ICONIFY) && self->iconic) { - g_message("UNSETTING ICONIC"); if (self->frame) client_iconify(self, FALSE, TRUE); else self->iconic = FALSE; }

@@ -1191,8 +1191,8 @@ }

if (ur != self->urgent) { self->urgent = ur; - g_message("Urgent Hint for 0x%lx: %s", self->window, - ur ? "ON" : "OFF"); + ob_debug("Urgent Hint for 0x%lx: %s\n", self->window, + ur ? "ON" : "OFF"); /* fire the urgent callback if we're mapped, otherwise, wait until after we're mapped */ if (self->frame)

@@ -1905,8 +1905,8 @@ gboolean changed = FALSE;

if (self->iconic != iconic) { - g_message("%sconifying window: 0x%lx", (iconic ? "I" : "Uni"), - self->window); + ob_debug("%sconifying window: 0x%lx\n", (iconic ? "I" : "Uni"), + self->window); self->iconic = iconic;

@@ -2126,7 +2126,7 @@ GSList *it;

if (target != self->desktop) { - g_message("Setting desktop %u", target+1); + ob_debug("Setting desktop %u\n", target+1); g_assert(target < screen_num_desktops || target == DESKTOP_ALL);

@@ -2416,9 +2416,9 @@ XSendEvent(ob_display, self->window, FALSE, NoEventMask, &ce);

} #ifdef DEBUG_FOCUS - g_message("%sively focusing %lx at %d", (self->can_focus ? "act" : "pass"), - self->window, (int) - event_lasttime); + ob_debug("%sively focusing %lx at %d\n", + (self->can_focus ? "act" : "pass"), + self->window, (int) event_lasttime); #endif /* Cause the FocusIn to come back to us. Important for desktop switches,

@@ -2432,7 +2432,7 @@ void client_unfocus(ObClient *self)

{ g_assert(focus_client == self); #ifdef DEBUG_FOCUS - g_message("client_unfocus for %lx", self->window); + ob_debug("client_unfocus for %lx\n", self->window); #endif focus_fallback(OB_FOCUS_FALLBACK_UNFOCUSING); }
M openbox/debug.hopenbox/debug.h

@@ -1,6 +1,8 @@

#ifndef __ob__debug_h #define __ob__debug_h +#include <glib.h> + void ob_debug_show_output(gboolean enable); void ob_debug(char *a, ...);
M openbox/dock.copenbox/dock.c

@@ -1,3 +1,4 @@

+#include "debug.h" #include "dock.h" #include "screen.h" #include "prop.h"

@@ -115,7 +116,7 @@ GrabModeAsync, OB_CURSOR_MOVE);

g_hash_table_insert(window_map, &app->icon_win, app); - g_message("Managed Dock App: 0x%lx (%s)", app->icon_win, app->class); + ob_debug("Managed Dock App: 0x%lx (%s)\n", app->icon_win, app->class); } void dock_remove_all()

@@ -141,7 +142,7 @@

dock->dock_apps = g_list_remove(dock->dock_apps, app); dock_configure(); - g_message("Unmanaged Dock App: 0x%lx (%s)", app->icon_win, app->class); + ob_debug("Unmanaged Dock App: 0x%lx (%s)\n", app->icon_win, app->class); g_free(app->name); g_free(app->class);
M openbox/event.copenbox/event.c

@@ -1,3 +1,4 @@

+#include "debug.h" #include "openbox.h" #include "dock.h" #include "client.h"

@@ -315,8 +316,8 @@ */

if (INVALID_FOCUSIN(e) || client == NULL) { #ifdef DEBUG_FOCUS - g_message("FocusIn on %lx mode %d detail %d IGNORED", e->xfocus.window, - e->xfocus.mode, e->xfocus.detail); + ob_debug("FocusIn on %lx mode %d detail %d IGNORED\n", + e->xfocus.window, e->xfocus.mode, e->xfocus.detail); #endif /* says a client was not found for the event (or a valid FocusIn event was not found.

@@ -326,22 +327,22 @@ return TRUE;

} #ifdef DEBUG_FOCUS - g_message("FocusIn on %lx mode %d detail %d", e->xfocus.window, - e->xfocus.mode, e->xfocus.detail); + ob_debug("FocusIn on %lx mode %d detail %d\n", e->xfocus.window, + e->xfocus.mode, e->xfocus.detail); #endif break; case FocusOut: if (INVALID_FOCUSOUT(e)) { #ifdef DEBUG_FOCUS - g_message("FocusOut on %lx mode %d detail %d IGNORED", - e->xfocus.window, e->xfocus.mode, e->xfocus.detail); + ob_debug("FocusOut on %lx mode %d detail %d IGNORED\n", + e->xfocus.window, e->xfocus.mode, e->xfocus.detail); #endif return TRUE; } #ifdef DEBUG_FOCUS - g_message("FocusOut on %lx mode %d detail %d", - e->xfocus.window, e->xfocus.mode, e->xfocus.detail); + ob_debug("FocusOut on %lx mode %d detail %d\n", + e->xfocus.window, e->xfocus.mode, e->xfocus.detail); #endif {

@@ -355,7 +356,7 @@ if (!XCheckTypedEvent(ob_display, FocusIn, &fe))

break; if (fe.type == FocusOut) { #ifdef DEBUG_FOCUS - g_message("found pending FocusOut"); + ob_debug("found pending FocusOut"); #endif if (!INVALID_FOCUSOUT(&fe)) { /* if there is a VALID FocusOut still coming, don't

@@ -366,7 +367,7 @@ break;

} } else { #ifdef DEBUG_FOCUS - g_message("found pending FocusIn"); + ob_debug("found pending FocusIn"); #endif /* is the focused window getting a FocusOut/In back to itself?

@@ -383,16 +384,16 @@ window (such as on a SendToDesktop-esque action.

*/ if (focus_client) { #ifdef DEBUG_FOCUS - g_message("focused window got an Out/In back to " - "itself IGNORED both"); + ob_debug("focused window got an Out/In back to " + "itself IGNORED both"); #endif return TRUE; } else { event_process(&fe); #ifdef DEBUG_FOCUS - g_message("focused window got an Out/In back to " - "itself but focus_client was null " - "IGNORED just the Out"); + ob_debug("focused window got an Out/In back to " + "itself but focus_client was null " + "IGNORED just the Out"); #endif return TRUE; }

@@ -411,8 +412,8 @@ }

} if (fallback) { #ifdef DEBUG_FOCUS - g_message("no valid FocusIn and no FocusOut events found, " - "falling back"); + ob_debug("no valid FocusIn and no FocusOut events found, " + "falling back"); #endif focus_fallback(OB_FOCUS_FALLBACK_NOFOCUS); }

@@ -428,18 +429,18 @@ e->xcrossing.detail == NotifyInferior ||

(e->xcrossing.mode == NotifyUngrab && e->xcrossing.detail == NotifyVirtual)) { #ifdef DEBUG_FOCUS - g_message("%sNotify mode %d detail %d on %lx IGNORED", - (e->type == EnterNotify ? "Enter" : "Leave"), - e->xcrossing.mode, - e->xcrossing.detail, client?client->window:0); + ob_debug("%sNotify mode %d detail %d on %lx IGNORED", + (e->type == EnterNotify ? "Enter" : "Leave"), + e->xcrossing.mode, + e->xcrossing.detail, client?client->window:0); #endif return TRUE; } #ifdef DEBUG_FOCUS - g_message("%sNotify mode %d detail %d on %lx", - (e->type == EnterNotify ? "Enter" : "Leave"), - e->xcrossing.mode, - e->xcrossing.detail, client?client->window:0); + ob_debug("%sNotify mode %d detail %d on %lx", + (e->type == EnterNotify ? "Enter" : "Leave"), + e->xcrossing.mode, + e->xcrossing.detail, client?client->window:0); #endif break; }

@@ -552,7 +553,7 @@ Atom msgtype;

switch(e->type) { case SelectionClear: - g_message("Another WM has requested to replace us. Exiting."); + ob_debug("Another WM has requested to replace us. Exiting.\n"); ob_exit(); break;

@@ -588,7 +589,7 @@ default:

; #ifdef VIDMODE if (extensions_vidmode && e->type == extensions_vidmode_event_basep) { - g_message("VIDMODE EVENT"); + ob_debug("VIDMODE EVENT\n"); } #endif }

@@ -635,7 +636,7 @@ }

break; case FocusIn: #ifdef DEBUG_FOCUS - g_message("FocusIn on client for %lx", client->window); + ob_debug("FocusIn on client for %lx\n", client->window); #endif if (client != focus_client) { focus_set_client(client);

@@ -644,7 +645,7 @@ }

break; case FocusOut: #ifdef DEBUG_FOCUS - g_message("FocusOut on client for %lx", client->window); + ob_debug("FocusOut on client for %lx\n", client->window); #endif /* are we a fullscreen window or a transient of one? (checks layer) if we are then we need to be iconified since we are losing focus

@@ -668,8 +669,8 @@ focus_order[desktop] = g_list_prepend(focus_order[desktop],

client); } else if (config_focus_follow) { #ifdef DEBUG_FOCUS - g_message("EnterNotify on %lx, focusing window", - client->window); + ob_debug("EnterNotify on %lx, focusing window\n", + client->window); #endif client_focus(client); }

@@ -782,7 +783,7 @@

client_unmanage(client); break; case MapRequest: - g_message("MapRequest for 0x%lx", client->window); + ob_debug("MapRequest for 0x%lx\n", client->window); if (!client->iconic) break; /* this normally doesn't happen, but if it does, we don't want it! */ if (screen_showing_desktop)

@@ -836,22 +837,22 @@ client_set_desktop(client, (unsigned)e->xclient.data.l[0],

FALSE); } else if (msgtype == prop_atoms.net_wm_state) { /* can't compress these */ - g_message("net_wm_state %s %ld %ld for 0x%lx", - (e->xclient.data.l[0] == 0 ? "Remove" : - e->xclient.data.l[0] == 1 ? "Add" : - e->xclient.data.l[0] == 2 ? "Toggle" : "INVALID"), - e->xclient.data.l[1], e->xclient.data.l[2], - client->window); + ob_debug("net_wm_state %s %ld %ld for 0x%lx\n", + (e->xclient.data.l[0] == 0 ? "Remove" : + e->xclient.data.l[0] == 1 ? "Add" : + e->xclient.data.l[0] == 2 ? "Toggle" : "INVALID"), + e->xclient.data.l[1], e->xclient.data.l[2], + client->window); client_set_state(client, e->xclient.data.l[0], e->xclient.data.l[1], e->xclient.data.l[2]); } else if (msgtype == prop_atoms.net_close_window) { - g_message("net_close_window for 0x%lx", client->window); + ob_debug("net_close_window for 0x%lx\n", client->window); client_close(client); } else if (msgtype == prop_atoms.net_active_window) { - g_message("net_active_window for 0x%lx", client->window); + ob_debug("net_active_window for 0x%lx\n", client->window); client_activate(client); } else if (msgtype == prop_atoms.net_wm_moveresize) { - g_message("net_wm_moveresize for 0x%lx", client->window); + ob_debug("net_wm_moveresize for 0x%lx\n", client->window); if ((Atom)e->xclient.data.l[2] == prop_atoms.net_wm_moveresize_size_topleft || (Atom)e->xclient.data.l[2] ==

@@ -978,7 +979,7 @@ GList *it = NULL;

top = g_list_nth_data(menu_visible, 0); - g_message("EVENT %d", e->type); + ob_debug("EVENT %d\n", e->type); switch (e->type) { case KeyPress: if (e->xkey.keycode == ob_keycode(OB_KEY_DOWN))

@@ -1009,12 +1010,12 @@ break;

case ButtonPress: if (e->xbutton.button > 3) break; - g_message("BUTTON PRESS"); + ob_debug("BUTTON PRESS\n"); break; case ButtonRelease: if (e->xbutton.button > 3) break; - g_message("BUTTON RELEASED"); + ob_debug("BUTTON RELEASED\n"); for (it = menu_visible; it; it = g_list_next(it)) { ObMenu *m = it->data;

@@ -1062,7 +1063,7 @@ }

break; case MotionNotify: - g_message("motion"); + ob_debug("motion\n"); for (it = menu_visible; it; it = g_list_next(it)) { ObMenu *m = it->data; if ((entry = menu_find_entry_by_pos(it->data,
M openbox/focus.copenbox/focus.c

@@ -1,3 +1,4 @@

+#include "debug.h" #include "event.h" #include "openbox.h" #include "grab.h"

@@ -64,7 +65,7 @@ Window active;

ObClient *old; #ifdef DEBUG_FOCUS - g_message("focus_set_client 0x%lx", client ? client->window : 0); + ob_debug("focus_set_client 0x%lx\n", client ? client->window : 0); #endif /* uninstall the old colormap, and install the new one */
M openbox/menu.copenbox/menu.c

@@ -1,3 +1,4 @@

+#include "debug.h" #include "menu.h" #include "openbox.h" #include "stacking.h"

@@ -37,7 +38,7 @@ if (!parse_attr_string("id", node, &id))

goto parse_menu_fail; if (!parse_attr_string("label", node, &title)) goto parse_menu_fail; - g_message("menu label %s", title); + ob_debug("menu label %s\n", title); if (parse_attr_string("plugin", node, &plugin)) { PluginMenuCreateData data;

@@ -431,7 +432,8 @@

y -= menu->title_h + ob_rr_theme->bwidth; if (y < 0) return NULL; - g_message ("%d %p", y/menu->item_h, g_list_nth_data(menu->entries, y / menu->item_h)); + ob_debug("%d %p\n", y/menu->item_h, + g_list_nth_data(menu->entries, y / menu->item_h)); return g_list_nth_data(menu->entries, y / menu->item_h); }
M openbox/menu_render.copenbox/menu_render.c

@@ -1,5 +1,6 @@

/* Functions for default rendering of menus. Might become pluginnable */ +#include "debug.h" #include "menu.h" #include "openbox.h" #include "render/theme.h"

@@ -125,15 +126,10 @@ a = self->a_item;

break; default: - g_message("unhandled render_type"); - a = !self->enabled ? self->a_disabled : - (self->hilite && - (self->action || - self->render_type == OB_MENU_ENTRY_RENDER_TYPE_SUBMENU) ? - self->a_hilite : self->a_item); + g_assert_not_reached(); /* unhandled rendering type */ break; } - g_message ("%s %d", self->label, self->hilite); + ob_debug("%s %d\n", self->label, self->hilite); XMoveResizeWindow(ob_display, self->item, 0, self->y, menu->size.width, menu->item_h);
M openbox/openbox.copenbox/openbox.c

@@ -1,3 +1,4 @@

+#include "debug.h" #include "openbox.h" #include "dock.h" #include "event.h"

@@ -91,6 +92,10 @@ sigset_t sigset;

char *path; xmlDocPtr doc; xmlNodePtr node; + +#ifdef DEBUG + ob_debug_show_output(TRUE); +#endif state = OB_STATE_STARTING;

@@ -430,7 +435,7 @@ g_free(val_uid.value);

g_free(prop_cmd.vals); g_free(prop_res.vals); - g_message("Connected to session manager with id %s", ob_sm_id); + ob_debug("Connected to session manager with id %s\n", ob_sm_id); } g_free (ob_sm_id); #endif

@@ -510,6 +515,7 @@ g_print(" --help Display this help and exit\n");

g_print(" --version Display the version and exit\n"); g_print(" --sync Run in synchronous mode (this is slow and\n" " meant for debugging X routines)\n"); + g_print(" --debug Display debugging output\n"); g_print("\nPlease report bugs at %s\n", PACKAGE_BUGREPORT); }

@@ -530,6 +536,8 @@ } else if (!strcmp(argv[i], "--replace")) {

ob_replace_wm = TRUE; } else if (!strcmp(argv[i], "--sync")) { xsync = TRUE; + } else if (!strcmp(argv[i], "--debug")) { + ob_debug_show_output(TRUE); #ifdef USE_SM } else if (!strcmp(argv[i], "--sm-client-id")) { if (i == argc - 1) /* no args left */

@@ -551,24 +559,24 @@ #ifdef USE_SM

static void sm_save_yourself(SmcConn conn, SmPointer data, int save_type, Bool shutdown, int interact_style, Bool fast) { - g_message("got SAVE YOURSELF from session manager"); + ob_debug("got SAVE YOURSELF from session manager\n"); SmcSaveYourselfDone(conn, TRUE); } static void sm_die(SmcConn conn, SmPointer data) { ob_exit(); - g_message("got DIE from session manager"); + ob_debug("got DIE from session manager\n"); } static void sm_save_complete(SmcConn conn, SmPointer data) { - g_message("got SAVE COMPLETE from session manager"); + ob_debug("got SAVE COMPLETE from session manager\n"); } static void sm_shutdown_cancelled(SmcConn conn, SmPointer data) { - g_message("got SHUTDOWN CANCELLED from session manager"); + ob_debug("got SHUTDOWN CANCELLED from session manager\n"); } #endif
M openbox/screen.copenbox/screen.c

@@ -1,3 +1,4 @@

+#include "debug.h" #include "openbox.h" #include "dock.h" #include "xerror.h"

@@ -65,7 +66,7 @@

current_wm_sn_owner = XGetSelectionOwner(ob_display, wm_sn_atom); if (current_wm_sn_owner) { if (!ob_replace_wm) { - g_message("A window manager is already running on screen %d", + g_warning("A window manager is already running on screen %d", ob_screen); return FALSE; }

@@ -102,7 +103,7 @@ XSetSelectionOwner(ob_display, wm_sn_atom, screen_support_win,

timestamp); if (XGetSelectionOwner(ob_display, wm_sn_atom) != screen_support_win) { - g_message("Could not acquire window manager selection on screen %d", + g_warning("Could not acquire window manager selection on screen %d", ob_screen); return FALSE; }

@@ -123,7 +124,7 @@ wait += G_USEC_PER_SEC / 10;

} if (wait >= timeout) { - g_message("Timeout expired while waiting for the current WM to die " + g_warning("Timeout expired while waiting for the current WM to die " "on screen %d", ob_screen); return FALSE; }

@@ -165,7 +166,7 @@ XSelectInput(ob_display, RootWindow(ob_display, ob_screen),

ROOT_EVENTMASK); xerror_set_ignore(FALSE); if (xerror_occured) { - g_message("A window manager is already running on screen %d", + g_warning("A window manager is already running on screen %d", ob_screen); XDestroyWindow(ob_display, screen_support_win);

@@ -173,7 +174,7 @@ return FALSE;

} - g_message("Managing screen %d", ob_screen); + ob_debug("Managing screen %d\n", ob_screen); set_root_cursor();

@@ -426,7 +427,7 @@ net_current_desktop, cardinal, num);

if (old == num) return; - g_message("Moving to desktop %d", num+1); + ob_debug("Moving to desktop %d\n", num+1); /* show windows before hiding the rest to lessen the enter/leave events */

@@ -452,11 +453,11 @@ /* focus the last focused window on the desktop, and ignore enter events

from the switch so it doesnt mess with the focus */ while (XCheckTypedEvent(ob_display, EnterNotify, &e)); #ifdef DEBUG_FOCUS - g_message("switch fallback"); + ob_debug("switch fallback\n"); #endif focus_fallback(OB_FOCUS_FALLBACK_DESKTOP); #ifdef DEBUG_FOCUS - g_message("/switch fallback"); + ob_debug("/switch fallback\n"); #endif dispatch_ob(Event_Ob_Desktop, num, old);
M parser/parse.cparser/parse.c

@@ -59,7 +59,7 @@ }

} g_free(path); if (!r) - g_message("unable to find a valid config file, using defaults"); + g_warning("unable to find a valid config file, using defaults"); return r; }
M plugins/keyboard/keyboard.cplugins/keyboard/keyboard.c

@@ -146,7 +146,7 @@ t = tree;

while (t->first_child) t = t->first_child; if (conflict) { - g_message("conflict with binding"); + g_warning("conflict with binding"); tree_destroy(tree); return FALSE; }
M plugins/keyboard/translate.cplugins/keyboard/translate.c

@@ -15,7 +15,7 @@ else if (!g_ascii_strcasecmp("Control", str) ||

!g_ascii_strcasecmp("C", str)) return ControlMask; else if (!g_ascii_strcasecmp("Shift", str) || !g_ascii_strcasecmp("S", str)) return ShiftMask; - g_message("Invalid modifier '%s' in binding.", str); + g_warning("Invalid modifier '%s' in binding.", str); return 0; }

@@ -47,12 +47,12 @@

/* figure out the keycode */ sym = XStringToKeysym(l); if (sym == NoSymbol) { - g_message("Invalid key name '%s' in key binding.", l); + g_warning("Invalid key name '%s' in key binding.", l); goto translation_fail; } *keycode = XKeysymToKeycode(ob_display, sym); if (!*keycode) { - g_message("Key '%s' does not exist on the display.", l); + g_warning("Key '%s' does not exist on the display.", l); goto translation_fail; }
M plugins/menu/client_menu.cplugins/menu/client_menu.c

@@ -1,13 +1,13 @@

-#include <glib.h> - +#include "kernel/debug.h" #include "kernel/menu.h" #include "kernel/screen.h" #include "kernel/client.h" #include "kernel/openbox.h" - #include "kernel/frame.h" #include "render/theme.h" + +#include <glib.h> static char *PLUGIN_NAME = "client_menu";

@@ -42,7 +42,7 @@ }

if (it != NULL || i != screen_num_desktops) { menu_clear(self); - g_message("update"); + ob_debug("update\n"); for (i = 0; i < screen_num_desktops; ++i) { ObMenuEntry *e; Action *a = action_from_string("sendtodesktop");

@@ -58,7 +58,8 @@ }

void client_menu_show(ObMenu *self, int x, int y, ObClient *client) { - guint i, newy, newx; + guint i; + gint newy, newx; Rect *a = NULL; g_assert(!self->invalid);
M plugins/placement/history.cplugins/placement/history.c

@@ -1,3 +1,4 @@

+#include "kernel/debug.h" #include "kernel/openbox.h" #include "kernel/dispatch.h" #include "kernel/frame.h"

@@ -145,7 +146,7 @@ xmlDocSetRootElement(doc, root);

for (it = history_list; it; it = g_slist_next(it)) { struct HistoryItem *hi = it->data; - g_message("adding %s", hi->name); + ob_debug("adding %s\n", hi->name); node = xmlNewChild(root, NULL, (const xmlChar*) "entry", NULL); xmlNewProp(node, (const xmlChar*) "name", (const xmlChar*) hi->name); xmlNewProp(node, (const xmlChar*) "class", (const xmlChar*) hi->class);
M render/color.crender/color.c

@@ -1,8 +1,9 @@

+#include "render.h" +#include "color.h" + #include <X11/Xlib.h> #include <X11/Xutil.h> #include <string.h> -#include "render.h" -#include "color.h" void RrColorAllocateGC(RrColor *in) {

@@ -75,10 +76,6 @@ case 32:

if ((RrRedOffset(inst) != RrDefaultRedOffset) || (RrBlueOffset(inst) != RrDefaultBlueOffset) || (RrGreenOffset(inst) != RrDefaultGreenOffset)) { - g_message("CONVERSION %d->%d %d->%d %d->%d", - RrDefaultRedOffset, RrRedOffset(inst), - RrDefaultGreenOffset, RrGreenOffset(inst), - RrDefaultBlueOffset, RrBlueOffset(inst)); for (y = 0; y < im->height; y++) { for (x = 0; x < im->width; x++) { r = (data[x] >> RrDefaultRedOffset) & 0xFF;

@@ -125,7 +122,7 @@ }

break; default: - g_message("your bit depth is currently unhandled\n"); + g_warning("your bit depth is currently unhandled\n"); } }

@@ -142,8 +139,6 @@

static void swap_byte_order(XImage *im) { int x, y, di; - - g_message("SWAPPING BYTE ORDER"); di = 0; for (y = 0; y < im->height; ++y) {

@@ -163,7 +158,7 @@ c[1] = t;

case 8: break; default: - g_message("your bit depth is currently unhandled\n"); + g_warning("your bit depth is currently unhandled"); } } di += im->bytes_per_line;

@@ -224,7 +219,7 @@ p16 += im->bytes_per_line/2;

} break; case 8: - g_message("this image bit depth is currently unhandled\n"); + g_warning("this image bit depth is currently unhandled"); break; case 1: for (y = 0; y < im->height; y++) {

@@ -239,7 +234,7 @@ p8 += im->bytes_per_line;

} break; default: - g_message("this image bit depth is currently unhandled\n"); + g_warning("this image bit depth is currently unhandled"); } }
M render/gradient.crender/gradient.c

@@ -38,7 +38,7 @@ case RR_SURFACE_PYRAMID:

gradient_pyramid(&a->surface, w, h); break; default: - g_message("unhandled gradient"); + g_assert_not_reached(); /* unhandled gradient */ return; }

@@ -183,9 +183,6 @@ create_bevel_colors(l);

switch (sp->bevel) { case RR_BEVEL_1: - g_message("%lx %lx %lx", - sp->primary->pixel, - sp->bevel_dark->pixel, sp->bevel_light->pixel); XDrawLine(RrDisplay(l->inst), l->pixmap, sp->bevel_dark->gc, left, bottom, right, bottom); XDrawLine(RrDisplay(l->inst), l->pixmap, sp->bevel_dark->gc,
M render/instance.crender/instance.c

@@ -72,7 +72,6 @@ XColor icolors[256];

int tr, tg, tb, n, r, g, b, i, incolors, ii; unsigned long dev; int cpc, _ncolors; - g_message("Initializing PseudoColor RenderControl\n"); /* determine the number of colors and the bits-per-color */ inst->pseudo_bpc = 2; /* XXX THIS SHOULD BE A USER OPTION */
M render/theme.crender/theme.c

@@ -63,8 +63,9 @@

if (name) { db = loaddb(theme, name); if (db == NULL) { - g_warning("Failed to load the theme '%s'", name); - g_message("Falling back to the default: '%s'", DEFAULT_THEME); + g_warning("Failed to load the theme '%s'\n" + "Falling back to the default: '%s'", + name, DEFAULT_THEME); } else theme->name = g_path_get_basename(name); }
M tools/obconf/main.ctools/obconf/main.c

@@ -1,3 +1,4 @@

+#include "kernel/debug.h" #include "obconf.h" #include "plugins.h" #include "parser/parse.h"

@@ -71,21 +72,21 @@ }

void on_applybutton_clicked(GtkButton *but, gpointer d) { - g_message("apply"); + ob_debug("apply\n"); } void on_revertbutton_clicked(GtkButton *but, gpointer d) { - g_message("revert"); + ob_debug("revert\n"); } void on_helpbutton_clicked(GtkButton *but, gpointer d) { - g_message("help"); + ob_debug("help\n"); } void on_sectiontree_row_activated(GtkTreeView *tree, GtkTreePath *path, GtkTreeViewColumn *col, gpointer p) { - g_message("activated"); + ob_debug("activated\n"); }