summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-03-31 18:32:18 +0000
committerMatthias Clasen <mclasen@redhat.com>2020-03-31 18:32:18 +0000
commite4fb4b635cb78694b60ca1d49c029bb066b6a8c3 (patch)
tree538a7fb7f0e939c71959b7d3e5ef3df3cb1dc893
parent2f64651a3f10d350a80e0c74c4655925e7cfb3cf (diff)
parent5432f73095ac18f6dcd9efb4ba8b4763308c6e89 (diff)
downloadgtk+-e4fb4b635cb78694b60ca1d49c029bb066b6a8c3.tar.gz
Merge branch 'matthiasc/for-master' into 'master'
Matthiasc/for master See merge request GNOME/gtk!1591
-rw-r--r--NEWS20
-rw-r--r--gtk/gtkwindow.c38
2 files changed, 45 insertions, 13 deletions
diff --git a/NEWS b/NEWS
index a060224a89..d38ba7dd94 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,23 @@
+Overview of Changes in GTK 3.98.2
+=================================
+
+* Introduce GtkShortcutController, and replace key bindings,
+ mnemonics and accelerators by GtkShortcut
+
+* Derive the HighContrast theme from Adwaita
+
+* GtkMenuButton: Add a use-underline property
+
+* GtkTreeView: Fix cell editing
+
+* Add gdk_toplevel_inhibit_system_shortcuts
+
+* gtk-demo: Fix issues in multiple demos
+
+* Translation updates:
+ Polish
+
+
Overview of Changes in GTK 3.98.1
=================================
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 7f1ec9e020..d57810aa43 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -257,6 +257,7 @@ typedef struct
GList *foci;
GtkConstraintSolver *constraint_solver;
+ GdkToplevelLayout *layout;
} GtkWindowPrivate;
enum {
@@ -4194,7 +4195,6 @@ static void
gtk_window_present_toplevel (GtkWindow *window)
{
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
- GdkToplevelLayout *layout;
GdkRectangle request;
GdkGeometry geometry;
GdkSurfaceHints flags;
@@ -4205,13 +4205,13 @@ gtk_window_present_toplevel (GtkWindow *window)
if (!(flags & GDK_HINT_MIN_SIZE))
geometry.min_width = geometry.min_height = 1;
- layout = gtk_window_compute_layout (window, geometry.min_width, geometry.min_height);
+ if (!priv->layout)
+ priv->layout = gtk_window_compute_layout (window, geometry.min_width, geometry.min_height);
gdk_toplevel_present (GDK_TOPLEVEL (priv->surface),
request.width,
request.height,
- layout);
- gdk_toplevel_layout_unref (layout);
+ priv->layout);
}
static void
@@ -4219,17 +4219,24 @@ gtk_window_update_toplevel (GtkWindow *window)
{
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
-
if (priv->surface && gdk_surface_get_mapped (priv->surface))
{
- GdkToplevelLayout *layout;
+ int min_width = 1;
+ int min_height = 1;
+
+ if (priv->layout)
+ {
+ min_width = gdk_toplevel_layout_get_min_width (priv->layout);
+ min_height = gdk_toplevel_layout_get_min_height (priv->layout);
+ }
+
+ g_clear_pointer (&priv->layout, gdk_toplevel_layout_unref);
+ priv->layout = gtk_window_compute_layout (window, min_width, min_height);
- layout = gtk_window_compute_layout (window, 1, 1);
gdk_toplevel_present (GDK_TOPLEVEL (priv->surface),
gdk_surface_get_width (priv->surface),
gdk_surface_get_height (priv->surface),
- layout);
- gdk_toplevel_layout_unref (layout);
+ priv->layout);
}
}
@@ -6105,7 +6112,6 @@ gtk_window_move_resize (GtkWindow *window)
gboolean hints_changed; /* do we need to send these again */
GtkWindowLastGeometryInfo saved_last_info;
int current_width, current_height;
- GdkToplevelLayout *layout;
widget = GTK_WIDGET (window);
@@ -6118,6 +6124,13 @@ gtk_window_move_resize (GtkWindow *window)
gtk_window_compute_configure_request (window, &new_request,
&new_geometry, &new_flags);
+ if (!(new_flags & GDK_HINT_MIN_SIZE))
+ new_geometry.min_width = new_geometry.min_height = 1;
+
+ g_clear_pointer (&priv->layout, gdk_toplevel_layout_unref);
+ priv->layout = gtk_window_compute_layout (window, new_geometry.min_width, new_geometry.min_height);
+
+
/* This check implies the invariant that we never set info->last
* without setting the hints and sending off a configure request.
*
@@ -6267,6 +6280,7 @@ gtk_window_move_resize (GtkWindow *window)
* to postpone our configure request until later.
*/
info->last = saved_last_info;
+ g_clear_pointer (&priv->layout, gdk_toplevel_layout_unref);
gtk_widget_queue_resize (widget); /* might recurse for GTK_RESIZE_IMMEDIATE */
}
@@ -6320,11 +6334,9 @@ gtk_window_move_resize (GtkWindow *window)
if (configure_request_pos_changed)
g_warning ("configure request position changed. This should not happen. Ignoring the position");
- layout = gtk_window_compute_layout (window, 1, 1);
gdk_toplevel_present (GDK_TOPLEVEL (priv->surface),
new_request.width, new_request.height,
- layout);
- gdk_toplevel_layout_unref (layout);
+ priv->layout);
}
else
{