summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-06-30 11:45:16 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-06-30 11:47:06 +0100
commitf43058753b6d9850261ab050d14de7b9e4ec8a37 (patch)
tree6273eea36208164f6dd7ce490b0cbbd84394f79b
parent6b2006c26713793867cfa2527d2d9c67e94ddb7d (diff)
gtk3: detect if a new frame is just a tooltip
Change-Id: I906f53ca5428b51077b4ac28462c2e8827f2a31f
-rw-r--r--vcl/unx/gtk/fpicker/SalGtkPicker.cxx23
1 files changed, 17 insertions, 6 deletions
diff --git a/vcl/unx/gtk/fpicker/SalGtkPicker.cxx b/vcl/unx/gtk/fpicker/SalGtkPicker.cxx
index 2d2ff309616a..6f9cfb21b5f3 100644
--- a/vcl/unx/gtk/fpicker/SalGtkPicker.cxx
+++ b/vcl/unx/gtk/fpicker/SalGtkPicker.cxx
@@ -25,6 +25,8 @@
#include <com/sun/star/lang/XMultiComponentFactory.hpp>
#include <com/sun/star/uri/ExternalUriReferenceTranslator.hpp>
+#include <com/sun/star/accessibility/XAccessibleContext.hpp>
+#include <com/sun/star/accessibility/AccessibleRole.hpp>
#include <comphelper/processfactory.hxx>
#include <rtl/process.h>
#include <osl/diagnose.h>
@@ -132,15 +134,24 @@ RunDialog::~RunDialog()
g_source_remove_by_user_data (this);
}
-void SAL_CALL RunDialog::windowOpened( const ::com::sun::star::lang::EventObject& )
- throw (::com::sun::star::uno::RuntimeException, std::exception)
+void SAL_CALL RunDialog::windowOpened(const css::lang::EventObject& e)
+ throw (css::uno::RuntimeException, std::exception)
{
-#if !GTK_CHECK_VERSION(3,0,0)
SolarMutexGuard g;
+
+ //Don't popdown dialogs if a tooltip appears elsewhere, that's ok, but do pop down
+ //if another dialog/frame is launched.
+ css::uno::Reference<css::accessibility::XAccessible> xAccessible(e.Source, css::uno::UNO_QUERY);
+ if (xAccessible.is())
+ {
+ css::uno::Reference<css::accessibility::XAccessibleContext> xContext(xAccessible->getAccessibleContext());
+ if (xContext.is() && xContext->getAccessibleRole() == css::accessibility::AccessibleRole::TOOL_TIP)
+ {
+ return;
+ }
+ }
+
g_timeout_add_full(G_PRIORITY_HIGH_IDLE, 0, reinterpret_cast<GSourceFunc>(canceldialog), this, NULL);
-#else
- SAL_WARN( "vcl", "ignoring windowOpened, because gtk3 dialog is probably not modal as expected and a tooltip was triggered" );
-#endif
}
void SAL_CALL RunDialog::queryTermination( const ::com::sun::star::lang::EventObject& )