[gtk/wip/matthiasc/sortlistmodel] gdk: Don't emit size-changed unless it changed
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/matthiasc/sortlistmodel] gdk: Don't emit size-changed unless it changed
- Date: Sat, 11 Jul 2020 15:18:25 +0000 (UTC)
commit 9b1dde64e3ba9a8434d8b565538642456459370e
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Jul 11 11:16:35 2020 -0400
gdk: Don't emit size-changed unless it changed
This really should be handled before we even create
the event, but at least we can stop it from reaching GTK.
gdk/gdksurface.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/gdk/gdksurface.c b/gdk/gdksurface.c
index 96302ea630..d630e5d14f 100644
--- a/gdk/gdksurface.c
+++ b/gdk/gdksurface.c
@@ -2861,6 +2861,7 @@ gdk_surface_handle_event (GdkEvent *event)
{
gint64 begin_time = g_get_monotonic_time ();
gboolean handled = FALSE;
+ GdkSurface *surface = gdk_event_get_surface (event);
if (check_autohide (event))
return TRUE;
@@ -2870,13 +2871,13 @@ gdk_surface_handle_event (GdkEvent *event)
int width, height;
gdk_configure_event_get_size (event, &width, &height);
- g_signal_emit (gdk_event_get_surface (event), signals[SIZE_CHANGED], 0,
- width, height);
+ if (width != surface->width || height != surface->height)
+ g_signal_emit (surface, signals[SIZE_CHANGED], 0, width, height);
handled = TRUE;
}
else
{
- g_signal_emit (gdk_event_get_surface (event), signals[EVENT], 0, event, &handled);
+ g_signal_emit (surface, signals[EVENT], 0, event, &handled);
}
if (GDK_PROFILER_IS_RUNNING)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]