summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qwindow.cpp
Commit message (Collapse)AuthorAgeFilesLines
* QtGui: de-duplicate calls and cache resultsAnton Kudryavtsev2016-03-131-2/+2
| | | | | | | Change-Id: Iaf232c31d6780b49dc6a3d0faafb9717f3c36e65 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* QtGui: use printf-style qWarning/qDebug where possible (I)Marc Mutz2016-03-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The printf-style version of QDebug expands to a lot less code than the std::ostream-style version. Of course, you pay in type safety (but compilers warn about it these days), you cannot stream complex Qt types and streaming QStrings is awkward, but in many cases you actually improve on readability. But the main reason is that something that's not supposed to be executed under normal operation has no business bloating executable code size. This is not an attempt at converting all qWarnings() to printf-style, only the low-hanging fruit. In this first part, replace qWarning() << "..."; with qWarning("..."); In QTransform shared warning strings. Saves 3KiB in text size on optimized GCC 5.3 AMD64 builds. Change-Id: I142a8020eaab043d78465178192f2c8c6d1cc4f9 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-02-291-2/+2
|\ | | | | | | | | | | | | Conflicts: tests/auto/corelib/io/qprocess/tst_qprocess.cpp Change-Id: Ib6955eb874b516b185b45d6c38cec646fbaa95f4
| * QWindow: Use scaling when calling QPlatformWindow::mapTo/FromGlobal().Friedemann Kleint2016-02-251-2/+2
| | | | | | | | | | | | | | | | The platform window API uses native pixels. Task-number: QTBUG-50206 Change-Id: I1385d34bb0eacd61d77cad483e2a863d129ed129 Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
* | QtPlatformHeaders/Windows: Add function to set window activation behavior.Friedemann Kleint2016-02-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Windows OS by default does not activate windows when the calling process is not active; only the taskbar entry is flashed as not to distract the user. Nevertheless, for some use cases, it is desirable to activate the window also in the inactive state. Introduce an enumeration specifying the behavior to QtPlatformHeaders and employ a workaround using the Win32 API AttachThreadInput() to attach to other processes while setting the foreground window to achieve the AlwaysActivateWindow behavior. Task-number: QTBUG-14062 Task-number: QTBUG-37435 Change-Id: I79cb6cd3fab29d55b5d3db7f9af01bbaa5096a37 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-02-181-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This also reverts commit 018e670a26ff5a61b949100ae080f5e654e7bee8. The change was introduced in 5.6. After the refactoring, 14960f52, in 5.7 branch and a merge, it is not needed any more. Conflicts: .qmake.conf src/corelib/io/qstandardpaths_mac.mm src/corelib/tools/qsharedpointer_impl.h tests/auto/widgets/itemviews/qlistview/tst_qlistview.cpp Change-Id: If4fdff0ebf2b9b5df9f9db93ea0022d5ee3da2a4
| * QWindow: Make screen warning more informativeGabriel de Dietrich2016-02-171-1/+1
| | | | | | | | | | Change-Id: Icd7933422e272434370ae6080348de6159d2e725 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* | QtGui: eradicate Q_FOREACH loops [const-& returns]Marc Mutz2016-02-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | ... by replacing them with C++11 range-for loops. The function QObject::children() returns by const-reference, so they can be passed to range-for without further changes. Change-Id: I8cd2921165c45020914dd3a23b1f18b519fe7900 Reviewed-by: Gunnar Sletta <gunnar@sletta.org> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | QtGui: eradicate Q_FOREACH loops [rvalues]Marc Mutz2016-02-111-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | ... by replacing them with C++11 range-for loops. This is the simplest of the patch series: Q_FOREACH took a copy, so we do, too. Except we don't, since we're just catching the return value that comes out of the function (RVO). We can't feed the rvalues into range-for, because they are non-const and would thus detach. Change-Id: I457942159015ff153bdfc6d5f031a3f0a0f6e9ac Reviewed-by: Gunnar Sletta <gunnar@sletta.org> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2016-02-111-1/+1
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qfilesystemwatcher_win.cpp src/corelib/plugin/plugin.pri src/plugins/platforms/cocoa/qcocoaaccessibility.mm tests/auto/corelib/tools/qlocale/tst_qlocale.cpp Change-Id: Id6824631252609a75eff8b68792e4d10095c8fc1
| * QWindow::setMask(): Apply High DPI scaling.Friedemann Kleint2016-02-091-1/+1
| | | | | | | | | | | | | | | | | | | | Move code from QWidget::setMask() and reimplement QWidget::setMask() using QWindow::setMask(). Task-number: QTBUG-50938 Change-Id: I040688d6b18df91368fa6ab6392a3b4cd80f2683 Reviewed-by: Błażej Szczygieł <spaz16@wp.pl> Reviewed-by: Paul Olav Tvete <paul.tvete@theqtcompany.com>
| * Revert "QWindow::destroy(): only reset QGuiApp::focus_window and friends as ↵Tor Arne Vestbø2016-02-021-35/+11
| | | | | | | | | | | | | | | | | | | | | | | | a last resort" This reverts commit 4c71db756741d35ccb32dc4c32aa1823264c85df. It's too risky for 5.6, we should let it cook in dev for a while and backport when ready. Change-Id: I91e677e65d967f29c84a254cd3dffc8bb847b263 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
| * QWindow::destroy(): only reset QGuiApp::focus_window and friends as a last ↵Tor Arne Vestbø2016-01-291-11/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | resort Resetting focus_window and other internal QGuiApplication variables before calling setVisible(false) and destroying the platform window means that the platform window can't reason about whether or not it was the focus window unless it can resolve that using native APIs. We should let the platform window take care of resetting the focus window and related states, and only execute our fallback logic if the plugin doesn't do the right thing. We also use QPA to update the state instead of modifying the internal QGuiApplication variables directly, so that events and signals are emitted as a result of the reset. The QLineEdit test gets two added calls to processEvents(), since assuming that activateWindow() is synchronous is not correct, and would result in the QMenu resetting the focus window to 0 on destroy. Task-number: QTBUG-46414 Change-Id: I562788393ed0ffd77d7a4be2279862322f721c1a Reviewed-by: Błażej Szczygieł <spaz16@wp.pl> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
| * QtGui: Don't set a screen to a child windowBłażej Szczygieł2016-01-061-7/+9
| | | | | | | | | | | | | | | | This is a partial revert of eaa3a9d0108cdf692f1686cafefb7b834f0e5af6 Task-number: QTBUG-50081 Change-Id: Ic3dc4daa90d7a968a4ebf45d3029c99a12985686 Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
| * Fix crash because of NULL screen in QXcbWindowBłażej Szczygieł2016-01-041-8/+6
| | | | | | | | | | | | Change-Id: If7bbe3ad1656dadcb098bcd3ece2e7b064eeb44d Task-number: QTBUG-50081 Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* | Updated license headersJani Heikkinen2016-01-151-14/+20
| | | | | | | | | | | | | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-12-021-3/+3
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/kernel/qcoreapplication.cpp src/corelib/kernel/qeventdispatcher_blackberry.cpp src/network/bearer/qnetworkconfiguration.cpp src/plugins/bearer/blackberry/qbbengine.cpp src/plugins/platforms/android/androidjnimain.cpp src/plugins/platforms/android/qandroidplatformtheme.cpp src/plugins/platforms/qnx/qqnxbpseventfilter.cpp src/plugins/platforms/qnx/qqnxfiledialoghelper_bb10.cpp src/plugins/platforms/qnx/qqnxinputcontext_imf.cpp src/plugins/platforms/qnx/qqnxintegration.cpp src/plugins/platforms/qnx/qqnxnavigatorbps.cpp src/plugins/platforms/qnx/qqnxvirtualkeyboardbps.cpp src/plugins/platforms/qnx/qqnxwindow.cpp src/widgets/kernel/qwidgetwindow.cpp src/widgets/styles/qwindowsvistastyle.cpp src/widgets/styles/qwindowsxpstyle.cpp src/widgets/widgets/qtoolbararealayout.cpp tests/auto/corelib/global/qflags/qflags.pro tests/auto/corelib/itemmodels/qitemmodel/modelstotest.cpp tests/auto/corelib/tools/qversionnumber/qversionnumber.pro tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp Change-Id: I37be88c6c185bb85404823353e027a0a6acdbce4
| * QtBase: remove explicit function info from qWarning() etcMarc Mutz2015-11-281-3/+3
| | | | | | | | | | | | | | | | | | | | | | This information is already registered by the QMessageLogger ctor. Where, by dropping the << Q_FUNC_INFO in ostream-style qDebug(), only a string literal remained, converted to printf-style qDebug() on the go. Change-Id: I3f261c98fd7bcfa1fead381a75a82713bb75e6f3 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Use Q_UNLIKELY for every qFatal()/qCritical()Marc Mutz2015-11-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If, after checking a condition, we issue a qFatal() or a qCritical(), by definition that check is unlikely to be true. Tell the compiler so it can move the error handling code out of the normal code path to increase the effective icache size. Moved conditional code around where possible so that we could always use Q_UNLIKELY, instead of having to revert to Q_LIKELY here and there. In some cases, simplified the expressions newly wrapped in Q_UNLIKELY as a drive-by. Change-Id: I67537d62b04bc6977d69254690c5ebbdf98bfd6d Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Accept concurrent input from multiple tablet devices in QGuiApplicationRomain Pokrzywka2015-11-261-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As a follow-up to 352c357e6f0785c0775a85151d6716b47aea1006 enabling support for multiple evdevtablet plugins at runtime (one per device), we also need to adjust the way QGuiApplication handles the events received from those plugins, in particular when multiple devices are sending tablet events concurrently. Replace the static members in QGuiApplication by a vector storing the same data per-device, so tablet press/release events can be recognized independently. Change-Id: Ie0975cdb03a8f6d05903e2e2e57ceb9de73a74a4 Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com>
* | Defer QPlatformWindow creation on setVisible(true) if parent hasn't been createdTor Arne Vestbø2015-10-261-13/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a child QWindow is shown by calling setVisible(true), we don't need to create the platform window immediately if the parent window hasn't been created yet. We defer creation until the parent is created, or we're re-parented into a created parent or made top level. This optimization is more important now that we create the full parent hierarchy once we decide that we need to create a child QWindow. Change-Id: Ia4f0430f0d3709a12f41f6473c1cea6b0ef3c9cd Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Ensure QWindow::setParent() creates parent hierarchy if neededTor Arne Vestbø2015-10-261-7/+6
| | | | | | | | | | | | | | | | | | | | If the QWindow has been created and has a platform window, we need to ensure that the windows in the parent hierarchy also are created before we set a new parent on the platform window, otherwise the platform window will think that it's a top level window. Change-Id: Icb2c3cd5411cd1eb595e8673e144095feda31df9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Ensure QWindow::create() creates parent hierarchy before creating selfTor Arne Vestbø2015-10-261-0/+3
|/ | | | | | | | | | | | | To be able to create a platform window for a given QWindow we need to sync up the parent hierarchy first, so that the newly created window can be placed into that hierarchy. Without creating the parent hierarchy first, the QPlatformWindow will end up thinking it's a top level window, when in reality is represents the platform backing of a child QWindow. Change-Id: I2cad7759fbc118b04718e7a27ec7570ce1238757 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Check that QPlatformIntegration::createPlatformWindow() doesn't failTor Arne Vestbø2015-10-161-15/+21
| | | | | | | | | | We expect createPlatformWindow() to return a valid platform window. If it fails we now assert in debug, and emit a warning in release. The only platform where this is currently possible is on Windows, where the platform plugin will return 0 if CreateWindowEx for some reason fails. Change-Id: Ia2461efcfc48d180e073fa372d9c385650129e1c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* Document that QWindow::fromWinId() should be used with cautionTor Arne Vestbø2015-10-161-0/+5
| | | | | | Change-Id: I28c58fb720c323048615efe677a920f179ef9d20 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* Clarify foreign window documentation a bitTor Arne Vestbø2015-10-161-5/+6
| | | | | | | Change-Id: I50193cb0c106bc17a008e6778d2d722545c7cb1c Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* Add default argument to QPlatformWindow::isEmbedded()Tor Arne Vestbø2015-10-141-2/+2
| | | | | | | Removes magic 0-pointers at the call sites. Change-Id: I6740f6b8cc75004ab5f2ebcb3b3c95cbbdc43153 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Don't use d_func in QWindow::mapToGlobalTor Arne Vestbø2015-10-141-2/+2
| | | | | | | We initialize the variable d at the top using Q_D(const QWindow); Change-Id: I2de3b33c043024c5599b7cd1ebecae2db0b39d87 Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2015-10-021-0/+6
|\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/doc/src/qmake-manual.qdoc src/corelib/tools/qstring.h src/gui/image/qimagereader.cpp src/network/access/qnetworkaccessmanager.cpp src/tools/qdoc/doc/examples/examples.qdoc src/widgets/accessible/qaccessiblewidgetfactory_p.h src/widgets/doc/qtwidgets.qdocconf Change-Id: I8fae62283aebefe24e5ca4b4abd97386560c0fcb
| * Set positionAutomatic when using setX setYDavid Edmundson2015-09-221-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | QWindow keeps track of whether a position has been explicitly set by use of a flag positionAutomatic which gets set in setGeometry. This is used to determine if position is passed to the window manager. However calls to setX, setY via properties did not update this flag if the caller is setting it to the default position 0,0. This patch fixes that by making sure the flag is always updated. Change-Id: I2c0c002fe57efa101b3ca79e6e8b3f36cc465761 Reviewed-by: Kai Uwe Broulik <kde@privat.broulik.de> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Fix -Wcast-qual warningsThiago Macieira2015-08-131-1/+1
| | | | | | | | | | | | | | qwidget.cpp:12864:70: error: cast from type ‘const QWidget*’ to type ‘void*’ casts away qualifiers [-Werror=cast-qual] Change-Id: I7de033f80b0e4431b7f1ffff13f956cb26108af7 Reviewed-by: Martin Smith <martin.smith@digia.com>
* | Introduce cross platform high-dpi scalingMorten Johan Sørvig2015-07-301-12/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a coordinate scaling layer to QtGui, which supports 'devicePixelRatio' type high-dpi on all platforms, in production and also for development and testing purposes. High-DPI scaling is opt-in, by setting environment variables: QT_SCALE_FACTOR - sets a global scale factor QT_AUTO_SCREEN_SCALE_FACTOR - sets per-screen scale factors, where the scale factors are provided by the platform plugin. This QtGui scaling can be used instead of or in addition to scaling done by the window system. This distinction is not visible to applications [when they use Qt API], which will see a change in the value returned by the devicePixelRatio() accessors as usual. Introduce a new (private to Qt) coordinate system: native pixels. The coordinate system stack now looks like: device-independent pixels (app, upper parts of Qt) native pixels (lower parts of Qt Gui, platform plugins) device pixels (backing stores and OpenGL) Add private QHighDpi namespace with scaling functions that convert between device-independent pixels and native pixels: T toNativePixels(T, QWindow *); T fromNativePixels(T, QWindow *); Add scaling calls the QWindow (and friends) cross-platform implementation, around the calls to QPlatformWindow functions. QPlatformWindow now uses native coordinates - platform code remains largely unchanged since native coordinates are window system coordinates. QWindow now uses (possibly) scaled coordinates. This means that platform plugins no longer can rely on QWindow::geometry() and related functions. QPlatformWindow::windowGeometry() and other convenience functions have been added for use when the platform plugin needs to convert scaled geometry to native geometry. Add Qt::AA_NoHighDpiScaling, which can be use to disable any scaling in QtGui, effectively ignoring the environment variables. (Note that this does not disable any scaling done by the window system.) Contributions from Friedemann and Paul. Task-number: QTBUG-46615 Change-Id: I673bbd69c130e73b13cce83be11bfb28f580bf60 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-07-011-0/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qglobal.cpp src/corelib/global/qglobal.h src/corelib/global/qsysinfo.h src/corelib/global/qsystemdetection.h src/corelib/kernel/qobjectdefs.h src/plugins/plugins.pro tests/auto/widgets/itemviews/qlistview/qlistview.pro Change-Id: Ib55aa79d707c4c1453fb9d697f6cf92211ed665c
| * doc: mark QWindow::requestUpdate() as \since 5.5Gunnar Sletta2015-06-181-0/+2
| | | | | | | | | | Change-Id: I322e2e93edc4bdb6582c7614b9a8552221317553 Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-04-221-0/+4
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/statemachine/qstatemachine.cpp src/corelib/statemachine/qstatemachine_p.h src/gui/painting/qdrawhelper.cpp src/plugins/platforms/xcb/qxcbnativeinterface.cpp src/plugins/platforms/xcb/qxcbwindow.cpp src/plugins/platforms/xcb/qxcbwindow.h src/testlib/qtestblacklist.cpp src/tools/qdoc/node.cpp src/tools/qdoc/node.h tests/auto/gui/painting/qcolor/tst_qcolor.cpp Change-Id: I6c78b7b162001712d5774293f501b06b4ff32684
| * Enhance QWindow::devicePixelRatio() docsLaszlo Agocs2015-04-211-0/+4
| | | | | | | | | | | | | | | | | | | | Document that fact that for non-create()'ed windows this is the same as QGuiApplication::devicePixelRatio() which is the highest dpr in the system. This has consequences when running with multiple displays so application developer's have to be aware of this. Change-Id: Ic05a18732ff021659da04428cb49421ac3453870 Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-04-061-1/+8
|\| | | | | | | Change-Id: If9fd98525b6b4ca07e5e006fc98bf372a73b8a21
| * Merge remote-tracking branch 'origin/5.4' into 5.5Liang Qi2015-03-311-1/+8
| |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/android-g++/qmake.conf qmake/generators/unix/unixmake2.cpp src/gui/image/qimage_conversions.cpp Change-Id: Ib76264b8c2d29a0228438ec02bd97d4b97545be0
| | * Fix use of the window geometry specificationAlexander Volkov2015-03-271-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Until now we applied the geometry in QWidget::setVisible() by calling QWidget::move() and QWidget::resize(). But these methods are unreliable when the window is created but not visible yet. For example, specifying the window position by "-geometry +0+0" will take no effect. Apply the geometry directly to QWindow in QWindow::setVisible(). QWidget will update its geometry after the response of the window system. Besides it allows to specify the geometry for QML applications. Task-number: QTBUG-44713 Change-Id: I9a0e110e81e569c81da802729707fec104fef887 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
| | * Always clear QWindowPrivate::positionAutomatic in setFramePosition()Alexander Volkov2015-03-061-1/+1
| | | | | | | | | | | | | | | Change-Id: I3dd494eee6a133c05256cc1518853e6c5511f8b7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* | | Merge "Merge remote-tracking branch 'origin/5.5' into dev" into refs/staging/devSimon Hausmann2015-03-181-0/+2
|\| |
| * | eglfs: Generate enter and leave eventsLaszlo Agocs2015-03-141-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In addition the logic in QGuiApplication that picks the target window for input events with a null window has to be enhanced to be compatible with how real windowing systems work: mouse events following a press are delivered to the same window until the release, even if the cursor has left the original target window. Task-number: QTBUG-44814 Change-Id: I3fea84ac77a5ccebeae5def64f92d8d2e03d13ff Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* | | Implement QDebug streaming operators for QWindow, QScreen and QWidget.Friedemann Kleint2015-03-161-0/+39
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | The operators can be switched to verbose using QDebug::setVerbosity() and then provide more useful information than the standard operator for QObject. [ChangeLog][QtCore][QDebug] When streaming QWindow, QScreen, QWidget instances to a debug stream that has increased verbosity set, detailed information about geometries, states etc. will be printed. Change-Id: Ice26e00f6c713cd6244e1c1df54195e0b0de3c20 Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* | docs: QPlatformWindow::screen() and QWindow::screen() can return nullShawn Rutledge2015-03-061-1/+1
| | | | | | | | | | | | | | | | | | | | After change f4b8697c40bd476ef6bf83418e144adce7c7d4a3, it is normal on X11 to have a null screen when all outputs have been disconnected or turned off. Change-Id: I97eeefd86d97701be50f0757fe5c53ca36d79aaa Reviewed-by: Harri Porten <porten@froglogic.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* | Use QPlatformWindow::mapToGlobal()/mapFromGlobal() for Qt::ForeignWindow.Friedemann Kleint2015-02-181-6/+10
| | | | | | | | | | | | | | Task-number: QTBUG-43252 Task-number: QTBUG-41186 Change-Id: I91654b6591585dec9748982a0686becf3f5e2718 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | Add widget support for requestUpdate() and improve its docs and testsLaszlo Agocs2015-02-161-4/+9
| | | | | | | | | | | | | | | | | | | | | | We must do something when requestUpdate() is called on a QWidgetWindow. The semantics of UpdateRequest for QWindow and QWidget are unfortunately different: for widgets an UpdateRequest means "sync the backing store". For QWindow it also involves marking as dirty. Change-Id: Idf40b3fc0873652dc081edeb12c96b3007a126ef Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com> Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* | Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* | Handle gracefully the removal and re-attachment of all QScreensShawn Rutledge2015-02-071-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't crash; restore windows when all screens are removed and re-added. xcb: on configure notify, check for screen change: it may be that a window belonging to a screen which was removed has now gotten mapped to the new screen. On screen change, send a synthetic expose event, because the real expose events already happened. Task-number: QTBUG-38326 Task-number: QTBUG-32973 Task-number: QTBUG-42985 Change-Id: If334f55c248468ad3c95e7066bb14eca377d2050 Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
* | Only show QWindows after QScreen destruction if coming from virtual siblingTor Arne Vestbø2015-01-221-24/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For windows that were shown on an external screen (not a virtual sibling of the primary screen), eg. on iOS, it doesn't make sense to re-show the window when moved back to the primary screen. By moving the logic into the QScreen destructor, we ensure that the code path is hit both for the old and unsupported style way of destroying QPlatformScreen by deleting it directly, and the new and safe way of using QPlatformIntegration::destroyScreen(), while still allowing clients to manage the windows themselves by emitting screenRemoved() before applying our fallback logic. [ChangeLog][QtGui][Important Behavior Changes] QWindows will no longer be re-shown automatically when moved from a destroyed QScreen, unless that QScreen was a virtual sibling of the primary screen. Change-Id: If1105bc5ef41a5392854bb97d121c998bffa3606 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-12-291-1/+2
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qbytearray.cpp src/gui/kernel/qplatformsystemtrayicon.cpp src/gui/kernel/qplatformsystemtrayicon.h src/plugins/platforms/xcb/xcb-plugin.pro Change-Id: I00355d3908b678af8a61c38f9e814a63df808c79