summaryrefslogtreecommitdiff
path: root/src/gtkutil.c
diff options
context:
space:
mode:
authorJan Djärv <jan.h.d@swipnet.se>2012-12-03 20:16:17 +0100
committerJan Djärv <jan.h.d@swipnet.se>2012-12-03 20:16:17 +0100
commit005c8d1340722a2a34b447a2ade4e4bf5bd077d0 (patch)
tree26d41ebf20fe3076d4dc10d271b8c9d7c17d00ca /src/gtkutil.c
parent475eea6f70ccf3cba346b5c66f924d612d5484aa (diff)
* gtkutil.c (my_log_handler): New function.
(xg_set_geometry): Set log handler to my_log_handler. Fixes: debbugs:11177
Diffstat (limited to 'src/gtkutil.c')
-rw-r--r--src/gtkutil.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 4367b534cb..52a6c37b0d 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -813,6 +813,14 @@ xg_hide_tooltip (FRAME_PTR f)
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
only way to get geometry position right if the user explicitly
asked for a position when starting Emacs.
@@ -828,6 +836,7 @@ xg_set_geometry (FRAME_PTR f)
int top = f->top_pos;
int yneg = f->size_hint_flags & YNegative;
char geom_str[sizeof "=x--" + 4 * INT_STRLEN_BOUND (int)];
+ guint id;
if (xneg)
left = -left;
@@ -840,9 +849,15 @@ xg_set_geometry (FRAME_PTR f)
(xneg ? '-' : '+'), left,
(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)),
geom_str))
fprintf (stderr, "Failed to parse: '%s'\n", geom_str);
+
+ g_log_remove_handler ("Gtk", id);
}
}