<AWT Dev> [10] JDK-8178361: JFileChooser does not allow to open folders with a double tap when using the touch screen interface

Shashidhara Veerabhadraiah shashidhara.veerabhadraiah at oracle.com
Mon Sep 25 06:29:36 UTC 2017

Hi Alexey, Thank you for pointing that out. I misread the info that EnableMouseInPointer() is a must call and would enable the WM_POINTER messages being sent to the component. But actually it is not required to be enabled and as you rightly pointed out that it would convert the WM_MOUSE to the WM_POINTER messages.


Below is the Webrev that does this change. Now since mouse in pointer is disabled, the mouse behavior should not have any effect at all by this software updates.


Webrev: http://cr.openjdk.java.net/~sveerabhadra/8178361/webrev.01/


For additional replies, please see below.


Thanks and regards,



From: Alexey Ivanov 
Sent: Friday, September 22, 2017 5:19 PM
To: Shashidhara Veerabhadraiah <shashidhara.veerabhadraiah at oracle.com>; Sergey Bylokhov <sergey.bylokhov at oracle.com>
Cc: awt-dev at openjdk.java.net
Subject: Re: <AWT Dev> [10] JDK-8178361: JFileChooser does not allow to open folders with a double tap when using the touch screen interface


Hi Shashi,

You use EnableMouseInPointer which converts classical WM_MOUSE events to WM_POINTER events. This could have substantial effect on AWT components behaviour. I am worried about High DPI support, drag-and-drop functionality etc.

[Shashi] This is not required and hence removed.

Is there a simpler way to handle double-tap?
Windows converts taps to clicks, i.e. the app receives WM_LBUTTONDOWN and WM_LBUTTONUP.
Have you tried to find out why double-tap is not converted to double-click?

[Shashi] Since the mouse in pointer is disabled and a windows icon behavior is different from a windows button behavior(Because the a touch on the icon does not translate to a left button down event whereas it does for a windows button(file name!!)), it is required to bring in the WM_POINTER message type into the component message handling routine.

Do right and middle mouse buttons continue to work as expected? Mouse wheel? Any additional mouse buttons?

[Shashi] It should not have any effect after mouse in pointer is disabled.

The documentation for EnableMouseInPointer [1] says: “This function can be called only once in the context of a process lifetime.” You call it for every component created. It would have been enough to call it once during Toolkit initialization.


[1] https://msdn.microsoft.com/en-us/library/windows/desktop/hh447467(v=vs.85).aspx

On 19/09/2017 04:35, Shashidhara Veerabhadraiah wrote:

Hi Sergey, When I checked it was not working on the Java applications. None of the controls could take touch click events but it used to highlight because when we touch on the touch screen interface the system moves the cursor over to the touch point thereby enabling mouse focus events being sent.
Thanks and regards,
-----Original Message-----
From: Sergey Bylokhov 
Sent: Tuesday, September 19, 2017 3:39 AM
To: HYPERLINK "mailto:shashidhara.veerabhadraiah at oracle.com"shashidhara.veerabhadraiah at oracle.com >> Shashidhara Veerabhadraiah HYPERLINK "mailto:shashidhara.veerabhadraiah at oracle.com"<shashidhara.veerabhadraiah at oracle.com>
Cc: HYPERLINK "mailto:awt-dev at openjdk.java.net"awt-dev at openjdk.java.net
Subject: Re: <AWT Dev> [10] JDK-8178361: JFileChooser does not allow to open folders with a double tap when using the touch screen interface
Hi, Shashi.
Why the bug is JFileChooser specific?
Does it means that it works for other elements(buttons/lists/menu/etc)?
On 9/18/17 08:58, Shashidhara Veerabhadraiah wrote:

Hi All, Please review this software changes for the /_enhancement_/ 
Issue: Request was filed to enable the touch event processing for Java 
client applications.
Fix: Windows platform offers 'pointer' implementation thro' which one 
can tap for the touch inputs as well. A typical 'pointer' function may 
contain touch, pen, touch pad or mouse inputs. This allows for a 
uniform input processing though the event source may defer. This fix 
enables the 'touch' events(via TOUCH pointer) to be passed to the 
components using the other type of pointer 'mouse'. Essentially there 
is a conversion put in place to convert a touch event input into a 
left click mouse event. I think this is the right thing to do 
considering desktop scenarios to which the typical Java applications 
that gets exposed to. This is also the same behavior on my touch 
enabled windows 10 laptop as well. Please let me know if a different behavior is expected. Below is the output:
Now touch event works as a typical mouse left click as in general. But 
there is an issue because the icon size of the Java UI is typically 
small, touching that icon exactly is sometimes difficult. This is 
handled by an Windows application by having larger icon size or icon 
view as a standard. Hence I believe this is outside the scope this 
software update. Any changes to it would be done later as a new bug or 
an enhancement.
Bug ID: https://bugs.openjdk.java.net/browse/JDK-8178361
Webrev: HYPERLINK "http://cr.openjdk.java.net/%7Esveerabhadra/8178361/webrev.00/"http://cr.openjdk.java.net/~sveerabhadra/8178361/webrev.00/
Thanks and regards,

Best regards, Sergey.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/awt-dev/attachments/20170924/27fc6c91/attachment.html>

More information about the awt-dev mailing list