Skip to content

Refactor winit key handling - #21250

Merged
bors-servo merged 1 commit into
servo:masterfrom
paulrouget:fixkeys
Jul 30, 2018
Merged

bors-servo merged 1 commit into
servo:masterfrom
paulrouget:fixkeys

Conversation

@paulrouget

@paulrouget paulrouget commented Jul 26, 2018 •

Copy link
Copy Markdown
Contributor

This should improve keys input on Linux and Windows.
Should fix #17146 and fix #21161

Tested Mac, Windows and Linux. Basic typing works, combo work, text navigation works. I hit some strange issues where sometimes the text would be displayed late, but I believe it is unrelated to this PR.

If we land that now, we will hit a regression on Mac, we need a winit update that includes rust-windowing/winit#610.


This change is Reviewable

@highfive highfive added the S-awaiting-review There is new code that needs to be reviewed. label Jul 26, 2018
@paulrouget

Copy link
Copy Markdown
Contributor Author

I basically recorded all the winit events when doing this: #21161 (comment)

Linux and Windows behave the same way. Mac has extra ReceivedCharacter events.

I figured that the logic is to only send release events on KeyboardInput and send press events on ReceivedCharacter only if the character is printable (see the code comments).

@paulrouget

paulrouget commented Jul 26, 2018 •

Copy link
Copy Markdown
Contributor Author

/cc @dorfsmay maybe you can also test this PR

@dorfsmay

Copy link
Copy Markdown

The sticky control key is still there.

I checked that I'm on the right branch (checked the line in the files), and also:

$ git branch -v
* fixkeys 3c7bb87 Refactor winit key handling
master  4c5a7ea Auto merge of #21246 - servo:webgl, r=emilio

But, it's not worse, so if this PR fixes other things it's worth merging, and we can investigate the Linux ctrl key further later.

@paulrouget

Copy link
Copy Markdown
Contributor Author

@dorfsmay with this PR, here, I can not reproduce the sticky control key issue.

This is what I do:

  • Linux, Xorg server
  • ./mach run -d 'data:text/html,<input>'
  • click on the text input
  • Ctrl-L, this brings the popup. Click cancel.
  • l, the letter l is printed in the input

@dorfsmay

Copy link
Copy Markdown

Correct that sequence works fine, but this one shows the stickiness of the control key:

  • ./mach run --dev
  • move mouse to servo and give focus
  • press the R key - nothing happens - good, as expected
  • press ctrl-R - nothing happens - bad, should reload
  • press ctrl-R - reloads content
  • press R - reloads content!! - bad, shows that the ctrl state is stuck
  • press ctrl-R (or anything) - reloads
  • press R - nothing happens, shows that the ctrl state is gone now

If this PR fixes other issues, I think it's worth merging, and we can keep working on the sticky control separately.

@jdm jdm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

These changes seem like a reasonable improvement.

@jdm jdm assigned jdm and unassigned emilio Jul 27, 2018
@jdm jdm added S-blocked-on-external Something, somewhere else, needs to happen before this PR can be merged. and removed S-awaiting-review There is new code that needs to be reviewed. labels Jul 27, 2018
@kwonoj

kwonoj commented Jul 27, 2018

Copy link
Copy Markdown
Contributor

Changewise looks fine, I may try few on windows once this is landed.

@paulrouget

Copy link
Copy Markdown
Contributor Author

@dorfsmay sadly I cannot reproduce your steps. Works fine here on Ubuntu. ctrl-R reloads on first hit. Can you check with xev the events you got on Ctrl-R and gather as many info about this bug in a different issue? We will also need to understand which version of Linux you use, your keyboard layout, and if possible, some winit logs.

@paulrouget

Copy link
Copy Markdown
Contributor Author

@bors-servo r=jdm

@bors-servo

Copy link
Copy Markdown
Contributor

📌 Commit 3c7bb87 has been approved by jdm

@highfive highfive added the S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. label Jul 30, 2018
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 3c7bb87 with merge 9c7891c...

bors-servo pushed a commit that referenced this pull request Jul 30, 2018
Refactor winit key handling

This should improve keys input on Linux and Windows.
Should fix #17146 and #21161

Tested Mac, Windows and Linux. Basic typing works, combo work, text navigation works. I hit some strange issues where sometimes the text would be displayed late, but I believe it is unrelated to this PR.

If we land that now, we will hit a regression on Mac, we need a winit update that includes rust-windowing/winit#610.

@kwonoj and @atouchet I'd appreciate if you could look at this.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21250)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - mac-rel-css1

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Jul 30, 2018
@jdm

jdm commented Jul 30, 2018

Copy link
Copy Markdown
Member

@bors-servo retry

@atouchet

Copy link
Copy Markdown
Contributor

I will make sure to test this on Windows when it's merged.

@bors-servo

Copy link
Copy Markdown
Contributor

@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - mac-rel-css1

@highfive highfive added the S-tests-failed The changes caused existing tests to fail. label Jul 30, 2018
@CYBAI

CYBAI commented Jul 30, 2018

Copy link
Copy Markdown
Member

@bors-servo retry

  • #JustInfraThings

@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 3c7bb87 with merge 1bd34e7...

bors-servo pushed a commit that referenced this pull request Jul 30, 2018
Refactor winit key handling

This should improve keys input on Linux and Windows.
Should fix #17146 and fix #21161

Tested Mac, Windows and Linux. Basic typing works, combo work, text navigation works. I hit some strange issues where sometimes the text would be displayed late, but I believe it is unrelated to this PR.

If we land that now, we will hit a regression on Mac, we need a winit update that includes rust-windowing/winit#610.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21250)
<!-- Reviewable:end -->
@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-tests-failed The changes caused existing tests to fail. labels Jul 30, 2018
@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - android

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Jul 30, 2018
@jdm

jdm commented Jul 30, 2018

Copy link
Copy Markdown
Member

@bors-servo retry

  • cleared out the builder

@bors-servo

Copy link
Copy Markdown
Contributor

bors-servo pushed a commit that referenced this pull request Jul 30, 2018
This should improve keys input on Linux and Windows.
Should fix #17146 and fix #21161

Tested Mac, Windows and Linux. Basic typing works, combo work, text navigation works. I hit some strange issues where sometimes the text would be displayed late, but I believe it is unrelated to this PR.

If we land that now, we will hit a regression on Mac, we need a winit update that includes rust-windowing/winit#610.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/21250)
<!-- Reviewable:end -->
@bors-servo

Copy link
Copy Markdown
Contributor

⌛ Testing commit 3c7bb87 with merge 9790f87...

@highfive highfive added S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. and removed S-tests-failed The changes caused existing tests to fail. labels Jul 30, 2018
@bors-servo

Copy link
Copy Markdown
Contributor

💔 Test failed - android

@highfive highfive added S-tests-failed The changes caused existing tests to fail. and removed S-awaiting-merge The PR is in the process of compiling and running tests on the automated CI. labels Jul 30, 2018
@jdm

jdm commented Jul 30, 2018

Copy link
Copy Markdown
Member

@bors-servo retry

@bors-servo

Copy link
Copy Markdown
Contributor

@bors-servo

Copy link
Copy Markdown
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-blocked-on-external Something, somewhere else, needs to happen before this PR can be merged. S-tests-failed The changes caused existing tests to fail.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Keybindings don't work on Linux and maybe windows Key events involving the control key don't work as expected

9 participants