Tk Source Code

View Ticket
Login
Ticket UUID: 220599
Title: Bug in FocusGroup Handling under CDE
Type: Bug Version: obsolete: 8.2
Submitter: welch Created on: 2000-10-31 23:47:54
Subsystem: 67. Unix Window Operations Assigned To: nobody
Priority: 2 Severity:
Status: Closed Last Modified: 2001-03-23 02:24:18
Resolution: Fixed Closed By: dgp
    Closed on: 2001-03-22 19:24:18
Description:
OriginalBugID: 2960 Bug
Version: 8.2
SubmitDate: '1999-09-28'
LastModified: '2000-04-07'
Severity: MED
Status: Released
Submitter: techsupp
ChangedBy: hobbs
OS: Solaris
OSVersion: 2.7
Machine: Other
FixedDate: '2000-04-07'
FixedInVersion: 8.3.1


Name:

Donal Fellows



Comments:

This fixes a long-standing bug in Tk (it was certainly there

    in 8.0.4) which made keyboard navigation of the standard

    open/save file dialogs nearly impossible.  Since keyboard

    navigation is important for Power Users, this fix is a good

    idea.  It doesn't impact much on beginners though, who

    tend to prefer the point-and-grunt style of interaction...



ReproducibleScript:

First, run the following code in wish running under CDE (it might

    exist under other window managers/environments, but I have not

    checked):

        set tk_strictMotif 0

        tk_getOpenFile -initialfile foobar

    Now, try to use the left arrow key (not the mouse) to move

    backward within the entry field to between the "o" and the "b". 

    You will find that it is impossible to move more than one

    character back.  This is a problem!



ObservedBehavior:

The problem is that the focus handling for focus groups is too

    agressive (given the context of CDE at least, which traps

    some keystrokes for its own nefarious purposes.)  FocusIn

    events are only meaningful when they have a detail field (%d)

    of NotifyNonlinear or NotifyNonlinearVirtual.



DesiredBehavior:

I expect to be able to use the keyboard to navigate about the entry

    widget!



Patch:

*** comdlg.tcl.old      Tue Sep 28 10:50:29 1999

--- comdlg.tcl.new      Tue Sep 28 10:51:30 1999

***************

*** 217,222 ****

--- 217,228 ----

  proc tkFocusGroup_In {t w detail} {

      global tkPriv tkFocusIn

  

+     if {[string compare $detail NotifyNonlinear] &&

+       [string compare $detail NotifyNonlinearVirtual]} {

+       # This is caused by mouse moving out&in of the window *or*

+       # ordinary keypresses some window managers!

+       return

+     }

      if {![info exists tkFocusIn($t,$w)]} {

        set tkFocusIn($t,$w) ""

        return



PatchFiles:

comdlg.tcl





Confirmed in CDE and fixed for 8.3.1. 
-- 04/07/2000 hobbs