summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* xcb: Fix available geometry after rotationAlexander Volkov2020-12-132-5/+10
QXcbVirtualDesktop::m_workArea is not updated after screen rotation if _NET_WORKAREA is not updated, e.g. when a window manager is not running. Use width of -1 for m_workArea to indicate that _NET_WORKAREA is not set and thus there is no need to find its intersection with screens' geometries. Pick-to: 5.15 6.0 Change-Id: Ic1f3ec23576ed8407a76cc2b9f84a145c67b1d4b Reviewed-by: Liang Qi <liang.qi@qt.io>
* Stylesheet example: Get rid of auto-connection slotsAlexander Volkov2020-09-253-16/+21
| | | | | Change-Id: I55d89cf33e5f9c8aef3a3dfbbdcd212415d35bcb Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* xcb: Avoid BadMatch error when creating non-OpenGL windowAlexander Volkov2020-09-251-13/+3
The Xorg Server requires colormap when creating a window if the window's parent either has a different visual or has no colormap. To simplify logic and avoid extra requests, create a new window with colormap unconditionally. Pick-to: 5.15 Change-Id: I21a53f9146ae0a03b38bb3a07c8a478043a2eb89 Reviewed-by: Liang Qi <liang.qi@qt.io>
* Simplify QHighDpi::fromNativeLocalExposedRegion()Alexander Volkov2020-09-231-7/+3
... by using QRectF::toAlignedRect(). Change-Id: I310b2f0ad87c541aa0d63d6a8061783aff791abb Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* xcb: Reduce number of created colormapsAlexander Volkov2020-09-164-12/+26
Create a colormap per visual, not per window. Pick-to: 5.15 Change-Id: I97d94618f159b4beaffd4a1afe0611233ced6676 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* xcb: Fix comments' indentationAlexander Volkov2020-05-253-3/+3
Change-Id: Ic0a3e65dd1abc907f1941590ab042f785d90d91c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* xcb: Add support for XdndActionList propertyAlexander Volkov2020-03-234-7/+118
This allows to pass and receive possible drop actions from other processes, including GTK applications. Fixes: QTBUG-75744 Change-Id: I944edc6fa00f8801a25912e70eb104a647a9fc0e Reviewed-by: JiDe Zhang <zccrs@live.com> Reviewed-by: Liang Qi <liang.qi@qt.io>
* Doc: Clarify ownership of added menu for QMenuBar::addMenu(QMenu *)Alexander Volkov2019-12-091-1/+2
| | | | | | Change-Id: Iaafba9557ece36607c86d5be4fbb5e4ac2e459d3 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Avoid crash in menu that was previously shown as submenuAlexander Volkov2019-12-091-0/+2
Reset sloppyState for the previous submenu, so that if it will be shown as a menu, it will not use an incorrect pointer. Fixes: QTBUG-80528 Change-Id: If2ba8c3a664983ee76eb90d2c9a8096e2bd0a4e6 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* xcb: Simplify code by using helper QXcbIntegration::defaultConnection()Alexander Volkov2019-11-201-2/+1
Change-Id: Ieb0e21d85fcd0c168b1bb090e967d02a8a6a6083 Reviewed-by: Mikhail Svetkin <mikhail.svetkin@gmail.com>
* QKeySequence: Add missing names for multimedia keysAlexander Volkov2019-10-241-0/+6
Task-number: QTBUG-40030 Change-Id: Ib34bcbf42d6dd1206209c2d76444fd8c777278fe Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* doc: Fix variable name in QDBusArgument snippetAlexander Volkov2019-09-271-1/+1
Change-Id: I751802d3f9f389e80cbb9aabcdb637d4742d3832 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Avoid invalid memory access in QIconCacheGtkReader::lookup()Alexander Volkov2019-09-021-1/+1
If name argument is empty, e.g. an icon is created by QIcon::fromTheme(""), then icon_name_hash() will access a byte at index 1, which is outside of the string. Change-Id: I109c476718939d7dd252007ebac48c3dbbeceb72 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Avoid rounding of the size in QGraphicsPixmapItem::boundingRect()Alexander Volkov2019-05-091-2/+2
Fixes: QTBUG-75458 Change-Id: Ib240ddc0b490ae3c0348b6bfa290ad1f51b1e071 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Use QPlatformTheme::TouchDoubleTapDistance for touch eventsAlexander Volkov2019-05-013-10/+21
... and update the cached values on theme change. Modify tst_QWidget::touchEventSynthesizedMouseEvent() to avoid unexpected double click detection. Change-Id: I151c47e851ebba7550b1b09caca2781c28d7d3d9 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QSystemTrayIcon/X11: Create tray icon window when system tray appearsAlexander Volkov2019-04-232-22/+57
... and destroy it otherwise. Fixes: QTBUG-61898 Fixes: QTBUG-73459 Done-with: Gatis Paeglis <gatis.paeglis@qt.io> Change-Id: I6bd8f397f7ccdb123f6a60d4fa466f7b0d760dfc Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* Fix effects for highdpi graphical itemsAlexander Volkov2019-04-103-6/+9
Create a highdpi pixmap as a source for graphical effects. Fixes: QTBUG-74963 Change-Id: Ie144df3dbe61421fb28e639e640857aca6e6320f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Forward physical parameters for derived QImagesAlexander Volkov2019-04-012-9/+62
| | | | | | | | | | More specifically, for masks and rotated images. Add tests for it, also add tests that image metadata is forwarded for converted and copied images. Fixes: QTBUG-49259 Change-Id: I05d4a468b17f53a2625500b871c01b2c53b981a1 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Forward devicePixelRatio in QPixmap::mask()Alexander Volkov2019-04-012-0/+35
Also add a test checking that devicePixelRatio is forwarded to derivatives of QPixmap. Change-Id: Idb2b3f033ccc0fd49bf54b11f5dffbce5a19b006 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Handle device pixel ratio in QIconLoaderEngine::paint()Alexander Volkov2019-03-201-1/+4
QIcon::paint() paints blurry icons on HighDPI screens. In particular, it is called by QCommonStyle to paint icons for CE_ItemViewItem's. Change-Id: Iffe6bd01a8756e617656195ef63fe13c968e0832 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Force font antialiasing with highdpi scalingAlexander Volkov2019-03-201-1/+1
Fonts look ugly when they are drawn scaled without antialiasing. Change-Id: I64268db5b37d4bc763ffa23632aca2eaac5d8eae Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* QListView: Fix Shift+click selection for non-default itemAlignmentAlexander Volkov2019-02-273-3/+66
QListView::setSelection() algorithm is designed for items to occupy their cells completely, which is not the case when itemAlignment is used. The middle part of the selection rect goes beyond the column borders and extra items are selected. Use the introduced cellRectForIndex() instead of rectForIndex() to calculate the middle part correctly. Fixes: QTBUG-73684 Change-Id: I4a1e42a056d56e85a16d8ae0ffe18b78d1d6deb7 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Improve keyboard navigation in QListView when isWrapping is enabledAlexander Volkov2019-02-062-8/+51
Search the previous item or the next item in a model instead of searching them on visual layout. This way the cursor will not stop at the beginning or at the end of a row or a column. Fixes: QTBUG-14444 Change-Id: I0ef203a4dcd876e4c50559fb87e61585f07434d1 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* xcb: Avoid repaint lags with DnDAlexander Volkov2019-01-253-2/+19
The lags can be seen when dragged data is requested for a MIME type. This leads to calling QXcbClipboard::waitForClipboardEvent() which runs a loop in the GUI thread and processes events from QXcbEventQueue. The loop ends when a corresponding event is received, otherwise it makes a delay of 50 ms before the next iteration. Sync with QXcbEventQueue thread by QWaitCondition instead of using the delay. This way the loop will end as soon as possible and Expose events will be processed with minimal delay. Task-number: QTBUG-44849 Fixes: QTBUG-55442 Fixes: QTBUG-62344 Fixes: QTBUG-73253 Change-Id: Ie18d63b51a7260c83d53ffe1169b25e5135dd73b Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io> Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QDialog: Pass transient parent as a parent to native dialogsAlexander Volkov2018-12-242-4/+7
Sometimes it's needed to show a native dialog for another process, for example in xdg-desktop-portal-kde. In this case we have WId of a parent window which can be used for calling QWindow::setTransientParent(QWindow::fromWinId(...)). Pass this transient parent to a native dialog so it could use it as a transient parent for itself. Rename QDialogPrivate::parentWindow() for clarity. Change-Id: I68974ddea35f9366a0ddffe602d9d028f45e26fa Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Notepad example: Get rid of auto-connection slotsAlexander Volkov2018-11-013-43/+60
Their correctness is not checked at compile time and even object renames can break code. Change-Id: I99273a28743a79a76c00e6db0ed4cd6d7eba8bf2 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* QWidgetTextControl: Get rid of dependency on QTextEditPrivateAlexander Volkov2018-10-092-10/+8
| | | | | | | | | QWidgetTextControl is a base class for controls of text widgets and widget-specific code should be used in derived classes, so override loadResource() in QTextEditControl. Change-Id: I6d829ead0837419530094d19e0ca53a964413e92 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Fix drawing of QGroupBox's title when check box is higher than textAlexander Volkov2018-10-091-11/+16
| | | | | | Task-number: QTBUG-70623 Change-Id: I36c3b3e0250a4d2b0a2a2f03793f0eae3d868de2 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QSideBar: take the icon size from a styleAlexander Volkov2018-10-092-3/+11
Change-Id: I9c4677b42cc920b7bb016b61b8c1fd34fe67aa30 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QLineEdit: take the size of actions' icons from a styleAlexander Volkov2018-10-062-2/+3
The height of a line edit depends on the height of its font, which in turn depends on DPI. So use the DPI-scaled icon size from a style instead of hard-coded values. Task-number: QTBUG-65627 Change-Id: Ic1f5af61b0d6346cfbc828817c4a3a39296a41ba Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Allow to prevent blocking of native dialogs by a proxy Qt dialogAlexander Volkov2018-10-023-0/+32
When native dialogs become visible, their invisible proxy Qt dialog blocks input to Qt windows. It is intended for native dialogs which can't block Qt windows themselves, e.g. on Android. But this behavior is incompatible with native dialogs which are implemented as in-process Qt windows, because the proxy dialog blocks them as well. This change introduces QPlatformDialogHelper::DialogIsQtWindow style which allows to detect such cases and prevent blocking. Change-Id: I8f1f741e05d09f2c27192890bcec35fdd2e8f074 Task-number: QTBUG-58116 Reviewed-by: Alberto Mardegan <mardy@users.sourceforge.net> Reviewed-by: David Faure <david.faure@kdab.com>
* xcb: Extract QXcbWindow::isTrayIconWindow()Alexander Volkov2018-09-293-4/+7
| | | | | | | | Introduce this static function to detect tray icon windows. The old non-static method was unused, so drop it. Change-Id: Ia97b8a857bd1807ecd56340efbc9b145844d593e Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* xcb: Initialize OpenGL integration only when requiredAlexander Volkov2018-09-294-34/+46
In some cases OpenGL integration may be unnecessary, e.g. an application may set Qt::AA_ForceRasterWidgets attribute and don't use OpenGL in any other way. In addition OpenGL initialization can take noticeable time on some configurations. So do it on demand only. Change-Id: If88953f8d5c826bc96fd49eb397b5e1ad693546d Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* doc: Add missing override and remove redundant virtual for snippetsAlexander Volkov2018-08-1637-95/+95
Change-Id: I2395fd01b93c4ea364225e0cf1a5f59908b691d0 Reviewed-by: Martin Smith <martin.smith@qt.io>
* Make QMessageBox window with the detailed text closableAlexander Volkov2018-08-142-0/+16
QMessageBox window ignores QCloseEvent if it was created with Ok button and the detailed text was set. But it can be closed if it contains only one button. Make it closable if there are two buttons and one of them is the "Show Details..." button. [ChangeLog][QtWidgets][QMessageBox] A message box with two buttons, one of which is the "Show Details..." button, can be closed by clicking the X button on the window's title bar. Task-number: QTBUG-69526 Change-Id: Iba09e38561eb3898dc2aecfd38d8519d512a71c1 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QLineEdit: Fix behavior of DeleteStartOfWord keyAlexander Volkov2018-07-161-1/+2
DeleteStartOfWord key behaves like Delete key when the cursor is at the beginning of the line. Do nothing instead. Task-number: QTBUG-65855 Change-Id: I56402961b44ec6fe3a382df68a76db36891c4522 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* xcb: Monitor XSETTINGS changeAlexander Volkov2018-07-101-0/+1
Register QXcbXSettings object as a listener of events received by XSETTINGS window. It was forgotten to be done in 0f31a5d91f13bd6a574bed8db894a7ebb2813292 which introduced QXcbXSettings. XSettings are used by QXcbCursor to get cursor theme. Without this change QXcbCursor can't react on theme change. Change-Id: I0fdd4c913b1d7a482b507c5a054b7052cac61666 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* xcb: Move handling of RRScreenChangeNotify from QXcbScreen to QXcbVirtualDesktopAlexander Volkov2018-07-093-100/+103
This event relates to xcb_screen_t (virtual desktop), not to RandR crtcs, so move its processing to QXcbVirtualDesktop. Currently it triggers redundant calling of RRGetCrtcInfo (from QXcbScreen::updateGeometry()). It's called anyway after receiving RRCrtcChangeNotify, so just drop it. There is also a mess between the rotation of Screen and crtcs, obviously they should be processed separately. Task-number: QTBUG-65598 Change-Id: I124752ccbde03adb15e9ba592dd8b2d8d7fc35f4 Reviewed-by: Daniel Vrátil <dvratil@kde.org> Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* xcb: Remove unused QXcbNativeInterface::locateSystemTray()Alexander Volkov2018-07-102-21/+0
| | | | | | | It was forgotten to be removed in 8f9a72c39df46e94b38dd804b7cdffaed9f340b9. Change-Id: I028bea448a2c99cdbdfa0db07de2b1fcd50c93b2 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* QSystemTrayIcon/X11: Move platform-specific calls to the xcb pluginAlexander Volkov2018-07-1013-311/+12
| | | | | | | | | | | | | | | | | | | | | - Detect the tray icon window in the platform plugin by the object name. This way we don't need QXcbWindowFunctions::requestSystemTrayWindowDockIdentifier(). - Get rid of unused calls QXcbIntegrationFunctions::xEmbedSystemTrayVisualHasAlphaChannel() and QXcbWindowFunctions::setParentRelativeBackPixmap(). - Mark the tray icon window as embedded to be able to get the correct result from QWindow::mapToGlobal(). It allows to drop QXcbWindowFunctions::systemTrayWindowGlobalGeometry(). This change allows to remove the intermediate level between the QSystemTrayIconSys widget and the xcb plugin. The code looks clearer. Change-Id: I7d067131287a6dec162b36f0bddc8cb518aaa38c Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* xcb: Fix artifacts on the tray background with lock screensAlexander Volkov2018-07-108-71/+261
With the current method of painting the tray icon with 24 bpp visuals we grab the window's background once on the first show and then use it in all paint operations. This leads to a wrong background if an application shows the system tray icon when the lock screen is active. We can avoid this by painting with XRender when it's available. This change introduces QXcbSystemTrayBackingStore and moves the selection of a suitable painting method from QSystemTrayIconSys into it. In addition the visual for the window is selected according to the system tray specification and the platform window for the tray icon is created without needless OpenGL and Vulkan support. Task-number: QTBUG-55540 Change-Id: Ib3ca42bc02dcbdd4ccfe5d6e23f870ef22f0d25a Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* xcb: Set WM_CLIENT_MACHINE propertyAlexander Volkov2018-07-093-0/+9
It can be useful to detect that a window belongs to an application running on a remote host. E.g. a window manager may display the name of the remote host in the window title. Or it can detect whether a client can be killed. This property is set by Xlib's function XSetWMProperties(), which is called by GTK and Qt 4, so it's also good to do for consistency. Change-Id: I0693156635cb2696b2fbe7006cbecb25d2680513 Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* Return a correct filter from QFileDialog::selectedMimeTypeFilter()Alexander Volkov2018-06-272-16/+37
QFileDialog::selectedMimeTypeFilter() returns either an empty filter in the case when a platform file dialog doesn't implement mime type filters, or initiallySelectedMimeTypeFilter() in the case of Qt's file dialog. In both cases the result is incorrect. Make it return a mime type filter corresponding to a selected name filter. As a result, tst_QFiledialog::setMimeTypeFilters() has to be fixed: QFileDialog::selectMimeTypeFilter() can't select a name filter for an invalid mime type, and "application/json" is not supported by RHEL 6.6, so replace it by "application/pdf". Change-Id: I58d3be860a9b5e8a72cba86d74b520178115a812 Reviewed-by: David Faure <david.faure@kdab.com>
* Fix interaction with the menu bar on touchscreensAlexander Volkov2018-06-251-1/+8
Ignore synthesized mouse move events whithout the left mouse button pressed. We receive such mouse move event on touch before the mouse press event, it causes the menu to show and then the subsequent mouse press event closes the menu. Also don't propagate mouse events after closing a popup to another popup, because they may close the latter one. Change-Id: I50a2d9b57da63d33ffe416161a09f1696d65c88f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* QDBusTrayIcon: Avoid needless initialization of a global varAlexander Volkov2018-06-221-2/+7
TempFileTemplate is initialized each time an application starts. It leads to the call of QStandardPaths::writableLocation(QStandardPaths::RuntimeLocation) which is slow and can even change permissions of the runtime directory. Use a static wrapper function to initialize this variable only when needed. Change-Id: Ib620f9b842c88103c67f8dfab200f4d39c9981ee Reviewed-by: Dmitry Shachnev <mitya57@gmail.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Add itemAlignment property to QListViewAlexander Volkov2018-06-084-5/+83
This property allows to change the default behavior in which list items occupy the entire width of their column. Setting it to Qt::{AlignLeft,AlignRight,AlignHCenter} will reduce their widths to the minimum values, thus allowing to have intermediate free space. Then the user will be able to begin selections by mouse from this space. [ChangeLog][QtWidgets][QListView] Added itemAlignment property. Task-number: QTBUG-56606 Change-Id: Iae55c251379be4e45d0c0d69175ff4388b5785b4 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Doc: Fix description of QStyleOptionMenuItem::tabWidthAlexander Volkov2018-03-272-4/+6
It is actually not the tab width but the width reserved for the menu item's shortcut. Change-Id: I801dff0c57256690f61c022156a80cf6ff530c43 Reviewed-by: Martin Smith <martin.smith@qt.io>
* Update READMEs for the bundled xcb sources and the xcb pluginAlexander Volkov2018-03-232-18/+3
Mention that the current minimal supported version of libxcb is 1.9.1, amend 1f5d791708d5d256a76872f254251dac66e82cdb. Remove the specific package requirements for the xcb plugin: these lists are unmaintained and besides there are build instructions in wiki: https://wiki.qt.io/Building_Qt_5_from_Git Change-Id: I4d5b0583a1ba8a355ee1649022845f6c8d520e7c Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* xcb: Use XCB instead of Xlib for XInputAlexander Volkov2018-03-2211-456/+375
- Replace xinput2 feature by xcb-xinput, which doesn't depend on xcb-xlib - Remove xi2PrepareXIGenericDeviceEvent() that was used to fix incompatibilty between XCB and libXi structs - Drop XCB_USE_XINPUT21 and XCB_USE_XINPUT22 defines that were needed with libXi Although xcb-xinput was released in version 1.13 of libxcb, it was quite stable in version 1.12, and the parts that we use did not change between versions, so require system xcb-xinput 1.12. [ChangeLog][X11] The xcb plugin was ported to use libxcb-xinput instead of libXi for XInput2 support. The -xinput2 configure option was replaced by -xcb-xinput. Task-number: QTBUG-39624 Change-Id: I37475b09b2bd7057763345c3f33d8c7751a4e831 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
* Add xcb-xinput to 3rd party libsAlexander Volkov2018-03-204-2/+23467
| | | | | | | | | | | | | | | | The added xcb-xinput code was produced by build of libxcb 1.13 with xcb-proto 1.13. The following parts were removed from it: - Pointer Barriers API (requires xcb-xfixes 1.9 with xcb-proto 1.9) - SendExtensionEvent API (requires definition of xcb_raw_generic_event_t from libxcb 1.13) [ChangeLog][Third-Party Code] Sources of xcb-xinput 1.13 were bundled and are available via -qt-xcb. Change-Id: I43d2f43bee0ba874d099c9fb858e74b0e3edc970 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>