Commit 1d252b3e authored by Alberts Muktupāvels's avatar Alberts Muktupāvels

util: replace meta_bug with g_error

parent f0853bc5
......@@ -51,7 +51,7 @@ get_window (Display *xdisplay,
if (window == NULL || window->frame == NULL)
{
meta_bug ("No such frame window 0x%lx!\n", frame_xwindow);
g_error ("No such frame window 0x%lx!", frame_xwindow);
return NULL;
}
......@@ -60,8 +60,8 @@ get_window (Display *xdisplay,
void
meta_core_get (Display *xdisplay,
Window xwindow,
...)
Window xwindow,
...)
{
va_list args;
MetaCoreGetType request;
......@@ -85,10 +85,11 @@ meta_core_get (Display *xdisplay,
*/
if (request != META_CORE_WINDOW_HAS_FRAME &&
(window == NULL || window->frame == NULL)) {
meta_bug ("No such frame window 0x%lx!\n", xwindow);
goto out;
}
(window == NULL || window->frame == NULL))
{
g_error ("No such frame window 0x%lx!", xwindow);
goto out;
}
while (request != META_CORE_GET_END) {
......
......@@ -822,7 +822,7 @@ meta_display_close (MetaDisplay *display,
}
if (display->error_traps > 0)
meta_bug ("Display closed with error traps pending\n");
g_error ("Display closed with error traps pending");
display->closing += 1;
......@@ -931,7 +931,7 @@ void
meta_display_ungrab (MetaDisplay *display)
{
if (display->server_grab_count == 0)
meta_bug ("Ungrabbed non-grabbed server\n");
g_error ("Ungrabbed non-grabbed server");
display->server_grab_count -= 1;
if (display->server_grab_count == 0)
......
......@@ -1210,7 +1210,7 @@ process_event (MetaKeyBinding *bindings,
event->xkey.keycode, event->xkey.state);
if (handler == NULL)
meta_bug ("Binding %s has no handler\n", bindings[i].name);
g_error ("Binding %s has no handler", bindings[i].name);
else
meta_topic (META_DEBUG_KEYBINDINGS,
"Running handler for %s\n",
......
......@@ -485,7 +485,7 @@ handle_preference_init_string (void)
if (cursor->handler)
{
if (cursor->target)
meta_bug ("%s has both a target and a handler\n", cursor->base.key);
g_error ("%s has both a target and a handler", cursor->base.key);
g_settings_get_mapped (SETTINGS (cursor->base.schema),
cursor->base.key, cursor->handler, NULL);
......@@ -493,7 +493,7 @@ handle_preference_init_string (void)
else
{
if (!cursor->target)
meta_bug ("%s must have handler or target\n", cursor->base.key);
g_error ("%s must have handler or target", cursor->base.key);
if (*(cursor->target))
g_free (*(cursor->target));
......@@ -598,7 +598,7 @@ handle_preference_update_string (GSettings *settings,
if (cursor->handler)
{
if (cursor->target)
meta_bug ("%s has both a target and a handler\n", cursor->base.key);
g_error ("%s has both a target and a handler", cursor->base.key);
g_settings_get_mapped (SETTINGS (cursor->base.schema),
cursor->base.key, cursor->handler, NULL);
......@@ -606,7 +606,7 @@ handle_preference_update_string (GSettings *settings,
else
{
if (!cursor->target)
meta_bug ("%s must have handler or target\n", cursor->base.key);
g_error ("%s must have handler or target", cursor->base.key);
value = g_settings_get_string (SETTINGS (cursor->base.schema),
cursor->base.key);
......@@ -686,7 +686,7 @@ meta_prefs_remove_listener (MetaPrefsChangedFunc func,
tmp = tmp->next;
}
meta_bug ("Did not find listener to remove\n");
g_error ("Did not find listener to remove");
}
static void
......
......@@ -2208,8 +2208,8 @@ meta_screen_calc_workspace_layout (MetaScreen *screen,
}
if (i != grid_area)
meta_bug ("did not fill in the whole workspace grid in %s (%d filled)\n",
G_STRFUNC, i);
g_error ("did not fill in the whole workspace grid in %s (%d filled)",
G_STRFUNC, i);
current_row = 0;
current_col = 0;
......
......@@ -292,7 +292,7 @@ meta_session_init (const char *previous_client_id,
else
{
if (client_id == NULL)
meta_bug ("Session manager gave us a NULL client ID?");
g_error ("Session manager gave us a NULL client ID?");
meta_topic (META_DEBUG_SM, "Obtained session ID '%s'\n", client_id);
}
......
......@@ -110,7 +110,7 @@ meta_stack_add (MetaStack *stack,
meta_topic (META_DEBUG_STACK, "Adding window %s to the stack\n", window->desc);
if (window->stack_position >= 0)
meta_bug ("Window %s had stack position already\n", window->desc);
g_error ("Window %s had stack position already", window->desc);
stack->added = g_list_prepend (stack->added, window);
......@@ -130,8 +130,8 @@ meta_stack_remove (MetaStack *stack,
meta_topic (META_DEBUG_STACK, "Removing window %s from the stack\n", window->desc);
if (window->stack_position < 0)
meta_bug ("Window %s removed from stack but had no stack position\n",
window->desc);
g_error ("Window %s removed from stack but had no stack position",
window->desc);
/* Set window to top position, so removing it will not leave gaps
* in the set of positions
......
......@@ -284,33 +284,6 @@ meta_topic (MetaDebugTopic topic,
g_free (str);
}
void
meta_bug (const char *format, ...)
{
va_list args;
gchar *str;
FILE *out;
g_return_if_fail (format != NULL);
va_start (args, format);
str = g_strdup_vprintf (format, args);
va_end (args);
out = logfile ? logfile : stderr;
if (no_prefix == 0)
utf8_fputs (_("Bug in window manager: "), out);
utf8_fputs (str, out);
fflush (out);
g_free (str);
/* stop us in a debugger */
abort ();
}
void
meta_fatal (const char *format, ...)
{
......
......@@ -1048,8 +1048,8 @@ meta_window_free (MetaWindow *window,
}
if (destroying_windows_disallowed > 0)
meta_bug ("Tried to destroy window %s while destruction was not allowed\n",
window->desc);
g_error ("Tried to destroy window %s while destruction was not allowed",
window->desc);
window->unmanaging = TRUE;
......
......@@ -328,7 +328,7 @@ static void workspace_switch_sound(MetaWorkspace *from,
break;
if (i >= nw) {
meta_bug("Failed to find destination workspace in layout\n");
g_error ("Failed to find destination workspace in layout");
goto finish;
}
......@@ -343,7 +343,7 @@ static void workspace_switch_sound(MetaWorkspace *from,
movement but not such much vertical movement. */
if (x == layout.current_col && y == layout.current_row) {
meta_bug("Uh, origin and destination workspace at same logic position!\n");
g_error ("Uh, origin and destination workspace at same logic position!");
goto finish;
}
......@@ -469,7 +469,7 @@ meta_workspace_index (MetaWorkspace *workspace)
ret = g_list_index (workspace->screen->workspaces, workspace);
if (ret < 0)
meta_bug ("Workspace does not exist to index!\n");
g_error ("Workspace does not exist to index!");
return ret;
}
......@@ -865,8 +865,10 @@ meta_workspace_get_neighbor (MetaWorkspace *workspace,
i = current_space;
if (i >= num_workspaces)
meta_bug ("calc_workspace_layout left an invalid (too-high) workspace number %d in the grid\n",
i);
{
g_error ("calc_workspace_layout left an invalid (too-high) workspace "
"number %d in the grid", i);
}
meta_verbose ("Neighbor workspace is %d at row %d col %d\n",
i, layout.current_row, layout.current_col);
......
......@@ -1017,7 +1017,7 @@ meta_prop_get_values (MetaDisplay *display,
* property notify on an atom we don't care about.
*/
if (values[i].atom != None)
meta_bug ("META_PROP_VALUE_INVALID requested in %s\n", G_STRFUNC);
g_error ("META_PROP_VALUE_INVALID requested in %s", G_STRFUNC);
break;
case META_PROP_VALUE_UTF8_LIST:
case META_PROP_VALUE_UTF8:
......
......@@ -38,8 +38,6 @@ void meta_set_replace_current_wm (gboolean setting);
void meta_verbose (const char *format,
...) G_GNUC_PRINTF (1, 2);
void meta_bug (const char *format,
...) G_GNUC_PRINTF (1, 2);
void meta_fatal (const char *format,
...) G_GNUC_PRINTF (1, 2);
......
......@@ -883,7 +883,7 @@ meta_frames_get_borders (MetaFrames *frames,
frame = meta_frames_lookup_window (frames, xwindow);
if (frame == NULL)
meta_bug ("No such frame 0x%lx\n", xwindow);
g_error ("No such frame 0x%lx", xwindow);
meta_ui_frame_get_borders (frames, frame, borders);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment