Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows 11 24H2/ShellHost: mark "Control Center Window" class as good UIA window #16370

Merged
merged 5 commits into from Apr 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion source/appModules/__init__.py
@@ -1,5 +1,5 @@
# A part of NonVisual Desktop Access (NVDA)
# Copyright (C) 2009-2023 NV Access Limited, Łukasz Golonka
# Copyright (C) 2009-2024 NV Access Limited, Łukasz Golonka, Joseph Lee
# This file may be used under the terms of the GNU General Public License, version 2 or later.
# For more details see: https://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -38,6 +38,8 @@
"searchapp": "searchui",
# Windows search in Windows 11.
"searchhost": "searchui",
# Quick settings in Windows 11 24H2 (2024 Update and Server 2025).
"shellhost": "shellexperiencehost",
# Spring Tool Suite is based on Eclipse and should use its appModule.
"springtoolsuite4": "eclipse",
"sts": "eclipse",
Expand Down
17 changes: 12 additions & 5 deletions source/appModules/shellexperiencehost.py
@@ -1,24 +1,25 @@
# A part of NonVisual Desktop Access (NVDA)
# Copyright (C) 2015-2022 NV Access Limited, Joseph Lee
# Copyright (C) 2015-2024 NV Access Limited, Joseph Lee
# This file is covered by the GNU General Public License.
# See the file COPYING for more details.

"""App module for Shell Experience Host, part of Windows 10.
"""App module for Shell Experience Host, part of Windows 10 and later.
Shell Experience Host is home to a number of things, including Action Center and other shell features.
In Windows 11 24H2 (2024 Update and Server 2025), quick settings component is part of ShellHost.exe.
"""

from typing import Optional

import appModuleHandler
from NVDAObjects.IAccessible import IAccessible, ContentGenericClient
from NVDAObjects.UIA import UIA
from UIAHandler import IUIAutomationElement, UIA_NamePropertyId
import controlTypes
import ui
import winUser
from winAPI.types import HWNDValT


class CalendarViewDayItem(UIA):
def _getTextFromHeaderElement(self, element: IUIAutomationElement) -> Optional[str]:
def _getTextFromHeaderElement(self, element: IUIAutomationElement) -> str | None:
# Generally we prefer text content as the header text.
# But although this element does expose a UIA text pattern,
# The text content is only the 2 character week day abbreviation.
Expand Down Expand Up @@ -71,3 +72,9 @@ def chooseNVDAObjectOverlayClasses(self, obj, clsList):
and obj.UIAElement.cachedClassName == "CalendarViewDayItem"
):
clsList.insert(0, CalendarViewDayItem)

def isGoodUIAWindow(self, hwnd: HWNDValT) -> bool:
# #16348: reclassify Windows 11 24H2 control center window as UIA to allow mouse/touch interaction.
if winUser.getClassName(hwnd) == "ControlCenterWindow":
return True
return False
5 changes: 4 additions & 1 deletion user_docs/en/changes.t2t
Expand Up @@ -67,7 +67,10 @@ What's New in NVDA
- ``alt+downArrow`` is now mapped to ``dot5+dot6+dot7+space``
-
- Fixed a bug causing NVDA to fail to read the ribbon and options within Geekbench. (#16251, @mzanm)
- In Windows 11, NVDA will once again announce hardware keyboard input suggestions. (#16283, @josephsl)
- Windows 11 fixes:
- NVDA will once again announce hardware keyboard input suggestions. (#16283, @josephsl)
- In Version 24H2 (2024 Update and Windows Server 2025), mouse and touch interaction can be used in quick settings. (#16348, @josephsl)
-
- Fixed a rare case when saving the configuration may fail to save all profiles. (#16343, @CyrilleB79)
-In Firefox and Chromium-based browsers, NVDA will correctly enter focus mode when pressing enter when positioned within a presentational list (ul / ol) inside editable content. (#16325)
-
Expand Down