summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/tools/widgets.c1
-rw-r--r--gtk/gtkrange.c105
-rw-r--r--gtk/gtkstatusbar.c183
-rw-r--r--gtk/gtkwindow.c436
-rw-r--r--gtk/gtkwindow.h8
-rw-r--r--tests/styleexamples.c1
-rw-r--r--testsuite/gtk/testing.c2
-rw-r--r--testsuite/reftests/toplevel-vs-popup.ui1
8 files changed, 25 insertions, 712 deletions
diff --git a/docs/tools/widgets.c b/docs/tools/widgets.c
index f3dc8bee1f..c468f5a8c6 100644
--- a/docs/tools/widgets.c
+++ b/docs/tools/widgets.c
@@ -35,7 +35,6 @@ new_widget_info (const char *name,
else
{
info->window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_has_resize_grip (GTK_WINDOW (info->window), FALSE);
gtk_container_set_border_width (GTK_CONTAINER (info->window), 12);
info->include_decorations = FALSE;
gtk_widget_show_all (widget);
diff --git a/gtk/gtkrange.c b/gtk/gtkrange.c
index ae74045b22..7c7e3f0a69 100644
--- a/gtk/gtkrange.c
+++ b/gtk/gtkrange.c
@@ -206,8 +206,6 @@ static void gtk_range_get_preferred_height
gint *natural);
static void gtk_range_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
-static void gtk_range_hierarchy_changed (GtkWidget *widget,
- GtkWidget *previous_toplevel);
static void gtk_range_realize (GtkWidget *widget);
static void gtk_range_unrealize (GtkWidget *widget);
static void gtk_range_map (GtkWidget *widget);
@@ -322,7 +320,6 @@ gtk_range_class_init (GtkRangeClass *class)
widget_class->get_preferred_width = gtk_range_get_preferred_width;
widget_class->get_preferred_height = gtk_range_get_preferred_height;
widget_class->size_allocate = gtk_range_size_allocate;
- widget_class->hierarchy_changed = gtk_range_hierarchy_changed;
widget_class->realize = gtk_range_realize;
widget_class->unrealize = gtk_range_unrealize;
widget_class->map = gtk_range_map;
@@ -1623,81 +1620,6 @@ gtk_range_get_preferred_height (GtkWidget *widget,
*minimum = *natural = range_rect.height + border.top + border.bottom;
}
-static gboolean
-modify_allocation_for_window_grip (GtkWidget *widget,
- GtkAllocation *allocation)
-{
- GtkRange *range = GTK_RANGE (widget);
- GtkRangePrivate *priv = range->priv;
- GtkWidget *window, *parent;
- GdkRectangle grip_rect;
- GdkRectangle translated_rect;
- gint x;
- gint y;
-
- window = gtk_widget_get_toplevel (widget);
- if (!GTK_IS_WINDOW (window))
- return FALSE;
-
- if (!gtk_window_resize_grip_is_visible (GTK_WINDOW (window)))
- return FALSE;
-
- /* Get the area of the window's corner grip */
- gtk_window_get_resize_grip_area (GTK_WINDOW (window), &grip_rect);
-
- x = 0;
- y = 0;
-
- /* Translate the stepper's area into window coords.
- * This is slightly tricky. We can't just use
- * gtk_widget_translate_coordinates (widget, window, 0, 0, &x, &y)
- * since that translates wrt to the _current_ allocation
- * and will lead to alternating between overlap and nonoverlap
- * for successive allocations.
- * Therefore, we find the window-widget to whose window allocation
- * is relative, and translate from there upwards.
- */
- parent = widget;
- while (gtk_widget_get_window (parent) == gtk_widget_get_window (widget) &&
- parent != window)
- {
- parent = gtk_widget_get_parent (parent);
- }
-
- if (parent == window)
- translated_rect = *allocation;
- else
- {
- gtk_widget_translate_coordinates (parent,
- window,
- allocation->x, allocation->y,
- &x, &y);
- translated_rect.x = x;
- translated_rect.y = y;
- translated_rect.width = allocation->width;
- translated_rect.height = allocation->height;
- }
-
- /* If the stepper button intersects the window resize grip.. */
- if (gdk_rectangle_intersect (&grip_rect, &translated_rect, &grip_rect))
- {
- if (priv->orientation == GTK_ORIENTATION_HORIZONTAL)
- {
- allocation->width -= grip_rect.width;
- if (gtk_widget_get_direction (window) == GTK_TEXT_DIR_RTL)
- allocation->x += grip_rect.width;
- }
- else
- {
- allocation->height -= grip_rect.height;
- }
-
- return TRUE;
- }
-
- return FALSE;
-}
-
static void
gtk_range_size_allocate (GtkWidget *widget,
GtkAllocation *allocation)
@@ -1705,7 +1627,6 @@ gtk_range_size_allocate (GtkWidget *widget,
GtkRange *range = GTK_RANGE (widget);
GtkRangePrivate *priv = range->priv;
- modify_allocation_for_window_grip (widget, allocation);
gtk_widget_set_allocation (widget, allocation);
priv->recalc_marks = TRUE;
@@ -1720,30 +1641,6 @@ gtk_range_size_allocate (GtkWidget *widget,
}
static void
-resize_grip_visible_changed (GObject *object,
- GParamSpec *pspec,
- gpointer user_data)
-{
- gtk_widget_queue_resize (GTK_WIDGET (user_data));
-}
-
-static void
-gtk_range_hierarchy_changed (GtkWidget *widget,
- GtkWidget *previous_toplevel)
-{
- GtkWidget *window;
-
- if (previous_toplevel)
- g_signal_handlers_disconnect_by_func (previous_toplevel,
- G_CALLBACK (resize_grip_visible_changed),
- widget);
- window = gtk_widget_get_toplevel (widget);
- if (gtk_widget_is_toplevel (window))
- g_signal_connect (window, "notify::resize-grip-visible",
- G_CALLBACK (resize_grip_visible_changed), widget);
-}
-
-static void
gtk_range_realize (GtkWidget *widget)
{
GtkAllocation allocation;
@@ -1762,8 +1659,6 @@ gtk_range_realize (GtkWidget *widget)
g_object_ref (window);
gtk_widget_get_allocation (widget, &allocation);
- if (modify_allocation_for_window_grip (widget, &allocation))
- gtk_widget_set_allocation (widget, &allocation);
attributes.window_type = GDK_WINDOW_CHILD;
attributes.x = allocation.x;
diff --git a/gtk/gtkstatusbar.c b/gtk/gtkstatusbar.c
index 7b69ce70c6..a49457f0f3 100644
--- a/gtk/gtkstatusbar.c
+++ b/gtk/gtkstatusbar.c
@@ -106,13 +106,7 @@ enum
static void gtk_statusbar_update (GtkStatusbar *statusbar,
guint context_id,
const gchar *text);
-static void gtk_statusbar_realize (GtkWidget *widget);
static void gtk_statusbar_destroy (GtkWidget *widget);
-static void gtk_statusbar_size_allocate (GtkWidget *widget,
- GtkAllocation *allocation);
-static void gtk_statusbar_hierarchy_changed (GtkWidget *widget,
- GtkWidget *previous_toplevel);
-
static guint statusbar_signals[SIGNAL_LAST] = { 0 };
@@ -123,10 +117,7 @@ gtk_statusbar_class_init (GtkStatusbarClass *class)
{
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
- widget_class->realize = gtk_statusbar_realize;
widget_class->destroy = gtk_statusbar_destroy;
- widget_class->size_allocate = gtk_statusbar_size_allocate;
- widget_class->hierarchy_changed = gtk_statusbar_hierarchy_changed;
class->text_pushed = gtk_statusbar_update;
class->text_popped = gtk_statusbar_update;
@@ -547,177 +538,3 @@ gtk_statusbar_destroy (GtkWidget *widget)
GTK_WIDGET_CLASS (gtk_statusbar_parent_class)->destroy (widget);
}
-
-/* look for extra children between the frame containing
- * the label and where we want to draw the resize grip
- */
-static gboolean
-has_extra_children (GtkStatusbar *statusbar)
-{
- GtkStatusbarPrivate *priv = statusbar->priv;
- GtkPackType child_pack_type, frame_pack_type;
- GtkWidget *child, *frame;
- GList *l, *children;
- gboolean retval = FALSE;
-
- frame = NULL;
- children = _gtk_box_get_children (GTK_BOX (statusbar));
- for (l = children; l; l = l->next)
- {
- frame = l->data;
-
- if (frame == priv->frame)
- break;
- }
-
- gtk_box_query_child_packing (GTK_BOX (statusbar), frame,
- NULL, NULL, NULL, &frame_pack_type);
-
- for (l = l->next; l; l = l->next)
- {
- child = l->data;
-
- if (!gtk_widget_get_visible (child))
- continue;
-
- gtk_box_query_child_packing (GTK_BOX (statusbar), child,
- NULL, NULL, NULL, &child_pack_type);
-
- if (frame_pack_type == GTK_PACK_START || child_pack_type == GTK_PACK_END)
- {
- retval = TRUE;
- break;
- }
- }
-
- g_list_free (children);
-
- return retval;
-}
-
-static void
-gtk_statusbar_size_allocate (GtkWidget *widget,
- GtkAllocation *allocation)
-{
- GtkStatusbar *statusbar = GTK_STATUSBAR (widget);
- GtkStatusbarPrivate *priv = statusbar->priv;
- gboolean extra_children = FALSE;
- gboolean has_resize_grip = FALSE;
- GdkRectangle rect;
- GtkWidget *window;
- gint x, y;
- GdkRectangle translated_rect;
-
- window = gtk_widget_get_toplevel (widget);
-
- if (GTK_IS_WINDOW (window) &&
- gtk_window_resize_grip_is_visible (GTK_WINDOW (window)))
- {
- gtk_window_get_resize_grip_area (GTK_WINDOW (window), &rect);
- if (gtk_widget_translate_coordinates (widget, window, 0, 0, &x, &y))
- {
- translated_rect.x = x;
- translated_rect.y = y;
- translated_rect.width = allocation->width;
- translated_rect.height = allocation->height;
-
- if (gdk_rectangle_intersect (&rect, &translated_rect, NULL))
- {
- has_resize_grip = TRUE;
- extra_children = has_extra_children (statusbar);
-
- /* If there are extra children, we don't want them to occupy
- * the space where we draw the resize grip, so we temporarily
- * shrink the allocation.
- * If there are no extra children, we want the frame to get
- * the full allocation, and we fix up the allocation of the
- * label afterwards to make room for the grip.
- */
- if (extra_children)
- {
- allocation->width -= rect.width;
- if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
- allocation->x += rect.width;
- }
- }
- }
- }
-
- /* chain up normally */
- GTK_WIDGET_CLASS (gtk_statusbar_parent_class)->size_allocate (widget, allocation);
-
- if (has_resize_grip)
- {
- if (extra_children)
- {
- allocation->width += rect.width;
- if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
- allocation->x -= rect.width;
-
- gtk_widget_set_allocation (widget, allocation);
- }
- else
- {
- GtkAllocation child_allocation, frame_allocation;
- GtkWidget *child;
-
- /* Use the frame's child instead of statusbar->label directly, in case
- * the label has been replaced by a container as the frame's child
- * (and the label reparented into that container).
- */
- child = gtk_bin_get_child (GTK_BIN (priv->frame));
-
- gtk_widget_get_allocation (child, &child_allocation);
- gtk_widget_get_allocation (priv->frame, &frame_allocation);
- if (child_allocation.width + rect.width > frame_allocation.width)
- {
- /* shrink the label to make room for the grip */
- *allocation = child_allocation;
- allocation->width = MAX (1, allocation->width - rect.width);
- if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
- allocation->x += child_allocation.width - allocation->width;
-
- gtk_widget_size_allocate (child, allocation);
- }
- }
- }
-}
-
-static void
-resize_grip_visible_changed (GObject *object,
- GParamSpec *pspec,
- gpointer user_data)
-{
- GtkStatusbar *statusbar = GTK_STATUSBAR (user_data);
- GtkStatusbarPrivate *priv = statusbar->priv;
-
- gtk_widget_queue_resize (priv->label);
- gtk_widget_queue_resize (priv->frame);
- gtk_widget_queue_resize (GTK_WIDGET (statusbar));
-}
-
-static void
-gtk_statusbar_hierarchy_changed (GtkWidget *widget,
- GtkWidget *previous_toplevel)
-{
- GtkWidget *window;
-
- if (previous_toplevel)
- g_signal_handlers_disconnect_by_func (previous_toplevel,
- G_CALLBACK (resize_grip_visible_changed),
- widget);
- window = gtk_widget_get_toplevel (widget);
- if (GTK_IS_WINDOW (window))
- g_signal_connect (window, "notify::resize-grip-visible",
- G_CALLBACK (resize_grip_visible_changed), widget);
-
- resize_grip_visible_changed (NULL, NULL, widget);
-}
-
-static void
-gtk_statusbar_realize (GtkWidget *widget)
-{
- GTK_WIDGET_CLASS (gtk_statusbar_parent_class)->realize (widget);
-
- resize_grip_visible_changed (NULL, NULL, widget);
-}
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 45db97374e..b5234f7714 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -88,11 +88,6 @@
* of the windowing system and allow the user to manipulate the window
* (resize it, move it, close it,...).
*
- * GTK+ also allows windows to have a resize grip (a small area in the lower
- * right or left corner) which can be clicked to resize the window. To
- * control whether a window has a resize grip, use
- * gtk_window_set_has_resize_grip().
- *
* # GtkWindow as GtkBuildable
*
* The GtkWindow implementation of the GtkBuildable interface supports a
@@ -149,8 +144,6 @@ struct _GtkWindowPrivate
GdkModifierType mnemonic_modifier;
GdkWindowTypeHint gdk_type_hint;
- GdkWindow *grip_window;
-
gchar *startup_id;
gchar *title;
gchar *wmclass_class;
@@ -219,10 +212,6 @@ struct _GtkWindowPrivate
* GDK_WINDOW_TYPE_HINT_NORMAL
*/
guint urgent : 1;
- guint has_resize_grip : 1;
- guint resize_grip_visible : 1; /* don't use, just for "resize-
- * grip-visible" notification
- */
guint gravity : 5; /* GdkGravity */
guint csd_requested : 1;
guint client_decorated : 1; /* Decorations drawn client-side */
@@ -414,10 +403,6 @@ static void gtk_window_move_focus (GtkWidget *widget,
GtkDirectionType dir);
static void gtk_window_real_set_focus (GtkWindow *window,
GtkWidget *focus);
-static void gtk_window_direction_changed (GtkWidget *widget,
- GtkTextDirection prev_dir);
-static void gtk_window_state_changed (GtkWidget *widget,
- GtkStateType previous_state);
static void gtk_window_real_activate_default (GtkWindow *window);
static void gtk_window_real_activate_focus (GtkWindow *window);
@@ -474,9 +459,6 @@ static GList *icon_list_from_theme (GtkWidget *widget,
const gchar *name);
static void gtk_window_realize_icon (GtkWindow *window);
static void gtk_window_unrealize_icon (GtkWindow *window);
-static void resize_grip_create_window (GtkWindow *window);
-static void resize_grip_destroy_window (GtkWindow *window);
-static void update_grip_visibility (GtkWindow *window);
static void update_window_buttons (GtkWindow *window);
static void get_shadow_width (GtkWidget *widget,
GtkBorder *shadow_width);
@@ -681,8 +663,6 @@ gtk_window_class_init (GtkWindowClass *klass)
widget_class->move_focus = gtk_window_move_focus;
widget_class->draw = gtk_window_draw;
widget_class->window_state_event = gtk_window_state_event;
- widget_class->direction_changed = gtk_window_direction_changed;
- widget_class->state_changed = gtk_window_state_changed;
widget_class->style_updated = gtk_window_style_updated;
widget_class->get_preferred_width = gtk_window_get_preferred_width;
widget_class->get_preferred_width_for_height = gtk_window_get_preferred_width_for_height;
@@ -998,6 +978,8 @@ gtk_window_class_init (GtkWindowClass *klass)
* #GtkWindow:resize-grip-visible to find out if the resize
* grip is currently shown.
*
+ * Deprecated: 3.14: Resize grips have been removed.
+ *
* Since: 3.0
*/
g_object_class_install_property (gobject_class,
@@ -1006,13 +988,15 @@ gtk_window_class_init (GtkWindowClass *klass)
P_("Resize grip"),
P_("Specifies whether the window should have a resize grip"),
TRUE,
- GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY));
+ GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY|G_PARAM_DEPRECATED));
/**
* GtkWindow:resize-grip-visible:
*
* Whether a corner resize grip is currently shown.
*
+ * Deprecated: 3.14: Resize grips have been removed.
+ *
* Since: 3.0
*/
g_object_class_install_property (gobject_class,
@@ -1021,7 +1005,7 @@ gtk_window_class_init (GtkWindowClass *klass)
P_("Resize grip is visible"),
P_("Specifies whether the window's resize grip is visible."),
FALSE,
- GTK_PARAM_READABLE));
+ GTK_PARAM_READABLE|G_PARAM_DEPRECATED));
/**
@@ -1539,7 +1523,6 @@ gtk_window_init (GtkWindow *window)
priv->type_hint = GDK_WINDOW_TYPE_HINT_NORMAL;
priv->startup_id = NULL;
priv->initial_timestamp = GDK_CURRENT_TIME;
- priv->has_resize_grip = TRUE;
priv->mnemonics_visible = TRUE;
priv->focus_visible = TRUE;
@@ -1680,7 +1663,7 @@ gtk_window_set_property (GObject *object,
gtk_window_set_attached_to (window, g_value_get_object (value));
break;
case PROP_HAS_RESIZE_GRIP:
- gtk_window_set_has_resize_grip (window, g_value_get_boolean (value));
+ gtk_window_set_has_resize_grip (window, FALSE);
break;
case PROP_APPLICATION:
gtk_window_set_application (window, g_value_get_object (value));
@@ -1801,7 +1784,7 @@ gtk_window_get_property (GObject *object,
g_value_set_object (value, gtk_window_get_attached_to (window));
break;
case PROP_HAS_RESIZE_GRIP:
- g_value_set_boolean (value, priv->has_resize_grip);
+ g_value_set_boolean (value, FALSE);
break;
case PROP_RESIZE_GRIP_VISIBLE:
g_value_set_boolean (value, gtk_window_resize_grip_is_visible (window));
@@ -5832,9 +5815,6 @@ gtk_window_map (GtkWidget *widget)
gdk_window_show (gdk_window);
- if (priv->grip_window)
- gdk_window_show (priv->grip_window);
-
if (!disable_startup_notification)
{
/* Do we have a custom startup-notification id? */
@@ -6434,9 +6414,6 @@ gtk_window_realize (GtkWidget *widget)
/* Icons */
gtk_window_realize_icon (window);
- if (priv->has_resize_grip)
- resize_grip_create_window (window);
-
link = priv->popovers;
while (link)
@@ -6498,9 +6475,6 @@ gtk_window_unrealize (GtkWidget *widget)
/* Icons */
gtk_window_unrealize_icon (window);
- if (priv->grip_window != NULL)
- resize_grip_destroy_window (window);
-
if (priv->border_window[0] != NULL)
{
for (i = 0; i < 8; i++)
@@ -6523,163 +6497,6 @@ gtk_window_unrealize (GtkWidget *widget)
GTK_WIDGET_CLASS (gtk_window_parent_class)->unrealize (widget);
}
-static GtkJunctionSides
-get_grip_junction (GtkWidget *widget)
-{
- if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)
- return GTK_JUNCTION_CORNER_BOTTOMRIGHT;
- else
- return GTK_JUNCTION_CORNER_BOTTOMLEFT;
-}
-
-static gboolean
-get_drag_edge (GtkWidget *widget,
- GdkWindowEdge *edge)
-{
- GtkWindowPrivate *priv = GTK_WINDOW (widget)->priv;
- gboolean hresizable;
- gboolean vresizable;
- GtkTextDirection dir;
- GtkWindowGeometryInfo *info;
-
- hresizable = TRUE;
- vresizable = TRUE;
-
- info = priv->geometry_info;
- if (info)
- {
- GdkWindowHints flags = info->last.flags;
- GdkGeometry *geometry = &info->last.geometry;
-
- if ((flags & GDK_HINT_MIN_SIZE) && (flags & GDK_HINT_MAX_SIZE))
- {
- hresizable = geometry->min_width < geometry->max_width;
- vresizable = geometry->min_height < geometry->max_height;
- }
- }
-
- dir = gtk_widget_get_direction (widget);
-
- if (hresizable && vresizable)
- *edge = dir == GTK_TEXT_DIR_LTR ? GDK_WINDOW_EDGE_SOUTH_EAST : GDK_WINDOW_EDGE_SOUTH_WEST;
- else if (hresizable)
- *edge = dir == GTK_TEXT_DIR_LTR ? GDK_WINDOW_EDGE_EAST : GDK_WINDOW_EDGE_WEST;
- else if (vresizable)
- *edge = GDK_WINDOW_EDGE_SOUTH;
- else
- return FALSE;
-
- return TRUE;
-}
-
-static void
-set_grip_cursor (GtkWindow *window)
-{
- GtkWidget *widget = GTK_WIDGET (window);
- GtkWindowPrivate *priv = window->priv;
-
- if (priv->grip_window == NULL)
- return;
-
- if (gtk_widget_is_sensitive (widget))
- {
- GdkWindowEdge edge;
- GdkDisplay *display;
- GdkCursorType cursor_type;
- GdkCursor *cursor;
-
- cursor_type = GDK_LEFT_PTR;
-
- if (get_drag_edge (widget, &edge))
- {
- switch (edge)
- {
- case GDK_WINDOW_EDGE_EAST:
- cursor_type = GDK_RIGHT_SIDE;
- break;
- case GDK_WINDOW_EDGE_SOUTH_EAST:
- cursor_type = GDK_BOTTOM_RIGHT_CORNER;
- break;
- case GDK_WINDOW_EDGE_SOUTH:
- cursor_type = GDK_BOTTOM_SIDE;
- break;
- case GDK_WINDOW_EDGE_SOUTH_WEST:
- cursor_type = GDK_BOTTOM_LEFT_CORNER;
- break;
- case GDK_WINDOW_EDGE_WEST:
- cursor_type = GDK_LEFT_SIDE;
- break;
- default: ;
- }
- }
-
- display = gtk_widget_get_display (widget);
- cursor = gdk_cursor_new_for_display (display, cursor_type);
- gdk_window_set_cursor (priv->grip_window, cursor);
- g_object_unref (cursor);
- }
- else
- gdk_window_set_cursor (priv->grip_window, NULL);
-}
-
-static void
-set_grip_shape (GtkWindow *window)
-{
- GtkWindowPrivate *priv = window->priv;
- cairo_region_t *region;
- cairo_surface_t *surface;
- cairo_t *cr;
- double width, height;
-
- if (priv->grip_window == NULL)
- return;
-
- width = gdk_window_get_width (priv->grip_window);
- height = gdk_window_get_height (priv->grip_window);
- surface = cairo_image_surface_create (CAIRO_FORMAT_A1, width, height);
-
- cr = cairo_create (surface);
- cairo_set_source_rgba (cr, 0.0, 0.0, 0.0, 0.0);
- cairo_paint (cr);
- cairo_set_source_rgba (cr, 0.0, 0.0, 0.0, 1.0);
- if (get_grip_junction (GTK_WIDGET (window)) & GTK_JUNCTION_CORNER_BOTTOMRIGHT)
- {
- cairo_move_to (cr, width, 0.0);
- cairo_line_to (cr, width, height);
- cairo_line_to (cr, 0.0, height);
- }
- else
- {
- cairo_move_to (cr, 0.0, 0.0);
- cairo_line_to (cr, width, height);
- cairo_line_to (cr, 0.0, height);
- }
- cairo_close_path (cr);
- cairo_fill (cr);
- cairo_destroy (cr);
- region = gdk_cairo_region_create_from_surface (surface);
- cairo_surface_destroy (surface);
-
- gdk_window_shape_combine_region (priv->grip_window, region, 0, 0);
- cairo_region_destroy (region);
-}
-
-static void
-set_grip_position (GtkWindow *window)
-{
- GtkWindowPrivate *priv = window->priv;
- GdkRectangle rect;
-
- if (priv->grip_window == NULL)
- return;
-
- gtk_window_get_resize_grip_area (window, &rect);
- gdk_window_raise (priv->grip_window);
- gdk_window_move_resize (priv->grip_window,
- rect.x, rect.y,
- rect.width, rect.height);
-}
-
static void
sum_borders (GtkBorder *one,
GtkBorder *two)
@@ -7253,8 +7070,6 @@ _gtk_window_set_allocation (GtkWindow *window,
}
else
{
- update_grip_visibility (window);
- set_grip_position (window);
update_border_windows (window);
}
}
@@ -7389,8 +7204,6 @@ gtk_window_state_event (GtkWidget *widget,
GtkWindow *window = GTK_WINDOW (widget);
GtkWindowPrivate *priv = window->priv;
- update_grip_visibility (window);
-
if (event->changed_mask & GDK_WINDOW_STATE_FOCUSED)
ensure_state_flag_backdrop (widget);
@@ -7424,40 +7237,12 @@ gtk_window_state_event (GtkWidget *widget,
}
static void
-gtk_window_direction_changed (GtkWidget *widget,
- GtkTextDirection prev_dir)
-{
- GtkWindow *window = GTK_WINDOW (widget);
-
- set_grip_cursor (window);
- set_grip_position (window);
- set_grip_shape (window);
-}
-
-static void
-gtk_window_state_changed (GtkWidget *widget,
- GtkStateType previous_state)
-{
- GtkWindow *window = GTK_WINDOW (widget);
-
- update_grip_visibility (window);
-}
-
-static void
gtk_window_style_updated (GtkWidget *widget)
{
- GtkWindow *window = GTK_WINDOW (widget);
- GtkWindowPrivate *priv = window->priv;
GdkRGBA transparent = { 0.0, 0.0, 0.0, 0.0 };
GTK_WIDGET_CLASS (gtk_window_parent_class)->style_updated (widget);
- if (priv->grip_window != NULL)
- {
- set_grip_position (window);
- set_grip_shape (window);
- }
-
if (gtk_widget_get_realized (widget))
{
gdk_window_set_background_rgba (gtk_widget_get_window (widget),
@@ -7466,60 +7251,6 @@ gtk_window_style_updated (GtkWidget *widget)
}
}
-static void
-resize_grip_create_window (GtkWindow *window)
-{
- GtkWidget *widget;
- GtkWindowPrivate *priv;
- GdkWindowAttr attributes;
- gint attributes_mask;
- GdkRectangle rect;
- GdkRGBA transparent = {0, 0, 0, 0};
-
- priv = window->priv;
- widget = GTK_WIDGET (window);
-
- g_return_if_fail (gtk_widget_get_realized (widget));
- g_return_if_fail (priv->grip_window == NULL);
-
- gtk_window_get_resize_grip_area (window, &rect);
-
- attributes.x = rect.x;
- attributes.y = rect.y;
- attributes.width = rect.width;
- attributes.height = rect.height;
- attributes.window_type = GDK_WINDOW_CHILD;
- attributes.wclass = GDK_INPUT_OUTPUT;
- attributes.event_mask = gtk_widget_get_events (widget) |
- GDK_EXPOSURE_MASK |
- GDK_BUTTON_PRESS_MASK;
-
- attributes_mask = GDK_WA_X | GDK_WA_Y;
-
- priv->grip_window = gdk_window_new (gtk_widget_get_window (widget),
- &attributes,
- attributes_mask);
- gdk_window_set_background_rgba (priv->grip_window, &transparent);
-
- gtk_widget_register_window (widget, priv->grip_window);
-
- gdk_window_raise (priv->grip_window);
-
- set_grip_shape (window);
- update_grip_visibility (window);
-}
-
-static void
-resize_grip_destroy_window (GtkWindow *window)
-{
- GtkWindowPrivate *priv = window->priv;
-
- gtk_widget_unregister_window (GTK_WIDGET (window), priv->grip_window);
- gdk_window_destroy (priv->grip_window);
- priv->grip_window = NULL;
- update_grip_visibility (window);
-}
-
/**
* gtk_window_set_has_resize_grip:
* @window: a #GtkWindow
@@ -7533,61 +7264,14 @@ resize_grip_destroy_window (GtkWindow *window)
* resize grip is currently shown.
*
* Since: 3.0
+ *
+ * Deprecated: 3.14: Resize grips have been removed.
*/
void
gtk_window_set_has_resize_grip (GtkWindow *window,
gboolean value)
{
- GtkWidget *widget = GTK_WIDGET (window);
- GtkWindowPrivate *priv = window->priv;
-
- value = value != FALSE;
-
- if (value != priv->has_resize_grip)
- {
- priv->has_resize_grip = value;
- gtk_widget_queue_draw (widget);
-
- if (gtk_widget_get_realized (widget) &&
- gtk_widget_is_toplevel (widget))
- {
- if (priv->has_resize_grip && priv->grip_window == NULL)
- resize_grip_create_window (window);
- else if (!priv->has_resize_grip && priv->grip_window != NULL)
- resize_grip_destroy_window (window);
- }
-
- g_object_notify (G_OBJECT (window), "has-resize-grip");
- }
-}
-
-static void
-update_grip_visibility (GtkWindow *window)
-{
- GtkWindowPrivate *priv = window->priv;
- gboolean val;
-
- val = gtk_window_resize_grip_is_visible (window);
-
- if (priv->grip_window != NULL)
- {
- if (val)
- {
- gdk_window_show (priv->grip_window);
- set_grip_cursor (window);
- }
- else
- {
- gdk_window_hide (priv->grip_window);
- }
- }
-
- if (priv->resize_grip_visible != val)
- {
- priv->resize_grip_visible = val;
-
- g_object_notify (G_OBJECT (window), "resize-grip-visible");
- }
+ g_return_if_fail (GTK_IS_WINDOW (window));
}
/**
@@ -7599,42 +7283,15 @@ update_grip_visibility (GtkWindow *window)
* Returns: %TRUE if a resize grip exists and is visible
*
* Since: 3.0
+ *
+ * Deprecated: 3.14: Resize grips have been removed.
*/
gboolean
gtk_window_resize_grip_is_visible (GtkWindow *window)
{
- GtkWidget *widget;
- GtkWindowPrivate *priv;
- GdkWindowEdge edge;
-
g_return_val_if_fail (GTK_IS_WINDOW (window), FALSE);
- priv = window->priv;
- widget = GTK_WIDGET (window);
-
- if (priv->type == GTK_WINDOW_POPUP)
- return FALSE;
-
- if (!priv->resizable)
- return FALSE;
-
- if (!gtk_widget_is_toplevel (widget))
- return FALSE;
-
- if (gtk_widget_get_realized (widget))
- {
- GdkWindowState state;
-
- state = gdk_window_get_state (gtk_widget_get_window (widget));
-
- if (state & GDK_WINDOW_STATE_MAXIMIZED || state & GDK_WINDOW_STATE_FULLSCREEN)
- return FALSE;
- }
-
- if (!get_drag_edge (widget, &edge))
- return FALSE;
-
- return window->priv->has_resize_grip;
+ return FALSE;
}
/**
@@ -7646,13 +7303,16 @@ gtk_window_resize_grip_is_visible (GtkWindow *window)
* Returns: %TRUE if the window has a resize grip
*
* Since: 3.0
+ *
+ * Deprecated: 3.14: Resize grips have been removed.
*/
gboolean
gtk_window_get_has_resize_grip (GtkWindow *window)
+
{
g_return_val_if_fail (GTK_IS_WINDOW (window), FALSE);
- return window->priv->has_resize_grip;
+ return FALSE;
}
/**
@@ -7667,49 +7327,16 @@ gtk_window_get_has_resize_grip (GtkWindow *window)
* Returns: %TRUE if the resize grip’s area was retrieved
*
* Since: 3.0
+ *
+ * Deprecated: 3.14: Resize grips have been removed.
*/
gboolean
gtk_window_get_resize_grip_area (GtkWindow *window,
GdkRectangle *rect)
{
- GtkWidget *widget = GTK_WIDGET (window);
- GtkWindowPrivate *priv = window->priv;
- GtkAllocation allocation;
- gint grip_width;
- gint grip_height;
- GtkBorder window_border = { 0 };
-
g_return_val_if_fail (GTK_IS_WINDOW (window), FALSE);
- if (!priv->has_resize_grip)
- return FALSE;
-
- get_shadow_width (widget, &window_border);
- gtk_widget_get_allocation (widget, &allocation);
-
- gtk_widget_style_get (widget,
- "resize-grip-width", &grip_width,
- "resize-grip-height", &grip_height,
- NULL);
-
- if (grip_width > allocation.width)
- grip_width = allocation.width;
-
- if (grip_height > allocation.height)
- grip_height = allocation.height;
-
- rect->width = grip_width;
- rect->height = grip_height;
- rect->y = allocation.y + allocation.height -
- grip_height - window_border.bottom;
-
- if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_LTR)
- rect->x = allocation.x + allocation.width -
- grip_width - window_border.right;
- else
- rect->x = allocation.x;
-
- return TRUE;
+ return FALSE;
}
/* the accel_key and accel_mods fields of the key have to be setup
@@ -9765,26 +9392,6 @@ gtk_window_draw (GtkWidget *widget,
if (GTK_WIDGET_CLASS (gtk_window_parent_class)->draw)
ret = GTK_WIDGET_CLASS (gtk_window_parent_class)->draw (widget, cr);
- if (priv->grip_window &&
- gtk_cairo_should_draw_window (cr, priv->grip_window))
- {
- GdkRectangle rect;
-
- gtk_style_context_save (context);
- cairo_save (cr);
-
- gtk_cairo_transform_to_window (cr, widget, priv->grip_window);
- gtk_window_get_resize_grip_area (GTK_WINDOW (widget), &rect);
-
- gtk_style_context_remove_class (context, GTK_STYLE_CLASS_BACKGROUND);
- gtk_style_context_add_class (context, GTK_STYLE_CLASS_GRIP);
- gtk_style_context_set_junction_sides (context, get_grip_junction (widget));
- gtk_render_handle (context, cr, 0, 0, rect.width, rect.height);
-
- cairo_restore (cr);
- gtk_style_context_restore (context);
- }
-
return ret;
}
@@ -10296,7 +9903,6 @@ gtk_window_set_resizable (GtkWindow *window,
{
priv->resizable = resizable;
- update_grip_visibility (window);
update_window_buttons (window);
gtk_widget_queue_resize_no_redraw (GTK_WIDGET (window));
diff --git a/gtk/gtkwindow.h b/gtk/gtkwindow.h
index f6fef87943..5c375dc83d 100644
--- a/gtk/gtkwindow.h
+++ b/gtk/gtkwindow.h
@@ -467,14 +467,14 @@ void gtk_window_set_application (GtkWindow *window,
/* Window grips
*/
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_14
void gtk_window_set_has_resize_grip (GtkWindow *window,
gboolean value);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_14
gboolean gtk_window_get_has_resize_grip (GtkWindow *window);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_14
gboolean gtk_window_resize_grip_is_visible (GtkWindow *window);
-GDK_AVAILABLE_IN_ALL
+GDK_DEPRECATED_IN_3_14
gboolean gtk_window_get_resize_grip_area (GtkWindow *window,
GdkRectangle *rect);
diff --git a/tests/styleexamples.c b/tests/styleexamples.c
index d55ea2d7a7..a20e2d6ebd 100644
--- a/tests/styleexamples.c
+++ b/tests/styleexamples.c
@@ -324,7 +324,6 @@ int main (int argc, char *argv[])
what = "check";
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_has_resize_grip (GTK_WINDOW (window), FALSE);
ebox = gtk_event_box_new ();
gtk_event_box_set_visible_window (GTK_EVENT_BOX (ebox), TRUE);
gtk_container_add (GTK_CONTAINER (window), ebox);
diff --git a/testsuite/gtk/testing.c b/testsuite/gtk/testing.c
index ed67615ae4..7d59bd1d1d 100644
--- a/testsuite/gtk/testing.c
+++ b/testsuite/gtk/testing.c
@@ -227,8 +227,6 @@ test_spin_button_arrows (void)
gboolean simsuccess;
double oldval, newval;
- gtk_window_set_has_resize_grip (GTK_WINDOW (window), FALSE);
-
child = gtk_bin_get_child (GTK_BIN (window));
gtk_container_add (GTK_CONTAINER (child), spinner);
gtk_widget_show (spinner);
diff --git a/testsuite/reftests/toplevel-vs-popup.ui b/testsuite/reftests/toplevel-vs-popup.ui
index c446ea933d..3707d7b654 100644
--- a/testsuite/reftests/toplevel-vs-popup.ui
+++ b/testsuite/reftests/toplevel-vs-popup.ui
@@ -3,7 +3,6 @@
<!-- interface-requires gtk+ 3.0 -->
<object class="GtkWindow" id="window1">
<property name="can_focus">False</property>
- <property name="has_resize_grip">False</property>
<child>
<object class="GtkLabel" id="label1">
<property name="visible">True</property>