Repository: nvaccess/nvda

Issue:
Double announcing of desktop icons when alt+tab is pressed.
**Reported by ateu on 2013-02-12 22:28**
When pressing alt+tab or Windows+m to go to desktop, NVDA announces twice the desktop icons. After this, it speaks correctly.
My system is Windows 7 64 bit.
**Blocking #4275**

Double speaking of menu items in Windows 7 Start Menu
**Reported by jteh on 2009-11-16 03:14**
We seem to get double speaking of menu items in the Windows 7 Start Menu. This occurs for all items except the first encountered when entering a sub-menu.

Str:
1. Open the Start Menu.
2. Press down arrow to move to the first item in the "Frequently Used Programs" menu.
   - Result: The item is only spoken once (correct).
3. Press down arrow to move to the second item.
   - Result: The item is spoken twice.
   - Expected: It should only be spoken once.
4. Find a sub-menu and open it.
   - Result: The first item is only spoken once (correct).
5. Press down arrow to move to the second item.
   - Result: The item is spoken twice.
   - Expected: It should only be spoken once.



Discussion:
Comment 1 by jteh on 2013-02-12 22:36
Do you mean it announces the selected desktop icon twice or announces multiple icons twice?

Comment 2 by ateu (in reply to comment 1) on 2013-02-12 23:42
Replying to [jteh](comment:1):

> Do you mean it announces the selected desktop icon twice or announces multiple icons twice?

The selected icon.

Comment 3 by briang1 on 2013-02-13 13:25
Could this be a tool tip?

Comment 4 by ateu on 2014-01-22 21:14
Strangely, when the focus is on another window, this does not occurs. However, when going from the start menu to desktop, this occurs.
My system is Windows 7 64 bit.

Comment 5 by blindbhavya on 2014-07-13 11:41
Hi.
You had posted in my ticket that it could be a duplicate of this one but I think it isn't actually.
Just to confirm this report I faced this issue as well.
Steps to reproduce
Press Ctrl Esc to launch the Start Menu.
Press Windows M to go to the Desktop.
NVDA says the desktop icon twice.
BTW, please put my e-mail address in the CC of this ticket so that I get all updates directly in my Inbox.

Comment 7 by jteh on 2014-07-13 23:27
@blindbhavya: You should be able to cc yourself by checking the appropriate box, but I've done it for you here anyway.

Comment 8 by blindbhavya on 2014-07-14 12:03
Hi.
Will you fix this?
The ticket owner means the person who will solve the issue, right?
Ok, I will CC myself from now on.
Sorry, for the duplicate, did it unknowingly.

This is not an issue on Windows 10. Could someone please test on Windows 7 to see if this is still an issue?
I cannot reproduce it on Windows 8.1 eather. @ateu can you still reproduce it on Windows 7?
I am not @ATeu but i can still reproduce in on Windows 7 by doing the following:
1. Press Windows to open menu start.
2. Start alt tabbing  to move to the desktop.
3. When desktop would be active window release both keys and observe, that the icon would be announced twice.
Which NVDA version are you using?

 

 

Von: Łukasz Golonka <notifications@github.com> 
Gesendet: Dienstag, 27. November 2018 22:46
An: nvaccess/nvda <nvda@noreply.github.com>
Cc: Adriani90 <adriani.botez@googlemail.com>; Comment <comment@noreply.github.com>
Betreff: Re: [nvaccess/nvda] Double announcing of desktop icons when alt+tab is pressed. (#2988)

 

I am not @ATeu <https://github.com/ATeu>  but i can still reproduce in on Windows 7 by doing the following:

1.	Press Windows to open menu start.
2.	Start alt tabbing to move to the desktop.
3.	When desktop would be active window release both keys and observe, that the icon would be announced twice.

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <https://github.com/nvaccess/nvda/issues/2988#issuecomment-442229116> , or mute the thread <https://github.com/notifications/unsubscribe-auth/Aaon8XKdpAtdGhA184ld7pCoN5WRhH1Bks5uzbKagaJpZM4O-Cxt> .  <https://github.com/notifications/beacon/Aaon8Y9lnOPqObEVnrel_OJGtx3p0yc2ks5uzbKagaJpZM4O-Cxt.gif> 


NVDA 2018.4 beta 2
One last question from my side:

If you press alt tab quickly, actually it should report it only once. If you press alt tab but you release the tab key and hold the alt key pressed for short time longer, then NVDA reports it twice. Can you confirm this behavior?

 

If yes, this is actually correct behavior because NVDA reports once when you press alt+tab and hold the alt key pressed to report the current window in the buffer and then when you release the alt key finally NVDA reports the window to which the focus really changed.

 

 

 

Von: Łukasz Golonka <notifications@github.com> 
Gesendet: Mittwoch, 28. November 2018 00:16
An: nvaccess/nvda <nvda@noreply.github.com>
Cc: Adriani90 <adriani.botez@googlemail.com>; Comment <comment@noreply.github.com>
Betreff: Re: [nvaccess/nvda] Double announcing of desktop icons when alt+tab is pressed. (#2988)

 

NVDA 2018.4 beta 2

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <https://github.com/nvaccess/nvda/issues/2988#issuecomment-442255251> , or mute the thread <https://github.com/notifications/unsubscribe-auth/Aaon8XX1284_Wf5smSOLTDXoKExV7rz1ks5uzcfHgaJpZM4O-Cxt> .  <https://github.com/notifications/beacon/Aaon8QShAUBwLBQ1I9Ha7HGufkbGEBW_ks5uzcfHgaJpZM4O-Cxt.gif> 


This issue Isn't about reporting window twice, but about repeating a focused icon on the desktop twice after releasing alt+tab.
Oh sorry I should read more exactly title and description. Sorry, forget my comment above *g*

Von meinem iPhone gesendet

> Am 28.11.2018 um 00:39 schrieb Łukasz Golonka <notifications@github.com>:
> 
> This issue Isn't about reporting window twice, but about repeating a focused icon on the desktop twice after releasing alt+tab.
> 
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub, or mute the thread.

@Adriani90 No problem.
Comment 2 by mdcurran on 2010-01-29 07:05
Having investigated this problem, it seems that those lists are firing two focus winEvents when focus moves from one item to another. However, the two focus winEvents differe from each other in their childID, and this is why they are not just filtered out by winEventLimiter.
The first winEvent has a childID of the item, the second winEvent has a childID of self (0). 
But, because NVDA (IAccessibleHandler.processFocusWinEvent) has special code to correct focus going to the list itself, the real focus is retreaved, and therefore we get two identical focus events.

One option is to:
create a sysListView32.MenuItem NVDAObject who's shouldAllowIAccessibleFocusEvent will be false if the item already has focus / is going to have focus.

Comment 3 by jteh on 2010-02-11 11:36
Fixed in r3500.
Changes:
Milestone changed from None to 2010.1
State: closed


Resolving patch:
diff --git a/source/appModules/explorer.py b/source/appModules/explorer.py
--- a/source/appModules/explorer.py
+++ b/source/appModules/explorer.py
@@ -20,7 +20,7 @@
 import eventHandler
 import mouseHandler
 from NVDAObjects.window import Window
-from NVDAObjects.IAccessible import sysListView32, IAccessible, List
+from NVDAObjects.IAccessible import IAccessible, List
 from NVDAObjects.UIA import UIA
 from NVDAObjects.window.edit import RichEdit50, EditTextInfo
 
@@ -55,16 +55,18 @@ class SearchBoxClient(IAccessible):
 
 
 # Class for menu items  for Windows Places and Frequently used Programs (in start menu)
-class SysListView32MenuItem(sysListView32.ListItemWithoutColumnSupport):
+# Also used for desktop items
+class SysListView32EmittingDuplicateFocusEvents(IAccessible):
 
 	# #474: When focus moves to these items, an extra focus is fired on the parent
 	# However NVDA redirects it to the real focus.
 	# But this means double focus events on the item, so filter the second one out
+	# #2988: Also seen when coming back to the Windows 7 desktop from different applications.
 	def _get_shouldAllowIAccessibleFocusEvent(self):
-		res=super(SysListView32MenuItem,self).shouldAllowIAccessibleFocusEvent
+		res = super().shouldAllowIAccessibleFocusEvent
 		if not res:
 			return False
-		focus=eventHandler.lastQueuedFocusObject
+		focus = eventHandler.lastQueuedFocusObject
 		if type(focus)!=type(self) or (self.event_windowHandle,self.event_objectID,self.event_childID)!=(focus.event_windowHandle,focus.event_objectID,focus.event_childID):
 			return True
 		return False
@@ -221,8 +223,17 @@ def chooseNVDAObjectOverlayClasses(self, obj, clsList):
 			clsList.insert(0, ReadOnlyEditBox)
 			return # Optimization: return early to avoid comparing class names and roles that will never match.
 
-		if windowClass == "SysListView32" and role == controlTypes.ROLE_MENUITEM:
-			clsList.insert(0, SysListView32MenuItem)
+		if windowClass == "SysListView32":
+			if(
+				role == controlTypes.ROLE_MENUITEM
+				or(
+					role == controlTypes.ROLE_LISTITEM
+					and obj.simpleParent
+					and obj.simpleParent.simpleParent
+					and obj.simpleParent.simpleParent == api.getDesktopObject()
+				)
+			):
+				clsList.insert(0, SysListView32EmittingDuplicateFocusEvents)
 			return # Optimization: return early to avoid comparing class names and roles that will never match.
 
 		# #5178: Start button in Windows 8.1 and 10 should not have been a list in the first place.


Test patch: