diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2020-07-01 09:02:17 +0200 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2020-07-03 07:39:49 +0200 |
commit | f7b2e98bb76d2ce37ddc886ab503c6b160d8849d (patch) | |
tree | 07106a267f52da8c0053b95bea308c33bc27e6c8 | |
parent | f6f5fa8038e1b8e320a8e74af1c5d901d13988a5 (diff) |
gtk3: receive mouse events on drawing area
Change-Id: I35ec84c7e2e849625db7d628e1fa2e3807b3ef21
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97566
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97743
Tested-by: Jenkins
-rw-r--r-- | vcl/source/app/customweld.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/gtk3/gtk3gtkinst.cxx | 12 |
2 files changed, 13 insertions, 1 deletions
diff --git a/vcl/source/app/customweld.cxx b/vcl/source/app/customweld.cxx index 07dc7935b198..e8ce7003532a 100644 --- a/vcl/source/app/customweld.cxx +++ b/vcl/source/app/customweld.cxx @@ -25,6 +25,7 @@ CustomWeld::CustomWeld(weld::Builder& rBuilder, const OString& rDrawingId, rWidgetController.GetUITestFactory(), &rWidgetController)) { + m_rWidgetController.SetDrawingArea(m_xDrawingArea.get()); m_xDrawingArea->connect_size_allocate(LINK(this, CustomWeld, DoResize)); m_xDrawingArea->connect_draw(LINK(this, CustomWeld, DoPaint)); m_xDrawingArea->connect_mouse_press(LINK(this, CustomWeld, DoMouseButtonDown)); @@ -37,7 +38,6 @@ CustomWeld::CustomWeld(weld::Builder& rBuilder, const OString& rDrawingId, m_xDrawingArea->connect_style_updated(LINK(this, CustomWeld, DoStyleUpdated)); m_xDrawingArea->connect_command(LINK(this, CustomWeld, DoCommand)); m_xDrawingArea->connect_query_tooltip(LINK(this, CustomWeld, DoRequestHelp)); - m_rWidgetController.SetDrawingArea(m_xDrawingArea.get()); } IMPL_LINK(CustomWeld, DoResize, const Size&, rSize, void) diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index 0959bb53421e..9791b7f28cc2 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -12761,6 +12761,18 @@ public: return m_pAccessible; } + virtual void connect_mouse_press(const Link<const MouseEvent&, bool>& rLink) override + { + gtk_widget_add_events(m_pWidget, GDK_BUTTON_PRESS_MASK); + GtkInstanceWidget::connect_mouse_press(rLink); + } + + virtual void connect_mouse_release(const Link<const MouseEvent&, bool>& rLink) override + { + gtk_widget_add_events(m_pWidget, GDK_BUTTON_RELEASE_MASK); + GtkInstanceWidget::connect_mouse_release(rLink); + } + virtual void set_direction(bool bRTL) override { GtkInstanceWidget::set_direction(bRTL); |