XFree(wmhint);
}
- ob_debug("Managing window: 0x%lx\n", window);
+ ob_debug("Managing window: 0x%lx", window);
map_time = event_get_server_time();
/* get all the stuff off the window */
client_get_all(self, TRUE);
- ob_debug("Window type: %d\n", self->type);
- ob_debug("Window group: 0x%x\n", self->group?self->group->leader:0);
+ ob_debug("Window type: %d", self->type);
+ ob_debug("Window group: 0x%x", self->group?self->group->leader:0);
/* now we have all of the window's information so we can set this up.
do this before creating the frame, so it can tell that we are still
/* figure out placement for the window if the window is new */
if (ob_state() == OB_STATE_RUNNING) {
- ob_debug("Positioned: %s @ %d %d\n",
+ ob_debug("Positioned: %s @ %d %d",
(!self->positioned ? "no" :
(self->positioned == PPosition ? "program specified" :
(self->positioned == USPosition ? "user specified" :
"program + user specified" :
"BADNESS !?")))), place.x, place.y);
- ob_debug("Sized: %s @ %d %d\n",
+ ob_debug("Sized: %s @ %d %d",
(!self->sized ? "no" :
(self->sized == PSize ? "program specified" :
(self->sized == USSize ? "user specified" :
place.width = MIN(place.width, a->width);
place.height = MIN(place.height, a->height);
- ob_debug("setting window size to %dx%d\n", place.width, place.height);
+ ob_debug("setting window size to %dx%d", place.width, place.height);
/* get the size of the client back */
place.width -= self->frame->size.left + self->frame->size.right;
}
ob_debug("placing window 0x%x at %d, %d with size %d x %d. "
- "some restrictions may apply\n",
+ "some restrictions may apply",
self->window, place.x, place.y, place.width, place.height);
if (self->session)
ob_debug(" but session requested %d, %d %d x %d instead, "
- "overriding\n",
+ "overriding",
self->session->x, self->session->y,
self->session->w, self->session->h);
g_free(monitor);
monitor = NULL;
- ob_debug_type(OB_DEBUG_FOCUS, "Going to try activate new window? %s\n",
+ ob_debug_type(OB_DEBUG_FOCUS, "Going to try activate new window? %s",
activate ? "yes" : "no");
if (activate) {
gboolean raise = FALSE;
/* This is focus stealing prevention */
ob_debug_type(OB_DEBUG_FOCUS,
"Want to focus new window 0x%x at time %u "
- "launched at %u (last user interaction time %u)\n",
+ "launched at %u (last user interaction time %u)",
self->window, map_time, launch_time,
event_last_user_time);
ob_debug_type(OB_DEBUG_FOCUS,
"Not focusing the window because the user is inside "
"an Openbox menu or is move/resizing a window and "
- "we don't want to interrupt them\n");
+ "we don't want to interrupt them");
}
/* if it's on another desktop */
raise = TRUE;
ob_debug_type(OB_DEBUG_FOCUS,
"Not focusing the window because its on another "
- "desktop\n");
+ "desktop");
}
/* If something is focused, and it's not our relative... */
else if (focus_client && client_search_focus_tree_full(self) == NULL &&
activate = FALSE;
ob_debug_type(OB_DEBUG_FOCUS,
"Not focusing the window because the user is "
- "working in another window\n");
+ "working in another window");
}
/* If its a transient (and its parents aren't focused) */
else if (client_has_parent(self)) {
activate = FALSE;
ob_debug_type(OB_DEBUG_FOCUS,
"Not focusing the window because it is a "
- "transient, and its relatives aren't focused\n");
+ "transient, and its relatives aren't focused");
}
/* Don't steal focus from globally active clients.
I stole this idea from KWin. It seems nice.
activate = FALSE;
ob_debug_type(OB_DEBUG_FOCUS,
"Not focusing the window because a globally "
- "active client has focus\n");
+ "active client has focus");
}
/* Don't move focus if it's not going to go to this window
anyway */
raise = TRUE;
ob_debug_type(OB_DEBUG_FOCUS,
"Not focusing the window because another window "
- "would get the focus anyway\n");
+ "would get the focus anyway");
}
else if (!(self->desktop == screen_desktop ||
self->desktop == DESKTOP_ALL))
if (!activate) {
ob_debug_type(OB_DEBUG_FOCUS,
"Focus stealing prevention activated for %s at "
- "time %u (last user interactioon time %u)\n",
+ "time %u (last user interactioon time %u)",
self->title, map_time, event_last_user_time);
/* if the client isn't focused, then hilite it so the user
knows it is there */
/* free the ObAppSettings shallow copy */
g_free(settings);
- ob_debug("Managed window 0x%lx plate 0x%x (%s)\n",
+ ob_debug("Managed window 0x%lx plate 0x%x (%s)",
window, self->frame->window, self->class);
return;
ObClient *self;
ObAppSettings *settings;
- ob_debug("Pretend-managing window: %lx\n", window);
+ ob_debug("Pretend-managing window: %lx", window);
/* do this minimal stuff to figure out the client's decorations */
self->frame = frame_new(self);
frame_adjust_area(self->frame, FALSE, TRUE, TRUE);
- ob_debug("gave extents left %d right %d top %d bottom %d\n",
+ ob_debug("gave extents left %d right %d top %d bottom %d",
self->frame->size.left, self->frame->size.right,
self->frame->size.top, self->frame->size.bottom);
GSList *it;
gulong ignore_start;
- ob_debug("Unmanaging window: 0x%x plate 0x%x (%s) (%s)\n",
+ ob_debug("Unmanaging window: 0x%x plate 0x%x (%s) (%s)",
self->window, self->frame->window,
self->class, self->title ? self->title : "");
/* update the list hints */
client_set_list();
- ob_debug("Unmanaged window 0x%lx\n", self->window);
+ ob_debug("Unmanaged window 0x%lx", self->window);
/* free all data allocated in the client struct */
g_slist_free(self->transients);
match = FALSE;
if (match) {
- ob_debug("Window matching: %s\n", app->name);
+ ob_debug("Window matching: %s", app->name);
/* copy the settings to our struct, overriding the existing
settings if they are not defaults */
GList *it;
ob_debug_type(OB_DEBUG_SM,
- "Restore session for client %s\n", self->title);
+ "Restore session for client %s", self->title);
if (!(it = session_state_find(self))) {
ob_debug_type(OB_DEBUG_SM,
- "Session data not found for client %s\n", self->title);
+ "Session data not found for client %s", self->title);
return;
}
self->session = it->data;
- ob_debug_type(OB_DEBUG_SM, "Session data loaded for client %s\n",
+ ob_debug_type(OB_DEBUG_SM, "Session data loaded for client %s",
self->title);
RECT_SET_POINT(self->area, self->session->x, self->session->y);
POINT_SET(self->root_pos, wattrib.x, wattrib.y);
self->border_width = wattrib.border_width;
- ob_debug("client area: %d %d %d %d bw %d\n", wattrib.x, wattrib.y,
+ ob_debug("client area: %d %d %d %d bw %d", wattrib.x, wattrib.y,
wattrib.width, wattrib.height, wattrib.border_width);
}
self->desktop = screen_num_desktops - 1;
else
self->desktop = d;
- ob_debug("client requested desktop 0x%x\n", self->desktop);
+ ob_debug("client requested desktop 0x%x", self->desktop);
} else {
GSList *it;
gboolean first = TRUE;
if (all != screen_num_desktops) {
self->desktop = all;
- ob_debug("client desktop set from parents: 0x%x\n",
+ ob_debug("client desktop set from parents: 0x%x",
self->desktop);
}
/* try get from the startup-notification protocol */
if (self->desktop >= screen_num_desktops &&
self->desktop != DESKTOP_ALL)
self->desktop = screen_num_desktops - 1;
- ob_debug("client desktop set from startup-notification: 0x%x\n",
+ ob_debug("client desktop set from startup-notification: 0x%x",
self->desktop);
}
/* defaults to the current desktop */
else {
self->desktop = screen_desktop;
- ob_debug("client desktop set to the current desktop: %d\n",
+ ob_debug("client desktop set to the current desktop: %d",
self->desktop);
}
}
{
if (colormap == self->colormap) return;
- ob_debug("Setting client %s colormap: 0x%x\n", self->title, colormap);
+ ob_debug("Setting client %s colormap: 0x%x", self->title, colormap);
if (client_focused(self)) {
screen_install_colormap(self, FALSE); /* uninstall old one */
if (size.flags & PResizeInc && size.width_inc && size.height_inc)
SIZE_SET(self->size_inc, size.width_inc, size.height_inc);
- ob_debug("Normal hints: min size (%d %d) max size (%d %d)\n "
- "size inc (%d %d) base size (%d %d)\n",
+ ob_debug("Normal hints: min size (%d %d) max size (%d %d)",
self->min_size.width, self->min_size.height,
- self->max_size.width, self->max_size.height,
+ self->max_size.width, self->max_size.height);
+ ob_debug("size inc (%d %d) base size (%d %d)",
self->size_inc.width, self->size_inc.height,
self->base_size.width, self->base_size.height);
}
else
- ob_debug("Normal hints: not set\n");
+ ob_debug("Normal hints: not set");
}
void client_setup_decor_and_functions(ObClient *self, gboolean reconfig)
pre-max/pre-fullscreen values
*/
client_try_configure(self, &x, &y, &w, &h, &l, &l, FALSE);
- ob_debug("placed window 0x%x at %d, %d with size %d x %d\n",
+ ob_debug("placed window 0x%x at %d, %d with size %d x %d",
self->window, x, y, w, h);
/* save the area, and make it where it should be for the premax stuff */
oldarea = self->area;
event.xconfigure.event = self->window;
event.xconfigure.window = self->window;
- ob_debug("Sending ConfigureNotify to %s for %d,%d %dx%d\n",
+ ob_debug("Sending ConfigureNotify to %s for %d,%d %dx%d",
self->title, self->root_pos.x, self->root_pos.y, w, h);
/* root window real coords */
RECT_SET(self->pre_fullscreen_area, 0, 0, 0, 0);
}
- ob_debug("Window %s going fullscreen (%d)\n",
+ ob_debug("Window %s going fullscreen (%d)",
self->title, self->fullscreen);
client_setup_decor_and_functions(self, FALSE);
if (self->iconic != iconic) {
- ob_debug("%sconifying window: 0x%lx\n", (iconic ? "I" : "Uni"),
+ ob_debug("%sconifying window: 0x%lx", (iconic ? "I" : "Uni"),
self->window);
if (iconic) {
if (!self->client_machine && self->pid) {
/* running on the local host */
if (!self->close_tried_term) {
- ob_debug("killing window 0x%x with pid %lu, with SIGTERM\n",
+ ob_debug("killing window 0x%x with pid %lu, with SIGTERM",
self->window, self->pid);
kill(self->pid, SIGTERM);
self->close_tried_term = TRUE;
client_update_title(self);
}
else {
- ob_debug("killing window 0x%x with pid %lu, with SIGKILL\n",
+ ob_debug("killing window 0x%x with pid %lu, with SIGKILL",
self->window, self->pid);
kill(self->pid, SIGKILL); /* kill -9 */
}
if (target != self->desktop && self->type != OB_CLIENT_TYPE_DESKTOP) {
- ob_debug("Setting desktop %u\n", target+1);
+ ob_debug("Setting desktop %u", target+1);
g_assert(target < screen_num_desktops || target == DESKTOP_ALL);
if (!client_can_focus(self)) {
ob_debug_type(OB_DEBUG_FOCUS,
- "Client %s can't be focused\n", self->title);
+ "Client %s can't be focused", self->title);
return FALSE;
}
ob_debug_type(OB_DEBUG_FOCUS,
- "Focusing client \"%s\" (0x%x) at time %u\n",
+ "Focusing client \"%s\" (0x%x) at time %u",
self->title, self->window, event_curtime);
/* if using focus_delay, stop the timer now so that focus doesn't
obt_display_ignore_errors(FALSE);
- ob_debug_type(OB_DEBUG_FOCUS, "Error focusing? %d\n",
+ ob_debug_type(OB_DEBUG_FOCUS, "Error focusing? %d",
obt_display_error_occured);
return !obt_display_error_occured;
}
g_assert_not_reached();
}
- ob_debug("my head %d size %d\n", my_head, my_size);
- ob_debug("head %d tail %d deest %d\n", head, tail, *dest);
+ ob_debug("my head %d size %d", my_head, my_size);
+ ob_debug("head %d tail %d deest %d", head, tail, *dest);
if (!skip_head) {
- ob_debug("using near edge %d\n", head);
+ ob_debug("using near edge %d", head);
*dest = head;
*near_edge = TRUE;
}
else if (!skip_tail) {
- ob_debug("using far edge %d\n", tail);
+ ob_debug("using far edge %d", tail);
*dest = tail;
*near_edge = FALSE;
}
cur->desktop != screen_desktop)
continue;
- ob_debug("trying window %s\n", cur->title);
+ ob_debug("trying window %s", cur->title);
detect_edge(cur->frame->area, dir, my_head, my_size, my_edge_start,
my_edge_size, dest, near_edge);
g_assert_not_reached();
}
- ob_debug("head %d dir %d\n", head, dir);
+ ob_debug("head %d dir %d", head, dir);
client_find_edge_directional(self, dir, head, 1,
e_start, e_size, &e, &near);
- ob_debug("edge %d\n", e);
+ ob_debug("edge %d", e);
*x = self->frame->area.x;
*y = self->frame->area.y;
*w = self->frame->area.width;
*/
#include "debug.h"
+#include "gettext.h"
+#include "obt/paths.h"
#include <glib.h>
#include <stdlib.h>
#include <stdarg.h>
#include <stdio.h>
+#include <errno.h>
-static gboolean show;
+static gboolean enabled_types[OB_DEBUG_TYPE_NUM] = {FALSE};
+static FILE *log_file = NULL;
+static guint rr_handler_id = 0;
+static guint obt_handler_id = 0;
+static guint ob_handler_id = 0;
-void ob_debug_show_output(gboolean enable)
+static void log_handler(const gchar *log_domain, GLogLevelFlags log_level,
+ const gchar *message, gpointer user_data);
+
+void ob_debug_startup(void)
{
- show = enable;
+ ObtPaths *p = obt_paths_new();
+ gchar *dir = g_build_filename(obt_paths_cache_home(p),
+ "openbox", NULL);
+
+ /* log messages to a log file! fancy, no? */
+ if (!obt_paths_mkdir_path(dir, 0777))
+ g_message(_("Unable to make directory '%s': %s"),
+ dir, g_strerror(errno));
+ else {
+ gchar *name = g_build_filename(obt_paths_cache_home(p),
+ "openbox", "openbox.log", NULL);
+ log_file = fopen(name, "w");
+ g_free(name);
+ }
+
+ rr_handler_id =
+ g_log_set_handler("ObRender", G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL |
+ G_LOG_FLAG_RECURSION, log_handler, NULL);
+ obt_handler_id =
+ g_log_set_handler("Obt", G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL |
+ G_LOG_FLAG_RECURSION, log_handler, NULL);
+ ob_handler_id =
+ g_log_set_handler("Openbox", G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL |
+ G_LOG_FLAG_RECURSION, log_handler, NULL);
+
+ g_free(dir);
}
-void ob_debug(const gchar *a, ...)
+void ob_debug_shutdown(void)
{
- va_list vl;
+ g_log_remove_handler("ObRender", rr_handler_id);
+ g_log_remove_handler("Obt", obt_handler_id);
+ g_log_remove_handler("Openbox", ob_handler_id);
- if (show) {
- fprintf(stderr, "DEBUG: ");
- va_start(vl, a);
- vfprintf(stderr, a, vl);
- va_end(vl);
+ if (log_file) {
+ fclose(log_file);
+ log_file = NULL;
}
}
-static gboolean enabled_types[OB_DEBUG_TYPE_NUM] = {FALSE};
-
void ob_debug_enable(ObDebugType type, gboolean enable)
{
g_assert(type < OB_DEBUG_TYPE_NUM);
enabled_types[type] = enable;
}
-void ob_debug_type(ObDebugType type, const gchar *a, ...)
+static inline void log_print(FILE *out, const gchar* log_domain,
+ const gchar *level, const gchar *message)
{
- va_list vl;
+ fprintf(out, log_domain);
+ fprintf(out, "-");
+ fprintf(out, level);
+ fprintf(out, ": ");
+ fprintf(out, message);
+ fprintf(out, "\n");
+ fflush(out);
+}
+
+static void log_handler(const gchar *log_domain, GLogLevelFlags log_level,
+ const gchar *message, gpointer data)
+{
+ FILE *out;
+ const gchar *level;
+
+ switch (log_level & G_LOG_LEVEL_MASK) {
+ case G_LOG_LEVEL_DEBUG: level = "Debug"; out = stdout; break;
+ case G_LOG_LEVEL_INFO: level = "Info"; out = stdout; break;
+ case G_LOG_LEVEL_MESSAGE: level = "Message"; out = stdout; break;
+ case G_LOG_LEVEL_WARNING: level = "Warning"; out = stderr; break;
+ case G_LOG_LEVEL_CRITICAL: level = "Critical"; out = stderr; break;
+ case G_LOG_LEVEL_ERROR: level = "Error"; out = stderr; break;
+ default: g_assert_not_reached(); /* invalid level.. */
+ }
+
+ log_print(out, log_domain, level, message);
+ if (log_file) log_print(log_file, log_domain, level, message);
+}
+
+static inline void log_argv(ObDebugType type,
+ const gchar *format, va_list args)
+{
+ const gchar *prefix;
+ gchar *message;
g_assert(type < OB_DEBUG_TYPE_NUM);
+ if (!enabled_types[type]) return;
- if (show && enabled_types[type]) {
- switch (type) {
- case OB_DEBUG_FOCUS:
- fprintf(stderr, "FOCUS: ");
- break;
- case OB_DEBUG_APP_BUGS:
- fprintf(stderr, "APPLICATION BUG: ");
- break;
- case OB_DEBUG_SM:
- fprintf(stderr, "SESSION: ");
- break;
- default:
- g_assert_not_reached();
- }
-
- va_start(vl, a);
- vfprintf(stderr, a, vl);
- va_end(vl);
+ switch (type) {
+ case OB_DEBUG_FOCUS: prefix = "(FOCUS) "; break;
+ case OB_DEBUG_APP_BUGS: prefix = "(APPLICATION BUG) "; break;
+ case OB_DEBUG_SM: prefix = "(SESSION) "; break;
+ default: prefix = NULL; break;
}
+
+ message = g_strdup_vprintf(format, args);
+ if (prefix) {
+ gchar *a = message;
+ message = g_strconcat(prefix, message, NULL);
+ g_free(a);
+ }
+
+ g_debug(message);
+ g_free(message);
+}
+
+void ob_debug(const gchar *a, ...)
+{
+ va_list vl;
+
+ va_start(vl, a);
+ log_argv(OB_DEBUG_NORMAL, a, vl);
+ va_end(vl);
+}
+
+void ob_debug_type(ObDebugType type, const gchar *a, ...)
+{
+ va_list vl;
+
+ va_start(vl, a);
+ log_argv(type, a, vl);
+ va_end(vl);
}
#include <glib.h>
-void ob_debug_show_output(gboolean enable);
+void ob_debug_startup();
+void ob_debug_shutdown();
void ob_debug(const gchar *a, ...);
typedef enum {
+ OB_DEBUG_NORMAL,
OB_DEBUG_FOCUS,
OB_DEBUG_APP_BUGS,
OB_DEBUG_SM,
dock_app_grab_button(app, TRUE);
- ob_debug("Managed Dock App: 0x%lx (%s)\n", app->icon_win, app->class);
+ ob_debug("Managed Dock App: 0x%lx (%s)", app->icon_win, app->class);
}
void dock_remove_all(void)
dock->dock_apps = g_list_remove(dock->dock_apps, app);
dock_configure();
- ob_debug("Unmanaged Dock App: 0x%lx (%s)\n", app->icon_win, app->class);
+ ob_debug("Unmanaged Dock App: 0x%lx (%s)", app->icon_win, app->class);
g_free(app->name);
g_free(app->class);
g_assert(modestr);
g_assert(detailstr);
- ob_debug_type(OB_DEBUG_FOCUS, "Focus%s 0x%x mode=%s detail=%s\n",
+ ob_debug_type(OB_DEBUG_FOCUS, "Focus%s 0x%x mode=%s detail=%s",
(e->xfocus.type == FocusIn ? "In" : "Out"),
win,
modestr, detailstr);
XEvent ce;
ob_debug_type(OB_DEBUG_FOCUS,
- "Focus went to root or pointer root/none\n");
+ "Focus went to root or pointer root/none");
if (e->xfocus.detail == NotifyInferior ||
e->xfocus.detail == NotifyNonlinear)
{
XPutBackEvent(obt_display, &ce);
ob_debug_type(OB_DEBUG_FOCUS,
- " but another FocusIn is coming\n");
+ " but another FocusIn is coming");
} else {
/* Focus has been reverted.
else if (!client)
{
ob_debug_type(OB_DEBUG_FOCUS,
- "Focus went to a window that is already gone\n");
+ "Focus went to a window that is already gone");
/* If you send focus to a window and then it disappears, you can
get the FocusIn for it, after it is unmanaged.
root != obt_root(ob_screen))
{
ob_debug_type(OB_DEBUG_FOCUS,
- "Focus went to another screen !\n");
+ "Focus went to another screen !");
focus_left_screen = TRUE;
}
else
ob_debug_type(OB_DEBUG_FOCUS,
- "Focus went to a black hole !\n");
+ "Focus went to a black hole !");
obt_display_ignore_errors(FALSE);
/* nothing is focused */
focus_set_client(NULL);
/* The FocusIn was ignored, this means it was on a window
that isn't a client. */
ob_debug_type(OB_DEBUG_FOCUS,
- "Focus went to an unmanaged window 0x%x !\n",
+ "Focus went to an unmanaged window 0x%x !",
ce.xfocus.window);
focus_fallback(TRUE, config_focus_under_mouse, TRUE, TRUE);
}
else if (e->type == MappingNotify) {
/* keyboard layout changes for modifier mapping changes. reload the
modifier map, and rebind all the key bindings as appropriate */
- ob_debug("Kepboard map changed. Reloading keyboard bindings.\n");
+ ob_debug("Kepboard map changed. Reloading keyboard bindings.");
obt_keyboard_reload();
keyboard_rebind();
}
switch(e->type) {
case SelectionClear:
- ob_debug("Another WM has requested to replace us. Exiting.\n");
+ ob_debug("Another WM has requested to replace us. Exiting.");
ob_exit_replace();
break;
if (event_curtime == 0)
ob_debug_type(OB_DEBUG_APP_BUGS,
"_NET_CURRENT_DESKTOP message is missing "
- "a timestamp\n");
+ "a timestamp");
screen_set_desktop(d, TRUE);
}
} else if (msgtype == OBT_PROP_ATOM(NET_NUMBER_OF_DESKTOPS)) {
} else if (msgtype == OBT_PROP_ATOM(NET_SHOWING_DESKTOP)) {
screen_show_desktop(e->xclient.data.l[0] != 0, NULL);
} else if (msgtype == OBT_PROP_ATOM(OB_CONTROL)) {
- ob_debug("OB_CONTROL: %d\n", e->xclient.data.l[0]);
+ ob_debug("OB_CONTROL: %d", e->xclient.data.l[0]);
if (e->xclient.data.l[0] == 1)
ob_reconfigure();
else if (e->xclient.data.l[0] == 2)
break;
case PropertyNotify:
if (e->xproperty.atom == OBT_PROP_ATOM(NET_DESKTOP_NAMES)) {
- ob_debug("UPDATE DESKTOP NAMES\n");
+ ob_debug("UPDATE DESKTOP NAMES");
screen_update_desktop_names();
}
else if (e->xproperty.atom == OBT_PROP_ATOM(NET_DESKTOP_LAYOUT))
event_end_ignore_all_enters(event_start_ignore_all_enters());
ob_debug_type(OB_DEBUG_FOCUS,
- "%sNotify mode %d detail %d on %lx\n",
+ "%sNotify mode %d detail %d on %lx",
(e->type == EnterNotify ? "Enter" : "Leave"),
e->xcrossing.mode,
e->xcrossing.detail, (client?client->window:0));
{
ob_debug_type(OB_DEBUG_FOCUS,
"%sNotify mode %d detail %d serial %lu on %lx "
- "IGNORED\n",
+ "IGNORED",
(e->type == EnterNotify ? "Enter" : "Leave"),
e->xcrossing.mode,
e->xcrossing.detail,
else {
ob_debug_type(OB_DEBUG_FOCUS,
"%sNotify mode %d detail %d serial %lu on %lx, "
- "focusing window\n",
+ "focusing window",
(e->type == EnterNotify ? "Enter" : "Leave"),
e->xcrossing.mode,
e->xcrossing.detail,
RECT_TO_DIMS(client->area, x, y, w, h);
ob_debug("ConfigureRequest for \"%s\" desktop %d wmstate %d "
- "visibile %d\n"
- " x %d y %d w %d h %d b %d\n",
+ "visibile %d",
client->title,
- screen_desktop, client->wmstate, client->frame->visible,
+ screen_desktop, client->wmstate, client->frame->visible);
+ ob_debug(" x %d y %d w %d h %d b %d",
x, y, w, h, client->border_width);
if (e->xconfigurerequest.value_mask & CWBorderWidth)
}
ob_debug("ConfigureRequest x(%d) %d y(%d) %d w(%d) %d h(%d) %d "
- "move %d resize %d\n",
+ "move %d resize %d",
e->xconfigurerequest.value_mask & CWX, x,
e->xconfigurerequest.value_mask & CWY, y,
e->xconfigurerequest.value_mask & CWWidth, w,
ob_debug_type(OB_DEBUG_APP_BUGS,
"Application %s is trying to move via "
"ConfigureRequest to it's root window position "
- "but it is not using StaticGravity\n",
+ "but it is not using StaticGravity",
client->title);
/* don't move it */
x = client->area.x;
client_find_onscreen(client, &x, &y, w, h, FALSE);
- ob_debug("Granting ConfigureRequest x %d y %d w %d h %d\n",
+ ob_debug("Granting ConfigureRequest x %d y %d w %d h %d",
x, y, w, h);
client_configure(client, x, y, w, h, FALSE, TRUE, TRUE);
}
}
case UnmapNotify:
ob_debug("UnmapNotify for window 0x%x eventwin 0x%x sendevent %d "
- "ignores left %d\n",
+ "ignores left %d",
client->window, e->xunmap.event, e->xunmap.from_configure,
client->ignore_unmaps);
if (client->ignore_unmaps) {
client_unmanage(client);
break;
case DestroyNotify:
- ob_debug("DestroyNotify for window 0x%x\n", client->window);
+ ob_debug("DestroyNotify for window 0x%x", client->window);
client_unmanage(client);
break;
case ReparentNotify:
X server to deal with after we unmanage the window */
XPutBackEvent(obt_display, e);
- ob_debug("ReparentNotify for window 0x%x\n", client->window);
+ ob_debug("ReparentNotify for window 0x%x", client->window);
client_unmanage(client);
break;
case MapRequest:
- ob_debug("MapRequest for 0x%lx\n", client->window);
+ ob_debug("MapRequest for 0x%lx", client->window);
if (!client->iconic) break; /* this normally doesn't happen, but if it
does, we don't want it!
it can happen now when the window is on
gulong ignore_start;
/* can't compress these */
- ob_debug("net_wm_state %s %ld %ld for 0x%lx\n",
+ ob_debug("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"),
if (!config_focus_under_mouse)
event_end_ignore_all_enters(ignore_start);
} else if (msgtype == OBT_PROP_ATOM(NET_CLOSE_WINDOW)) {
- ob_debug("net_close_window for 0x%lx\n", client->window);
+ ob_debug("net_close_window for 0x%lx", client->window);
client_close(client);
} else if (msgtype == OBT_PROP_ATOM(NET_ACTIVE_WINDOW)) {
- ob_debug("net_active_window for 0x%lx source=%s\n",
+ ob_debug("net_active_window for 0x%lx source=%s",
client->window,
(e->xclient.data.l[0] == 0 ? "unknown" :
(e->xclient.data.l[0] == 1 ? "application" :
if (e->xclient.data.l[1] == 0)
ob_debug_type(OB_DEBUG_APP_BUGS,
"_NET_ACTIVE_WINDOW message for window %s is"
- " missing a timestamp\n", client->title);
+ " missing a timestamp", client->title);
} else
ob_debug_type(OB_DEBUG_APP_BUGS,
"_NET_ACTIVE_WINDOW message for window %s is "
- "missing source indication\n");
+ "missing source indication");
client_activate(client, FALSE, TRUE, TRUE,
(e->xclient.data.l[0] == 0 ||
e->xclient.data.l[0] == 2));
} else if (msgtype == OBT_PROP_ATOM(NET_WM_MOVERESIZE)) {
- ob_debug("net_wm_moveresize for 0x%lx direction %d\n",
+ ob_debug("net_wm_moveresize for 0x%lx direction %d",
client->window, e->xclient.data.l[2]);
if ((Atom)e->xclient.data.l[2] ==
OBT_PROP_ATOM(NET_WM_MOVERESIZE_SIZE_TOPLEFT) ||
else
h = client->area.height;
- ob_debug("MOVERESIZE x %d %d y %d %d (gravity %d)\n",
+ ob_debug("MOVERESIZE x %d %d y %d %d (gravity %d)",
e->xclient.data.l[0] & 1 << 8, x,
e->xclient.data.l[0] & 1 << 9, y,
client->gravity);
if (e->xclient.data.l[0] != 2) {
ob_debug_type(OB_DEBUG_APP_BUGS,
"_NET_RESTACK_WINDOW sent for window %s with "
- "invalid source indication %ld\n",
+ "invalid source indication %ld",
client->title, e->xclient.data.l[0]);
} else {
ObClient *sibling = NULL;
if (sibling == NULL)
ob_debug_type(OB_DEBUG_APP_BUGS,
"_NET_RESTACK_WINDOW sent for window %s "
- "with invalid sibling 0x%x\n",
+ "with invalid sibling 0x%x",
client->title, e->xclient.data.l[1]);
}
if (e->xclient.data.l[2] == Below ||
} else
ob_debug_type(OB_DEBUG_APP_BUGS,
"_NET_RESTACK_WINDOW sent for window %s "
- "with invalid detail %d\n",
+ "with invalid detail %d",
client->title, e->xclient.data.l[2]);
}
}
msgtype = e->xproperty.atom;
if (msgtype == XA_WM_NORMAL_HINTS) {
- ob_debug("Update NORMAL hints\n");
+ ob_debug("Update NORMAL hints");
client_update_normal_hints(client);
/* normal hints can make a window non-resizable */
client_setup_decor_and_functions(client, FALSE);
r->end = end;
ignore_serials = g_slist_prepend(ignore_serials, r);
- ob_debug_type(OB_DEBUG_FOCUS, "ignoring enters from %lu until %lu\n",
+ ob_debug_type(OB_DEBUG_FOCUS, "ignoring enters from %lu until %lu",
r->start, r->end);
/* increment the serial so we don't ignore events we weren't meant to */
{
if (actions_interactive_act_running()) {
actions_interactive_cancel_act();
- ob_debug("KILLED interactive action\n");
+ ob_debug("KILLED interactive action");
}
else if (menu_frame_visible) {
menu_frame_hide_all();
- ob_debug("KILLED open menus\n");
+ ob_debug("KILLED open menus");
}
else if (moveresize_in_progress) {
moveresize_end(TRUE);
- ob_debug("KILLED interactive moveresize\n");
+ ob_debug("KILLED interactive moveresize");
}
else if (grab_on_keyboard()) {
ungrab_keyboard();
- ob_debug("KILLED active grab on keyboard\n");
+ ob_debug("KILLED active grab on keyboard");
}
else
ungrab_passive_key();
Window active;
ob_debug_type(OB_DEBUG_FOCUS,
- "focus_set_client 0x%lx\n", client ? client->window : 0);
+ "focus_set_client 0x%lx", client ? client->window : 0);
if (focus_client == client)
return;
GList *it;
ObClient *c;
- ob_debug_type(OB_DEBUG_FOCUS, "trying pointer stuff\n");
+ ob_debug_type(OB_DEBUG_FOCUS, "trying pointer stuff");
if (allow_pointer && config_focus_follow)
if ((c = client_under_pointer()) &&
(allow_refocus || client_focus_target(c) != old) &&
(client_normal(c) &&
client_focus(c)))
{
- ob_debug_type(OB_DEBUG_FOCUS, "found in pointer stuff\n");
+ ob_debug_type(OB_DEBUG_FOCUS, "found in pointer stuff");
return c;
}
- ob_debug_type(OB_DEBUG_FOCUS, "trying the focus order\n");
+ ob_debug_type(OB_DEBUG_FOCUS, "trying the focus order");
for (it = focus_order; it; it = g_list_next(it)) {
c = it->data;
/* fallback focus to a window if:
(allow_refocus || client_focus_target(c) != old) &&
client_focus(c))
{
- ob_debug_type(OB_DEBUG_FOCUS, "found in focus order\n");
+ ob_debug_type(OB_DEBUG_FOCUS, "found in focus order");
return c;
}
}
- ob_debug_type(OB_DEBUG_FOCUS, "trying a desktop window\n");
+ ob_debug_type(OB_DEBUG_FOCUS, "trying a desktop window");
for (it = focus_order; it; it = g_list_next(it)) {
c = it->data;
/* fallback focus to a window if:
(allow_refocus || client_focus_target(c) != old) &&
client_focus(c))
{
- ob_debug_type(OB_DEBUG_FOCUS, "found a desktop window\n");
+ ob_debug_type(OB_DEBUG_FOCUS, "found a desktop window");
return c;
}
}
state = OB_STATE_STARTING;
+ ob_debug_startup();
+
/* initialize the locale */
if (!setlocale(LC_ALL, ""))
g_message("Couldn't set locale from environment.");
bind_textdomain_codeset(PACKAGE_NAME, "UTF-8");
textdomain(PACKAGE_NAME);
- if (chdir(g_get_home_dir()) == -1)
- g_message(_("Unable to change to home directory '%s': %s"),
- g_get_home_dir(), g_strerror(errno));
-
/* parse the command line args, which can change the argv[0] */
parse_args(&argc, argv);
/* parse the environment variables */
g_free(ob_sm_id);
g_free(program_name);
+ ob_debug_shutdown();
+
return exitcode;
}
{
switch (signal) {
case SIGUSR1:
- ob_debug("Caught signal %d. Restarting.\n", signal);
+ ob_debug("Caught signal %d. Restarting.", signal);
ob_restart();
break;
case SIGUSR2:
- ob_debug("Caught signal %d. Reconfiguring.\n", signal);
+ ob_debug("Caught signal %d. Reconfiguring.", signal);
ob_reconfigure();
break;
case SIGCHLD:
while (waitpid(-1, NULL, WNOHANG) > 0);
break;
default:
- ob_debug("Caught signal %d. Exiting.\n", signal);
+ ob_debug("Caught signal %d. Exiting.", signal);
/* TERM and INT return a 0 code */
ob_exit(!(signal == SIGTERM || signal == SIGINT));
}
g_print(_(" --sync Run in synchronous mode\n"));
g_print(_(" --debug Display debugging output\n"));
g_print(_(" --debug-focus Display debugging output for focus handling\n"));
+ g_print(_(" --debug-session Display debugging output for session managment\n"));
g_print(_(" --debug-xinerama Split the display into fake xinerama screens\n"));
g_print(_("\nPlease report bugs at %s\n"), PACKAGE_BUGREPORT);
}
xsync = TRUE;
}
else if (!strcmp(argv[i], "--debug")) {
- ob_debug_show_output(TRUE);
- ob_debug_enable(OB_DEBUG_SM, TRUE);
+ ob_debug_enable(OB_DEBUG_NORMAL, TRUE);
ob_debug_enable(OB_DEBUG_APP_BUGS, TRUE);
}
else if (!strcmp(argv[i], "--debug-focus")) {
- ob_debug_show_output(TRUE);
- ob_debug_enable(OB_DEBUG_SM, TRUE);
+ ob_debug_enable(OB_DEBUG_NORMAL, TRUE);
ob_debug_enable(OB_DEBUG_APP_BUGS, TRUE);
ob_debug_enable(OB_DEBUG_FOCUS, TRUE);
}
+ else if (!strcmp(argv[i], "--debug-session")) {
+ ob_debug_enable(OB_DEBUG_NORMAL, TRUE);
+ ob_debug_enable(OB_DEBUG_APP_BUGS, TRUE);
+ ob_debug_enable(OB_DEBUG_SM, TRUE);
+ }
else if (!strcmp(argv[i], "--debug-xinerama")) {
ob_debug_xinerama = TRUE;
}
ob_sm_save_file = g_strdup(argv[i+1]);
remove_args(argc, argv, i, 2);
--i; /* this arg was removed so go back */
- ob_debug_type(OB_DEBUG_SM, "--sm-save-file %s\n",
+ ob_debug_type(OB_DEBUG_SM, "--sm-save-file %s",
ob_sm_save_file);
}
}
ob_sm_id = g_strdup(argv[i+1]);
remove_args(argc, argv, i, 2);
--i; /* this arg was removed so go back */
- ob_debug_type(OB_DEBUG_SM, "--sm-client-id %s\n", ob_sm_id);
+ ob_debug_type(OB_DEBUG_SM, "--sm-client-id %s", ob_sm_id);
}
}
else if (!strcmp(argv[i], "--sm-disable")) {
ObPingTarget *t;
if ((t = g_hash_table_lookup(ping_ids, &id))) {
- /*ob_debug("-PONG: '%s' (id %u)\n", t->client->title, t->id);*/
+ /*ob_debug("-PONG: '%s' (id %u)", t->client->title, t->id);*/
if (t->waiting > PING_TIMEOUT_WARN) {
/* we had notified that they weren't responding, so now we
need to notify that they are again */
t->waiting = 0; /* not waiting for a reply anymore */
}
else
- ob_debug("Got PONG with id %u but not waiting for one\n", id);
+ ob_debug("Got PONG with id %u but not waiting for one", id);
}
static gboolean find_client(gpointer key, gpointer value, gpointer client)
g_hash_table_insert(ping_ids, &t->id, t);
}
- /*ob_debug("+PING: '%s' (id %u)\n", t->client->title, t->id);*/
+ /*ob_debug("+PING: '%s' (id %u)", t->client->title, t->id);*/
OBT_PROP_MSG_TO(t->client->window, t->client->window, WM_PROTOCOLS,
OBT_PROP_ATOM(NET_WM_PING), t->id, t->client->window, 0, 0,
NoEventMask);
/* try direct parent first */
if ((p = client_direct_parent(c))) {
add_choice(choice, client_monitor(p));
- ob_debug("placement adding choice %d for parent\n",
+ ob_debug("placement adding choice %d for parent",
client_monitor(p));
}
itc->desktop == DESKTOP_ALL || c->desktop == DESKTOP_ALL))
{
add_choice(choice, client_monitor(it->data));
- ob_debug("placement adding choice %d for group sibling\n",
+ ob_debug("placement adding choice %d for group sibling",
client_monitor(it->data));
}
}
if (itc != c) {
add_choice(choice, client_monitor(it->data));
ob_debug("placement adding choice %d for group sibling on "
- "another desktop\n", client_monitor(it->data));
+ "another desktop", client_monitor(it->data));
}
}
}
config_place_monitor != OB_PLACE_MONITOR_MOUSE)
{
add_choice(choice, client_monitor(focus_client));
- ob_debug("placement adding choice %d for normal focused window\n",
+ ob_debug("placement adding choice %d for normal focused window",
client_monitor(focus_client));
}
g_free(monitor);
if (contain) {
add_choice(choice, i);
- ob_debug("placement adding choice %d for mouse pointer\n", i);
+ ob_debug("placement adding choice %d for mouse pointer", i);
break;
}
}
obt_main_loop_timeout_add(ob_main_loop, REMEMBER_LAST_DESKTOP_TIME,
last_desktop_func, NULL, NULL, NULL);
- ob_debug("Moving to desktop %d\n", num+1);
+ ob_debug("Moving to desktop %d", num+1);
/* ignore enter events caused by the move */
ignore_start = event_start_ignore_all_enters();
parent - which will have to be on the same desktop */
!client_direct_parent(c))
{
- ob_debug("moving window %s\n", c->title);
+ ob_debug("moving window %s", c->title);
client_set_desktop(c, c->desktop+1, FALSE, TRUE);
}
}
parent - which will have to be on the same desktop */
!client_direct_parent(c))
{
- ob_debug("moving window %s\n", c->title);
+ ob_debug("moving window %s", c->title);
client_set_desktop(c, c->desktop - 1, TRUE, TRUE);
}
/* raise all the windows that are on the current desktop which
(d == DESKTOP_ALL || d == screen_desktop))
{
stacking_raise(CLIENT_AS_WINDOW(c));
- ob_debug("raising window %s\n", c->title);
+ ob_debug("raising window %s", c->title);
}
}
}
/* fallback focus like we're changing desktops */
if (screen_desktop < screen_num_desktops - 1) {
screen_fallback_focus();
- ob_debug("fake desktop change\n");
+ ob_debug("fake desktop change");
}
screen_set_num_desktops(screen_num_desktops-1);
if (ob_sm_save_file != NULL) {
if (ob_sm_restore) {
- ob_debug_type(OB_DEBUG_SM, "Loading from session file %s\n",
+ ob_debug_type(OB_DEBUG_SM, "Loading from session file %s",
ob_sm_save_file);
session_load_file(ob_sm_save_file);
}
/* connect to the server */
oldid = ob_sm_id;
- ob_debug_type(OB_DEBUG_SM, "Connecting to SM with id: %s\n",
+ ob_debug_type(OB_DEBUG_SM, "Connecting to SM with id: %s",
oldid ? oldid : "(null)");
sm_conn = SmcOpenConnection(NULL, NULL, 1, 0,
SmcSaveYourselfProcMask |
&cb, oldid, &ob_sm_id,
SM_ERR_LEN-1, sm_err);
g_free(oldid);
- ob_debug_type(OB_DEBUG_SM, "Connected to SM with id: %s\n", ob_sm_id);
+ ob_debug_type(OB_DEBUG_SM, "Connected to SM with id: %s", ob_sm_id);
if (sm_conn == NULL)
- ob_debug("Failed to connect to session manager: %s\n", sm_err);
+ ob_debug("Failed to connect to session manager: %s", sm_err);
return sm_conn != NULL;
}
.vals = &vals
};
SmProp *list = ∝
- ob_debug_type(OB_DEBUG_SM, "Setting program: %s\n", sm_argv[0]);
+ ob_debug_type(OB_DEBUG_SM, "Setting program: %s", sm_argv[0]);
SmcSetProperties(sm_conn, 1, &list);
g_free(prop.name);
g_free(prop.type);
.vals = &vals
};
SmProp *list = ∝
- ob_debug_type(OB_DEBUG_SM, "Setting user: %s\n", user);
+ ob_debug_type(OB_DEBUG_SM, "Setting user: %s", user);
SmcSetProperties(sm_conn, 1, &list);
g_free(prop.name);
g_free(prop.type);
.vals = &vals
};
SmProp *list = ∝
- ob_debug_type(OB_DEBUG_SM, "Setting restart: %d\n", restart);
+ ob_debug_type(OB_DEBUG_SM, "Setting restart: %d", restart);
SmcSetProperties(sm_conn, 1, &list);
g_free(prop.name);
g_free(prop.type);
.vals = &vals
};
SmProp *list = ∝
- ob_debug_type(OB_DEBUG_SM, "Setting pid: %s\n", pid);
+ ob_debug_type(OB_DEBUG_SM, "Setting pid: %s", pid);
SmcSetProperties(sm_conn, 1, &list);
g_free(prop.name);
g_free(prop.type);
.vals = &vals
};
SmProp *list = ∝
- ob_debug_type(OB_DEBUG_SM, "Setting priority: %d\n", priority);
+ ob_debug_type(OB_DEBUG_SM, "Setting priority: %d", priority);
SmcSetProperties(sm_conn, 1, &list);
g_free(prop.name);
g_free(prop.type);
};
SmProp *list = ∝
- ob_debug_type(OB_DEBUG_SM, "Setting clone command: (%d)\n", sm_argc);
+ ob_debug_type(OB_DEBUG_SM, "Setting clone command: (%d)", sm_argc);
for (i = 0; i < sm_argc; ++i) {
vals[i].value = sm_argv[i];
vals[i].length = strlen(sm_argv[i]) + 1;
- ob_debug_type(OB_DEBUG_SM, " %s\n", vals[i].value);
+ ob_debug_type(OB_DEBUG_SM, " %s", vals[i].value);
}
SmcSetProperties(sm_conn, 1, &list);
};
SmProp *list = ∝
- ob_debug_type(OB_DEBUG_SM, "Setting restart command: (%d)\n", sm_argc+4);
+ ob_debug_type(OB_DEBUG_SM, "Setting restart command: (%d)", sm_argc+4);
for (i = 0; i < sm_argc; ++i) {
vals[i].value = sm_argv[i];
vals[i].length = strlen(sm_argv[i]) + 1;
- ob_debug_type(OB_DEBUG_SM, " %s\n", vals[i].value);
+ ob_debug_type(OB_DEBUG_SM, " %s", vals[i].value);
}
vals[i].value = g_strdup("--sm-client-id");
vals[i].length = strlen("--sm-client-id") + 1;
vals[i+1].value = ob_sm_id;
vals[i+1].length = strlen(ob_sm_id) + 1;
- ob_debug_type(OB_DEBUG_SM, " %s\n", vals[i].value);
- ob_debug_type(OB_DEBUG_SM, " %s\n", vals[i+1].value);
+ ob_debug_type(OB_DEBUG_SM, " %s", vals[i].value);
+ ob_debug_type(OB_DEBUG_SM, " %s", vals[i+1].value);
vals[i+2].value = g_strdup("--sm-save-file");
vals[i+2].length = strlen("--sm-save-file") + 1;
vals[i+3].value = ob_sm_save_file;
vals[i+3].length = strlen(ob_sm_save_file) + 1;
- ob_debug_type(OB_DEBUG_SM, " %s\n", vals[i+2].value);
- ob_debug_type(OB_DEBUG_SM, " %s\n", vals[i+3].value);
+ ob_debug_type(OB_DEBUG_SM, " %s", vals[i+2].value);
+ ob_debug_type(OB_DEBUG_SM, " %s", vals[i+3].value);
SmcSetProperties(sm_conn, 1, &list);
g_free(prop.name);
ObSMSaveData *savedata = data;
/* save the current state */
- ob_debug_type(OB_DEBUG_SM, "Session save phase 2 requested\n");
+ ob_debug_type(OB_DEBUG_SM, "Session save phase 2 requested");
ob_debug_type(OB_DEBUG_SM,
- " Saving session to file '%s'\n", ob_sm_save_file);
+ " Saving session to file '%s'", ob_sm_save_file);
if (savedata == NULL)
savedata = sm_save_get_data();
success = session_save_to_file(savedata);
/* tell the session manager how to restore this state */
if (success) session_setup_restart_command();
- ob_debug_type(OB_DEBUG_SM, "Saving is done (success = %d)\n", success);
+ ob_debug_type(OB_DEBUG_SM, "Saving is done (success = %d)", success);
SmcSaveYourselfDone(conn, success);
}
ObSMSaveData *savedata = NULL;
gchar *vendor;
- ob_debug_type(OB_DEBUG_SM, "Session save requested\n");
+ ob_debug_type(OB_DEBUG_SM, "Session save requested");
vendor = SmcVendor(sm_conn);
- ob_debug_type(OB_DEBUG_SM, "Session manager's vendor: %s\n", vendor);
+ ob_debug_type(OB_DEBUG_SM, "Session manager's vendor: %s", vendor);
if (!strcmp(vendor, "KDE")) {
/* ksmserver guarantees that phase 1 will complete before allowing any
free(vendor);
if (!SmcRequestSaveYourselfPhase2(conn, sm_save_yourself_2, savedata)) {
- ob_debug_type(OB_DEBUG_SM, "Requst for phase 2 failed\n");
+ ob_debug_type(OB_DEBUG_SM, "Requst for phase 2 failed");
g_free(savedata);
SmcSaveYourselfDone(conn, FALSE);
}
static void sm_die(SmcConn conn, SmPointer data)
{
- ob_debug_type(OB_DEBUG_SM, "Die requested\n");
+ ob_debug_type(OB_DEBUG_SM, "Die requested");
ob_exit(0);
}
static void sm_save_complete(SmcConn conn, SmPointer data)
{
- ob_debug_type(OB_DEBUG_SM, "Save complete\n");
+ ob_debug_type(OB_DEBUG_SM, "Save complete");
}
static void sm_shutdown_cancelled(SmcConn conn, SmPointer data)
{
- ob_debug_type(OB_DEBUG_SM, "Shutdown cancelled\n");
+ ob_debug_type(OB_DEBUG_SM, "Shutdown cancelled");
}
static gboolean session_save_to_file(const ObSMSaveData *savedata)
if (!c->sm_client_id) {
ob_debug_type(OB_DEBUG_SM, "Client %s does not have a "
- "session id set\n",
+ "session id set",
c->title);
if (!c->wm_command) {
ob_debug_type(OB_DEBUG_SM, "Client %s does not have an "
"oldskool wm_command set either. We won't "
- "be saving its data\n",
+ "be saving its data",
c->title);
continue;
}
}
- ob_debug_type(OB_DEBUG_SM, "Saving state for client %s\n",
+ ob_debug_type(OB_DEBUG_SM, "Saving state for client %s",
c->title);
prex = c->area.x;
static gboolean session_state_cmp(ObSessionState *s, ObClient *c)
{
- ob_debug_type(OB_DEBUG_SM, "Comparing client against saved state: \n");
- ob_debug_type(OB_DEBUG_SM, " client id: %s \n", c->sm_client_id);
- ob_debug_type(OB_DEBUG_SM, " client name: %s \n", c->name);
- ob_debug_type(OB_DEBUG_SM, " client class: %s \n", c->class);
- ob_debug_type(OB_DEBUG_SM, " client role: %s \n", c->role);
- ob_debug_type(OB_DEBUG_SM, " client type: %d \n", c->type);
- ob_debug_type(OB_DEBUG_SM, " client command: %s \n",
+ ob_debug_type(OB_DEBUG_SM, "Comparing client against saved state: ");
+ ob_debug_type(OB_DEBUG_SM, " client id: %s ", c->sm_client_id);
+ ob_debug_type(OB_DEBUG_SM, " client name: %s ", c->name);
+ ob_debug_type(OB_DEBUG_SM, " client class: %s ", c->class);
+ ob_debug_type(OB_DEBUG_SM, " client role: %s ", c->role);
+ ob_debug_type(OB_DEBUG_SM, " client type: %d ", c->type);
+ ob_debug_type(OB_DEBUG_SM, " client command: %s ",
c->wm_command ? c->wm_command : "(null)");
- ob_debug_type(OB_DEBUG_SM, " state id: %s \n", s->id);
- ob_debug_type(OB_DEBUG_SM, " state name: %s \n", s->name);
- ob_debug_type(OB_DEBUG_SM, " state class: %s \n", s->class);
- ob_debug_type(OB_DEBUG_SM, " state role: %s \n", s->role);
- ob_debug_type(OB_DEBUG_SM, " state type: %d \n", s->type);
- ob_debug_type(OB_DEBUG_SM, " state command: %s \n",
+ ob_debug_type(OB_DEBUG_SM, " state id: %s ", s->id);
+ ob_debug_type(OB_DEBUG_SM, " state name: %s ", s->name);
+ ob_debug_type(OB_DEBUG_SM, " state class: %s ", s->class);
+ ob_debug_type(OB_DEBUG_SM, " state role: %s ", s->role);
+ ob_debug_type(OB_DEBUG_SM, " state type: %d ", s->type);
+ ob_debug_type(OB_DEBUG_SM, " state command: %s ",
s->command ? s->command : "(null)");
if ((c->sm_client_id && s->id && !strcmp(c->sm_client_id, s->id)) ||
sibling->iconic))
{
ob_debug("Setting restack sibling to NULL, they are not on the same "
- "desktop or it is iconified\n");
+ "desktop or it is iconified");
sibling = NULL;
}
switch (detail) {
case Below:
- ob_debug("Restack request Below for client %s sibling %s\n",
+ ob_debug("Restack request Below for client %s sibling %s",
client->title, sibling ? sibling->title : "(all)");
/* just lower it */
stacking_lower(CLIENT_AS_WINDOW(client));
ret = TRUE;
break;
case BottomIf:
- ob_debug("Restack request BottomIf for client %s sibling "
- "%s\n",
+ ob_debug("Restack request BottomIf for client %s sibling %s",
client->title, sibling ? sibling->title : "(all)");
/* if this client occludes sibling (or anything if NULL), then
lower it to the bottom */
}
break;
case Above:
- ob_debug("Restack request Above for client %s sibling %s\n",
+ ob_debug("Restack request Above for client %s sibling %s",
client->title, sibling ? sibling->title : "(all)");
stacking_raise(CLIENT_AS_WINDOW(client));
ret = TRUE;
break;
case TopIf:
- ob_debug("Restack request TopIf for client %s sibling %s\n",
+ ob_debug("Restack request TopIf for client %s sibling %s",
client->title, sibling ? sibling->title : "(all)");
if (stacking_occluded(client, sibling)) {
stacking_raise(CLIENT_AS_WINDOW(client));
}
break;
case Opposite:
- ob_debug("Restack request Opposite for client %s sibling "
- "%s\n",
+ ob_debug("Restack request Opposite for client %s sibling %s",
client->title, sibling ? sibling->title : "(all)");
if (stacking_occluded(client, sibling)) {
stacking_raise(CLIENT_AS_WINDOW(client));
openbox/client_list_menu.c
openbox/client_menu.c
openbox/config.c
+openbox/debug.c
openbox/keyboard.c
openbox/menu.c
openbox/mouse.c