diff options
Diffstat (limited to 'views')
-rw-r--r-- | views/widget/widget_gtk.cc | 18 | ||||
-rw-r--r-- | views/widget/widget_gtk.h | 9 |
2 files changed, 14 insertions, 13 deletions
diff --git a/views/widget/widget_gtk.cc b/views/widget/widget_gtk.cc index 78137c5..5d946f5 100644 --- a/views/widget/widget_gtk.cc +++ b/views/widget/widget_gtk.cc @@ -1153,6 +1153,15 @@ void WidgetGtk::ReleaseGrab() { } } +void WidgetGtk::HandleGrabBroke() { + if (has_capture_) { + if (is_mouse_down_) + root_view_->ProcessMouseDragCanceled(); + is_mouse_down_ = false; + has_capture_ = false; + } +} + //////////////////////////////////////////////////////////////////////////////// // WidgetGtk, private: @@ -1399,15 +1408,6 @@ void WidgetGtk::ConfigureWidgetForIgnoreEvents() { 0); } -void WidgetGtk::HandleGrabBroke() { - if (has_capture_) { - if (is_mouse_down_) - root_view_->ProcessMouseDragCanceled(); - is_mouse_down_ = false; - has_capture_ = false; - } -} - void WidgetGtk::DrawTransparentBackground(GtkWidget* widget, GdkEventExpose* event) { cairo_t* cr = gdk_cairo_create(widget->window); diff --git a/views/widget/widget_gtk.h b/views/widget/widget_gtk.h index beb629f..8f7ca17 100644 --- a/views/widget/widget_gtk.h +++ b/views/widget/widget_gtk.h @@ -270,11 +270,15 @@ class WidgetGtk virtual bool ReleaseCaptureOnMouseReleased() { return true; } // Does a mouse grab on this widget. - void DoGrab(); + virtual void DoGrab(); // Releases a grab done by this widget. virtual void ReleaseGrab(); + // Invoked when input grab is stolen by other GtkWidget in the same + // application. + virtual void HandleGrabBroke(); + // Are we a subclass of WindowGtk? bool is_window_; @@ -316,9 +320,6 @@ class WidgetGtk // MakeIgnoreEvents has been invoked. void ConfigureWidgetForIgnoreEvents(); - // TODO(sky): documentation - void HandleGrabBroke(); - // A utility function to draw a transparent background onto the |widget|. static void DrawTransparentBackground(GtkWidget* widget, GdkEventExpose* event); |