summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vcl/inc/unx/gtk/gtkframe.hxx1
-rw-r--r--vcl/unx/gtk3/gtk3gtkframe.cxx15
2 files changed, 16 insertions, 0 deletions
diff --git a/vcl/inc/unx/gtk/gtkframe.hxx b/vcl/inc/unx/gtk/gtkframe.hxx
index 04ec68a7854e..94547848659e 100644
--- a/vcl/inc/unx/gtk/gtkframe.hxx
+++ b/vcl/inc/unx/gtk/gtkframe.hxx
@@ -537,6 +537,7 @@ public:
#if GTK_CHECK_VERSION(3,0,0)
virtual void PositionByToolkit(const tools::Rectangle& rRect, FloatWinPopupFlags nFlags) override;
virtual void SetModal(bool bModal) override;
+ void HideTooltip();
virtual bool ShowTooltip(const OUString& rHelpText, const tools::Rectangle& rHelpArea) override;
virtual void* ShowPopover(const OUString& rHelpText, vcl::Window* pParent, const tools::Rectangle& rHelpArea, QuickHelpFlags nFlags) override;
virtual bool UpdatePopover(void* nId, const OUString& rHelpText, vcl::Window* pParent, const tools::Rectangle& rHelpArea) override;
diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx
index acdb3f9e0d9a..37c01fa11a3d 100644
--- a/vcl/unx/gtk3/gtk3gtkframe.cxx
+++ b/vcl/unx/gtk3/gtk3gtkframe.cxx
@@ -2495,6 +2495,12 @@ bool GtkSalFrame::ShowTooltip(const OUString& rHelpText, const tools::Rectangle&
return true;
}
+void GtkSalFrame::HideTooltip()
+{
+ m_aTooltip.clear();
+ gtk_widget_trigger_tooltip_query(getMouseEventWidget());
+}
+
namespace
{
void set_pointing_to(GtkPopover *pPopOver, vcl::Window* pParent, const tools::Rectangle& rHelpArea, const SalFrameGeometry& rGeometry)
@@ -2619,6 +2625,15 @@ gboolean GtkSalFrame::signalButton( GtkWidget*, GdkEventButton* pEvent, gpointer
GtkWidget* pEventWidget = pThis->getMouseEventWidget();
bool bDifferentEventWindow = pEvent->window != widget_get_window(pEventWidget);
+ // tdf#120764 It isn't allowed under wayland to have two visible popups that share
+ // the same top level parent. The problem is that since gtk 3.24 tooltips are also
+ // implemented as popups, which means that we cannot show any popup if there is a
+ // visible tooltip. In fact, gtk will hide the tooltip by itself after this handler,
+ // in case of a button press event. But if we intend to show a popup on button press
+ // it will be too late, so just do it here:
+ if (pEvent->type == GDK_BUTTON_PRESS)
+ pThis->HideTooltip();
+
SalMouseEvent aEvent;
SalEvent nEventType = SalEvent::NONE;
switch( pEvent->type )