<AWT Dev> [8] Review request for 7194469 Pressing the Enter key results in an alert tone beep when focus is TextField

Alexander Scherbatiy alexandr.scherbatiy at oracle.com
Thu Sep 6 07:37:46 PDT 2012


On 9/6/2012 2:56 PM, Oleg Pekhovskiy wrote:
> Hi Alexander, Denis,
>
> agree with Alexander, as it's a workaround and we turn off beeping for 
> a short period of time, so we should avoid broadcasting that message.
>
> There is another reason for not doing that - possibility to freeze 
> waiting for another dead process:
> http://www.transl-gunsmoker.ru/2010/03/systemparametersinfo-spifsendchange.html 
> (Russian)
>
> Maybe it makes sense to monitor WM_WININICHANGE and check whether 
> somebody changed SPI_SETBEEP flag,
>  but I'm not completely sure about that.
      It seems that the WM_WININICHANGE message does not have the value 
that was used for the beeper turning on/off by other process.
      So we do not know how the beeper state was changed  in that time 
when we disabled/enabled the beeper and so it is not possible to restore 
this state.

    Thanks,
    Alexandr.

>
> Thanks,
> Oleg
>
> 9/6/2012 2:30 PM, Alexander Scherbatiy wrote:
>> On 9/6/2012 1:25 PM, Denis S. Fokin wrote:
>>> Hi Alexander,
>>>
>>> should not we use SPIF_SENDCHANGE instead of SPIF_UPDATEINIFILE? It 
>>> is possible that the user does not want to disable beep in his 
>>> profile. On the other hand, I do not see any issues with 
>>> SPIF_SENDCHANGE.
>>>
>>         Could you review the updated fix:
>>         http://cr.openjdk.java.net/~alexsch/7194469/webrev.01/
>>
>>          The MSDN doc says that the SPIF_SENDCHANGE broadcasts a 
>> message after updating the user profile. Probably we do not want to 
>> notify all that we disable and then enable the beeper for the 
>> RICHEDIT control:
>>         
>> http://msdn.microsoft.com/en-us/library/windows/desktop/ms724947%28v=vs.85%29.aspx
>>
>>         It allso says that this parameter can be zero if you do not 
>> want to update the user profile or broadcast a message.
>>
>>        So the fix sets the fWinIni parameter to 0 in the 
>> SystemParametersInfo method.
>>
>>    Thanks,
>>    Alexandr.
>>
>>> Thank you,
>>>    Denis.
>>>
>>> On 9/5/2012 5:24 PM, Alexander Scherbatiy wrote:
>>>>
>>>> bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7194469
>>>> webrev: http://cr.openjdk.java.net/~alexsch/7194469/webrev.00/
>>>>
>>>> The TextField control starts beeping on some keys pressing (enter, up,
>>>> down...) after switching the EDIT control to RICHEDIT.
>>>>
>>>> It seems that there are no flags that can disable this beeping for the
>>>> RICHEDIT.
>>>> At least SES_ALLOWBEEPS flag from EM_GETEDITSTYLE is set to zero by
>>>> default but beeping is present.
>>>>
>>>> The fix disables the beeper (in case if it was enabled) before the
>>>> necessary keys processing in the AWT TextField and enable it after 
>>>> that.
>>>>
>>>> Thanks,
>>>> Alexandr.
>>>>
>>>
>>
>




More information about the awt-dev mailing list