summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows
Commit message (Collapse)AuthorAgeFilesLines
* Windows: Add default SysMenu Buttons in case of no CustomizeWindowHintWladimir Leuschner10 hours1-10/+13
| | | | | | | | | | | | | In case of no specified Qt::CustomizeWindowHint add the WindowStyles for Minimize/Maximize/Close buttons to the toplevel window. Also transfer the old maximized/minimized state in applyWindowFlags to the new WindowStyles. Fixes: QTBUG-132522 Pick-to: 6.10 Change-Id: Iea9413673be239c0feab7dfcdc5ef5c8209512c5 Reviewed-by: Joerg Bornemann <[email protected]> Reviewed-by: Axel Spoerl <[email protected]>
* WindowsIconEngine: Correct icon for go-previous, go-next & process-stopWang Zichong11 hours1-3/+3
| | | | | | | | | | | | | | | | | | | | | go-previous and go-next icons are usually for "Back" and "Forward" navigation button. Currently these two are using an icon that looks like for media players instead of navigation. This patch change these icon to use the "Forward" and "Back" icon from Windows' symbol font to align to the same icon used by explorer.exe Additionally, this patch adds a process-stop icon that used by Windows' Task Manager. References: https://learn.microsoft.com/en-us/windows/apps/design/style/segoe-fluent-icons-font https://learn.microsoft.com/en-us/windows/apps/design/style/segoe-ui-symbol-font Pick-to: 6.10 Change-Id: Ic253da51cc28f564d201c47500968f2827a50d72 Reviewed-by: Tor Arne Vestbø <[email protected]> Reviewed-by: Volker Hilsheimer <[email protected]>
* QWindowsWindow: use suggested rect in dpi change event to query next screenWang Chuan30 hours4-7/+23
| | | | | | | | | | | | We currently use MonitorFromWindow to query the new screen when handling WM_DPICHANGED. However it actually uses the window rect before the dpi change to retrieve the new screen which can occasionally result in an inconsistent situation where the window is on the new screen but the QScreen for this window still refers to the old one. Change-Id: Id03151acf523a6a36614e9eb47b2b2423a9f8a80 Task-number: QTBUG-139336 Pick-to: 6.10 6.8 Reviewed-by: Oliver Wolff <[email protected]>
* Fix native a11y role of QAccessible::LayeredPaneLars Schmertmann6 days1-0/+1
| | | | | | | | | | | | | * The QML StackView started to use this role in qtdeclarative ee7151d5ab29ba812a93c1231ddc59c9129a7af0. * This will replace "Unknown" with "Window" on Windows with NVDA. * On macOS the behavior with VoiceOver is not changed but it seems sensible to supplement the mapping as well. Fixes: QTBUG-134138 Pick-to: 6.10 6.8 Change-Id: Iab5c7339a82d91b6eafdba45fa31c0537a94a135 Reviewed-by: Michael Weghorn <[email protected]>
* a11y uia: Report orientation via UIA_OrientationPropertyIdMichael Weghorn6 days1-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Support UIA_OrientationPropertyId [1] by mapping QAccessible::Attribute::Orientation introduced in a previous commit to it. In a test with the QTBUG-140769 sample program, this gives the expected result when querying the value in NVDA's Python console: For the vertical scroll bar: >>> mouse.UIAElement.GetCurrentPropertyValue(30023) 2 For the horizontal scroll bar: >>> mouse.UIAElement.GetCurrentPropertyValue(30023) 1 For the widget inside the scroll area (that doesn't have any orientation set): >>> mouse.UIAElement.GetCurrentPropertyValue(30023) 0 That matches the expected result according to the OrientationType enum in UIAutomationCore.h: enum OrientationType { OrientationType_None = 0, OrientationType_Horizontal = 1, OrientationType_Vertical = 2 } ; [1] https://learn.microsoft.com/en-us/windows/win32/winauto/uiauto-automation-element-propids Task-number: QTBUG-140769 Change-Id: I365d2400e74f972b1f1b4e61c35934dc3d9d348d Reviewed-by: Volker Hilsheimer <[email protected]> Reviewed-by: Morten Johan Sørvig <[email protected]> Reviewed-by: MohammadHossein Qanbari <[email protected]>
* Windows QPA: Add missing refresh rate updateMorteza Jamshidi7 days1-0/+5
| | | | | | | | | Added missing handleScreenRefreshRateChange call to QWindowsScreen Fixes: QTBUG-139966 Change-Id: If34ea49b61db1e6ec8b0af92517aee42480c4ce8 Reviewed-by: Wladimir Leuschner <[email protected]> Reviewed-by: Tor Arne Vestbø <[email protected]>
* Windows: Fix QWindowWindows::requestUpdateChristian Strømme2025-10-161-2/+4
| | | | | | | | | | | | | | It's very possible for the platform window to be released and recreated for a QWindow. We therefore still need to verify that we both have a platform window, and that it's the same window we triggered the update for. This change amends 31c38d5f766366931cd127f7323f9c26ac5de498 Fixes: QTBUG-141128 Pick-to: 6.10 Change-Id: Id6e3fcbe3c6d2d5aa30b2af256a74de2fc9e5f9e Reviewed-by: Tim Blechmann <[email protected]>
* a11y: Add Switch roleLars Schmertmann2025-10-132-2/+4
| | | | | | | | | | | | | | | Distinguishing a Switch from a CheckBox is necessary on at least Android. Windows uses the already available IToggleProvider interface, which gets correctly recognized as a switch when used with UIA_ButtonControlTypeId. [ChangeLog][QtGui][QAccessible] Added new Switch role that can be used instead of CheckBox for more accurately communicating the elements role to assistive technology. Fixes: QTBUG-139676 Change-Id: I77d33ea5ad32e58ba01c63c418c11ccc25d19c54 Reviewed-by: Michael Weghorn <[email protected]> Reviewed-by: Volker Hilsheimer <[email protected]>
* QWindowsWindow: requestUpdate - fix use-after-freeTim Blechmann2025-10-101-4/+7
| | | | | | | | | | | | | | QMetaObject::invokeMethod can overtake the destruction of the QWindowsWindow. So instread of storing the `this` pointer in the lambda capture we explicitly re-read it from the QWindow. This should fix a heap-use-after-free reported by address sanitizer. Amends 456fb97ddc4c606999c5468e063fe1c6f59c4408 Fixes: QTBUG-140869 Pick-to: 6.10 Change-Id: I47805c606fa32b6f370e0214829f2ea3e9bce83d Reviewed-by: Christian Strømme <[email protected]>
* Windows QPA: Fix flicker when moving Windows with High DPI scalingFriedemann Kleint2025-10-081-1/+12
| | | | | | | | | | | | | Change 8d7826442bf889364ab39cf54c6f4617891d0bd7 did not take High DPI scaling into account when checking for plain moves. Rewrite the code using native window geometry to avoid rounding errors as suggested in the report. Pick-to: 6.10 Fixes: QTBUG-132285 Task-number: QTBUG-115992 Change-Id: Iae751f46b1e398bfce7f8a37e4c10b31e258247a Reviewed-by: Oliver Wolff <[email protected]>
* Prefer using namespace Qt::StringLiteralsMarc Mutz2025-10-044-4/+4
| | | | | | | | | | | | | | | | | ... over Qt::Literals::StringLiterals. The latter works, but is needlessly verbose. Since such code is copy'n'pasted, use the preferred form everywhere, to avoid proliferation. The docs have been fixed to suggest the shortcut in a separate commit. As a drive-by, move them to their preferred location, after the QT_BEGIN_NAMESPACE, but only if they were far away to begin with. Pick-to: 6.10 6.8 6.5 Change-Id: I0325f749f3b5a331d9c6af458a9bd3bb70d4aa3b Reviewed-by: Paul Wicking <[email protected]>
* Windows with D3D: Guard vsync update deliveries moreLaszlo Agocs2025-10-021-2/+12
| | | | | | | | | | | | | | | | | | | | | Flip m_vsyncUpdatePending back to "ready" only on the gui thread, when the queued metacall is processed. Also have a third state, "posted", to indicate that the invokeMethod call has been made but not yet processed on the gui thread. Otherwise certain Quick applications can end up in a situation where there are an ever growing number of metacalls queued, not having the chance to process them all if new requestUpdate() calls are made continuously as a reaction to Qt Quick doing a new frame. Done-with: Christian Strømme <[email protected]> Fixes: QTBUG-139014 Pick-to: 6.10 6.9 Change-Id: I1ae4f28ee6a52d66cc4349bf930c5e873a7e299c Reviewed-by: Christian Strømme <[email protected]>
* Remove Qt::WindowType::Desktop in QWindowsWindowAxel Spoerl2025-09-262-18/+9
| | | | | | | | | Qt::WindowType::Desktop is no longer a valid window type in Qt6. Remove its occurence in QWindowsWindow. Task-number: QTBUG-140514 Change-Id: I8c30711b878bae35ab2313e5af4a9e881845c9f6 Reviewed-by: Christian Ehrlicher <[email protected]>
* Remove Qt::WindowType::Desktop in QWindowsIntegrationAxel Spoerl2025-09-251-7/+0
| | | | | | | | | Qt::WindowType::Desktop is no longer a valid window type in Qt6. Remove its occurence in QWindowsIntegration. Task-number: QTBUG-140514 Change-Id: I0312eaeb14539e49083c48943a8ebb9b46a43e41 Reviewed-by: Wladimir Leuschner <[email protected]>
* Remove Qt::WindowType::Desktop in QWindowsScreenAxel Spoerl2025-09-251-2/+2
| | | | | | | | | Qt::WindowType::Desktop is no longer a valid window type in Qt6. Remove its occurence in QWindowsScreen. Task-number: QTBUG-140514 Change-Id: If44f53b8e4cb8b9d57a7d7cae7c2982f900d22eb Reviewed-by: Wladimir Leuschner <[email protected]>
* platforms: windows - remove unused private fieldTim Blechmann2025-09-251-1/+0
| | | | | | | | | | | Silences a -Wunused-private-field when compiling with Clang. Amends 127468e053c84e089f0afc87704758ae360406e9, which removed the last use of the variable. Pick-to: 6.10 Change-Id: I17cd41f19a1c352582bfbdcd432672c05a9df5e3 Reviewed-by: Marc Mutz <[email protected]>
* WindowsQPA: Remove unused GDIPlus include from qwindowswindow.cppWladimir Leuschner2025-09-231-1/+0
| | | | | | | | | | GDIPlus is not used anymore to draw the custom titlebar, therefore the gdiplus include can be removed. Fixes: QTBUG-139653 Pick-to: 6.10 6.9 Change-Id: Id80b9d58bd6729dad8a4a428333e41d41aec5cd0 Reviewed-by: Joerg Bornemann <[email protected]>
* Windows: Return hittest region for CustomizeWindowHint|ExpandedClientAreaHintWladimir Leuschner2025-09-171-14/+31
| | | | | | | | | When Qt::CustomizeWindowHint in combination with Qt::ExpandedClientAreaHint is set, we are not returning any hittest region for WM_NCHITTEST, resulting in ignoring mouse events. This patch adds another code path to handle WM_NCHITTEST in this case properly. A test whether a Widget was hit is performed with QWSI with the current coordinates and button state of the mouse. In case a widget was hit the event is consumed and NCHITTEST will return HTCLIENT. In case no widget was hit, a check is performed whether the mouse event happened in the titlebar area and if so, the respective hittest region for the titlebar area is returned. Fixes: QTBUG-137927 Pick-to: 6.10 6.9 Change-Id: I4531fec71eaaa20959a8015ea1babd6d36ee9341 Reviewed-by: Oliver Wolff <[email protected]>
* Deprecate and remove traces of RasterGLSurfaceTor Arne Vestbø2025-09-032-3/+0
| | | | | | | | | | We no longer use this hybrid surface type approach for Qt Widget's composition mode. Nowadays we use RHI to compose the widget texture and the native textures, and the window surface type depends on the RHI API in use, e.g. QSurface::MetalSurface, or QSurface::OpenGLSurface. Change-Id: I85001100f681a1cf524b8b7dc50f680a9579b447 Reviewed-by: Laszlo Agocs <[email protected]>
* a11y Windows: Implement UIA_AriaRolePropertyId for Accessible::HeadingJulian Greilich2025-09-021-0/+4
| | | | | | | | | | | This way also the property UIA_LocalizedControlTypePropertyId is populated and screen readers like narrator can announce the role of headings correctly. Pick-to: 6.8 6.9 6.10 Change-Id: I745e4420bbe0f2cc1ef0e52ecdeab781d641b474 Reviewed-by: Michael Weghorn <[email protected]> Reviewed-by: Volker Hilsheimer <[email protected]>
* Windows QPA: remove unnecessary WinRT usageZhao Yuhang2025-08-301-16/+3
| | | | | | | | | | | | | | | We have QOperatingSystemVersion to retrieve and compare the current OS version, which is accurate and reliable, I see no absolute reason to use WinRT APIs to do this job, and WinRT APIs may throw in some environments, so let's use our own facility. Amends commit 081062ea5e396d9d251956eee412156f2319b816 Task-number: QTBUG-135964 Pick-to: 6.10 6.9 6.8 6.5 Change-Id: I80df22c2ffde3c8e7d724fe03a684021ea6c5094 Reviewed-by: Santhosh Kumar <[email protected]>
* a11y Windows: Announce change to Accessible.name for focused elementJan Moeller2025-08-221-3/+3
| | | | | | | | | | | | | The changeset bcd0a3220348778c0d72faac202efb97f4d6dd07 restricted notifications of updates to Accessible.name to the role QAccessible::ComboBox to avoid slowdowns to the application. This change extends the notification for the currently focused element so the user is correctly informed. Task-number: QTBUG-139275 Pick-to: 6.8 6.9 6.10 Change-Id: Ic0daa0b10407780434594b9b5888c9d740c4b80b Reviewed-by: Volker Hilsheimer <[email protected]>
* Windows QPA: make theme code more robustZhao Yuhang2025-08-211-68/+74
| | | | | | | | | | | | | | | WinRT APIs may throw in some cases (real cases reported by our customers), let's wrap WinRT calls in try catch to avoid app crash. As a drive-by, move the accent color handling in populateDarkSystemBasePalette out of the try-catch block due to it has been handled already in qt_accentColor(), also remove some color entries which are not used. Change-Id: Ibdd9b9b7d93ebc8218a127e1f9a8e73f5d1332a5 Reviewed-by: Oliver Wolff <[email protected]> Reviewed-by: Wladimir Leuschner <[email protected]>
* Update palette in windows as set in high contrast themeSanthoshKumar Selvaraj2025-08-041-12/+38
| | | | | | | | | | | | The palette in windows doesn't respect the colors as set in the high contrast theme. This can lead to an issue as not reflecting the native theme colors. This patch updates the windows theme palette with the native high contrast colors. Fixes: QTBUG-135964 Pick-to: 6.10 6.9 6.8 6.5 Change-Id: Ic1f6839046cb432fe33b4e79e611b36f542a0737 Reviewed-by: Oliver Eftevaag <[email protected]>
* QPA: windows - declare windowproc functions as C++Tim Blechmann2025-07-317-9/+8
| | | | | | | | | | | | | | Declaring the window functions as extern "C" disabled all name mangling and namespacing. This may have been done with the intention to use C function pointers instead of C++ function pointers as they are passed as WNDPROC. Drop the extern "C" and thereby implicitly declare the functions as C++. Task-number: QTBUG-138543 Pick-to: 6.10 Change-Id: Ia20782a82f94eb3133b972dead7cdac623cfa626 Reviewed-by: Axel Spoerl <[email protected]>
* CMake: Support clang building on Windows using MSVC ABICristian Adam2025-07-301-1/+3
| | | | | | | | | | | | | | This allows building QtBase using clang.exe / clang++.exe from the LLVM official build. The LLVM official build uses the MSVC ABI. clang.exe / clang++.exe are using the GNU command line interface, but this affects only the frontend. Task-number: QTBUG-138750 Change-Id: Ic60ab3ae85c844e7fa5c08155bcf895824b30099 Reviewed-by: Alexandru Croitor <[email protected]>
* Get accent color from GetSysColor for high contrast without winrtOliver Eftevaag2025-07-292-19/+28
| | | | | | | | | | | | | | | | When Qt for Windows isn't using cpp_winrt, the accent color would be retreived from the Windows registry. This color would be different from what native WinUI controls would use, which instead is the COLOR_HIGHLIGHT value from GetSysColor. Fix this by using GetSysColor, when a contrast theme is enabled, instead of the value read from the Windows registry. Pick-to: 6.10 Done-with: MohammadHossein Qanbari <[email protected]> Change-Id: If7025d4f52223abd6160feeb065df6b68b8fb2b5 Reviewed-by: Wladimir Leuschner <[email protected]> Reviewed-by: MohammadHossein Qanbari <[email protected]>
* a11y: Introduce RoleChanged event, bridge to AT-SPI, UIAMichael Weghorn2025-07-173-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | For some accessible objects, the role isn't static, but can change. Introduce QAccessible::RoleChanged to allow notifying about such role changes, which allows AT clients and platform a11y caches to be notified and updated accordingly. For AT-SPI, send a corresponding AT-SPI "object:property-change:accessible-role" event. For UIA on Windows, notify about a change of the UIA_ControlTypePropertyId property. The new event type will be used in an upcoming commit to notify about role changes in QAccessibleDockWidget when the QDockWidget gets (un)docked. [ChangeLog][QtGui][QAccessible::Event] Added new RoleChanged enum value that can be used to send a corresponding event when the role of an accessible object has changed. Task-number: QTBUG-138206 Change-Id: Ifbd712b5573bb748be4dec9ba540f6a3a8de1c76 Reviewed-by: MohammadHossein Qanbari <[email protected]> Reviewed-by: Volker Hilsheimer <[email protected]>
* a11y uia: Move OSK logic to roleToControlTypeIdMichael Weghorn2025-07-172-15/+16
| | | | | | | | | | | | | This ensures it will be applied for all callers of that helper function. (At the moment, QWindowsUiaMainProvider::GetPropertyValue is the only one, but that will change in an upcoming commit.) Task-number: QTBUG-138206 Change-Id: I0879c09021f5ee7af901dfa42cf81b392da8f4f9 Reviewed-by: Volker Hilsheimer <[email protected]> Reviewed-by: MohammadHossein Qanbari <[email protected]>
* Guard OpenGL tests with QPlatformIntegration::Capability::OpenGLTor Arne Vestbø2025-07-091-0/+5
| | | | | | | | | | | Instead of run_opengl_tests Qt config flag. We need the runtime check anyways, so we can simplify things by having the Windows platform return false for the capability if the run_opengl_tests configure feature is not enabled. Change-Id: Ie14dbf2c6d8a1fee552bac004b0bb144ccf46d27 Reviewed-by: Oliver Wolff <[email protected]> Reviewed-by: Volker Hilsheimer <[email protected]>
* WindowsQPA: Make custom titlebar a child windowWladimir Leuschner2025-07-083-157/+64
| | | | | | | | | | | | | | | | | | 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: If23b8d9cd85b7b6abdd1e6b8b523e41e24971de3 Reviewed-by: Oliver Wolff <[email protected]>
* Windows: Fix title bar artifact for frameless windows after restoringMorteza Jamshidi2025-07-071-0/+5
| | | | | | | | | | | | commit ee942d7ab40e1d29008695ad1406d25d25780d28 fixed part of the problem. added an ignore case in the handleCalculateSize function for when window is frameless. This change fixes the problem completely. Pick-to: 6.10 Fixes: QTBUG-127116 Change-Id: Ic4a37dd30712c9219df787e08100314058c375e4 Reviewed-by: Tor Arne Vestbø <[email protected]>
* Windows: silence -Wimplicit-fallthroughTim Blechmann2025-07-051-0/+1
| | | | | | | | | | mingw warngs about a missing [[fallthrough]]. Amends c2bdf7636eb46e56760f3e2f6d457c8f14627576 Pick-to: 6.9 6.10 Change-Id: I6fe960a80013e7f051e55d24fdd8db021184eaef Reviewed-by: Thiago Macieira <[email protected]> Reviewed-by: Morteza Jamshidi <[email protected]>
* Windows QPA: fix PMv2 detect logicZhao Yuhang2025-06-261-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]>