diff options
| author | Yuuki Harano | 2019-06-26 00:30:33 +0900 |
|---|---|---|
| committer | Jeff Walsh | 2020-11-22 14:46:55 +1100 |
| commit | 164800da6f673afeba729befbfbfd0e6131eadb8 (patch) | |
| tree | 5d54518af541ca162222056d879c1e190d0b27f9 /src | |
| parent | 330a346ca734d39c0233ef899e044d05e0e1ebe9 (diff) | |
| download | emacs-164800da6f673afeba729befbfbfd0e6131eadb8.tar.gz emacs-164800da6f673afeba729befbfbfd0e6131eadb8.zip | |
Add Preferred geometry settings
* ../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 でサイズが変化していっていたのを修正。
Diffstat (limited to 'src')
| -rw-r--r-- | src/emacsgtkfixed.c | 8 | ||||
| -rw-r--r-- | src/gtkutil.c | 2 | ||||
| -rw-r--r-- | src/pgtkterm.h | 1 |
3 files changed, 9 insertions, 2 deletions
diff --git a/src/emacsgtkfixed.c b/src/emacsgtkfixed.c index aeca3d4f7cc..4128f81cce9 100644 --- a/src/emacsgtkfixed.c +++ b/src/emacsgtkfixed.c | |||
| @@ -188,11 +188,13 @@ emacs_fixed_get_preferred_width (GtkWidget *widget, | |||
| 188 | EmacsFixedPrivate *priv = fixed->priv; | 188 | EmacsFixedPrivate *priv = fixed->priv; |
| 189 | #ifdef HAVE_PGTK | 189 | #ifdef HAVE_PGTK |
| 190 | int w = priv->f->output_data.pgtk->size_hints.min_width; | 190 | int w = priv->f->output_data.pgtk->size_hints.min_width; |
| 191 | if (minimum) *minimum = w; | ||
| 192 | if (natural) *natural = priv->f->output_data.pgtk->preferred_width; | ||
| 191 | #else | 193 | #else |
| 192 | int w = priv->f->output_data.x->size_hints.min_width; | 194 | int w = priv->f->output_data.x->size_hints.min_width; |
| 193 | #endif | ||
| 194 | if (minimum) *minimum = w; | 195 | if (minimum) *minimum = w; |
| 195 | if (natural) *natural = w; | 196 | if (natural) *natural = w; |
| 197 | #endif | ||
| 196 | } | 198 | } |
| 197 | 199 | ||
| 198 | static void | 200 | static void |
| @@ -204,11 +206,13 @@ emacs_fixed_get_preferred_height (GtkWidget *widget, | |||
| 204 | EmacsFixedPrivate *priv = fixed->priv; | 206 | EmacsFixedPrivate *priv = fixed->priv; |
| 205 | #ifdef HAVE_PGTK | 207 | #ifdef HAVE_PGTK |
| 206 | int h = priv->f->output_data.pgtk->size_hints.min_height; | 208 | int h = priv->f->output_data.pgtk->size_hints.min_height; |
| 209 | if (minimum) *minimum = h; | ||
| 210 | if (natural) *natural = priv->f->output_data.pgtk->preferred_height; | ||
| 207 | #else | 211 | #else |
| 208 | int h = priv->f->output_data.x->size_hints.min_height; | 212 | int h = priv->f->output_data.x->size_hints.min_height; |
| 209 | #endif | ||
| 210 | if (minimum) *minimum = h; | 213 | if (minimum) *minimum = h; |
| 211 | if (natural) *natural = h; | 214 | if (natural) *natural = h; |
| 215 | #endif | ||
| 212 | } | 216 | } |
| 213 | 217 | ||
| 214 | 218 | ||
diff --git a/src/gtkutil.c b/src/gtkutil.c index 6c0d42103b1..10120422ae3 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c | |||
| @@ -1696,8 +1696,10 @@ x_wm_set_size_hint (struct frame *f, long int flags, bool user_position) | |||
| 1696 | sizeof (size_hints)) != 0) | 1696 | sizeof (size_hints)) != 0) |
| 1697 | { | 1697 | { |
| 1698 | block_input (); | 1698 | block_input (); |
| 1699 | #ifndef HAVE_PGTK | ||
| 1699 | gtk_window_set_geometry_hints (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), | 1700 | gtk_window_set_geometry_hints (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), |
| 1700 | NULL, &size_hints, hint_flags); | 1701 | NULL, &size_hints, hint_flags); |
| 1702 | #endif | ||
| 1701 | f->output_data.xp->size_hints = size_hints; | 1703 | f->output_data.xp->size_hints = size_hints; |
| 1702 | f->output_data.xp->hint_flags = hint_flags; | 1704 | f->output_data.xp->hint_flags = hint_flags; |
| 1703 | unblock_input (); | 1705 | unblock_input (); |
diff --git a/src/pgtkterm.h b/src/pgtkterm.h index 622b5ef76fe..6bb03697a50 100644 --- a/src/pgtkterm.h +++ b/src/pgtkterm.h | |||
| @@ -297,6 +297,7 @@ struct pgtk_output | |||
| 297 | /* The last size hints set. */ | 297 | /* The last size hints set. */ |
| 298 | GdkGeometry size_hints; | 298 | GdkGeometry size_hints; |
| 299 | long hint_flags; | 299 | long hint_flags; |
| 300 | int preferred_width, preferred_height; | ||
| 300 | 301 | ||
| 301 | /* The widget of this screen. This is the window of a top widget. */ | 302 | /* The widget of this screen. This is the window of a top widget. */ |
| 302 | GtkWidget *widget; | 303 | GtkWidget *widget; |