# Prevent incorrect Gtk warning at startup when a specific geometry is
# explicitly specified. See components/emacs/README.
#
--- emacs-24.3.orig/src/gtkutil.c 2013-01-12 12:29:19.000000000 -0700
+++ emacs-24.3/src/gtkutil.c 2013-09-23 11:36:07.414160374 -0600
@@ -813,6 +813,14 @@
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 @@
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,6 +849,10 @@
(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);