From 04c9c3e0585eb63500ba70c8e0f347c1c450c6db Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Sun, 27 Oct 2002 03:03:32 +0000 Subject: [PATCH] include config.h 2002-10-26 Havoc Pennington * src/iconcache.c: include config.h * src/group.c: include config.h * src/frame.c: include config.h * src/core.c: include config.h so it doesn't crash all over the place due to #ifdef HAVE_STARTUP_NOTIFICATION * src/util.c (meta_print_backtrace): export from this file * src/main.c (log_handler): print backtrace here --- ChangeLog | 15 +++++++++++++++ src/core.c | 1 + src/display.h | 17 +++++++++++++---- src/frame.c | 1 + src/group.c | 1 + src/iconcache.c | 1 + src/main.c | 1 + src/metacity.desktop.in | 5 +++++ src/stack.c | 1 + src/util.c | 10 +++++----- src/util.h | 2 ++ 11 files changed, 46 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2106a02b4..d713b7953 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2002-10-26 Havoc Pennington + + * src/iconcache.c: include config.h + + * src/group.c: include config.h + + * src/frame.c: include config.h + + * src/core.c: include config.h so it doesn't crash all over the + place due to #ifdef HAVE_STARTUP_NOTIFICATION + + * src/util.c (meta_print_backtrace): export from this file + + * src/main.c (log_handler): print backtrace here + 2002-10-26 Havoc Pennington * src/wm-tester/main.c (evil_timeout): make windows randomly diff --git a/src/core.c b/src/core.c index 33bd04ab4..b70420194 100644 --- a/src/core.c +++ b/src/core.c @@ -19,6 +19,7 @@ * 02111-1307, USA. */ +#include #include "core.h" #include "frame.h" #include "workspace.h" diff --git a/src/display.h b/src/display.h index 395e97868..faba61e34 100644 --- a/src/display.h +++ b/src/display.h @@ -22,6 +22,10 @@ #ifndef META_DISPLAY_H #define META_DISPLAY_H +#ifndef PACKAGE +#error "config.h not included" +#endif + #include #include #include "eventqueue.h" @@ -153,10 +157,6 @@ struct _MetaDisplay Atom atom_net_wm_action_close; Atom atom_net_wm_state_above; Atom atom_net_wm_state_below; - -#ifdef HAVE_STARTUP_NOTIFICATION - SnDisplay *sn_display; -#endif /* This is the actual window from focus events, * not the one we last set @@ -258,6 +258,15 @@ struct _MetaDisplay /* Managed by group.c */ GHashTable *groups_by_leader; + + +#ifdef HAVE_STARTUP_NOTIFICATION + /* This is at the end in case someone doesn't include config.h before this file + * the results won't be catastrophic + */ + SnDisplay *sn_display; +#endif + }; gboolean meta_display_open (const char *name); diff --git a/src/frame.c b/src/frame.c index eddd40496..b981559e9 100644 --- a/src/frame.c +++ b/src/frame.c @@ -19,6 +19,7 @@ * 02111-1307, USA. */ +#include #include "frame.h" #include "errors.h" #include "keybindings.h" diff --git a/src/group.c b/src/group.c index 8550c50c2..61e175ff2 100644 --- a/src/group.c +++ b/src/group.c @@ -19,6 +19,7 @@ * 02111-1307, USA. */ +#include #include "util.h" #include "group.h" #include "window.h" diff --git a/src/iconcache.c b/src/iconcache.c index 388df5197..fb4e57dc5 100644 --- a/src/iconcache.c +++ b/src/iconcache.c @@ -19,6 +19,7 @@ * 02111-1307, USA. */ +#include #include "iconcache.h" #include "ui.h" #include "errors.h" diff --git a/src/main.c b/src/main.c index 55ecf6244..9719e9e25 100644 --- a/src/main.c +++ b/src/main.c @@ -55,6 +55,7 @@ log_handler (const gchar *log_domain, gpointer user_data) { meta_warning ("Log level %d: %s\n", log_level, message); + meta_print_backtrace (); } static void diff --git a/src/metacity.desktop.in b/src/metacity.desktop.in index 1d847fb3b..c96e88c4f 100644 --- a/src/metacity.desktop.in +++ b/src/metacity.desktop.in @@ -1,6 +1,11 @@ [Desktop Entry] _Name=Metacity Exec=metacity +# name of loadable control center module +X-GNOME-WMSettingsModule=metacity +# name we put on the WM spec check window +X-GNOME-WMName=Metacity +# back compat only X-GnomeWMSettingsLibrary=metacity [Window Manager] diff --git a/src/stack.c b/src/stack.c index 7018283d5..04dcac9aa 100644 --- a/src/stack.c +++ b/src/stack.c @@ -20,6 +20,7 @@ * 02111-1307, USA. */ +#include #include "stack.h" #include "window.h" #include "errors.h" diff --git a/src/util.c b/src/util.c index 36851ee0e..4126b1dbf 100644 --- a/src/util.c +++ b/src/util.c @@ -31,8 +31,8 @@ #ifdef HAVE_BACKTRACE #include -static void -print_backtrace (void) +void +meta_print_backtrace (void) { void *bt[500]; int bt_size; @@ -53,8 +53,8 @@ print_backtrace (void) free (syms); } #else -static void -print_backtrace (void) +void +meta_print_backtrace (void) { meta_verbose ("Not compiled with backtrace support\n"); } @@ -317,7 +317,7 @@ meta_bug (const char *format, ...) g_free (str); - print_backtrace (); + meta_print_backtrace (); /* stop us in a debugger */ abort (); diff --git a/src/util.h b/src/util.h index ae2e6ee17..6ac6f55d5 100644 --- a/src/util.h +++ b/src/util.h @@ -76,6 +76,8 @@ gint meta_unsigned_long_equal (gconstpointer v1, gconstpointer v2); guint meta_unsigned_long_hash (gconstpointer v); +void meta_print_backtrace (void); + #include #define _(x) dgettext (GETTEXT_PACKAGE, x) #define N_(x) x