[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
feature/pgtk 164800d 013/100: Add Preferred geometry settings
From: |
Yuuki Harano |
Subject: |
feature/pgtk 164800d 013/100: Add Preferred geometry settings |
Date: |
Tue, 24 Nov 2020 08:02:26 -0500 (EST) |
branch: feature/pgtk
commit 164800da6f673afeba729befbfbfd0e6131eadb8
Author: Yuuki Harano <masm+github@masm11.me>
Commit: Jeff Walsh <fejfighter@gmail.com>
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 でサイズが変化していっていたのを修正。
---
src/emacsgtkfixed.c | 8 ++++++--
src/gtkutil.c | 2 ++
src/pgtkterm.h | 1 +
3 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/emacsgtkfixed.c b/src/emacsgtkfixed.c
index aeca3d4..4128f81 100644
--- a/src/emacsgtkfixed.c
+++ b/src/emacsgtkfixed.c
@@ -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
}
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 6c0d421..1012042 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)
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 ();
diff --git a/src/pgtkterm.h b/src/pgtkterm.h
index 622b5ef..6bb0369 100644
--- a/src/pgtkterm.h
+++ b/src/pgtkterm.h
@@ -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;
- feature/pgtk 526f727 036/100: Let gtk handle scaling., (continued)
- feature/pgtk 526f727 036/100: Let gtk handle scaling., Yuuki Harano, 2020/11/24
- feature/pgtk 68b99a3 021/100: Implement invisible-pointer to create blinking effect, Yuuki Harano, 2020/11/24
- feature/pgtk 53cb431 007/100: replace listn with list., Yuuki Harano, 2020/11/24
- feature/pgtk 592badc 014/100: Early toolbar improvements, Yuuki Harano, 2020/11/24
- feature/pgtk 9d9c828 025/100: TIMERFD support for PGTK, prevent calling when timerfd<0, Yuuki Harano, 2020/11/24
- feature/pgtk fbba846 017/100: Addframe highlighting support, Yuuki Harano, 2020/11/24
- feature/pgtk 0056ca2 064/100: * src/pgtkterm.h: Change coding style, Yuuki Harano, 2020/11/24
- feature/pgtk f761a09 065/100: * src/pgtkim.c: Change coding style, Yuuki Harano, 2020/11/24
- feature/pgtk 27a92f7 072/100: Add font chooser functionality, Yuuki Harano, 2020/11/24
- feature/pgtk 9752896 042/100: Bring pgtk more inline with X11-cairo builds, Yuuki Harano, 2020/11/24
- feature/pgtk 164800d 013/100: Add Preferred geometry settings,
Yuuki Harano <=
- feature/pgtk 383ced7 071/100: Fix migrating Child frames, Yuuki Harano, 2020/11/24
- feature/pgtk 3b161dd 066/100: * src/pgtkselect.h: Change coding style, Yuuki Harano, 2020/11/24
- feature/pgtk 89cbe37 070/100: * src/keyboard.c (make_lispy_event): Fix coding style, Yuuki Harano, 2020/11/24
- feature/pgtk f6d8c59 001/100: Introduce Pure GTK3 port, Yuuki Harano, 2020/11/24
- feature/pgtk a9c8a56 006/100: Fix xdg-open handling, Yuuki Harano, 2020/11/24
- feature/pgtk ed1f7d1 008/100: Simplify compilaiton condtion, Yuuki Harano, 2020/11/24
- feature/pgtk cdc04b4 010/100: Implement menubar for pgtk emacs, Yuuki Harano, 2020/11/24
- feature/pgtk 85441c9 016/100: Add Stipple support for PGTK, Yuuki Harano, 2020/11/24
- feature/pgtk bfbcb11 026/100: implement set-tool-bar-position and set-sticky, Yuuki Harano, 2020/11/24
- feature/pgtk af5b725 061/100: * src/pgtkmenu.c: change coding style, Yuuki Harano, 2020/11/24