Subject: bug#25851: 25.2; GTK warning when starting Emacs when desktop file has more than one frame

From: martin rudalics <[email-masked]>
Date: Thu, 02 Mar 2017 12:00:22 +0100

> It's legitimate, but what we do as legitimate as well, right?  And
 > emitting a warning in such use cases will only annoy users, right?

The doc-string of gtk_window_parse_geometry says

  * Note that for gtk_window_parse_geometry() to work as expected, it has
  * to be called when the window has its “final” size, i.e. after calling
  * gtk_widget_show_all() on the contents and gtk_window_set_geometry_hints()
  * on the window.

and also

  * Deprecated: 3.20: Geometry handling in GTK is deprecated.

If this were our doc-string, would you say that calling that function as
we do now is legitimate?

IIUC we call gtk_window_parse_geometry here because we cannot call
gtk_window_set_geometry_hints at this early stage because of

   /* Don't set size hints during initialization; that apparently leads
      to a race condition.  See the thread at
      http://lists.gnu.org/archive/html/emacs-devel/2008-10/msg00033.html  */
   if (NILP (Vafter_init_time)
       || !FRAME_GTK_OUTER_WIDGET (f)
       || FRAME_PARENT_FRAME (f))
     return;

Aren't we desperately trying to shoot ourselves in the foot?  If we
can't set hints realiably during initialization, we shouldn't try doing
it through some backdoor.

martin