summaryrefslogtreecommitdiff
path: root/vcl/qt5/QtFrame.cxx
AgeCommit message (Collapse)Author
2022-01-19WASM Qt: various EMSCRIPTEN adaptionsJan-Marek Glogowski
* Don't create a native window handle * Use a static QMimeData for non-working clipboard * Use Qt::Tooltip for LO's popup windows Change-Id: I6b6edfa26466814cb0500116098eafcbe41bba26 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128587 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2022-01-14VCL drop m_pInstance from *nix SalDataJan-Marek Glogowski
AKA the "*nix SalData untangling" commit. The original plan was to get rid of vcl/inc/saldatabasic.hxx and even SalData for all the *nix backends. But after many backs and forths, reinspecting the code and imagining the resulting code, I decided against that plan. All these variants would have resulted in reinterpret_cast calls, I wanted to prevent. And they would have required larger renames for no benefit. An other, related idea was to include all SalData implementations in the vcl/inc/svdata.hxx header, but that seemed like an include explosion, so was also dropped. I tried to untangling iOS from using GenericUnixSalData, as it doesn't use any of it's features. The new, minimal SalData should be sufficient. I'm leaving the easier drop of mpInstance from the Windows and MacOSX backend as a minimal interesting EasyHack. Change-Id: I5be01c1f42131a7e31cb30899392308e1e2de53b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128402 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2022-01-09Qt minimize modal reparenting a bitJan-Marek Glogowski
Change-Id: Ie7203e9d92e5971de6c2730ff847f351e5641c9f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128178 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2022-01-09Qt use platform-independent visibility functionsJan-Marek Glogowski
show() isn't just some conveniently renamed setVisible(true), but presents a window in a platform-dependant way, which - at least for WASM - means maximized and without a title bar. This is not really expected and WASM can also use multiple windows. Change-Id: I3fbaec1dfc2cd32bf3a90a94dcee01ebc88e58c7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128179 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2021-12-21tdf#131467 Qt set default position on first resizeJan-Marek Glogowski
Setting the position in Show() is too late, because LO will try to set the mouse pointer to the default button, if configured. That obviously needs the window position. And also take the menubar offset into account. Change-Id: Ia280539c082ff6f675966869fb6643a41a17d696 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127154 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2021-12-21Qt use asChild for pointer positioningJan-Marek Glogowski
.. and refactor some variable names. Change-Id: I7d31a7a377f614bdd78f8d09852a2eda0cc47442 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127153 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2021-12-01Qt fix non-X11 build and introduce CHECK_* macrosJan-Marek Glogowski
Explicitly uses ANY, so it's hopefully easier to read then QT, QT5 and QT6 in the otherwise same macro names. Change-Id: Ie9bbbc858f5f9db5c8b429c7b0d8a897ac6159fc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126168 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2021-11-17Qt resolve native winId() on demandJan-Marek Glogowski
As for gtk3 in commit ac9789dbb36f45dcc1caf7dd2951353b1574c8ea ("tdf#139609 avoid fetching unnecessary xid under gtk3"). Change-Id: I82b2c22437e5ab957706c25fcc118b28abb07242 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125395 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins
2021-11-17Qt refactor SystemEnvData setupJan-Marek Glogowski
Change-Id: I900d1079c9a832a9b5170e58ce4e7a8b81d7d01b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125393 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de> Tested-by: Jenkins
2021-11-11qt (>=5.14): Don't create native window for QWidget in QtFrame::screenMichael Weghorn
For Qt >= 5.14, directly use 'QWidget::screen' (added in Qt 5.14) to retrieve the screen that the widget is on, rather than first retrieving a window handle, which forces a platform-native window to be created. Due to QTBUG-75766 [1], forcing the creation of native windows also leads to mouseMoveEvents not being reliably emitted by Qt, s. commit 0e3c3b842e14b9646d3697cf1266be21359e0f13 Author: Michael Weghorn <m.weghorn@posteo.de> Date: Sat May 11 21:31:33 2019 +0200 tdf#122293 qt5: Use "alien widgets" by default on Wayland for more details. The behaviour described in tdf#122293 started showing up again after commit b00a68a8e19370e106cd76258a3c1825f43613ee Date: Sun Oct 31 02:33:46 2021 +0200 tdf#145363 Qt reparent modal dialogs on show but that just seems to have been a side-effect of 'QWidget::screen' now being called in different ways than previously. [1] https://bugreports.qt.io/browse/QTBUG-75766 Change-Id: Ic11923cef5e704c09494f96b19157372a869ae40 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124997 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2021-11-10tdf#145508 Qt NONE-frames should still be windowsJan-Marek Glogowski
This drops the newly "&& (nStyle != SalFrameStyleFlags::NONE))" introduced in the regressing commit e4abf879f4a24258bcc560eb58ca78b147768d46 ("tdf#145363 Qt popups actually are windows"). A GtkBox based UI snippet, like vcl/uiconfig/ui/combobox.ui, IMHO shoulden't be represented as a Qt::Window, but a Qt::Widget. But there is no real way to identify it, so lets keep the old, working code. Change-Id: Ic41ff15ab651b422ee95c906cac67e37be8d8a65 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124958 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2021-10-31tdf#145363 Qt reparent modal dialogs on showJan-Marek Glogowski
Simply said, one can't have two modal dialogs open at the same parent in Qt. All modal windows must open as a stack, each parented to the previous one. This is kind of logical. Unexpectedly Qt totally breaks, if you open two modal dialogs on the same window. This happens, because the existing paragraph style dialog and the "sub" "list style" dialog are both children of their Writer window. I'm not sure the additionally introduced QWidget-based parent handling is strictly needed. It seems Ok. So for every visibility and modality change, we reparent the Qt widget, either on top of the modal stack or restore the original LO-based parent. The LO hierachy is never changed! Change-Id: Id209c9aa67774440089dc50a6648ac293950087a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124500 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2021-10-31tdf#145363 Qt popups actually are windowsJan-Marek Glogowski
An other patch in the whole Qt popup handling saga. At this point it mainly exists as a prerequisite for the real tdf#145363 fix. I just wanted to keep it separate. Maybe it also helps Qt Wayland. Change-Id: Ib76e9919398bdd5fa7d6239ddb126859f0c0edbf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124525 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2021-10-31Qt de-obfuscate the aWinFlags assignmentJan-Marek Glogowski
The aWinFlags assignement is an obfuscated case statement, so this explicitly defaults to Qt::Widget and drops the whole or'ing. Change-Id: If6ac1817d1e600a174c1308a3bad0af5f3f9c30b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124524 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
2021-10-22qt: Adapt log area: "vcl.qt5" -> "vcl.qt"Michael Weghorn
And also: "vcl.opengl.qt5" -> "vcl.opengl.qt" Change-Id: I86f8a34cb8c1303a81ffbf40c801ba628f3fa0d4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124065 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2021-10-22Rename SystemEnvData::Toolkit::{Qt5 -> Qt}Michael Weghorn
It's used for the qt6 VCL plugin as well. Change-Id: I3f57258c2c8e3c12532d79b44f24105a30590675 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124064 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2021-09-29qt6: Add a qt6 VCL pluginMichael Weghorn
This adds a new "qt6" VCL plugin based on Qt 6. Building the plugin is enabled by autogen option '--enable-qt6' (and optionally setting 'QT6DIR' as needed). Use the 'SAL_USE_VCLPLUGIN=qt6' environment variable before running LO to select this VCL plugin. Taking qt6 into account at all relevant places certainly still requires follow-up changes, but this builds and runs with a self-compiled qtbase from the 'dev' git branch as of commit 3ce0672143d2eb3c3809f82998a4d71c5800d77a. I didn't see anything obviously broken in a quick run, but didn't test much. This reuses and shares the qt5 VCL plugin code; the qt6 headers and sources for now just '#include' the qt5 ones. Version checks are used for the code places that need different handling to be built against Qt 6. The build system parts in this commit were mostly done by copying the qt5 equivalents, then adapting as needed. Some notes on things I came across while porting to qt6: 1) At least in my self-compiled Qt versions, 'moc' (the meta-object compiler) is located in the 'libexec' subdirectory in 'QT6DIR', while the Qt 5 equivalent is located in the "bin" subdirectory of 'QT5DIR', so the configure.ac check uses the former. 2) moc does not process classes from the included headers. Since the headers in 'vcl/inc/qt6' just '#include' the ones from 'vcl/inc/qt5', running moc on the qt6 headers doesn't work, so moc is currently run on the qt5 headers for qt6 as well (s. 'vcl/CustomTarget_qt6_moc.mk'). That will have to be adapted in case the qt6 VCL plugin uses "own" headers instead of just including the qt5 ones at some point. 3) QX11Extras has been removed from Qt 6. [1] says: > Changes to Qt X11 Extras > > The QX11Info class has been removed. > > Clients that still rely on the functionality can include the private > header <QtGui/private/qtx11extras_p.h> as a stopgap solution. To enable > private headers use QT += core-private with qmake, or add a project > dependency to Qt::CorePrivate with CMake. I didn't take any closer look, just dropped the use of QtX11Extras for qt6 for now. 4) XCB_ICCCM is no longer needed. It is only used in qt5 to workaround a Qt bug fixed in Qt 5.12, s. commit fe2baf9e84e0ca9aeaa683e37076f57fa3f38dca Author: Jan-Marek Glogowski <jan-marek.glogowski@extern.cib.de> Date: Tue Dec 3 08:32:58 2019 +0100 Qt5 fix missing XCB_ICCCM_WM_HINT_WINDOW_GROUP 5) X11-specific code is still used for key modifier handling. Therefore, still check for the XCB headers when 'USING_X11' is set in configure.ac, and use a 'QT6_USING_X11' define (as qt5 uses 'QT5_USING_X11'). 6) There's currently no Qt 6 video sink for GStreamer. As of today, qt-gstreamer is unmaintained and there is no Qt 6 version. The project's README [2] says: > 0. Maintenance Notice > --------------------- > > This code is unmaintained. You can use it at your own risk. > > If you want to integrate video display in your QML-based UI, > you should consider using 'qmlglsink', from gst-plugins-good. > This is a well supported video sink that uses the generic > gstreamer-gl stack and is in many ways superior to 'qtquick2videosink' > that is provided by qt-gstreamer. You can use this code as an example: > https://cgit.freedesktop.org/gstreamer/gst-plugins-good/tree/tests/examples/qt/qmlsink > > If you are not interested in using QML in your UI, then you > may use one of the other elements provided by this module > (see below). If you do that, it would be helpful to let us > know that this code is still useful to you. We may consider > adding these elements in one of the core gstreamer modules. > > If you are here for the Qt-style bindings, I'm sorry to disappoint you. > The alternative is to use the C API, or the GStreamermm C++ API. > Qt-style bindings are cool, but unfortunately they are very hard > to maintain because they are written by hand. If you are interested > in continuing this project, you are welcome to implement a > generator for them, probably based on GObject-Introspection. > I am happy to provide directions if you want to pursue such a thing. Therefore, the Qt video sink handling is qt5-only and the corresponding handling for GOBJECT (used for the GStreamer video sink handling) was not taken over for qt6. This presumably means that video playback in Impress presentations does not work when using qt6 with they Qt Wayland plugin, s. tdf#125219 for the corresponding bug for qt5/kf5. (I did not build the qtwayland module to actually test this, though. Video playback with the Qt xcb plugin in a Wayland session works.) [1] https://doc-snapshots.qt.io/qt6-dev/extras-changes-qt6.html [2] https://cgit.freedesktop.org/gstreamer/qt-gstreamer/tree/README Change-Id: Ib105ccfb2c3630ec5d5403793a3cd9ba31d85bdf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122808 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2021-09-29qt5: Rename sources + headers according to new class namesMichael Weghorn
This renames the source and header files according to the new class names without a "5" in them, as mentioned in Change-Id: Idf422f82ca9dafbb70e9a64de9c8cfc4cc8c0909 (qt5: Remove "5" from class names in qt5 VCL plugin): > Renaming the headers and source files will be done > in a separate commit to make tracking git history easier. Change-Id: If955e77c8ba508d0a2e01e3a9df1be6dc04c4e4e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122806 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>