summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2017-12-08 11:37:18 +0000
committerJan-Marek Glogowski <glogow@fbihome.de>2018-01-03 10:20:45 +0100
commit15d9087ff1e495e234b2cf073329c3358abb4dc0 (patch)
treedb61a4165da49e2d422f830d21e361572433548a /vcl
parentd857e2780e882810bd2d615c0a5252c35c54d987 (diff)
Qt5 set and update the frame geometry
The geometry is used for mouse hit tests for mapping LO mouse events to popup positions. This way (popup) menus become at at least usable. Change-Id: Ic2b409d7a8937320c70b9f377374fe7d51e4ebf3 Reviewed-on: https://gerrit.libreoffice.org/47276 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/qt5/Qt5Frame.cxx27
-rw-r--r--vcl/qt5/Qt5Widget.cxx3
2 files changed, 29 insertions, 1 deletions
diff --git a/vcl/qt5/Qt5Frame.cxx b/vcl/qt5/Qt5Frame.cxx
index 95e3363efe3f..cb44b71f6e2c 100644
--- a/vcl/qt5/Qt5Frame.cxx
+++ b/vcl/qt5/Qt5Frame.cxx
@@ -99,6 +99,20 @@ Qt5Frame::Qt5Frame(Qt5Frame* pParent, SalFrameStyleFlags nStyle, bool bUseCairo)
if (pParentWindow != pChildWindow)
pChildWindow->setTransientParent(pParentWindow);
}
+
+ // fake an initial geometry, gets updated via configure event or SetPosSize
+ if (m_bDefaultPos || m_bDefaultSize)
+ {
+ Size aDefSize = CalcDefaultSize();
+ maGeometry.nX = -1;
+ maGeometry.nY = -1;
+ maGeometry.nWidth = aDefSize.Width();
+ maGeometry.nHeight = aDefSize.Height();
+ maGeometry.nTopDecoration = 0;
+ maGeometry.nBottomDecoration = 0;
+ maGeometry.nLeftDecoration = 0;
+ maGeometry.nRightDecoration = 0;
+ }
}
Qt5Frame::~Qt5Frame()
@@ -292,6 +306,9 @@ void Qt5Frame::SetPosSize(long nX, long nY, long nWidth, long nHeight, sal_uInt1
nY += aRect.y();
}
+ maGeometry.nX = nX;
+ maGeometry.nY = nY;
+
m_bDefaultPos = false;
m_pQWidget->move(nX, nY);
}
@@ -434,7 +451,15 @@ bool Qt5Frame::MapUnicodeToKeyCode(sal_Unicode aUnicode, LanguageType aLangType,
LanguageType Qt5Frame::GetInputLanguage() { return LANGUAGE_DONTKNOW; }
-void Qt5Frame::UpdateSettings(AllSettings& rSettings) {}
+void Qt5Frame::UpdateSettings(AllSettings& rSettings)
+{
+ StyleSettings style(rSettings.GetStyleSettings());
+
+ const int flash_time = QApplication::cursorFlashTime();
+ style.SetCursorBlinkTime(flash_time != 0 ? flash_time / 2 : STYLE_CURSOR_NOBLINKTIME);
+
+ rSettings.SetStyleSettings(style);
+}
void Qt5Frame::Beep() {}
diff --git a/vcl/qt5/Qt5Widget.cxx b/vcl/qt5/Qt5Widget.cxx
index c1cb8e7ce9ff..526662b15c34 100644
--- a/vcl/qt5/Qt5Widget.cxx
+++ b/vcl/qt5/Qt5Widget.cxx
@@ -82,6 +82,9 @@ void Qt5Widget::resizeEvent(QResizeEvent*)
m_pFrame->m_pQImage.reset(pImage);
}
+ m_pFrame->maGeometry.nWidth = size().width();
+ m_pFrame->maGeometry.nHeight = size().height();
+
m_pFrame->CallCallback(SalEvent::Resize, nullptr);
}