Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dead key crashes on Win32 #28047

Merged
merged 4 commits into from
Aug 13, 2021
Merged

Conversation

dkwingsmt
Copy link
Contributor

@dkwingsmt dkwingsmt commented Aug 12, 2021

This PR fixes the crash caused by pressing dead keys on Win32.

It was not tested out because the MapVk function does not work the same in unit tests. Another dependency injection has been added.

Fixes flutter/flutter#88108.

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide and the C++, Objective-C, Java style guides.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt. See testing the engine for instructions on
    writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the CLA.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@dkwingsmt dkwingsmt requested a review from gspencergoog August 12, 2021 19:52
Copy link
Contributor

@gspencergoog gspencergoog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

32384589-a60f0e74-c078-11e7-9bc1-e5b5287aea9d

// value: the "normal character" | 0x80000000. For example, when pressing
// "dead key caret" (one that makes the following e into ê), its mapped
// character is 0x8000005E. "Reverting" it gives 0x5E, which is character '^'.
uint32_t _UndeadChar(uint32_t ch) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love the name. :-)

@dkwingsmt dkwingsmt merged commit b87e626 into flutter:master Aug 13, 2021
@dkwingsmt dkwingsmt deleted the fix-dead-key-tests branch August 13, 2021 08:36
@marcoprodata
Copy link

The problem persist, need to open another issue?

@dkwingsmt
Copy link
Contributor Author

@marcoprodata It takes a few hours for the change to be rolled into flutter/flutter. Can you try again?

@marcoprodata
Copy link

Yes, tomorrow i will try again, thanks for your attention

@marcoprodata
Copy link

@dkwingsmt the problem persist, updated and the winapp crash with accents

Launching lib\main.dart on Windows in debug mode...
Connecting to VM Service at ws://127.0.0.1:59050/B6Bz_A_vuMw=/ws
Unable to parse JSON message:
The document is empty.

════════ Exception caught by services library ══════════════════════════════════
The following RangeError was thrown during a platform message callback:
Invalid value: Not in inclusive range 0..1114111: 2147483828

When the exception was thrown, this was the stack
#0 new String.fromCharCode (dart:core-patch/string_patch.dart:45:5)
#1 new RawKeyEvent.fromMessage
#2 KeyEventManager.handleRawKeyMessage
#3 BasicMessageChannel.setMessageHandler.
#4 BasicMessageChannel.setMessageHandler.
#5 _DefaultBinaryMessenger.setMessageHandler.
#6 _DefaultBinaryMessenger.setMessageHandler.
#7 _invoke2. (dart:ui/hooks.dart:205:15)
#11 _invoke2 (dart:ui/hooks.dart:204:10)
#12 _ChannelCallbackRecord.invoke (dart:ui/channel_buffers.dart:42:5)
#13 _Channel.push (dart:ui/channel_buffers.dart:132:31)
#14 ChannelBuffers.push (dart:ui/channel_buffers.dart:329:17)
#15 PlatformDispatcher._dispatchPlatformMessage (dart:ui/platform_dispatcher.dart:544:22)
#16 _dispatchPlatformMessage (dart:ui/hooks.dart:92:31)
(elided 3 frames from dart:async)
════════════════════════════════════════════════════════════════════════════════
Lost connection to device.
Exited (sigterm)

@dkwingsmt
Copy link
Contributor Author

dkwingsmt commented Aug 16, 2021 via email

@marcoprodata
Copy link

Yes, any accent, ãõéáó, after press the accent key the error was launched in the console and the winapp crash

@eduardo-cervantes
Copy link

eduardo-cervantes commented Aug 17, 2021

I've been following this issue for some time, and I still have the application closing when using accent.
Same mistake commented above by @marcoprodata.

======== Exception caught by services library ======== 
The following RangeError was thrown during a platform message callback:
Invalid value: Not in inclusive range 0..1114111: 2147483687

@marcoprodata
Copy link

@dkwingsmt Thanks for your attention, now the winapp dont crash and accents works correctly, the only thing that remain is when press twice dead keys, reported reported in PR by knopp

filmil pushed a commit to filmil/engine that referenced this pull request Apr 21, 2022
This PR fixes the crash caused by pressing dead keys on Win32.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Win32]:Crash windows application when use accents in keyboard
4 participants