[gtk/wip/baedert/single-node-window] /o\
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/baedert/single-node-window] /o\
- Date: Fri, 8 May 2020 14:14:39 +0000 (UTC)
commit 90e6c88fffefafee421ab2050ce384dc7c62e246
Author: Timm Bäder <mail baedert org>
Date: Sat May 2 18:50:53 2020 +0200
/o\
gtk/gtkwidget.c | 57 ++++++-
gtk/gtkwindow.c | 336 ++++++++++++++++++++++++-----------------
gtk/gtkwindowprivate.h | 4 -
gtk/theme/Adwaita/_common.scss | 4 +-
tests/testwidgetfocus.c | 2 +-
5 files changed, 250 insertions(+), 153 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index c392196fe6..f01f953839 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -3536,19 +3536,25 @@ gtk_widget_get_surface_allocation (GtkWidget *widget,
{
GtkWidget *parent;
graphene_rect_t bounds;
+ int native_x, native_y;
/* Don't consider the parent == widget case here. */
parent = _gtk_widget_get_parent (widget);
while (parent && !GTK_IS_NATIVE (parent))
parent = _gtk_widget_get_parent (parent);
+ if (GTK_IS_NATIVE (parent))
+ gtk_native_get_surface_transform (GTK_NATIVE (parent), &native_x, &native_y);
+ else
+ native_x = native_y = 0;
+
g_assert (GTK_IS_WINDOW (parent) || GTK_IS_POPOVER (parent));
if (gtk_widget_compute_bounds (widget, parent, &bounds))
{
*allocation = (GtkAllocation){
- floorf (bounds.origin.x),
- floorf (bounds.origin.y),
+ floorf (bounds.origin.x) + native_x,
+ floorf (bounds.origin.y) + native_y,
ceilf (bounds.size.width),
ceilf (bounds.size.height)
};
@@ -4645,11 +4651,29 @@ translate_event_coordinates (GdkEvent *event,
event_widget = gtk_get_event_widget (event);
+
if (!gtk_widget_compute_point (event_widget,
widget,
&GRAPHENE_POINT_INIT (event_x, event_y),
&p))
return FALSE;
+ /* POAH */
+ if (G_LIKELY (GTK_IS_NATIVE (event_widget)))
+ {
+ int transform_x, transform_y;
+
+ gtk_native_get_surface_transform (GTK_NATIVE (event_widget), &transform_x, &transform_y);
+
+ p.x -= transform_x;
+ p.y -= transform_y;
+ }
+
+ g_message ("Translating event from %s to %s: (%f, %f) -> (%f, %f)",
+ G_OBJECT_TYPE_NAME (event_widget), G_OBJECT_TYPE_NAME (widget),
+ event_x, event_y,
+ p.x, p.y);
+
+
*x = p.x;
*y = p.y;
@@ -9987,6 +10011,18 @@ gtk_widget_pick (GtkWidget *widget,
if (!gtk_widget_can_be_picked (widget, flags))
return NULL;
+ if (GTK_IS_NATIVE (widget))
+ {
+ int nx, ny;
+
+ gtk_native_get_surface_transform (GTK_NATIVE (widget), &nx, &ny);
+
+ g_message ("%s is a GtkNative, so subtracting %d/%d from the picking coordinates",
+ G_OBJECT_TYPE_NAME (widget), nx, ny);
+ x -= nx;
+ y -= ny;
+ }
+
return gtk_widget_do_pick (widget, x, y, flags);
}
@@ -11645,6 +11681,7 @@ gtk_widget_render (GtkWidget *widget,
GdkSurface *surface,
const cairo_region_t *region)
{
+ GtkWidgetPrivate *priv = gtk_widget_get_instance_private (widget);
GtkSnapshot *snapshot;
GskRenderer *renderer;
GskRenderNode *root;
@@ -11660,9 +11697,19 @@ gtk_widget_render (GtkWidget *widget,
return;
snapshot = gtk_snapshot_new ();
- gtk_native_get_surface_transform (GTK_NATIVE (widget), &x, &y);
- gtk_snapshot_translate (snapshot, &GRAPHENE_POINT_INIT (x, y));
- gtk_widget_snapshot (widget, snapshot);
+ /*gtk_native_get_surface_transform (GTK_NATIVE (widget), &x, &y);*/
+ /*gtk_snapshot_translate (snapshot, &GRAPHENE_POINT_INIT (x, y));*/
+
+ /*{*/
+ gtk_snapshot_save (snapshot);
+ gtk_snapshot_transform (snapshot, priv->transform);
+
+ gtk_widget_snapshot (widget, snapshot);
+
+ gtk_snapshot_restore (snapshot);
+
+
+ /*gtk_widget_snapshot (widget, snapshot);*/
root = gtk_snapshot_free_to_node (snapshot);
if (GDK_PROFILER_IS_RUNNING)
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index bdea5ad977..310bff94ba 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -258,8 +258,6 @@ typedef struct
GdkSurface *surface;
GskRenderer *renderer;
- cairo_region_t *extra_input_region;
-
GList *foci;
GtkConstraintSolver *constraint_solver;
@@ -722,6 +720,15 @@ gtk_window_get_request_mode (GtkWidget *widget)
return GTK_SIZE_REQUEST_CONSTANT_SIZE;
}
+static gboolean
+gtk_window_contains (GtkWidget *widget,
+ double x,
+ double y)
+{
+ g_message ("%s: %f, %f", __FUNCTION__, x, y);
+ return TRUE;
+}
+
static void
gtk_window_class_init (GtkWindowClass *klass)
{
@@ -754,6 +761,7 @@ gtk_window_class_init (GtkWindowClass *klass)
widget_class->move_focus = gtk_window_move_focus;
widget_class->measure = gtk_window_measure;
widget_class->css_changed = gtk_window_css_changed;
+ /*widget_class->contains = gtk_window_contains;*/
klass->activate_default = gtk_window_real_activate_default;
klass->activate_focus = gtk_window_real_activate_focus;
@@ -1526,6 +1534,91 @@ constraints_for_edge (GdkSurfaceEdge edge)
}
}
+static int
+get_edge_for_coordinates (GtkWindow *window,
+ double x,
+ double y)
+{
+ GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
+ GtkAllocation allocation;
+ GtkStyleContext *context;
+ gint handle_v, handle_h;
+ GtkBorder border;
+ gboolean supports_edge_constraints;
+ guint constraints;
+ GtkBorder handle_size;
+ int surface_width, surface_height;
+ GtkCssBoxes css_boxes;
+ const graphene_rect_t *border_rect;
+
+#define edge_or_minus_one(edge) ((priv->edge_constraints & constraints_for_edge (edge)) ? edge : -1)
+
+ if (!priv->client_decorated ||
+ !priv->resizable ||
+ priv->fullscreen ||
+ priv->maximized)
+ return -1;
+
+ supports_edge_constraints = gdk_toplevel_supports_edge_constraints (GDK_TOPLEVEL (priv->surface));
+ /*constraints = constraints_for_edge (edge);*/
+
+ if (!supports_edge_constraints && priv->tiled)
+ return -1;
+
+ /*if (supports_edge_constraints &&*/
+ /*(priv->edge_constraints & constraints) != constraints)*/
+ /*return FALSE;*/
+
+ gtk_css_boxes_init (&css_boxes, GTK_WIDGET (window));
+ border_rect = gtk_css_boxes_get_border_rect (&css_boxes);
+
+ surface_width = gdk_surface_get_width (priv->surface);
+ surface_height = gdk_surface_get_height (priv->surface);
+
+ if (priv->use_client_shadow)
+ {
+ /* TODO: Should probably not use the entire shadow size, hmm */
+ get_shadow_width (window, &handle_size);
+ }
+ else
+ {
+ g_assert (0);
+ }
+
+ if (x < 0 && x >= -handle_size.left)
+ {
+ if (y < 0 && y >= -handle_size.top)
+ return GDK_SURFACE_EDGE_NORTH_WEST;
+
+ if (y > border_rect->size.height && y <= border_rect->size.height + handle_size.bottom)
+ return GDK_SURFACE_EDGE_SOUTH_WEST;
+
+ return edge_or_minus_one (GDK_SURFACE_EDGE_WEST);
+ }
+ else if (x > border_rect->size.width && x <= border_rect->size.width + handle_size.right)
+ {
+ if (y < 0 && y >= -handle_size.top)
+ return GDK_SURFACE_EDGE_NORTH_EAST;
+
+ if (y > border_rect->size.height && y <= border_rect->size.height + handle_size.bottom)
+ return GDK_SURFACE_EDGE_SOUTH_EAST;
+
+ return GDK_SURFACE_EDGE_EAST;
+ }
+
+ if (y < 0 && y >= - handle_size.top)
+ {
+ /* NORTH_EAST is handled elsewhere */
+ return GDK_SURFACE_EDGE_NORTH;
+ }
+ else if (y > border_rect->size.height && y <= border_rect->size.height + handle_size.bottom)
+ {
+ return GDK_SURFACE_EDGE_SOUTH;
+ }
+
+ return -1;
+}
+
static gboolean
edge_under_coordinates (GtkWindow *window,
gint x,
@@ -1653,8 +1746,8 @@ edge_under_coordinates (GtkWindow *window,
static void
gtk_window_capture_motion (GtkWidget *widget,
- gdouble x,
- gdouble y)
+ double x,
+ double y)
{
GtkWindow *window = GTK_WINDOW (widget);
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
@@ -1664,18 +1757,29 @@ gtk_window_capture_motion (GtkWidget *widget,
"w-resize", "e-resize",
"sw-resize", "s-resize", "se-resize"
};
+ int edge;
+
+ g_message ("%s: %f, %f", __FUNCTION__, x, y);
+ /*g_critical ("");*/
g_clear_object (&priv->resize_cursor);
- for (i = 0; i < 8; i++)
+ edge = get_edge_for_coordinates (window, x, y);
+ g_message ("%s: Edge: %d", __FUNCTION__, edge);
+ if (edge != -1)
{
- if (edge_under_coordinates (GTK_WINDOW (widget), x, y, i))
- {
- priv->resize_cursor = gdk_cursor_new_from_name (cursor_names[i], NULL);
- break;
- }
+ priv->resize_cursor = gdk_cursor_new_from_name (cursor_names[edge], NULL);
}
+ /*for (i = 0; i < 8; i++)*/
+ /*{*/
+ /*if (edge_under_coordinates (GTK_WINDOW (widget), x, y, i))*/
+ /*{*/
+ /*priv->resize_cursor = gdk_cursor_new_from_name (cursor_names[i], NULL);*/
+ /*break;*/
+ /*}*/
+ /*}*/
+
gtk_window_maybe_update_cursor (window, widget, NULL);
}
@@ -2153,11 +2257,19 @@ gtk_window_native_get_surface_transform (GtkNative *native,
int *y)
{
GtkBorder shadow;
+ GtkCssBoxes css_boxes;
+ const graphene_rect_t *border_rect;
get_shadow_width (GTK_WINDOW (native), &shadow);
+ gtk_css_boxes_init (&css_boxes, GTK_WIDGET (native));
+ border_rect = gtk_css_boxes_get_border_rect (&css_boxes);
+
+
+
+ *x = shadow.left - border_rect->origin.x;
+ *y = shadow.top - border_rect->origin.y;
+
- *x = shadow.left;
- *y = shadow.right;
}
static void
@@ -4018,7 +4130,6 @@ gtk_window_finalize (GObject *object)
GtkWindow *window = GTK_WINDOW (object);
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
- g_clear_pointer (&priv->extra_input_region, cairo_region_destroy);
g_free (priv->title);
gtk_window_release_application (window);
@@ -4472,138 +4583,84 @@ check_scale_changed (GtkWindow *window)
_gtk_widget_scale_changed (widget);
}
-static void
-sum_borders (GtkBorder *one,
- GtkBorder *two)
-{
- one->top += two->top;
- one->right += two->right;
- one->bottom += two->bottom;
- one->left += two->left;
-}
-
-static void
-max_borders (GtkBorder *one,
- GtkBorder *two)
-{
- one->top = MAX (one->top, two->top);
- one->right = MAX (one->right, two->right);
- one->bottom = MAX (one->bottom, two->bottom);
- one->left = MAX (one->left, two->left);
-}
-
-static void
-subtract_borders (GtkBorder *one,
- GtkBorder *two)
-{
- one->top -= two->top;
- one->right -= two->right;
- one->bottom -= two->bottom;
- one->left -= two->left;
-}
-
static void
get_shadow_width (GtkWindow *window,
GtkBorder *shadow_width)
{
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
- GtkBorder border = { 0 };
- GtkBorder d = { 0 };
+ GtkBorder shadow;
GtkBorder margin;
- GtkStyleContext *context;
- GtkCssValue *shadows;
-
- *shadow_width = border;
+ GtkCssStyle *style;
if (!priv->decorated)
- return;
+ goto out;
if (!priv->client_decorated &&
!(gtk_window_should_use_csd (window) &&
gtk_window_supports_client_shadow (window)))
- return;
+ goto out;
if (priv->maximized ||
priv->fullscreen)
- return;
-
- context = _gtk_widget_get_style_context (GTK_WIDGET (window));
+ goto out;
- /* Always sum border + padding */
- gtk_style_context_get_border (context, &border);
- gtk_style_context_get_padding (context, &d);
- sum_borders (&d, &border);
+ style = gtk_css_node_get_style (gtk_widget_get_css_node (GTK_WIDGET (window)));
/* Calculate the size of the drop shadows ... */
- shadows = _gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BOX_SHADOW);
- gtk_css_shadow_value_get_extents (shadows, &border);
+ gtk_css_shadow_value_get_extents (style->background->box_shadow, &shadow);
/* ... and compare it to the margin size, which we use for resize grips */
- gtk_style_context_get_margin (context, &margin);
- max_borders (&border, &margin);
+ gtk_style_context_get_margin (gtk_widget_get_style_context (GTK_WIDGET (window)), &margin);
- sum_borders (&d, &border);
- *shadow_width = d;
+ shadow_width->left = MAX (shadow.left, margin.left);
+ shadow_width->top = MAX (shadow.top, margin.top);
+ shadow_width->right = MAX (shadow.right, margin.right);
+ shadow_width->bottom = MAX (shadow.bottom, margin.bottom);
+
+ g_assert_cmpint (shadow_width->left, >=, 0);
+ g_assert_cmpint (shadow_width->top, >=, 0);
+ g_assert_cmpint (shadow_width->right, >=, 0);
+ g_assert_cmpint (shadow_width->bottom, >=, 0);
+ return;
+
+out:
+ *shadow_width = (GtkBorder) {0, 0, 0, 0};
}
static void
update_csd_shape (GtkWindow *window)
{
- GtkWidget *widget = (GtkWidget *)window;
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
cairo_rectangle_int_t rect;
- GtkBorder border, tmp;
GtkBorder window_border;
- GtkStyleContext *context;
if (!priv->client_decorated)
return;
- context = _gtk_widget_get_style_context (widget);
-
- /*gtk_style_context_save_to_node (context, priv->decoration_node);*/
- gtk_style_context_get_margin (context, &border);
- gtk_style_context_get_border (context, &tmp);
- sum_borders (&border, &tmp);
- gtk_style_context_get_padding (context, &tmp);
- sum_borders (&border, &tmp);
- /*gtk_style_context_restore (context);*/
get_shadow_width (window, &window_border);
/* update the input shape, which makes it so that clicks
- * outside the border windows go through.
- */
-
- subtract_borders (&window_border, &border);
-
+ * outside the border windows go through. */
rect.x = window_border.left;
rect.y = window_border.top;
- rect.width = gtk_widget_get_allocated_width (widget) - window_border.left - window_border.right;
- rect.height = gtk_widget_get_allocated_height (widget) - window_border.top - window_border.bottom;
+ rect.width = gdk_surface_get_width (priv->surface) - window_border.left - window_border.right;
+ rect.height = gdk_surface_get_height (priv->surface) - window_border.top - window_border.bottom;
+
+
+ rect.x = 0;
+ rect.y = 0;
+ rect.width = gdk_surface_get_width (priv->surface);
+ rect.height = gdk_surface_get_height (priv->surface);
if (rect.width > 0 && rect.height > 0)
{
cairo_region_t *region = cairo_region_create_rectangle (&rect);
- if (priv->extra_input_region)
- cairo_region_intersect (region, priv->extra_input_region);
-
gdk_surface_set_input_region (priv->surface, region);
cairo_region_destroy (region);
}
}
-void
-gtk_window_set_extra_input_region (GtkWindow *window,
- cairo_region_t *region)
-{
- GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
-
- g_clear_pointer (&priv->extra_input_region, cairo_region_destroy);
- priv->extra_input_region = cairo_region_copy (region);
- update_csd_shape (window);
-}
-
static void
corner_rect (cairo_rectangle_int_t *rect,
const GtkCssValue *value)
@@ -4627,8 +4684,6 @@ subtract_decoration_corners_from_region (cairo_region_t *region,
priv->maximized)
return;
- /*gtk_style_context_save_to_node (context, priv->decoration_node);*/
-
corner_rect (&rect, _gtk_style_context_peek_property (context, GTK_CSS_PROPERTY_BORDER_TOP_LEFT_RADIUS));
rect.x = extents->x;
rect.y = extents->y;
@@ -4648,14 +4703,11 @@ subtract_decoration_corners_from_region (cairo_region_t *region,
rect.x = extents->x + extents->width - rect.width;
rect.y = extents->y + extents->height - rect.height;
cairo_region_subtract_rectangle (region, &rect);
-
- /*gtk_style_context_restore (context);*/
}
static void
-update_opaque_region (GtkWindow *window,
- const GtkBorder *border,
- const GtkAllocation *allocation)
+update_opaque_region (GtkWindow *window,
+ const GtkBorder *border)
{
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
GtkWidget *widget = GTK_WIDGET (window);
@@ -4664,7 +4716,7 @@ update_opaque_region (GtkWindow *window,
gboolean is_opaque = FALSE;
if (!_gtk_widget_get_realized (widget))
- return;
+ return;
context = gtk_widget_get_style_context (widget);
@@ -4679,8 +4731,8 @@ update_opaque_region (GtkWindow *window,
rect.x = border->left;
rect.y = border->top;
- rect.width = allocation->width - border->left - border->right;
- rect.height = allocation->height - border->top - border->bottom;
+ rect.width = gdk_surface_get_width (priv->surface) - border->left - border->right;
+ rect.height = gdk_surface_get_height (priv->surface) - border->top - border->bottom;
opaque_region = cairo_region_create_rectangle (&rect);
@@ -4697,20 +4749,26 @@ update_opaque_region (GtkWindow *window,
}
static void
-update_realized_window_properties (GtkWindow *window,
- GtkAllocation *child_allocation,
- GtkBorder *window_border)
+update_realized_window_properties (GtkWindow *window,
+ GtkAllocation *child_allocation,
+ const GtkBorder *window_border)
{
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
if (priv->surface && priv->client_decorated && priv->use_client_shadow)
- gdk_surface_set_shadow_width (priv->surface,
- window_border->left,
- window_border->right,
- window_border->top,
- window_border->bottom);
+ {
+ g_assert_cmpint (window_border->left, >=, 0);
+ g_assert_cmpint (window_border->top, >=, 0);
+ g_assert_cmpint (window_border->right, >=, 0);
+ g_assert_cmpint (window_border->bottom, >=, 0);
+ gdk_surface_set_shadow_width (priv->surface,
+ window_border->left,
+ window_border->right,
+ window_border->top,
+ window_border->bottom);
+ }
- update_opaque_region (window, window_border, child_allocation);
+ update_opaque_region (window, window_border);
update_csd_shape (window);
}
@@ -4740,6 +4798,7 @@ gtk_window_realize (GtkWidget *widget)
allocation.y = shadow.top;
allocation.width = request.width - shadow.left - shadow.right;
allocation.height = request.height - shadow.top - shadow.bottom;
+
gtk_widget_size_allocate (widget, &allocation, -1);
gtk_widget_queue_resize (widget);
@@ -5203,11 +5262,10 @@ get_active_region_type (GtkWindow *window, gint x, gint y)
if (priv->client_decorated)
{
- for (i = 0; i < 8; i++)
- {
- if (edge_under_coordinates (window, x, y, i))
- return i;
- }
+ int edge = get_edge_for_coordinates (window, x, y);
+
+ if (edge != -1)
+ return (GtkWindowRegion)edge;
}
if (priv->title_box != NULL &&
@@ -5640,13 +5698,11 @@ gtk_window_css_changed (GtkWidget *widget,
if (!_gtk_widget_get_alloc_needed (widget) &&
(change == NULL || gtk_css_style_change_changes_property (change, GTK_CSS_PROPERTY_BACKGROUND_COLOR)))
{
- GtkAllocation allocation;
- GtkBorder window_border;
+ GtkBorder shadow;
- gtk_widget_get_allocation (widget, &allocation);
- get_shadow_width (window, &window_border);
+ get_shadow_width (window, &shadow);
- update_opaque_region (window, &window_border, &allocation);
+ update_opaque_region (window, &shadow);
}
}
@@ -5940,7 +5996,6 @@ gtk_window_do_popup (GtkWindow *window,
/* This function doesn't constrain to geometry hints */
static void
gtk_window_compute_configure_request_size (GtkWindow *window,
- GdkGeometry *geometry,
guint flags,
gint *width,
gint *height)
@@ -6035,7 +6090,7 @@ gtk_window_compute_configure_request (GtkWindow *window,
gtk_window_compute_hints (window, &new_geometry, &new_flags);
gtk_window_compute_configure_request_size (window,
- &new_geometry, new_flags,
+ new_flags,
&w, &h);
gtk_window_update_fixed_size (window, &new_geometry, w, h);
gtk_window_constrain_size (window,
@@ -6057,14 +6112,10 @@ gtk_window_compute_configure_request (GtkWindow *window,
y = 0;
}
- GtkBorder shadow = {0, };
-
- /*get_shadow_width (window, &shadow);*/
-
request->x = x;
request->y = y;
- request->width = w + shadow.left + shadow.right;
- request->height = h + shadow.top + shadow.bottom;
+ request->width = w;
+ request->height = h;
if (geometry)
*geometry = new_geometry;
@@ -6242,10 +6293,10 @@ gtk_window_move_resize (GtkWindow *window)
gtk_widget_measure (widget, GTK_ORIENTATION_HORIZONTAL, -1,
&min, NULL, NULL, NULL);
- allocation.width = MAX (min, current_width);
+ allocation.width = MAX (min, current_width - shadow.left - shadow.right);
gtk_widget_measure (widget, GTK_ORIENTATION_VERTICAL, allocation.width,
&min, NULL, NULL, NULL);
- allocation.height = MAX (min, current_height);
+ allocation.height = MAX (min, current_height - shadow.top - shadow.bottom);
gtk_widget_size_allocate (widget, &allocation, -1);
@@ -6480,6 +6531,7 @@ gtk_window_update_fixed_size (GtkWindow *window,
if (info->default_width > -1)
{
gint w = MAX (MAX (default_width_csd, new_width), new_geometry->min_width);
+ g_critical ("TODO: Probably need to add the shadow size here as well");
new_geometry->min_width = w;
new_geometry->max_width = w;
}
@@ -6500,12 +6552,13 @@ gtk_window_update_fixed_size (GtkWindow *window,
*/
static void
gtk_window_compute_hints (GtkWindow *window,
- GdkGeometry *new_geometry,
- guint *new_flags)
+ GdkGeometry *new_geometry,
+ guint *new_flags)
{
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
GtkWidget *widget;
GtkRequisition requisition;
+ GtkBorder shadow;
widget = GTK_WIDGET (window);
@@ -6529,10 +6582,11 @@ gtk_window_compute_hints (GtkWindow *window,
new_geometry->base_width = 0;
new_geometry->base_height = 0;
+ get_shadow_width (window, &shadow);
*new_flags |= GDK_HINT_MIN_SIZE;
- new_geometry->min_width = requisition.width;
- new_geometry->min_height = requisition.height;
-
+ new_geometry->min_width = requisition.width + shadow.left + shadow.right;
+ new_geometry->min_height = requisition.height + shadow.top + shadow.bottom;
+
if (!priv->resizable)
{
*new_flags |= GDK_HINT_MAX_SIZE;
diff --git a/gtk/gtkwindowprivate.h b/gtk/gtkwindowprivate.h
index 32141ad77a..8ed1564b5a 100644
--- a/gtk/gtkwindowprivate.h
+++ b/gtk/gtkwindowprivate.h
@@ -132,10 +132,6 @@ GtkWidget * gtk_window_pick_popover (GtkWindow *window,
double y,
GtkPickFlags flags);
-void gtk_window_set_extra_input_region (GtkWindow *window,
- cairo_region_t *region);
-
-
G_END_DECLS
#endif /* __GTK_WINDOW_PRIVATE_H__ */
diff --git a/gtk/theme/Adwaita/_common.scss b/gtk/theme/Adwaita/_common.scss
index 14663a65dc..8ceef41acc 100644
--- a/gtk/theme/Adwaita/_common.scss
+++ b/gtk/theme/Adwaita/_common.scss
@@ -4052,8 +4052,8 @@ colorchooser .popover.osd { border-radius: 5px; }
/**********************
* Window Decorations *
*********************/
-decoration,
-window {
+window,
+dialog {
border-radius: $window_radius $window_radius 0 0;
// lamefun trick to get rounded borders regardless of CSD use
border-width: 0px;
diff --git a/tests/testwidgetfocus.c b/tests/testwidgetfocus.c
index 9a9ea5302a..d0c8d58436 100644
--- a/tests/testwidgetfocus.c
+++ b/tests/testwidgetfocus.c
@@ -295,7 +295,7 @@ main(int argc, char **argv)
window = gtk_window_new ();
widget = g_object_new (GTK_TYPE_FOCUS_WIDGET, NULL);
- gtk_window_set_decorated (GTK_WINDOW (window), FALSE);
+ /*gtk_window_set_decorated (GTK_WINDOW (window), FALSE);*/
gtk_window_set_child (GTK_WINDOW (window), widget);
g_signal_connect (window, "destroy", G_CALLBACK (quit_cb), &done);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]