diff options
author | Alexander Larsson <alexl@redhat.com> | 2012-06-05 19:08:22 +0200 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2012-06-05 19:13:05 +0200 |
commit | c4c06aae2e294cb247cb5421670f279c960087f8 (patch) | |
tree | de5136c9a7c4a672a796bbb358b64f438782bfb1 | |
parent | c98d0593d6d382028637dd3dcf285016f84fad72 (diff) | |
download | clutter-gtk-c4c06aae2e294cb247cb5421670f279c960087f8.tar.gz |
Make GtkClutterEmbed redraw resizes nicer
Currently when you vertically resize a GtkClutterEmbed we draw twice, once
with the old window size and once again when the ConfigureNotify gets
back with the right size. The first draw is at the wrong position due
to the wrong window height used to calculate the viewport position.
We fix this by immediately telling cogl about the new size by faking
a ConfigureNotify event.
https://bugzilla.gnome.org/show_bug.cgi?id=677493
-rw-r--r-- | clutter-gtk/gtk-clutter-embed.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/clutter-gtk/gtk-clutter-embed.c b/clutter-gtk/gtk-clutter-embed.c index add1078..2ab08d8 100644 --- a/clutter-gtk/gtk-clutter-embed.c +++ b/clutter-gtk/gtk-clutter-embed.c @@ -503,6 +503,21 @@ gtk_clutter_embed_size_allocate (GtkWidget *widget, clutter_stage_ensure_viewport (CLUTTER_STAGE (priv->stage)); gtk_clutter_embed_send_configure (GTK_CLUTTER_EMBED (widget)); + +#if defined(GDK_WINDOWING_X11) && defined(CLUTTER_WINDOWING_X11) + if (clutter_check_windowing_backend (CLUTTER_WINDOWING_X11) && + GDK_IS_X11_WINDOW (gtk_widget_get_window (widget))) + { + XConfigureEvent xevent = { ConfigureNotify }; + xevent.window = GDK_WINDOW_XID (gtk_widget_get_window (widget)); + xevent.width = allocation->width; + xevent.height = allocation->height; + + /* Ensure cogl knows about the new size immediately, as we will + draw before we get the ConfigureNotify response. */ + clutter_x11_handle_event ((XEvent *)&xevent); + } +#endif } } |