]> git.eshelyaron.com Git - emacs.git/commitdiff
Set accessibility subroles for child frame (bug#31324)
authorAlan Third <alan@idiocy.org>
Sun, 13 May 2018 10:02:00 +0000 (11:02 +0100)
committerAlan Third <alan@idiocy.org>
Sat, 2 Jun 2018 14:31:59 +0000 (15:31 +0100)
; Depends on patch in bug#31440.

* src/nsterm.m (x_set_parent_frame): Set subrole depending on whether
frame is a child or not.

src/nsterm.m

index df883346dee2e04acf9675455beb8354b3d2488e..e4a9b014f4900f341a3eca6abbf4b733bed51e2e 100644 (file)
@@ -1962,7 +1962,15 @@ x_set_parent_frame (struct frame *f, Lisp_Object new_value, Lisp_Object old_valu
       child = [FRAME_NS_VIEW (f) window];
 
       if ([child parentWindow] != nil)
-        [[child parentWindow] removeChildWindow:child];
+        {
+          [[child parentWindow] removeChildWindow:child];
+#if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= 101000
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 101000
+          if ([child respondsToSelector:@selector(setAccessibilitySubrole:)]
+#endif
+              [child setAccessibilitySubrole:NSAccessibilityStandardWindowSubrole];
+#endif
+        }
 
       if (!NILP (new_value))
         {
@@ -1970,6 +1978,12 @@ x_set_parent_frame (struct frame *f, Lisp_Object new_value, Lisp_Object old_valu
 
           [parent addChildWindow: child
                          ordered: NSWindowAbove];
+#if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= 101000
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 101000
+          if ([child respondsToSelector:@selector(setAccessibilitySubrole:)]
+#endif
+              [child setAccessibilitySubrole:NSAccessibilityFloatingWindowSubrole];
+#endif
         }
 
       unblock_input ();