[maemo-commits] [maemo-commits] r13893 - in projects/haf/trunk/hildon-home-webshortcut: . plugin

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Tue Sep 18 16:02:46 EEST 2007
Author: jobi
Date: 2007-09-18 16:02:43 +0300 (Tue, 18 Sep 2007)
New Revision: 13893

Modified:
   projects/haf/trunk/hildon-home-webshortcut/ChangeLog
   projects/haf/trunk/hildon-home-webshortcut/plugin/hildon-home-webshortcut.c
Log:

2007-09-18  Johan Bilien  <johan.bilien at nokia.com>

	* plugin/hildon-home-webshortcut.c:
	- removed unnecessary button-press handler
	- if the button-release event happened on another window than
	our own, ignore
	- if the button-release event happened outside our allocation,
	ignore.
	Fixes: NB#69825



Modified: projects/haf/trunk/hildon-home-webshortcut/ChangeLog
===================================================================
--- projects/haf/trunk/hildon-home-webshortcut/ChangeLog	2007-09-18 12:58:56 UTC (rev 13892)
+++ projects/haf/trunk/hildon-home-webshortcut/ChangeLog	2007-09-18 13:02:43 UTC (rev 13893)
@@ -1,3 +1,13 @@
+2007-09-18  Johan Bilien  <johan.bilien at nokia.com>
+
+	* plugin/hildon-home-webshortcut.c:
+	- removed unnecessary button-press handler
+	- if the button-release event happened on another window than
+	our own, ignore
+	- if the button-release event happened outside our allocation,
+	ignore.
+	Fixes: NB#69825
+
 2007-09-13  Johan Bilien  <johan.bilien at nokia.com>
 
 	* plugin/hws-background.c: the cache entry in gconf

Modified: projects/haf/trunk/hildon-home-webshortcut/plugin/hildon-home-webshortcut.c
===================================================================
--- projects/haf/trunk/hildon-home-webshortcut/plugin/hildon-home-webshortcut.c	2007-09-18 12:58:56 UTC (rev 13892)
+++ projects/haf/trunk/hildon-home-webshortcut/plugin/hildon-home-webshortcut.c	2007-09-18 13:02:43 UTC (rev 13893)
@@ -87,7 +87,6 @@
   guint             old_width;
   guint             old_height;
   GConfClient      *gconf_client;
-  gdouble           click_x, click_y;
 };
 
 HD_DEFINE_PLUGIN_WITH_CODE (Hhws, hhws, HILDON_DESKTOP_TYPE_HOME_ITEM, hhws_background_register_type (module);)
@@ -711,33 +710,20 @@
 }
 
 static gboolean
-hhws_button_press (GtkWidget           *widget,
-                   GdkEventButton      *event)
-{
-  Hhws             *hhws = HHWS (widget);
-  HhwsPrivate      *priv = hhws->priv;
-
-  priv->click_x = event->x_root;
-  priv->click_y = event->y_root;
-
-  return GTK_WIDGET_CLASS (hhws_parent_class)->button_press_event (widget,
-                                                                   event);
-}
-
-static gboolean
 hhws_button_release (GtkWidget         *widget,
                      GdkEventButton    *event)
 {
   Hhws             *hhws = HHWS (widget);
   HhwsPrivate      *priv = hhws->priv;
 
-  if ((ABS (priv->click_x - event->x_root)  > 15.0 )  ||
-      (ABS (priv->click_y - event->y_root)) > 15.0)
-  {
+  if (widget->window != event->window)
     return GTK_WIDGET_CLASS (hhws_parent_class)->button_release_event (widget,
                                                                        event);
-  }
 
+  if (event->x < 0 || event->x > widget->allocation.width ||
+      event->y < 0 || event->y > widget->allocation.height)
+    return TRUE;
+
   if (priv->iap)
   {
     ConIcConnection  *connection;
@@ -988,7 +974,6 @@
 
   applet_class->settings = hhws_settings;
 
-  widget_class->button_press_event   = hhws_button_press;
   widget_class->button_release_event = hhws_button_release;
   widget_class->expose_event         = hhws_expose;
   widget_class->realize              = hhws_realize;


More information about the maemo-commits mailing list