summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorKatarina Behrens <Katarina.Behrens@cib.de>2019-02-13 12:24:38 +0100
committerKatarina Behrens <Katarina.Behrens@cib.de>2019-02-13 18:24:31 +0100
commitdc32f930ede9df0d7c98fdef2d5bd787139dc7cf (patch)
treed618fa352fcaeb11dbb03e1150c7bce28d60bfe5 /vcl
parentb53dc3c30a8d6bae8325cbace174c9f02b5c59cc (diff)
tdf#120787: fine-tune window flags w/ focus on floating toolbars
Floating toolbars are tool windows (Qt::Tool, not Qt::Window which has a separate taskbar entry). They are frameles (Qt::FramelessWindowHint) bc LibO takes care of drawing window decorations itself. They also must be able to receive keyboard focus (remove Qt::WindowDoesNotAcceptFocus) Change-Id: I61e8a905fdc4fde1a64df5a0824d358036cfcdea Reviewed-on: https://gerrit.libreoffice.org/67768 Tested-by: Jenkins Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/qt5/Qt5Frame.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/vcl/qt5/Qt5Frame.cxx b/vcl/qt5/Qt5Frame.cxx
index 656cd6d9f885..26db19ea62c7 100644
--- a/vcl/qt5/Qt5Frame.cxx
+++ b/vcl/qt5/Qt5Frame.cxx
@@ -93,6 +93,11 @@ Qt5Frame::Qt5Frame(Qt5Frame* pParent, SalFrameStyleFlags nStyle, bool bUseCairo)
{
if (nStyle & SalFrameStyleFlags::INTRO)
aWinFlags |= Qt::SplashScreen;
+ // floating toolbars are frameless tool windows
+ // + they must be able to receive keyboard focus
+ else if ((nStyle & SalFrameStyleFlags::FLOAT)
+ && (nStyle & SalFrameStyleFlags::OWNERDRAWDECORATION))
+ aWinFlags |= Qt::Tool | Qt::FramelessWindowHint;
else if (nStyle & (SalFrameStyleFlags::FLOAT | SalFrameStyleFlags::TOOLTIP))
aWinFlags |= Qt::ToolTip;
else if ((nStyle & SalFrameStyleFlags::FLOAT)
@@ -102,8 +107,6 @@ Qt5Frame::Qt5Frame(Qt5Frame* pParent, SalFrameStyleFlags nStyle, bool bUseCairo)
aWinFlags |= Qt::Dialog;
else if (nStyle & SalFrameStyleFlags::TOOLWINDOW)
aWinFlags |= Qt::Tool;
- else if (nStyle & SalFrameStyleFlags::OWNERDRAWDECORATION)
- aWinFlags |= Qt::Window | Qt::FramelessWindowHint | Qt::WindowDoesNotAcceptFocus;
else
aWinFlags |= Qt::Window;
}