components/emacs/patches/gtkutil.patch
branchs11-update
changeset 2856 47b35501403f
equal deleted inserted replaced
2855:576d5a7857b7 2856:47b35501403f
       
     1 # Prevent incorrect Gtk warning at startup when a specific geometry is
       
     2 # explicitly specified. See components/emacs/README.
       
     3 #
       
     4 --- emacs-24.3.orig/src/gtkutil.c	2013-01-12 12:29:19.000000000 -0700
       
     5 +++ emacs-24.3/src/gtkutil.c	2013-09-23 11:36:07.414160374 -0600
       
     6 @@ -813,6 +813,14 @@
       
     7      General functions for creating widgets, resizing, events, e.t.c.
       
     8   ***********************************************************************/
       
     9  
       
    10 +static void
       
    11 +my_log_handler (const gchar *log_domain, GLogLevelFlags log_level,
       
    12 +                const gchar *msg, gpointer user_data)
       
    13 +{
       
    14 +  if (!strstr (msg, "visible children"))
       
    15 +    fprintf (stderr, "XX %s-WARNING **: %s\n", log_domain, msg);
       
    16 +}
       
    17 +
       
    18  /* Make a geometry string and pass that to GTK.  It seems this is the
       
    19     only way to get geometry position right if the user explicitly
       
    20     asked for a position when starting Emacs.
       
    21 @@ -828,6 +836,7 @@
       
    22        int top = f->top_pos;
       
    23        int yneg = f->size_hint_flags & YNegative;
       
    24        char geom_str[sizeof "=x--" + 4 * INT_STRLEN_BOUND (int)];
       
    25 +      guint id;
       
    26  
       
    27        if (xneg)
       
    28          left = -left;
       
    29 @@ -840,6 +849,10 @@
       
    30                 (xneg ? '-' : '+'), left,
       
    31                 (yneg ? '-' : '+'), top);
       
    32  
       
    33 +      /* Silence warning about visible children.  */
       
    34 +      id = g_log_set_handler ("Gtk", G_LOG_LEVEL_WARNING | G_LOG_FLAG_FATAL
       
    35 +                              | G_LOG_FLAG_RECURSION, my_log_handler, NULL);
       
    36 +
       
    37        if (!gtk_window_parse_geometry (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
       
    38                                        geom_str))
       
    39          fprintf (stderr, "Failed to parse: '%s'\n", geom_str);