[gtk+] separatortoolitem: Make gcc stop complaining



commit 25da672dbc07502521ffcf634fa82d1349bccc0d
Author: Benjamin Otte <otte redhat com>
Date:   Sun Mar 2 21:49:35 2014 +0100

    separatortoolitem: Make gcc stop complaining
    
    No, a ButtonEvent and a MotionEvent are not the same thing.

 gtk/gtkseparatortoolitem.c |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkseparatortoolitem.c b/gtk/gtkseparatortoolitem.c
index 006052c..c6c2a4f 100644
--- a/gtk/gtkseparatortoolitem.c
+++ b/gtk/gtkseparatortoolitem.c
@@ -83,6 +83,8 @@ static void     gtk_separator_tool_item_map               (GtkWidget
 static void     gtk_separator_tool_item_unmap             (GtkWidget                 *widget);
 static gboolean gtk_separator_tool_item_button_event      (GtkWidget                 *widget,
                                                            GdkEventButton            *event);
+static gboolean gtk_separator_tool_item_motion_event      (GtkWidget                 *widget,
+                                                           GdkEventMotion            *event);
 
 
 G_DEFINE_TYPE_WITH_PRIVATE (GtkSeparatorToolItem, gtk_separator_tool_item, GTK_TYPE_TOOL_ITEM)
@@ -130,7 +132,7 @@ gtk_separator_tool_item_class_init (GtkSeparatorToolItemClass *class)
   widget_class->unmap = gtk_separator_tool_item_unmap;
   widget_class->button_press_event = gtk_separator_tool_item_button_event;
   widget_class->button_release_event = gtk_separator_tool_item_button_event;
-  widget_class->motion_notify_event = gtk_separator_tool_item_button_event;
+  widget_class->motion_notify_event = gtk_separator_tool_item_motion_event;
 
   toolitem_class->create_menu_proxy = gtk_separator_tool_item_create_menu_proxy;
   
@@ -345,6 +347,19 @@ gtk_separator_tool_item_unmap (GtkWidget *widget)
 }
 
 static gboolean
+gtk_separator_tool_item_motion_event (GtkWidget      *widget,
+                                      GdkEventMotion *event)
+{
+  GtkSeparatorToolItem *separator = GTK_SEPARATOR_TOOL_ITEM (widget);
+  GtkSeparatorToolItemPrivate *priv = separator->priv;
+
+  /* We want window dragging to work on empty toolbar areas,
+   * so we only eat button events on visible separators
+   */
+  return priv->draw;
+}
+
+static gboolean
 gtk_separator_tool_item_button_event (GtkWidget      *widget,
                                       GdkEventButton *event)
 {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]