]> git.eshelyaron.com Git - emacs.git/commitdiff
Add Preferred geometry settings
authorYuuki Harano <masm+github@masm11.me>
Tue, 25 Jun 2019 15:30:33 +0000 (00:30 +0900)
committerJeff Walsh <fejfighter@gmail.com>
Sun, 22 Nov 2020 03:46:55 +0000 (14:46 +1100)
* ../src/pgtkterm.h (struct pgtk_output):

* ../src/pgtkterm.c (pgtk_set_window_size):

* ../src/gtkutil.c (x_wm_set_size_hint):

* ../src/emacsgtkfixed.c (emacs_fixed_get_preferred_width)
(emacs_fixed_get_preferred_height):

Fixup toolbar handling

toolbar, menubar の ON/OFF でサイズが変化していっていたのを修正。

src/emacsgtkfixed.c
src/gtkutil.c
src/pgtkterm.h

index aeca3d4f7cc9e590287439c09765aba16c5361df..4128f81cce9ca94b2997aa26a7ac54f64b9e278a 100644 (file)
@@ -188,11 +188,13 @@ emacs_fixed_get_preferred_width (GtkWidget *widget,
   EmacsFixedPrivate *priv = fixed->priv;
 #ifdef HAVE_PGTK
   int w = priv->f->output_data.pgtk->size_hints.min_width;
+  if (minimum) *minimum = w;
+  if (natural) *natural = priv->f->output_data.pgtk->preferred_width;
 #else
   int w = priv->f->output_data.x->size_hints.min_width;
-#endif
   if (minimum) *minimum = w;
   if (natural) *natural = w;
+#endif
 }
 
 static void
@@ -204,11 +206,13 @@ emacs_fixed_get_preferred_height (GtkWidget *widget,
   EmacsFixedPrivate *priv = fixed->priv;
 #ifdef HAVE_PGTK
   int h = priv->f->output_data.pgtk->size_hints.min_height;
+  if (minimum) *minimum = h;
+  if (natural) *natural = priv->f->output_data.pgtk->preferred_height;
 #else
   int h = priv->f->output_data.x->size_hints.min_height;
-#endif
   if (minimum) *minimum = h;
   if (natural) *natural = h;
+#endif
 }
 
 
index 6c0d42103b1b1ac45060edfa707de092445bcbf1..10120422ae3cd320ec48e3496b5b5d885f2432f3 100644 (file)
@@ -1696,8 +1696,10 @@ x_wm_set_size_hint (struct frame *f, long int flags, bool user_position)
                 sizeof (size_hints)) != 0)
     {
       block_input ();
+#ifndef HAVE_PGTK
       gtk_window_set_geometry_hints (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
                                      NULL, &size_hints, hint_flags);
+#endif
       f->output_data.xp->size_hints = size_hints;
       f->output_data.xp->hint_flags = hint_flags;
       unblock_input ();
index 622b5ef76fe1ba07c409eedc19f5e829fb07d564..6bb03697a50a5f1d805bfdac133a4bf3a080b357 100644 (file)
@@ -297,6 +297,7 @@ struct pgtk_output
   /* The last size hints set.  */
   GdkGeometry size_hints;
   long hint_flags;
+  int preferred_width, preferred_height;
 
   /* The widget of this screen.  This is the window of a top widget.  */
   GtkWidget *widget;