summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows
Commit message (Collapse)AuthorAgeFilesLines
* Windows QPA: fix PMv2 detect logicZhao Yuhang7 days1-2/+5
| | | | | | | | | | | | | Before this patch, in QWindowsContext::setProcessDpiAwareness, there are some conditions that will make this function return early, in this case, QWindowsContextPrivate::m_v2DpiAware won't be updated to the correct value (it's initially set to false and we want it to be true in these cases), this is absolutely wrong. Luckily, this issue just makes QPA call enableNonClientDpiScaling() in unnecessary situations and that is harmless. But it's also better to fix this issue. Change-Id: I04d70d5d83b898a3cd2856d504bcd3f5519427b4 Reviewed-by: Oliver Wolff <[email protected]>
* Windows: Check for screen changes for each window after adding screenMorteza Jamshidi2025-06-183-7/+26
| | | | | | | | | | | | | | When a new screen is attached Window might move windows to the new screen automatically, in which case they will get a WM_DPICHANGED event. But at that point we have not received WM_DISPLAYCHANGE yet, so we fail to reflect the new screen's DPI. To account for this we explicitly check for screen change after adding a new screen. Fixes: QTBUG-125319 Change-Id: Ic854fe9f9ae52f53bb34cb8434111a6a1ba032d2 Reviewed-by: Tor Arne Vestbø <[email protected]>
* Revert "WindowsQPA: Make custom titlebar a child window"Jani Heikkinen2025-06-173-61/+155
| | | | | | | | | | This reverts commit 295933aadce1222511aa33bd1c68c302ca0a0a61. Reason for revert: QTBUG-137779 Change-Id: I70a7d9e095c442e078bf012dd52395b05bf5f04c Reviewed-by: Oliver Wolff <[email protected]> Reviewed-by: Axel Spoerl <[email protected]>
* QWindowsScreenManager::removeScreen() - don't leave stale screen behindAxel Spoerl2025-06-141-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | QWindowsScreenManager::removeScreen() read an element from m_screens and removed it. If the removed screen was not the primary screen, QWindowSystemInterface::flushWindowSystemEvents() is called. When removeScreen() is called from handleScreenChanges() in the same class, flushing window events can lead to a re-entry. That is e.g. the case when a RDP connection is closed and the server removes the virtual screen. QWindowScreenManager::removeScreen() removes the platform screen only at the very end, which means that m_screens contains a stale pointer. The re-entry can therefore crash with a double delete. Take the platform screen at the beginning of the method, to make it safe for re-entry. Fixes: QTBUG-135337 Pick-to: 6.10 6.9 6.8 6.5 Change-Id: Id18a6fb3e72922bcdb62c9e79857b6bb713c0c1b Reviewed-by: Tor Arne Vestbø <[email protected]> Reviewed-by: Volker Hilsheimer <[email protected]> Reviewed-by: Wladimir Leuschner <[email protected]>
* WindowsQPA: Make custom titlebar a child windowWladimir Leuschner2025-06-133-155/+61
| | | | | | | | | | | | | | | | | | The current approach for custom titlebar uses an overlay of a frameless popup window at the position of the titlebar area. This involves synchronizing the window state, position and size of the popup window with the original window. Also, the drawing of rounded edges needs to be done manually with the old approach. This patch adds the titlebar as a real child to the original window, so that the window manager takes care of the synchronization and clipping process. Fixes: QTBUG-135643 Fixes: QTBUG-133943 Fixes: QTBUG-133946 Pick-to: 6.10 6.9 Change-Id: I1770580a1c306074f41a7ff64c1d525c93918480 Reviewed-by: Oliver Wolff <[email protected]>
* QPA/Windows: Fix QPainter warnings when animations are disabledChristian Ehrlicher2025-06-101-7/+11
| | | | | | | | | | | | | Don't draw on a QImage with a size of 0/0. This amends 5feefd30734cd12753956819fc7c152be07c24cd Pick-to: 6.10 6.9 6.9.1 Fixes: QTBUG-135844 Task-number: QTBUG-127634 Change-Id: Ib57cdccfabe67454984f3229f9d7ad02dd0d9992 Reviewed-by: Błażej Szczygieł <[email protected]> Reviewed-by: Wladimir Leuschner <[email protected]>
* Use WS_EX_NOACTIVATE to prevent window from getting focusedMorteza Jamshidi2025-05-302-0/+5
| | | | | | | | | | | | | | | | | | | On top of handling ActivateWindowEvent,MouseActivateWindowEvent and PointerActivateWindowEvent events and returning MA_NOACTIVATE we can also set the window extended style to prevent windows from stealing focus in special cases. Also on top all those mentioned events, when the window is requested to get keyboard focus, it should check if the window accepts focus or not. If it does not, then it should inform the underlying system that the window does not accept the focusIn event. [ChangeLog][Windows] Windows with flag Qt::WindowDoesNotAcceptFocus no longer have a taskbar entry. Pick-to: 6.9 Fixes: QTBUG-131714 Change-Id: I79f767b1622449ba05b41f8b80bf390d8cecfff8 Reviewed-by: Oliver Wolff <[email protected]> Reviewed-by: Zhao Yuhang <[email protected]>
* a11y uia: Report locale via UIA_CulturePropertyIdMichael Weghorn2025-05-291-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Map QAccessible::Attribute::Locale to UIA_CulturePropertyId [1] in the Windows UIA accessibility bridge: > Identifies the Culture property, which contains a > locale identifier for the automation element (for > example, 0x0409 for "en-US" or English (United States)). In a test with 2 spinboxes whose locales were explicitly set to * QLocale(QLocale::English, QLocale::UnitedStates)) * QLocale(QLocale::Chinese, QLocale::China)) , retrieving the current value of UIA_CulturePropertyId (30015) using NVDA's Python console gives the expected result: With the spinbox whose locale is set to English/United States: >>> hex(focus.UIAElement.GetCurrentPropertyValue(30015)) '0x409' With the spinbox whose locale is set to Chinese/China: >>> hex(focus.UIAElement.GetCurrentPropertyValue(30015)) '0x804' as "[MS-LCID]: Windows Language Code Identifier (LCID) Reference" [2] lists these identifiers as follows: * 0x0409 en-US * 0x0804 zh-CN [1] https://learn.microsoft.com/en-us/windows/win32/winauto/uiauto-automation-element-propids [2] https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-lcid/70feba9f-294e-491e-b6eb-56532684c37f Task-number: QTBUG-137144 Change-Id: I2b0cad9ab7ede9f01dee3d7f3efddb8c5335caaf Reviewed-by: Volker Hilsheimer <[email protected]>
* Windows: Only use UpdateLayeredWindowIndirect if window has an alphaTor Arne Vestbø2025-05-271-1/+4
| | | | | | | | | | | | | | | | | | We only call UpdateLayeredWindow in setWindowOpacity if the window has an alpha an no native frame, which means we need to use the same condition in the backingstore when choosing how to flush the window. Amends 9a45fea9d1f6e445fb488693b107cdec6e42cccd. As a follow-up we should refactor this code to avoid the duplicated logic that must always be kept in sync. Pick-to: 6.9 6.8 Change-Id: I2bd79bdc4a726339fc486d0892ff4e1960a5a10e Reviewed-by: Zhao Yuhang <[email protected]> Reviewed-by: Nodir Temirkhodjaev <[email protected]> Reviewed-by: Oliver Wolff <[email protected]>
* Revert "Windows QPA: Remove usage of deprecated DwmEnableBlurBehindWindow"Wladimir Leuschner2025-05-263-0/+27
| | | | | | | | | This reverts commit b07876105788d519a3bb04a353eaa5ffa6269253. Reason for revert: Introduced regression QTBUG-136098 Change-Id: Id1f4d7a485659c4150f6750866c2f702fcdc1bf6 Reviewed-by: Oliver Wolff <[email protected]>
* Windows: Update layered state on creation instead of backingstore flushTor Arne Vestbø2025-05-182-12/+5
| | | | | | | | | | | | | | | | | | The WS_EX_LAYERED state of a window can be determined on creation, and the logic to do so should be centralized to QWindowsWindow::setWindowLayered, so that we don't have divergence. This fixes an issue where child windows would only support transparency if they had Qt::FramelessWindowHint set, as the QWindowBackingStore had a different idea about when to enable WS_EX_LAYERED than QWindowsWindow. Task-number: QTBUG-122590 Task-number: QTBUG-135859 Pick-to: 6.9 6.8 Change-Id: I453967a5a2ce8974cdd1dbf6e36327e97384c33d Reviewed-by: Oliver Wolff <[email protected]> Reviewed-by: Zhao Yuhang <[email protected]> Reviewed-by: Pavel Dubsky <[email protected]>
* For qdebug operator<< of pointer types, always check for nullptrDaniel Trevitz2025-05-174-6/+6
| | | | | | | | Also, use a consistent syntax for when the pointer is null. Fixes: QTBUG-135856 Change-Id: I2f5c80a5650b1be6cc0d70cde7cd1e1c1990df9a Reviewed-by: Christian Ehrlicher <[email protected]>
* Windows: Detect lack of WS_CLIPCHILDREN when adding child windowsTor Arne Vestbø2025-05-152-1/+21
| | | | | | | | | | | | | The lack of WS_CLIPCHILDREN will cause drawing artifacts, so ensure we have WS_CLIPCHILDREN in our native window manual tests, and warn if users inadvertently end up reparenting windows into a HWND that doesn't have WS_CLIPCHILDREN set. Change-Id: Ic4dac83882167562599d63f46232071c8c21b617 Reviewed-by: Zhao Yuhang <[email protected]> Reviewed-by: Wladimir Leuschner <[email protected]> Reviewed-by: Oliver Wolff <[email protected]> Reviewed-by: Pavel Dubsky <[email protected]>
* WindowsQPA: Make custom titlebar respect swapped mouse buttonsWladimir Leuschner2025-05-141-7/+13
| | | | | | | | | | | | | | | | Custom titlebar input handling is done on WM_NCHITTEST, which is handled at the WinAPI level. The WinAPI does not take into account the swapped mouse buttons when querying the state of VK_LEFTBUTTON and VK_RIGHTBUTTON with GetAsyncKeyState, so this behavior has to be implemented manually. In case of swapped mouse buttons, GetSystemMetrics(SM_SWAPBUTTON) will return true. This patch inverses the meaning of Right and Left buttons in case GetSystemMetrics(SM_SWAPBUTTON) returns true. Pick-to: 6.9 Change-Id: Ie46e130dc0bb49de318c8d04a3cc426f7a346b5b Reviewed-by: Tor Arne Vestbø <[email protected]> Reviewed-by: Zhao Yuhang <[email protected]>
* QWindowsCursor: compile without feature_imageformat_xpmChristian Ehrlicher2025-05-111-0/+4
| | | | | | | | Fix compile with feature_imageformat_xpm = OFF Pick-to: 6.9 Change-Id: Id84c2050f27bbe43ae9710f4e23c52cc24dd3370 Reviewed-by: Axel Spoerl <[email protected]>
* Allow configuring Qt without clipboard on WindowsJuha Vuolle2025-04-221-0/+2
| | | | | | | | | | Most feature guards were already in place, this commit adds the missing ones. Pick-to: 6.9 6.8 Fixes: QTBUG-135890 Change-Id: I1fbfad6552b2896d867a29134a2add693dbd136f Reviewed-by: Oliver Wolff <[email protected]>
* Fix errors due to disabled exceptions with cpp_winrt supportMarius Kittler2025-04-151-0/+1
| | | | | | | | | | | | The winrt headers use exceptions so code using them must be compiled with exceptions enabled. Otherwise one runs into compile errors with mingw-w64 12.0.0 and GCC 14.2.0. Change-Id: I216f65b260062ff2020f8a288ddda78c3e9fc3c9 Reviewed-by: Alexey Edelev <[email protected]> Reviewed-by: Mårten Nordheim <[email protected]> Reviewed-by: Volker Hilsheimer <[email protected]> Reviewed-by: Oliver Wolff <[email protected]>
* Handle Windows theme changes in central theme listenerTor Arne Vestbø2025-04-154-31/+80
| | | | | | | | | | | | | | | | | | | | | | | | Instead of having each window listen for theme changes we now have a single theme listener window, similar to the way we handle screen management. This reduces the amount of redundant callbacks to QWSI for theme changes somewhat, but Windows still emits several redundant events even for a single window. We want the theme change event to be synchronous, so there is no obvious way to debounce these events, besides the clearing of the message queue that we already do in this patch. Since we don't know exactly what part of the theme changed we can't bail out of the theme change event to QWSI based on the color scheme being the same, as the accent color or other parts of the theme might have changed. Change-Id: I827fa50effadf8a8e674a03ddc72958c60310f48 Reviewed-by: Oliver Wolff <[email protected]> Reviewed-by: Zhao Yuhang <[email protected]>
* Ensure Qt builds with -no-feature-shortcut on WindowsJohannes Grunenberg2025-04-121-0/+2
| | | | | | | | | | Building without shortcuts would fail due to a missing QKeySequence. This was already handled in the implementation but required an ifdef in the header. Change-Id: I12c92ca480d0abdb518aae00b5b7e259133ef9ca Pick-to: 6.5 6.8 6.9 Reviewed-by: Oliver Wolff <[email protected]>
* Avoid compile errors due to inconsistent use of `noexcept`Marius Kittler2025-04-073-19/+19
| | | | | | | | Only with these changes the affected code compiles with mingw-w64 and GCC 14.2.0. Change-Id: Ib4c392cd306b4e8b433048af077ae7aeb0459e1f Reviewed-by: Mårten Nordheim <[email protected]>
* Windows: Remove support for QT_QPA_VERBOSE logging environment variableTor Arne Vestbø2025-04-013-14/+2
| | | | | | | | | | | We have QT_LOGGING_RULES nowadays, and the verbosity levels for QWindowsContext are controlled by the `verbose` platform plugin argument. Change-Id: I3f998afaa962220b7babb093c030d0798e450db0 Reviewed-by: Kai Köhne <[email protected]> Reviewed-by: Zhao Yuhang <[email protected]> Reviewed-by: Wladimir Leuschner <[email protected]>
* Add virtual member QPlatformTheme::contrastPreference()Oliver Eftevaag2025-03-282-0/+7
| | | | | | | | | | | | | | | | | This function can be overridden by individual platform themes, in order to read contrast settings from the platform's system settings, and report the result back to Qt. This information is relevant for our styles, and can be used to determine color palette values, and additional elements like outline thickness for controls/widgets. Currently only the Windows, macOS, Gnome and Flatpak themes support this feature. Task-number: QTBUG-133595 Change-Id: I3aff519aa7f07c8b2fdcc1e7fb35ec719ab8efcc Reviewed-by: Tor Arne Vestbø <[email protected]>
* Replace some not appropriate QSystemLibrary usagesZhao Yuhang2025-03-271-10/+9
| | | | | | | | For these use cases we consider it's more appropriate to use GetModuleHandle rather than QSystemLibrary. Change-Id: I30f54e3dbe42d96292b6350a26c84fdb97e56ea4 Reviewed-by: Thiago Macieira <[email protected]>
* WindowsQPA: Add default icon to custom titlebarWladimir Leuschner2025-03-171-8/+13
| | | | | | | | | | | In case that no application icon was provided, use the IDI_APPLICATION icon when Qt::WindowTitleHint was provided. Fixes: QTBUG-133941 Pick-to: 6.9 Change-Id: Ifb479a7056e0841215d525c2346938bda31fc1c6 Reviewed-by: Tor Arne Vestbø <[email protected]> Reviewed-by: Oliver Wolff <[email protected]>
* WindowsQPA: Adjust close button and hover color for custom titlebarWladimir Leuschner2025-03-171-3/+6
| | | | | | | | | | | | Adjust toe color of the close button to match the native color. Adjust the hover text color for the close in light mode to match the native behavior. Fixes: QTBUG-133945 Pick-to: 6.9 Change-Id: I2c9fafba9fee65f45f3878168b67b0d0a4b2a54c Reviewed-by: Tor Arne Vestbø <[email protected]> Reviewed-by: Oliver Wolff <[email protected]>
* Fix usage of API functions on Windows 1607 (Build 14393)Lars Schmertmann2025-03-152-3/+17
| | | | | | | | | | | | | | | | * Windows Server 2016, Windows 10 LTSB 2016 and Windows 10 version 1607: SetThreadDescription is only available by Run Time Dynamic Linking in KernelBase.dll. See [1]. * According to [2] UiaRaiseNotificationEvent should be available on Windows Server 2016 but in fact it is not. [1] https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-setthreaddescription [2] https://learn.microsoft.com/de-de/windows/win32/api/uiautomationcoreapi/nf-uiautomationcoreapi-uiaraisenotificationevent Fixes: QTBUG-134075 Pick-to: 6.8 6.8.3 6.9 6.9.0 Change-Id: I3c4c733a4112a72b75f91f017a278dff2454e100 Reviewed-by: Thiago Macieira <[email protected]>
* WindowsQPA: Add default window title to custom titlebarWladimir Leuschner2025-03-121-2/+3
| | | | | | | | | | In case that no window title was provided use the QCoreApplication::applicationName when Qt::WindowTitleHint was provided. Fixes: QTBUG-133942 Pick-to: 6.9 Change-Id: Ieeff0ba97bd996225c6f83f691fc1c149e3d7172 Reviewed-by: Tor Arne Vestbø <[email protected]>
* Add missing comparison operators for Microsoft::WRL::ComPtr on MINGWJøger Hansegård2025-03-061-4/+1
| | | | | | | | | | | | | | | | MINGW's implementation of Microsoft::WRL::ComPtr lacks comparison operators, and calling operator==() on them will implicitly convert them to bool before comparing the resulting bool values. Two non-zero ComPtr instances will therefore always compare equal, even if they point to different interfaces. This patch adds ComPtr comparison operators if they are missing, and replaces existing includes to wrl.h or wrl/client.h with QtCore/private/qcomptr_p.h Pick-to: 6.9 6.8 Change-Id: I8123d9d874ae53ebfd6d381b69097e75527848b6 Reviewed-by: Mårten Nordheim <[email protected]>
* a11y uia: fix build: MinGW has those macrosThiago Macieira2025-03-041-3/+39
| | | | | | | | | | | | | Don't do proxy checks for the thing you want to test. Whenever possible, test the thing you want to test. We can't check for the definition of certain structs, though. Those have to remain a proxy check. Pick-to: 6.9 6.9.0 6.8 Change-Id: I5003e785706cd66923e4fffd6b11254233d09dc5 Reviewed-by: Michael Weghorn <[email protected]> Reviewed-by: Volker Hilsheimer <[email protected]>
* Revert "Windows: Check for bitmask instead for equality for initial window ↵Wladimir Leuschner2025-03-031-4/+9
| | | | | | | | | | | | flags" This reverts commit 369be485101c856c626a85f77ea087603dcf8b6c. Reason for revert: This breaks the customize window hints on Windows. Fixes: QTBUG-133940 Change-Id: Ib553c3f3742a14e0487cda27d057a4f4d50f76e2 Reviewed-by: Tor Arne Vestbø <[email protected]>
* Add logging category for platform servicesDavid Redondo2025-02-251-12/+7
| | | | | | | Rather than being hidden behind a compile time flag or uncategorized Change-Id: I3bc1781351220441134fb9815644e905273a1e40 Reviewed-by: Tor Arne Vestbø <[email protected]>
* QWindowsTheme: Set highlight color to accent color in light modeWladimir Leuschner2025-02-211-1/+2
| | | | | | | | | | | | GetSysColor(COLOR_HIGHLIGHT) did not report the right highlight color in light mode palette, Leading to a wrong accent color on Windows. This patch uses the accent color analog to the dark mode palette for QPalette::Highlight. Fixes: QTBUG-130458 Pick-to: 6.9 6.8 Change-Id: If21f392e31c3187c28e871919ff17f417c8d144b Reviewed-by: Christian Ehrlicher <[email protected]>
* Windows: Check for bitmask instead for equality for initial window flagsWladimir Leuschner2025-02-181-9/+4
| | | | | | | | | | fixTopLevelWindowFlags uses a equality comparison for the initial window flags fixup. In case window flags are set before creation, this equality will fail and no initial window flag fixup will happen. This patch changes the equality comparison with a test for bitmasks. Change-Id: I5a18f37376af5cc72f5ee7a3365970ca7fd51b66 Reviewed-by: Tor Arne Vestbø <[email protected]>
* Windows: Fix title bar artifact for frameless windows after restoringMorteza Jamshidi2025-02-184-0/+18
| | | | | | | | If windows is frameless we don't let windows os handle WM_NCACTIVATE event. Fixes: QTBUG-127116 Change-Id: I90f6a394018d0b275c77d319f0dc6fe93707694e Reviewed-by: Richard Moe Gustavsen <[email protected]>
* a11y uia: Support UIA_LabeledByPropertyIdMichael Weghorn2025-01-282-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the Windows accessibility bridge, bridge the QAccessible::Label relation to the corresponding UIA property, UIA_LabeledByPropertyId [1]. Unlike UIA_DescribedByPropertyId, UIA_FlowsFromPropertyId and UIA_FlowsToPropertyId which all support "VT_UNKNOWN | VT_ARRAY", i.e. returning an array of relation targets, UIA_LabeledByPropertyId only supports "VT_UNKNOWN", i.e. returning a single element. Therefore, return only the first relation target. Sample use with NVDA's Python console: 1) start the NVDA screen reader 2) run the "calendarwidget" example (examples/widgets/widgets/calendarwidget/calendarwidget.exe) 3) move focus to the "Locale" combobox 4) start NVDA's Python console (Ctrl+Insert+Z) 5) print information about the object reported via the UIA_LabeledByPropertyId property in NVDA's Python console: >>> focus.UIAElement.CurrentLabeledBy <POINTER(IUIAutomationElement) ptr=0x831b6c8 at cfb8b20> >>> focus.UIAElement.CurrentLabeledBy.CurrentName 'Locale' >>> focus.UIAElement.CurrentLabeledBy.CurrentControlType 50020 [1] https://learn.microsoft.com/en-us/windows/win32/winauto/uiauto-automation-element-propids Change-Id: Ib03bfc00356b9bdab826c4c9c3d6b2b2b9fe531f Reviewed-by: Jan Arve Sæther <[email protected]>
* Replace QBoolBlocker with QScopedValueRoolbackThiago Macieira2025-01-271-1/+1
| | | | | | | | | | | | | It was pre-Qt 4.5 (so pre-C++11), while QScopedValueRollback is 4.8. Both are still old, but with Qt 6 and C++17, we can use CTAD. QScopedValueRollback requires a value change to be explicit, which is less surprising. The uses outside of qtbase have also been fixed. Change-Id: Ia930b1a2ed1e465a826ffffd179c1909e16583db Reviewed-by: Marc Mutz <[email protected]>
* Show window without activating if WindowDoesNotAcceptFocus flag is setMorteza Jamshidi2025-01-241-1/+5
| | | | | | | | | Added an extra condition to only show the window (without activation) if Qt::WindowDoesNotAcceptFocus flag is set. (Mostly from qml) Fixes: QTBUG-130912 Change-Id: I6b7a9cd03d726315b8531600c6a8b33436a3348b Reviewed-by: Tor Arne Vestbø <[email protected]>
* qpa: lazily populate the services object except xcbLiang Qi2025-01-211-2/+5
| | | | | | | | | | | In order to optimize the footprint of QPA plugins, we avoid to create QPlatformServices object in QPlatformIntegration constructor. It benefits embedded platforms and others. Task-number: QTBUG-130884 Pick-to: 6.9 6.8 6.5 Change-Id: I5c0d2616ace9fbc0e077eece32d8836b40fc83dd Reviewed-by: Volker Hilsheimer <[email protected]>
* Differentiate cached cursors with different hotspots or dpi scalesMorteza Jamshidi2025-01-212-7/+21
| | | | | | | | | | | | | Increased cache accuracy by adding cursor hotspot and dpi scale to the QWindowsPixmapCursorCacheKey. Also added cursor hotspot to the QXcbCursorCacheKey. With this change qt supports creating cursors based on the same disk file but with different hotspot or dpi scale Fixes: QTBUG-122381 Change-Id: I1ed6f8fab7f72fe5b658c4f68fa86bc8a033040f Reviewed-by: Tor Arne Vestbø <[email protected]> Reviewed-by: Wladimir Leuschner <[email protected]>
* WindowsTheme: Draw icon overlay manually instead of relying on the apiChristian Ehrlicher2025-01-151-12/+9
| | | | | | | | | | | | | Fix drawing the link overlay icon - we must not set the device pixel ratio here as we don't know the exact value. Also fix some styling issues introduced with the previous commit. This amends fd7bc16e9fbdc63bd22ba90d0c20b36ccffd2bae. Pick-to: 6.9 6.8 Task-number: QTBUG-131843 Change-Id: I382527d17e8187bfae7cf40f352e6f87965671a1 Reviewed-by: Tor Arne Vestbø <[email protected]>
* QWSI: Use floating point number for tablet tiltNicolas Fella2025-01-071-4/+4
| | | | | | | | | | | | | On some platforms (like Wayland and X11) we get non-integer values, and the QTabletEvent API also exposes it as qreal. However the QWSI API uses int, resulting in potential loss of information Task-number: QTBUG-8059 Change-Id: I9d2856a053091415c6f9e886fdd87ed71254fdd2 Reviewed-by: Shawn Rutledge <[email protected]> Reviewed-by: Tor Arne Vestbø <[email protected]>
* Draw icon overlay manually instead of relying on the apiMorteza Jamshidi2025-01-061-10/+21
| | | | | | | | | | | Even with SHGSI_LINKOVERLAY flag set, loaded Icon with SHDefExtractIcon doesn't have any overlay, so we draw it manually. Pick-to: 6.9 6.8 Fixes: QTBUG-131843 Change-Id: Iae4c2da12104a361b9a8cf05c78adcdb698f1f82 Reviewed-by: Christian Ehrlicher <[email protected]>
* Windows: Add Key_Backtab as possible key combination for Shift+TabMorteza Jamshidi2025-01-061-0/+5
| | | | | | | | | | | In windows Backtab key event always comes as "Shift+Backtab". So in order for Backtab key to be recognized as a shortcut sequence, we also consider Backtab without shift modifier a possibility. Fixes: QTBUG-94890 Change-Id: I20a7b404b57d8df5bea23765257a178f2e098ed0 Pick-to: 6.8 Reviewed-by: Oliver Wolff <[email protected]>
* Add missing noexcept specifiers for QUniqueHandle handle traitsJøger Hansegård2025-01-041-4/+4
| | | | | | | | | Handle traits should be simple, and not require exceptions. This patch will allow us to improve the noexcept correctness of QUniqueHandle. Pick-to: 6.8 6.9 Change-Id: I84d92818a2fcea5b98e09c0b7dc08b251751396c Reviewed-by: Tim Blechmann <[email protected]>
* WindowsQPA: Draw custom titlebar with QPainterWladimir Leuschner2024-12-173-117/+128
| | | | | | | | | | | - Draw custom titlebars that are requested by setting the Qt::ExpandedClientAreaHint with QPainter instead of GdiPlus. - Draw the application icon, in case it was set, for the custom titlebar - Add DPI awareness to the custom titlebar Pick-to: 6.9 Change-Id: I276e7d8948e5a436f1835d96b59756b7237f63d2 Reviewed-by: Tor Arne Vestbø <[email protected]>
* Windows: Fix title bar size calculationYuhang Zhao2024-12-171-7/+17
| | | | | | | | | The title bar calculation is terribly wrong and was missed during review. Pick-to: 6.9 Change-Id: I0c7a860e747465e6a5e4d8aa5415a9701cf170fd Reviewed-by: Oliver Wolff <[email protected]>
* Document that QPlatformTheme::standardPixmap should always be a 1x pixmapTor Arne Vestbø2024-12-161-11/+6
| | | | | | | | | | | | | | | This reverts 59bbfb17db563d7e62b9f3158dab3cc6e7e68acd and c853054910552f5fef04797222dde0d29a0c340d, as that approach was causing issues for QCommonStyle::iconFromWindowsTheme, for example in situations where the system has a 1x and 2.5x screen, and the user requests a 16x16 pixmap or icon via QStyle::standardPixmap or QStyle::standardIcon. In that situation our smallest pixmap is 40x40, and we need to downscale, causing blurred results on a 1x screen. Pick-to: 6.9 Change-Id: Ifa6e15d37d15954df689253c32eaa779885c567b Reviewed-by: Volker Hilsheimer <[email protected]>
* Windows: Return high-DPI pixmaps from QWindowsTheme::standardPixmapTor Arne Vestbø2024-12-111-6/+11
| | | | | | | | | | | | | | | | | | Most consumers feed the pixmaps into a QIcon, pulling out pixmaps of sizes 32, 64, 128, 256, 512, so consumers of that QIcon will not see low-resolution pixmaps for the common sizes like 64x64. However if someone uses standardPixmap directly, or request an icon with size 512x512, we won't have a high-DPI pixmap. Unlike QStyle::standardPixmap we don't have a QWidget/QWindow argument we can use to resolve the target DPR, so we have to assume the pixmap can be used anywhere, and use the highest DPR we've seen so far, via QGuiApplication::devicePixelRatio(). Pick-to: 6.9 Change-Id: Ib7fb08ab4932da1ca3f3325e25a7022c1cd17435 Reviewed-by: Volker Hilsheimer <[email protected]>
* Windows theme: don't refresh anything unless theme really changedYuhang Zhao2024-12-111-4/+4
| | | | | | | | | | Refreshing the global theme may be expensive for large scale applications, and even if Windows sent corresponding message, it may be triggered by many reasons, not just the system theme, so no matter what we'd better add an extra check. Pick-to: 6.9 Change-Id: I70847aa54fb4af37c81855a62330a4bce31ff104 Reviewed-by: Oliver Wolff <[email protected]>
* QFontIconEngine: always initialize with a non-merging fontVolker Hilsheimer2024-12-111-4/+6
| | | | | | | | | | | | | | | | The icon engine needs to be able to rely on glyph indices belonging to the correct font, and we generally don't want the overhead of iterating through potential fallbacks if a named glyph or unicode code point wasn't found in the font. Assert in the QFontIconEngine constructor that the font we get has the NoFontMerging strategy bit set. Amends 2af58490b3d33aab8d08610939fe2b7cab4c469c. Pick-to: 6.9 Change-Id: Ib38324aebbeda956c8dd053969d6cf08f7ef3c35 Reviewed-by: Eskil Abrahamsen Blomfeldt <[email protected]>