summaryrefslogtreecommitdiffstats
path: root/views/widget/widget_gtk.cc
diff options
context:
space:
mode:
Diffstat (limited to 'views/widget/widget_gtk.cc')
-rw-r--r--views/widget/widget_gtk.cc44
1 files changed, 22 insertions, 22 deletions
diff --git a/views/widget/widget_gtk.cc b/views/widget/widget_gtk.cc
index de5b43e..1224414 100644
--- a/views/widget/widget_gtk.cc
+++ b/views/widget/widget_gtk.cc
@@ -66,28 +66,6 @@ static void GetWidgetPositionOnScreen(GtkWidget* widget, int* x, int *y) {
*y += window_y;
}
-// Returns the view::Event::flags for a GdkEventButton.
-static int GetFlagsForEventButton(const GdkEventButton& event) {
- int flags = Event::GetFlagsFromGdkState(event.state);
- switch (event.button) {
- case 1:
- flags |= Event::EF_LEFT_BUTTON_DOWN;
- break;
- case 2:
- flags |= Event::EF_MIDDLE_BUTTON_DOWN;
- break;
- case 3:
- flags |= Event::EF_RIGHT_BUTTON_DOWN;
- break;
- default:
- // We only deal with 1-3.
- break;
- }
- if (event.type == GDK_2BUTTON_PRESS)
- flags |= MouseEvent::EF_IS_DOUBLE_CLICK;
- return flags;
-}
-
// static
GtkWidget* WidgetGtk::null_parent_ = NULL;
@@ -850,6 +828,28 @@ void WidgetGtk::ReleaseGrab() {
}
// static
+int WidgetGtk::GetFlagsForEventButton(const GdkEventButton& event) {
+ int flags = Event::GetFlagsFromGdkState(event.state);
+ switch (event.button) {
+ case 1:
+ flags |= Event::EF_LEFT_BUTTON_DOWN;
+ break;
+ case 2:
+ flags |= Event::EF_MIDDLE_BUTTON_DOWN;
+ break;
+ case 3:
+ flags |= Event::EF_RIGHT_BUTTON_DOWN;
+ break;
+ default:
+ // We only deal with 1-3.
+ break;
+ }
+ if (event.type == GDK_2BUTTON_PRESS)
+ flags |= MouseEvent::EF_IS_DOUBLE_CLICK;
+ return flags;
+}
+
+// static
WindowGtk* WidgetGtk::GetWindowForNative(GtkWidget* widget) {
gpointer user_data = g_object_get_data(G_OBJECT(widget), "chrome-window");
return static_cast<WindowGtk*>(user_data);