summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--vcl/inc/qt5/Qt5Frame.hxx7
-rw-r--r--vcl/inc/qt5/Qt5Widget.hxx1
-rw-r--r--vcl/qt5/Qt5Frame.cxx12
-rw-r--r--vcl/qt5/Qt5Widget.cxx20
4 files changed, 6 insertions, 34 deletions
diff --git a/vcl/inc/qt5/Qt5Frame.hxx b/vcl/inc/qt5/Qt5Frame.hxx
index 01b93ad3b825..ed82c2a7a8fb 100644
--- a/vcl/inc/qt5/Qt5Frame.hxx
+++ b/vcl/inc/qt5/Qt5Frame.hxx
@@ -210,7 +210,6 @@ public:
inline bool CallCallback(SalEvent nEvent, const void* pEvent) const;
void setInputLanguage(LanguageType);
- inline bool isPopup() const;
};
inline bool Qt5Frame::CallCallback(SalEvent nEvent, const void* pEvent) const
@@ -219,10 +218,4 @@ inline bool Qt5Frame::CallCallback(SalEvent nEvent, const void* pEvent) const
return SalFrame::CallCallback(nEvent, pEvent);
}
-inline bool Qt5Frame::isPopup() const
-{
- return ((m_nStyle & SalFrameStyleFlags::FLOAT)
- && !(m_nStyle & SalFrameStyleFlags::OWNERDRAWDECORATION));
-}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/qt5/Qt5Widget.hxx b/vcl/inc/qt5/Qt5Widget.hxx
index 60db1a306efd..7bf7ead6ae9a 100644
--- a/vcl/inc/qt5/Qt5Widget.hxx
+++ b/vcl/inc/qt5/Qt5Widget.hxx
@@ -75,7 +75,6 @@ class Qt5Widget : public QWidget
void inputMethodEvent(QInputMethodEvent*) override;
QVariant inputMethodQuery(Qt::InputMethodQuery) const override;
- static void closePopup();
public:
Qt5Widget(Qt5Frame& rFrame, Qt::WindowFlags f = Qt::WindowFlags());
diff --git a/vcl/qt5/Qt5Frame.cxx b/vcl/qt5/Qt5Frame.cxx
index a4c78d1b71a7..322f293828cd 100644
--- a/vcl/qt5/Qt5Frame.cxx
+++ b/vcl/qt5/Qt5Frame.cxx
@@ -144,13 +144,11 @@ Qt5Frame::Qt5Frame(Qt5Frame* pParent, SalFrameStyleFlags nStyle, bool bUseCairo)
else if ((nStyle & SalFrameStyleFlags::FLOAT)
&& (nStyle & SalFrameStyleFlags::OWNERDRAWDECORATION))
aWinFlags |= Qt::Tool | Qt::FramelessWindowHint;
- else if (nStyle & SalFrameStyleFlags::TOOLTIP)
+ else if (nStyle & (SalFrameStyleFlags::FLOAT | SalFrameStyleFlags::TOOLTIP))
aWinFlags |= Qt::ToolTip;
- // Can't use Qt::Popup, because it grabs the input focus and generates
- // a focus-out event, reaking the compbo box. This used to map to
- // Qt::ToolTip, which doesn't feel that correct...
- else if (isPopup())
- aWinFlags = Qt::Widget | Qt::FramelessWindowHint | Qt::BypassWindowManagerHint;
+ else if ((nStyle & SalFrameStyleFlags::FLOAT)
+ && !(nStyle & SalFrameStyleFlags::OWNERDRAWDECORATION))
+ aWinFlags |= Qt::Popup;
else if (nStyle & SalFrameStyleFlags::TOOLWINDOW)
aWinFlags |= Qt::Tool;
// top level windows can't be transient in Qt, so make them dialogs, if they have a parent. At least
@@ -428,7 +426,7 @@ void Qt5Frame::Show(bool bVisible, bool bNoActivate)
pSalInst->RunInMainThread([this, bVisible, bNoActivate]() {
asChild()->setVisible(bVisible);
asChild()->raise();
- if (!bNoActivate && !isPopup())
+ if (!bNoActivate)
{
asChild()->activateWindow();
asChild()->setFocus();
diff --git a/vcl/qt5/Qt5Widget.cxx b/vcl/qt5/Qt5Widget.cxx
index ca23138b5739..6cb548c0d028 100644
--- a/vcl/qt5/Qt5Widget.cxx
+++ b/vcl/qt5/Qt5Widget.cxx
@@ -46,7 +46,6 @@
#include <cairo.h>
#include <vcl/commandevent.hxx>
#include <vcl/event.hxx>
-#include <vcl/toolkit/floatwin.hxx>
#include <window.h>
#include <tools/diagnose_ex.h>
@@ -178,13 +177,7 @@ void Qt5Widget::handleMouseButtonEvent(const Qt5Frame& rFrame, const QMouseEvent
rFrame.CallCallback(nEventType, &aEvent);
}
-void Qt5Widget::mousePressEvent(QMouseEvent* pEvent)
-{
- handleMousePressEvent(m_rFrame, pEvent);
- if (m_rFrame.isPopup()
- && !geometry().translated(geometry().topLeft() * -1).contains(pEvent->pos()))
- closePopup();
-}
+void Qt5Widget::mousePressEvent(QMouseEvent* pEvent) { handleMousePressEvent(m_rFrame, pEvent); }
void Qt5Widget::mouseReleaseEvent(QMouseEvent* pEvent)
{
@@ -598,22 +591,11 @@ void Qt5Widget::keyReleaseEvent(QKeyEvent* pEvent)
void Qt5Widget::focusInEvent(QFocusEvent*) { m_rFrame.CallCallback(SalEvent::GetFocus, nullptr); }
-void Qt5Widget::closePopup()
-{
- VclPtr<FloatingWindow> pFirstFloat = ImplGetSVData()->mpWinData->mpFirstFloat;
- if (pFirstFloat && !(pFirstFloat->GetPopupModeFlags() & FloatWinPopupFlags::NoAppFocusClose))
- {
- SolarMutexGuard aGuard;
- pFirstFloat->EndPopupMode(FloatWinPopupEndFlags::Cancel | FloatWinPopupEndFlags::CloseAll);
- }
-}
-
void Qt5Widget::focusOutEvent(QFocusEvent*)
{
m_rFrame.m_nKeyModifiers = ModKeyFlags::NONE;
endExtTextInput();
m_rFrame.CallCallback(SalEvent::LoseFocus, nullptr);
- closePopup();
}
Qt5Widget::Qt5Widget(Qt5Frame& rFrame, Qt::WindowFlags f)