diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-03-28 16:40:43 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-03-28 22:07:32 +0100 |
commit | d8064c1f50fca388d2701a9702be694330ff0bc5 (patch) | |
tree | 0f4202faece90cf12edf57a79c64dbf7590bed1c /vcl/unx/gtk3/gtk3gtkinst.cxx | |
parent | 3e078e17ee2144fb976a7e6b9227152113cea0d4 (diff) |
mapped tooltip before attempting to show a menu is a problem
under wayland, see https://gitlab.gnome.org/GNOME/gtk/issues/1785
Change-Id: I542fb9e81b49144508d5403b2d5ad68a10ed8afe
Reviewed-on: https://gerrit.libreoffice.org/69897
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/unx/gtk3/gtk3gtkinst.cxx')
-rw-r--r-- | vcl/unx/gtk3/gtk3gtkinst.cxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index 06f0836df779..3b740f7a8985 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -4764,6 +4764,14 @@ public: static_cast<int>(rRect.GetWidth()), static_cast<int>(rRect.GetHeight())}; if (AllSettings::GetLayoutRTL()) aRect.x = gtk_widget_get_allocated_width(pWidget) - aRect.width - 1 - aRect.x; + + // Send a keyboard event through gtk_main_do_event to toggle any active tooltip offs + // before trying to launch the menu + // https://gitlab.gnome.org/GNOME/gtk/issues/1785 + GdkEvent *event = GtkSalFrame::makeFakeKeyPress(pWidget); + gtk_main_do_event(event); + gdk_event_free(event); + gtk_menu_popup_at_rect(m_pMenu, gtk_widget_get_window(pWidget), &aRect, GDK_GRAVITY_NORTH_WEST, GDK_GRAVITY_NORTH_WEST, nullptr); } else |