Current versions of Wine do not allow the Tab key to move between elements
of a dialog (ex. ChooseFont dialog). I have traced this back to a fix
submitted on 10/24/99. The change log says:

   revision 1.13
   date: 1999/10/24 17:23:52;  author: julliard;  state: Exp;  lines: +3 -0
   Adrian Thurston <[EMAIL PROTECTED]>
   Do not set focus to a disabled window.

The intent of the patch was to not set focus to the window passed in if it
was WS_MINIMIZED or WS_DISABLED. First not all the patch was applied, and
that is a good thing (need test in loop). Second, the test applied and
currently in the code tests whether WS_CHILD window is mined or disabled. If
a window passed in then that is ok. If a dialog item is passed in (in the
ChooseFont case a ComboBox), then the test is against the dialog box itself
which *is* disabled. The test succeeds and throws away the tab key.

I suggest the following patch, but since I am very unsure in this area, I
would appreciate any feedback.

Index: windows/focus.c
===================================================================
RCS file: /home/wine/wine/windows/focus.c,v
retrieving revision 1.15
diff -u -r1.15 focus.c
--- windows/focus.c 2000/03/08 18:26:58 1.15
+++ windows/focus.c 2000/03/26 04:43:43
@@ -89,6 +89,9 @@
     {
    /* Check if we can set the focus to this window */

+        /* if desired item is disabled then ignore attempt */
+        if ( wndPtr->dwStyle & ( WS_MINIMIZE | WS_DISABLED) ) goto CLEANUP;
+
  while ( (wndPtr->dwStyle & (WS_CHILD | WS_POPUP)) == WS_CHILD  )
  {
      if ( wndPtr->dwStyle & ( WS_MINIMIZE | WS_DISABLED) )
@@ -97,9 +100,6 @@
             if (!wndPtr) goto CLEANUP;
      hwndTop = wndPtr->hwndSelf;
  }
-
-        /* definitely at the top window now */
-        if ( wndPtr->dwStyle & ( WS_MINIMIZE | WS_DISABLED) ) goto CLEANUP;

         /* Retrieve the message queue associated with this window */
         pMsgQ = (MESSAGEQUEUE *)QUEUE_Lock( wndPtr->hmemTaskQ );


Guy Albertelli  <<[EMAIL PROTECTED]>>

Bathed in his currents of liquid helium, self-contained, immobile,
vastly well informed by every mechanical sense: Shalmaneser.
Every now and again there passes through his circuts a pulse
which carries the cybernetic equivalent of the phrase, "Christ, what
an imagination I've got. "  -  Stand on Zanzibar by John Brunner

Reply via email to