summaryrefslogtreecommitdiff
path: root/vcl/qt5/Qt5Frame.cxx
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2019-06-14 02:08:22 +0000
committerJan-Marek Glogowski <glogow@fbihome.de>2019-06-14 18:53:07 +0200
commitb5323c72ff7e5bcde34089e49fe98e589dcc5acb (patch)
tree99ead8a9804dbb847ba0a636aec0b66cc8f75fdb /vcl/qt5/Qt5Frame.cxx
parent846c68876c214d501bf163eede4288d7a307ec8a (diff)
KDE5 move screensafer inhibiting code into Qt5
There will presumably be more X11 specific code later to implement some "fix" for tdf#119202. Moving the screensafer inhibitor is rather uncontroversial in comparion, so start with it and use it to carry the matching configure.ac changes. A little "nightmare" are all the clashing X11 / Qt type undefs, but I couldn't find a better solution while the inhibitor continues to include the X11 headers in it's header. Change-Id: I55c89c76726d30a890178488484e954207267e89 Reviewed-on: https://gerrit.libreoffice.org/74015 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'vcl/qt5/Qt5Frame.cxx')
-rw-r--r--vcl/qt5/Qt5Frame.cxx26
1 files changed, 22 insertions, 4 deletions
diff --git a/vcl/qt5/Qt5Frame.cxx b/vcl/qt5/Qt5Frame.cxx
index 270885249298..3951dbced768 100644
--- a/vcl/qt5/Qt5Frame.cxx
+++ b/vcl/qt5/Qt5Frame.cxx
@@ -45,6 +45,10 @@
#include <QtWidgets/QMenuBar>
#include <QtWidgets/QMainWindow>
+#if QT5_USING_X11
+#include <QtX11Extras/QX11Info>
+#endif
+
#include <saldatabasic.hxx>
#include <window.h>
#include <vcl/layout.hxx>
@@ -635,11 +639,25 @@ void Qt5Frame::ShowFullScreen(bool bFullScreen, sal_Int32 nScreen)
}
}
-void Qt5Frame::StartPresentation(bool)
+void Qt5Frame::StartPresentation(bool bStart)
{
- // meh - so there's no Qt platform independent solution - defer to
- // KDE5 impl. For everyone else:
- // https://forum.qt.io/topic/38504/solved-qdialog-in-fullscreen-disable-os-screensaver
+// meh - so there's no Qt platform independent solution
+// https://forum.qt.io/topic/38504/solved-qdialog-in-fullscreen-disable-os-screensaver
+#if QT5_USING_X11
+ boost::optional<unsigned int> aRootWindow;
+ boost::optional<Display*> aDisplay;
+
+ if (QX11Info::isPlatformX11())
+ {
+ aRootWindow = QX11Info::appRootWindow();
+ aDisplay = QX11Info::display();
+ }
+
+ m_ScreenSaverInhibitor.inhibit(bStart, "presentation", QX11Info::isPlatformX11(), aRootWindow,
+ aDisplay);
+#else
+ (void)bStart;
+#endif
}
void Qt5Frame::SetAlwaysOnTop(bool bOnTop)