diff options
| author | Jan Djärv | 2009-12-13 14:24:22 +0000 |
|---|---|---|
| committer | Jan Djärv | 2009-12-13 14:24:22 +0000 |
| commit | b8f0067758d1710e580f55f60ab70cd073f7fa79 (patch) | |
| tree | ea8e49d8a5cdde385f601fe07a7a27b94217af6e /src | |
| parent | e5f0bc9ada3729749b83cfa246b39dd0d6fceca0 (diff) | |
| download | emacs-b8f0067758d1710e580f55f60ab70cd073f7fa79.tar.gz emacs-b8f0067758d1710e580f55f60ab70cd073f7fa79.zip | |
Work around warning about g_set_prgname() called multiple times.
* xterm.c (my_log_handler): New function.
(x_term_init): Set my_log_handler as log handler during gtk_init
so we can filter out buggy messages. (bug #5120).
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 4 | ||||
| -rw-r--r-- | src/xterm.c | 20 |
2 files changed, 23 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index bf71cc3ea32..692db938e61 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,9 @@ | |||
| 1 | 2009-12-13 Jan Djärv <jan.h.d@swipnet.se> | 1 | 2009-12-13 Jan Djärv <jan.h.d@swipnet.se> |
| 2 | 2 | ||
| 3 | * xterm.c (my_log_handler): New function. | ||
| 4 | (x_term_init): Set my_log_handler as log handler during gtk_init | ||
| 5 | so we can filter out buggy messages. (bug #5120). | ||
| 6 | |||
| 3 | * xterm.c (xg_scroll_callback): Parameter list changed, | 7 | * xterm.c (xg_scroll_callback): Parameter list changed, |
| 4 | use parameter GtkScrollType to determine scroll/line/page. | 8 | use parameter GtkScrollType to determine scroll/line/page. |
| 5 | Only allow dragging if a button < 4 is grabbed (bug #5177). | 9 | Only allow dragging if a button < 4 is grabbed (bug #5177). |
diff --git a/src/xterm.c b/src/xterm.c index 231275ea205..dee6190e755 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -10020,6 +10020,19 @@ x_display_ok (display) | |||
| 10020 | return dpy_ok; | 10020 | return dpy_ok; |
| 10021 | } | 10021 | } |
| 10022 | 10022 | ||
| 10023 | #ifdef USE_GTK | ||
| 10024 | static void | ||
| 10025 | my_log_handler (log_domain, log_level, message, user_data) | ||
| 10026 | const gchar *log_domain; | ||
| 10027 | GLogLevelFlags log_level; | ||
| 10028 | const gchar *message; | ||
| 10029 | gpointer user_data; | ||
| 10030 | { | ||
| 10031 | if (!strstr (message, "g_set_prgname")) | ||
| 10032 | fprintf (stderr, "%s-WARNING **: %s\n", log_domain, message); | ||
| 10033 | } | ||
| 10034 | #endif | ||
| 10035 | |||
| 10023 | /* Open a connection to X display DISPLAY_NAME, and return | 10036 | /* Open a connection to X display DISPLAY_NAME, and return |
| 10024 | the structure that describes the open display. | 10037 | the structure that describes the open display. |
| 10025 | If we cannot contact the display, return null. */ | 10038 | If we cannot contact the display, return null. */ |
| @@ -10054,7 +10067,7 @@ x_term_init (display_name, xrm_option, resource_name) | |||
| 10054 | char *argv[NUM_ARGV]; | 10067 | char *argv[NUM_ARGV]; |
| 10055 | char **argv2 = argv; | 10068 | char **argv2 = argv; |
| 10056 | GdkAtom atom; | 10069 | GdkAtom atom; |
| 10057 | 10070 | guint id; | |
| 10058 | #ifndef HAVE_GTK_MULTIDISPLAY | 10071 | #ifndef HAVE_GTK_MULTIDISPLAY |
| 10059 | if (!EQ (Vinitial_window_system, Qx)) | 10072 | if (!EQ (Vinitial_window_system, Qx)) |
| 10060 | error ("Sorry, you cannot connect to X servers with the GTK toolkit"); | 10073 | error ("Sorry, you cannot connect to X servers with the GTK toolkit"); |
| @@ -10089,7 +10102,12 @@ x_term_init (display_name, xrm_option, resource_name) | |||
| 10089 | 10102 | ||
| 10090 | XSetLocaleModifiers (""); | 10103 | XSetLocaleModifiers (""); |
| 10091 | 10104 | ||
| 10105 | /* Work around GLib bug that outputs a faulty warning. See | ||
| 10106 | https://bugzilla.gnome.org/show_bug.cgi?id=563627. */ | ||
| 10107 | id = g_log_set_handler ("GLib", G_LOG_LEVEL_WARNING | G_LOG_FLAG_FATAL | ||
| 10108 | | G_LOG_FLAG_RECURSION, my_log_handler, NULL); | ||
| 10092 | gtk_init (&argc, &argv2); | 10109 | gtk_init (&argc, &argv2); |
| 10110 | g_log_remove_handler ("GLib", id); | ||
| 10093 | 10111 | ||
| 10094 | /* gtk_init does set_locale. We must fix locale after calling it. */ | 10112 | /* gtk_init does set_locale. We must fix locale after calling it. */ |
| 10095 | fixup_locale (); | 10113 | fixup_locale (); |