RFR: 6777156: GTK L&F: JFileChooser shouldn't display /../../../.. in combobox and selection textarea. [v2]

Jayathirth D V jdv at openjdk.org
Mon Sep 26 14:07:20 UTC 2022


On Mon, 26 Sep 2022 06:13:47 GMT, Abhishek Kumar <duke at openjdk.org> wrote:

>> When a user selects ../ from directory list in GTK FileChooser continuosly, it leads to '../../../.....' in combobox and selection textarea even though it the current directory is at root level.
>> 
>> Fix for the issue is to check if current directory is root then don't process the selection of ' ../ '.
>> 
>> Test case has been added and checked in CI pipeline. Link is attached in JBS.
>
> Abhishek Kumar has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Comment added and test case condotion update

What is the behaviour in other LAF's?
Also lets change title of this bug to something like "GTK L&F: JFileChooser can jump beyond root directory in combobox and selection textarea"

src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/GTKFileChooserUI.java line 432:

> 430:         }
> 431: 
> 432:         public void mouseClicked(MouseEvent e) {

Is this issue reproducible only through mouse click event? Can we use key navigation and return button to see same issue? Is button press using keyboard navigation treated as mouseClick event?

test/jdk/javax/swing/JFileChooser/TestFileChooserDirectorySelection.java line 57:

> 55: 
> 56:             robot.waitForIdle();
> 57:             robot.delay(1000);

After robot.setAutoDelay() why we need such large delays in robot at many places?

test/jdk/javax/swing/JFileChooser/TestFileChooserDirectorySelection.java line 102:

> 100: 
> 101:     private static void doubleClickMouse(Point p) {
> 102:         robot.mouseMove(p.x+75, p.y+frame.getHeight()/2 - 90);

We should not use magic numbers to determine location on screen. Will these coordinates hold true at different uiScales?

-------------

PR: https://git.openjdk.org/jdk/pull/10390



More information about the client-libs-dev mailing list