summaryrefslogtreecommitdiff
path: root/gdk/gdksurface.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2018-07-15 10:45:57 -0400
committerMatthias Clasen <mclasen@redhat.com>2018-07-15 11:51:09 -0400
commita8926c9d873ce968353a2eb1d3930c4f1ac79c94 (patch)
tree5e5f7cfc0fcb9bcce6a0c1c8c0a2065223c37419 /gdk/gdksurface.c
parent443f8ddf6bbb15d4516bf2b5fd2c8b77fa10f840 (diff)
downloadgtk+-a8926c9d873ce968353a2eb1d3930c4f1ac79c94.tar.gz
gdk: Drop configure events
Replace configure events with a GdkSurface::size-changed signal. This is part of the move to use events only for input.
Diffstat (limited to 'gdk/gdksurface.c')
-rw-r--r--gdk/gdksurface.c34
1 files changed, 29 insertions, 5 deletions
diff --git a/gdk/gdksurface.c b/gdk/gdksurface.c
index bb9785a0a5..c96f45e82f 100644
--- a/gdk/gdksurface.c
+++ b/gdk/gdksurface.c
@@ -97,6 +97,7 @@
enum {
MOVED_TO_RECT,
+ SIZE_CHANGED,
LAST_SIGNAL
};
@@ -310,6 +311,19 @@ gdk_surface_class_init (GdkSurfaceClass *klass)
G_TYPE_POINTER,
G_TYPE_BOOLEAN,
G_TYPE_BOOLEAN);
+
+ signals[SIZE_CHANGED] =
+ g_signal_new (g_intern_static_string ("size-changed"),
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_FIRST,
+ 0,
+ NULL,
+ NULL,
+ NULL,
+ G_TYPE_NONE,
+ 2,
+ G_TYPE_INT,
+ G_TYPE_INT);
}
static void
@@ -2663,6 +2677,7 @@ gdk_surface_move_resize_internal (GdkSurface *surface,
{
cairo_region_t *old_region, *new_region;
gboolean expose;
+ gboolean size_changed;
g_return_if_fail (GDK_IS_SURFACE (surface));
@@ -2691,6 +2706,7 @@ gdk_surface_move_resize_internal (GdkSurface *surface,
/* Handle child surfaces */
expose = FALSE;
+ size_changed = FALSE;
old_region = NULL;
if (gdk_surface_is_viewable (surface) &&
@@ -2716,8 +2732,16 @@ gdk_surface_move_resize_internal (GdkSurface *surface,
}
if (!(width < 0 && height < 0))
{
- surface->width = width;
- surface->height = height;
+ if (surface->width != width)
+ {
+ surface->width = width;
+ size_changed = TRUE;
+ }
+ if (surface->height != height)
+ {
+ surface->height = height;
+ size_changed = TRUE;
+ }
}
recompute_visible_regions (surface, FALSE);
@@ -2740,9 +2764,10 @@ gdk_surface_move_resize_internal (GdkSurface *surface,
cairo_region_destroy (old_region);
cairo_region_destroy (new_region);
}
-}
-
+ if (size_changed)
+ g_signal_emit (surface, signals[SIZE_CHANGED], 0, width, height);
+}
/**
* gdk_surface_move:
@@ -3908,7 +3933,6 @@ _gdk_make_event (GdkSurface *surface,
break;
case GDK_FOCUS_CHANGE:
- case GDK_CONFIGURE:
case GDK_MAP:
case GDK_UNMAP:
case GDK_DELETE: