[glade3] * gladeui/glade-widget.c: Reduce processing of events by not running the widget lookup event red
- From: Tristan Van Berkom <tvb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glade3] * gladeui/glade-widget.c: Reduce processing of events by not running the widget lookup event red
- Date: Sun, 26 Dec 2010 11:47:39 +0000 (UTC)
commit 7dfe5becd7475730e8c8b2b48cdcde10d8cf695e
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date: Sun Dec 26 20:26:02 2010 +0900
* gladeui/glade-widget.c: Reduce processing of events by not running the
widget lookup event redirection for events we're not interested in.
ChangeLog | 3 +++
gladeui/glade-widget.c | 10 ++++++++++
2 files changed, 13 insertions(+), 0 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index d3afd50..a1a64e7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,6 +9,9 @@
* src/glade-close-button.c: Made the close button in notebook tabs smaller.
+ * gladeui/glade-widget.c: Reduce processing of events by not running the
+ widget lookup event redirection for events we're not interested in.
+
2010-12-23 Tristan Van Berkom <tristanvb openismus com>
* gladeui/glade-widget.c: Check if object is actually in the parent when rebuilding
diff --git a/gladeui/glade-widget.c b/gladeui/glade-widget.c
index 1070e9e..b39a56f 100644
--- a/gladeui/glade-widget.c
+++ b/gladeui/glade-widget.c
@@ -103,6 +103,11 @@ static guint glade_widget_signals[LAST_SIGNAL] = {0};
static GQuark glade_widget_name_quark = 0;
+#define IS_GLADE_WIDGET_EVENT(event) \
+ ((event) == GDK_BUTTON_PRESS || \
+ (event) == GDK_BUTTON_RELEASE || \
+ (event) == GDK_MOTION_NOTIFY)
+
G_DEFINE_TYPE (GladeWidget, glade_widget, G_TYPE_INITIALLY_UNOWNED)
/*******************************************************************************
@@ -3281,6 +3286,11 @@ glade_widget_event_private (GtkWidget *widget,
{
GtkWidget *layout = widget;
+ /* Dont run heavy machienery for events we're not interested in
+ * marshalling */
+ if (!IS_GLADE_WIDGET_EVENT (event->type))
+ return FALSE;
+
/* Find the parenting layout container */
while (layout && !GLADE_IS_DESIGN_LAYOUT (layout))
layout = gtk_widget_get_parent (layout);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]