Commit 005c8d13 authored by Jan Djärv's avatar Jan Djärv
Browse files

* gtkutil.c (my_log_handler): New function.

(xg_set_geometry): Set log handler to my_log_handler.

Fixes: debbugs:11177
parent 475eea6f
2012-12-03 Jan Djärv <jan.h.d@swipnet.se>
* gtkutil.c (my_log_handler): New function.
(xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
2012-12-03 Dmitry Antipov <dmantipov@yandex.ru> 2012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
   
* lisp.h (modify_region): Rename to... * lisp.h (modify_region): Rename to...
......
...@@ -813,6 +813,14 @@ xg_hide_tooltip (FRAME_PTR f) ...@@ -813,6 +813,14 @@ xg_hide_tooltip (FRAME_PTR f)
General functions for creating widgets, resizing, events, e.t.c. General functions for creating widgets, resizing, events, e.t.c.
***********************************************************************/ ***********************************************************************/
static void
my_log_handler (const gchar *log_domain, GLogLevelFlags log_level,
const gchar *msg, gpointer user_data)
{
if (!strstr (msg, "visible children"))
fprintf (stderr, "XX %s-WARNING **: %s\n", log_domain, msg);
}
/* Make a geometry string and pass that to GTK. It seems this is the /* Make a geometry string and pass that to GTK. It seems this is the
only way to get geometry position right if the user explicitly only way to get geometry position right if the user explicitly
asked for a position when starting Emacs. asked for a position when starting Emacs.
...@@ -828,6 +836,7 @@ xg_set_geometry (FRAME_PTR f) ...@@ -828,6 +836,7 @@ xg_set_geometry (FRAME_PTR f)
int top = f->top_pos; int top = f->top_pos;
int yneg = f->size_hint_flags & YNegative; int yneg = f->size_hint_flags & YNegative;
char geom_str[sizeof "=x--" + 4 * INT_STRLEN_BOUND (int)]; char geom_str[sizeof "=x--" + 4 * INT_STRLEN_BOUND (int)];
guint id;
if (xneg) if (xneg)
left = -left; left = -left;
...@@ -840,9 +849,15 @@ xg_set_geometry (FRAME_PTR f) ...@@ -840,9 +849,15 @@ xg_set_geometry (FRAME_PTR f)
(xneg ? '-' : '+'), left, (xneg ? '-' : '+'), left,
(yneg ? '-' : '+'), top); (yneg ? '-' : '+'), top);
/* Silence warning about visible children. */
id = g_log_set_handler ("Gtk", G_LOG_LEVEL_WARNING | G_LOG_FLAG_FATAL
| G_LOG_FLAG_RECURSION, my_log_handler, NULL);
if (!gtk_window_parse_geometry (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), if (!gtk_window_parse_geometry (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
geom_str)) geom_str))
fprintf (stderr, "Failed to parse: '%s'\n", geom_str); fprintf (stderr, "Failed to parse: '%s'\n", geom_str);
g_log_remove_handler ("Gtk", id);
} }
} }
......
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