summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2018-07-15 19:52:28 -0400
committerMatthias Clasen <mclasen@redhat.com>2018-07-15 20:23:45 -0400
commit7a1073c3ae89e4cdf35d95afec564d48f776774f (patch)
tree2c3c4eb8f3d942362297923c48e80807211e5e5a /tests
parente2fd33f78a5bcd461139a32957abfeaa45fa3d2e (diff)
downloadgtk+-7a1073c3ae89e4cdf35d95afec564d48f776774f.tar.gz
Revert "gdk: Drop configure events"
This reverts commit a8926c9d873ce968353a2eb1d3930c4f1ac79c94.
Diffstat (limited to 'tests')
-rw-r--r--tests/testwindowsize.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/tests/testwindowsize.c b/tests/testwindowsize.c
index 0f55a45092..6e62dd0a60 100644
--- a/tests/testwindowsize.c
+++ b/tests/testwindowsize.c
@@ -8,14 +8,21 @@ static GtkWidget *default_width_spin;
static GtkWidget *default_height_spin;
static GtkWidget *resizable_check;
-static void
-configure_event_cb (GtkWidget *window, int width, int height, GtkLabel *label)
+static gboolean
+configure_event_cb (GtkWidget *window, GdkEvent *event, GtkLabel *label)
{
- gchar *str;
-
- str = g_strdup_printf ("%d x %d", width, height);
- gtk_label_set_label (label, str);
- g_free (str);
+ if (gdk_event_get_event_type (event) == GDK_CONFIGURE)
+ {
+ gchar *str;
+ gint width, height;
+
+ gtk_window_get_size (GTK_WINDOW (window), &width, &height);
+ str = g_strdup_printf ("%d x %d", width, height);
+ gtk_label_set_label (label, str);
+ g_free (str);
+ }
+
+ return GDK_EVENT_PROPAGATE;
}
static void
@@ -64,8 +71,7 @@ show_dialog (void)
//gtk_widget_show (label);
gtk_dialog_add_action_widget (GTK_DIALOG (dialog), label, GTK_RESPONSE_HELP);
- gtk_widget_realize (dialog);
- g_signal_connect (gtk_widget_get_surface (dialog), "size-changed",
+ g_signal_connect (dialog, "event",
G_CALLBACK (configure_event_cb), label);
gtk_dialog_run (GTK_DIALOG (dialog));