internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: nvaccess/nvda

Issue:
Recognize Windows 10 21H2 and Server 2022 builds
Hi,

Briefly mentioned in #12509 

### Introduction:
With the development of Windows Core OS (Windows 11 base) throughout 2020 and 2021, Microsoft released Windows 10 2004 (20H1) and three feature updates on top of it, namely 20H2, 21H1, and soon, 21H2. These updates are enablement packages on top of build 19041 system files.

At the same time, Microsoft was working on the next long-term support version of Windows Server, culminating in Server Iron, nowadays known as Windows Server 2022. Although internals are different (Iron is newer than Vibranium/20H1), Server 2022 presents itself as 21H2.

Adding to confusion is Windows 11, which also shows up as 21H2. Because Windows 11 is termed "cobalt" internally, it has a higher build number than Server 2022 and Windows 10 21H2 (see #12626 for details). This scenario is the reason why #12509 was created in the first place.

### Is your feature request related to a problem? Please describe.
Because three Windows releases are labeled "21H2", it becomes necessary to define constants for each release. For now Windows 11 is defined, but the foundation is present to add Windows 10 and Server 2022 constants. The relationship between Windows 10 21H2 and Server 2022 is akin to XP and Server 2003 (two different build numbers).

### Describe the solution you'd like
Define the following Windows release constants in winVersion module:

* WIN10_21H2 for build 19044
* WINSERVER_2022 for build 20348 (server)

Also, edit appx manifest and say that NVDA is compatible with 10.0.19044. This is for two reasons:

1. Server systems does not come with Microsoft Store app (it might be possible to sideload the Store version of NVDA).
2. Windows 11 version of Microsoft Store will present desktop apps, therefore if NV Access is willing, the stable version of desktop NVDA may one day show up as a downloadable app.

### Describe alternatives you've considered
None

### Additional context
Windows 10 21H2 (build 19044) announcement:
https://blogs.windows.com/windows-insider/2021/07/15/announcing-windows-10-insider-preview-build-19044-1147-21h2/

In terms of Windows SDK, no changes unless folks agree that at least build 22000 should be used (@LeonardDeR, @MichaelDCurran, any thoughts?).

Thanks.


Discussion:

Resolving patch:
diff --git a/source/winVersion.py b/source/winVersion.py
--- a/source/winVersion.py
+++ b/source/winVersion.py
@@ -32,6 +32,8 @@
 	19041: "Windows 10 2004",
 	19042: "Windows 10 20H2",
 	19043: "Windows 10 21H1",
+	19044: "Windows 10 21H2",
+	20348: "Windows Server 2022",
 	22000: "Windows 11 21H2",
 }
 
@@ -151,6 +153,8 @@ def __ge__(self, other):
 WIN10_2004 = WinVersion(major=10, minor=0, build=19041)
 WIN10_20H2 = WinVersion(major=10, minor=0, build=19042)
 WIN10_21H1 = WinVersion(major=10, minor=0, build=19043)
+WIN10_21H2 = WinVersion(major=10, minor=0, build=19044)
+WINSERVER_2022 = WinVersion(major=10, minor=0, build=20348)
 WIN11 = WIN11_21H2 = WinVersion(major=10, minor=0, build=22000)
 
 


Test patch:
Repository: nvaccess/nvda

Issue:
Modern Settings (regression): volume meter progress bar beep is heard
Hi,

Regression from #12178 

### Steps to reproduce:
In Windows 10/11 Settings app:

1. Open the app.
2. Navigate to System/Sound.

### Actual behavior:
NVDA plays progress bar beep if "progress bar output" is set to "beeps".

### Expected behavior:
No progress bar output.

### System configuration
#### NVDA installed/portable/running from source:
Installed

#### NVDA version:
alpha-23637,39425061

#### Windows version:
Windows 10 21H2 release preview (build 19044.1200)

#### Name and version of other software in use when reproducing the issue:
Settings app 10.02.100

#### Other information about your system:
None

### Other questions
#### Does the issue still occur after restarting your computer?
Yes

#### Have you tried any other versions of NVDA? If so, please report their behaviors.
Does not happen with alpha.23630

#### If add-ons are disabled, is your problem still occurring?
Yes

#### Does the issue still occur after you run the COM Registration Fixing Tool in NVDA's tools menu?
Not applicable

### Technical:
Caused by imports - ProgressBar class is imported from NVDAObjects.behaviors instead of NVDAObjects.UIA. I expect modules importing UIA progress bar behavior from behaviors mix-in may run into issues like this.

Thanks.


Discussion:
CC @LeonardDeR 

Resolving patch:
diff --git a/source/appModules/systemsettings.py b/source/appModules/systemsettings.py
--- a/source/appModules/systemsettings.py
+++ b/source/appModules/systemsettings.py
@@ -1,14 +1,12 @@
-# appModules/systemsettings.py
 # A part of NonVisual Desktop Access (NVDA)
-# Copyright (C) 2019 NV Access Limited, Joseph Lee
+# Copyright (C) 2019-2021 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 Windows 10 Settings app (aka Immersive Control Panel)."""
+"""App module for Settings app on Windows 10 and later (aka Immersive Control Panel)."""
 
 import appModuleHandler
-from NVDAObjects.UIA import UIA
-from NVDAObjects.behaviors import ProgressBar
+from NVDAObjects.UIA import UIA, ProgressBar
 
 
 class AppModule(appModuleHandler.AppModule):


Test patch:
Repository: nvaccess/nvda

Issue:
LibreOffice Writer: in Confirm dialog in Document restore is not announced when using screenreaders
### Steps to reproduce:
1. Crash LibreOffice
2. restart LibreOffice
3. Dissmiss restoring Documents
4. The confirm dialog opens and all you can here from screenreader is "Yes" or "No".

### Actual behavior:
Only the buttons (Yes or No) are announced by screenreader.

### Expected behavior:
The question, which this dialog asks should be announced.

### System configuration
#### NVDA installed/portable/running from source:
installed
#### NVDA version:
2020.2

#### Windows version:
Edition	Windows 	10 Home
Version				1909
Operating system build	18363.1016

#### Name and version of other software in use when reproducing the issue:
LibreOffice
Version:	7.0.0.3 (x64)
Build ID:	8061b3e9204bef6b321a21033174034a5e2ea88e
CPU-Threads: 	4; BS: Windows 10.0 Build 18363; UI-Render: Skia/Vulkan; VCL: win
Locale: 	de-DE (de_DE); UI: de-DE
Calc: 	threaded

#### Other information about your system:
---
### Other questions
#### Does the issue still occur after restarting your computer?
Yes.

#### Have you tried any other versions of NVDA? If so, please report their behaviors.
No.

#### If addons are disabled, is your problem still occuring?
Not tested.

#### Did you try to run the COM registry fixing tool in NVDA menu / tools?
Not tested.



Discussion:
This issue has also been reported to the Document Foundation; see https://bugs.documentfoundation.org/show_bug.cgi?id=135588
I have made two related changes in LibreOffice, s. https://bugs.documentfoundation.org/show_bug.cgi?id=135588 .
An additional change is needed to make sure that the dialog text is actually announced. From how I understand it, that is best handled on NVDA side, and I have created a pull request for this:  #12801

I'd be happy to receive feedback on this.

Resolving patch:
diff --git a/source/NVDAObjects/behaviors.py b/source/NVDAObjects/behaviors.py
--- a/source/NVDAObjects/behaviors.py
+++ b/source/NVDAObjects/behaviors.py
@@ -89,15 +89,16 @@ def getDialogText(cls,obj,allowFocusedDescendants=True):
 				continue
 			#For particular objects, we want to descend in to them and get their children's message text
 			if childRole in (
-					controlTypes.Role.PROPERTYPAGE,
-					controlTypes.Role.PANE,
-					controlTypes.Role.PANEL,
-					controlTypes.Role.WINDOW,
-					controlTypes.Role.GROUPING,
-					controlTypes.Role.PARAGRAPH,
-					controlTypes.Role.SECTION,
-					controlTypes.Role.TEXTFRAME,
-					controlTypes.Role.UNKNOWN
+				controlTypes.ROLE_OPTIONPANE,
+				controlTypes.Role.PROPERTYPAGE,
+				controlTypes.Role.PANE,
+				controlTypes.Role.PANEL,
+				controlTypes.Role.WINDOW,
+				controlTypes.Role.GROUPING,
+				controlTypes.Role.PARAGRAPH,
+				controlTypes.Role.SECTION,
+				controlTypes.Role.TEXTFRAME,
+				controlTypes.Role.UNKNOWN
 			):
 				#Grab text from descendants, but not for a child which inherits from Dialog and has focusable descendants
 				#Stops double reporting when focus is in a property page in a dialog


Test patch:
Repository: nvaccess/nvda

Issue:
NVDA announces selected for every cell when UIA is enabled in Microsoft Excel
### Steps to reproduce:
1. Ensure that UIA for Excel is enabled
2. Open Excel
3. Navigate through the sheet

### Actual behavior:
Nvda announces the word selected for every cell

### Expected behavior:
NVDA does not announce selected for every cell.

### Underlying cause
getSelectedItemsCount on the selection container returns 0 even though the focused item is selected.

### System configuration
#### NVDA installed/portable/running from source:
Installed

#### NVDA version:
alpha-23054,43f4b192

#### Windows version:
Windows 10 21H1

#### Name and version of other software in use when reproducing the issue:
Excel for Office365 version 16.0.14026.20246



Discussion:
@michaelDCurran I don't recall this behavior from earlier tests with Excel, so this might be a regression.

Resolving patch:
diff --git a/source/NVDAObjects/UIA/excel.py b/source/NVDAObjects/UIA/excel.py
--- a/source/NVDAObjects/UIA/excel.py
+++ b/source/NVDAObjects/UIA/excel.py
@@ -1,7 +1,7 @@
 # A part of NonVisual Desktop Access (NVDA)
 # This file is covered by the GNU General Public License.
 # See the file COPYING for more details.
-# Copyright (C) 2018-2021 NV Access Limited
+# Copyright (C) 2018-2021 NV Access Limited, Leonard de Ruijter
 
 from typing import Optional, Tuple
 import UIAHandler
@@ -350,6 +350,14 @@ def _get__nextCellHasContent(self) -> bool:
 
 	def _get_states(self):
 		states = super().states
+		if controlTypes.State.FOCUSED in states and self.selectionContainer.getSelectedItemsCount() == 0:
+			# #12530: In some versions of Excel, the selection pattern reports 0 selected items,
+			# even though the focused UIA element reports as selected.
+			# NVDA only silences the positive SELECTED state when one item is selected.
+			# Therefore, by discarding both the SELECTED and SELECTABLE states,
+			# we eliminate the redundant selection announcement.
+			states.discard(controlTypes.State.SELECTED)
+			states.discard(controlTypes.State.SELECTABLE)
 		if self._isContentTooLargeForCell:
 			if not self._nextCellHasContent:
 				states.add(controlTypes.State.OVERFLOWING)


Test patch:
Repository: nvaccess/nvda

Issue:
NVDA 2021.3 Beta no longer announces backspaced characters in Visual Studio 2019
### Steps to reproduce:
Open a file in Visual Studio, type some text and try to remove characters with backspace.
### Actual behavior:
Deleted characters are not announced.
### Expected behavior:
NVDA should announce deleted characters.
### System configuration
#### NVDA installed/portable/running from source:
Tried all 3
#### NVDA version:
NVDA 2021.3 beta 2, latest Alpha
#### Windows version:
Tested both on Windows 7 and Windows 11
#### Name and version of other software in use when reproducing the issue:
Visual Studio 2019
#### Other information about your system:
None relevant
### Other questions
#### Does the issue still occur after restarting your computer?
Yes
#### Have you tried any other versions of NVDA? If so, please report their behaviors.
The issue does not occur with 2021.2
#### If NVDA add-ons are disabled, is your problem still occurring?
Yes
#### Does the issue still occur after you run the COM Registration Fixing Tool in NVDA's tools menu?
Yes
### Technical:
This is caused by PR #12868 - reverting it makes characters announced again. It looks like  Visual Studio does not emit UIA  caret events and this just worked previously by chance since the MSAA caret events were routed to the focused object even though it was UIA.
The best solution for now I believe would be to restrict fix from #12868 to the MS Word controls, as we are not aware about any other problematic places.

@michaelDCurran  Thoughts?


Discussion:

Resolving patch:
diff --git a/source/IAccessibleHandler/__init__.py b/source/IAccessibleHandler/__init__.py
--- a/source/IAccessibleHandler/__init__.py
+++ b/source/IAccessibleHandler/__init__.py
@@ -539,12 +539,20 @@ def processGenericWinEvent(eventID, window, objectID, childID):
 		winUser.EVENT_OBJECT_SHOW
 	):
 		if not isinstance(focus, NVDAObjects.IAccessible.IAccessible):
-			if isMSAADebugLoggingEnabled():
-				log.debug(
-					f"Ignoring MSAA caret event on non-MSAA focus {focus}, "
-					f"winEvent {getWinEventLogInfo(window, objectID, childID)}"
-				)
-			return False
+			# #12855: Ignore MSAA caret event on non-MSAA focus.
+			# as Chinese input method fires MSAA caret events over and over on UIA Word documents.
+			# #13098: However, limit this specifically to UIA Word documents,
+			# As other UIA documents (E.g. Visual Studio)
+			# Seem to rely on MSAA caret events,
+			# as they do not fire their own UIA caret events.
+			from NVDAObjects.UIA.wordDocument import WordDocument
+			if isinstance(focus, WordDocument):
+				if isMSAADebugLoggingEnabled():
+					log.debug(
+						f"Ignoring MSAA caret event on focused UIA Word document"
+						f"winEvent {getWinEventLogInfo(window, objectID, childID)}"
+					)
+				return False
 		if isMSAADebugLoggingEnabled():
 			log.debug(
 				"handling winEvent as caret event on focus. "


Test patch:
Repository: nvaccess/nvda

Issue:
Double setting dialog opened
Issue opened after https://github.com/nvaccess/nvda/pull/12800#issuecomment-911676751.
Cc @seanbudd 

### Steps to reproduce:

- Open braille settings
- press "Change button to choose braille display
- focus desktop (windows+D)
- press NVDA+ctrl+V to open voice settings


### Actual behavior:

New dialog opens and the following error is logged:

```
IO - external:inputCore.executeGesture (15:08:06.965) - winInputHook (10856):
Input: kb(desktop):NVDA+control+v
DEBUG - external:gui.settingsDialogs.__new__ (15:08:07.004) - MainThread (11064):
Creating new settings dialog (multiInstanceAllowed:False). State of _instances {<gui.settingsDialogs.NVDASettingsDialog object at 0x1255FD50>: <DialogState.DESTROYED: 1>, <gui.settingsDialogs.BrailleDisplaySelectionDialog object at 0x1260B760>: <DialogState.CREATED: 0>}
ERROR - external:gui.settingsDialogs.__new__ (15:08:07.004) - MainThread (11064):
Opening new settings dialog while instance still exists: <gui.settingsDialogs.NVDASettingsDialog object at 0x1255FD50>
```


### Expected behavior:

Only one setting dialog should be able to open at a time.

### System configuration
#### NVDA installed/portable/running from source:
installed
#### NVDA version:
2021.2rc1

#### Windows version:
Windows 10 20H2 (64-bit) build 19042.1165


#### Name and version of other software in use when reproducing the issue:
N/A
#### Other information about your system:
N/A
### Other questions
#### Does the issue still occur after restarting your computer?
yes
#### Have you tried any other versions of NVDA? If so, please report their behaviors.
No but probably not new
#### If add-ons are disabled, is your problem still occurring?
Yes
#### Does the issue still occur after you run the COM Registration Fixing Tool in NVDA's tools menu?
Not tested.



Discussion:

Resolving patch:
diff --git a/source/gui/settingsDialogs.py b/source/gui/settingsDialogs.py
--- a/source/gui/settingsDialogs.py
+++ b/source/gui/settingsDialogs.py
@@ -274,9 +274,17 @@ def onApply(self, evt):
 		self.postInit()
 		self.SetReturnCode(wx.ID_APPLY)
 
-	def _onWindowDestroy(self, evt):
-		evt.Skip()
-		self._setInstanceDestroyedState()
+	def _onWindowDestroy(self, evt: wx.WindowDestroyEvent):
+		# Destroy events are sent to parent windows for handling.
+		# If a child window is being destroyed, we don't want to
+		# set this object as destroyed.
+		# The ExpandoTextCtrl creates a destroy event as part of
+		# initialization, this caused the NVDASettings dialog
+		# to be incorrectly set to destroyed, causing #12818.
+		isSelfAlive = bool(self)
+		if not isSelfAlive:
+			evt.Skip()
+			self._setInstanceDestroyedState()
 
 # An event and event binder that will notify the containers that they should
 # redo the layout in whatever way makes sense for their particular content.


Test patch:
Repository: nvaccess/nvda

Issue:
The word landmark is no longer abbreviated in braille
<!-- Please read the text in this edit field before filling it in.
Please thoroughly read NVDA's wiki article on how to fill in this template, including how to provide the required files.
Issues may be closed if the required information is not present.
https://github.com/nvaccess/nvda/blob/master/devDocs/githubIssueTemplateExplanationAndExamples.md
Please also note that the NVDA project has a Citizen and Contributor Code of Conduct which can be found at https://github.com/nvaccess/nvda/blob/master/CODE_OF_CONDUCT.md. NV Access expects that all contributors and other community members read and abide by the rules set out in this document while participating or contributing to this project. This includes creating or commenting on issues and pull requests. 

Each of the questions and sections below start with multiple hash symbols (#). Place your answers and information on the blank line below each question.
-->

### Steps to reproduce:
1. Connect a braille display.
2. Go to www.nvaccess.org.
3. Ensure that browse mode is turned on.
3. Press Ctrl+Home.

### Actual behavior:
The braille display shows:
"landmark navi h1 lnk gra NV Access"

### Expected behavior:
The display shows:
"lmk navi h1 lnk gra NV Access"
That is, "landmark" should be "lmk", just as "navigation" is shortened to "navi".

### System configuration
#### NVDA installed/portable/running from source:
Installed

#### NVDA version:

2021.3

#### Windows version:
Windows 10 21H2 (10.0.19044) workstation

#### Name and version of other software in use when reproducing the issue:
Firefox 95.0

#### Other information about your system:
N/A

### Other questions
#### Does the issue still occur after restarting your computer?
Yes

#### Have you tried any other versions of NVDA? If so, please report their behaviors.
Yes, "lmk" is shown in 2021.2 and the release notes does not mention this change.

#### If NVDA add-ons are disabled, is your problem still occurring?
Yes

#### Does the issue still occur after you run the COM Registration Fixing Tool in NVDA's tools menu?
Yes



Discussion:
It looks like `getControlFieldBraille` retrieves `controlTypes.Role.LANDMARK.displayString`, but the value from `braille.roleLabels` should probably be used.

Resolving patch:
diff --git a/source/braille.py b/source/braille.py
--- a/source/braille.py
+++ b/source/braille.py
@@ -719,7 +719,7 @@ def getControlFieldBraille(  # noqa: C901
 	roleText = field.get('roleTextBraille', field.get('roleText'))
 	landmark = field.get("landmark")
 	if not roleText and role == controlTypes.Role.LANDMARK and landmark:
-		roleText = f"{controlTypes.Role.LANDMARK.displayString} {landmarkLabels[landmark]}"
+		roleText = f"{roleLabels[controlTypes.Role.LANDMARK]} {landmarkLabels[landmark]}"
 
 	content = field.get("content")
 


Test patch:
Repository: nvaccess/nvda

Issue:
nvda is not reading the result of the accounts in the windows calculator history

### Steps to reproduce:
open windows calculator
do at least two operations
walk with tabe until nvda advertise
list, list item
walk with the arrows below and sign up and see that nvda advertises only list item.
### Actual behavior:
nvda announces only list item
### Expected behavior:

the nvda must announce the realized accounts as well as the result of the account.
this is a regression, I remember using this feature a long time ago and everything worked fine.
the regression can be from nvda or windows
### System configuration
#### NVDA installed/portable/running from source:
instaled
#### NVDA version:
nvda.exe, NVDA alpha-21386,53cecfd7


#### Windows version:
windows 10 19042.630
#### Name and version of other software in use when reproducing the issue:
Calculator.exe, Microsoft.WindowsCalculator 10.2009.4.0

#### Other information about your system:

### Other questions
#### Does the issue still occur after restarting your computer?
yes
#### Have you tried any other versions of NVDA? If so, please report their behaviors.
yes
#### If addons are disabled, is your problem still occuring?
yes
#### Did you try to run the COM registry fixing tool in NVDA menu / tools?
no


Discussion:
cc: @josephsl 
Hi,

Confirmed - I'll do something about it from Windows 10 App Essentials this weekend.

Thanks.
@josephsl: Could you determine whether this is a regression in NVDA or a change in recent Windows 10?
Hi, this is specific to Calculator and I deployed a fix as part of Windows 10 App Essentials 20.12. ultimately I hope Microsoft Calculator team would take these bugs into account. Thanks.



Resolving patch:
diff --git a/source/appModules/calculator.py b/source/appModules/calculator.py
--- a/source/appModules/calculator.py
+++ b/source/appModules/calculator.py
@@ -1,5 +1,5 @@
 # A part of NonVisual Desktop Access (NVDA)
-# Copyright (C) 2020-2021 NV Access Limited, Joseph Lee
+# Copyright (C) 2020-2022 NV Access Limited, Joseph Lee
 # This file is covered by the GNU General Public License.
 # See the file COPYING for more details.
 
@@ -40,6 +40,15 @@ class AppModule(appModuleHandler.AppModule):
 	# Name change says the same thing multiple times for some items.
 	_resultsCache = ""
 
+	def event_NVDAObject_init(self, obj):
+		if not isinstance(obj, UIA):
+			return
+		# #11858: version 10.2009 introduces a regression where history and memory items have no names
+		# but can be fetched through its children.
+		# Resolved in version 10.2109 which is exclusive to Windows 11.
+		if not obj.name and obj.parent.UIAAutomationId in ("HistoryListView", "MemoryListView"):
+			obj.name = "".join([item.name for item in obj.children])
+
 	def event_nameChange(self, obj, nextHandler):
 		if not isinstance(obj, UIA):
 			return


Test patch: