Skip to content

More accurate handling of unicode/numpad input in gtk3 backends. #17791

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

Merged
merged 1 commit into from
Oct 8, 2020

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Jun 29, 2020

See changelog.

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code is Flake 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/api_changes.rst if API changed in a backward-incompatible way

@anntzer anntzer added this to the v3.4.0 milestone Jun 29, 2020
@anntzer anntzer force-pushed the gtkkeys branch 2 times, most recently from 0ef1c4a to 28f9312 Compare June 29, 2020 13:34
@QuLogic
Copy link
Member

QuLogic commented Jun 29, 2020

Interesting; some time back I tried to replace those magic numbers with GDK keysyms, but found that the numpad appeared to work backwards of numlock. I wonder if this will work correctly here.

@anntzer
Copy link
Contributor Author

anntzer commented Jun 29, 2020

It works correctly locally (the numbers were just wrong in keyvald for numpad...), but CI seems unhappy...

@anntzer anntzer force-pushed the gtkkeys branch 2 times, most recently from baf3410 to 72f731f Compare July 2, 2020 20:36
@QuLogic
Copy link
Member

QuLogic commented Jul 18, 2020

CI doesn't like your test, it seems.

@anntzer
Copy link
Contributor Author

anntzer commented Jul 18, 2020

I know :/

@anntzer anntzer force-pushed the gtkkeys branch 2 times, most recently from af82f01 to 11e3ba8 Compare July 20, 2020 13:39
@QuLogic
Copy link
Member

QuLogic commented Jul 24, 2020

This fixes input via numpad for me.

@anntzer
Copy link
Contributor Author

anntzer commented Sep 10, 2020

I decided to just skip the gtk test on travis for now...
Edit: the azure failure seems unrelated.

Comment on lines +36 to +35
# This is not actually really the right API: it depends on the
# actual keymap (e.g. on Azerty, shift+agrave -> 0).
Gtk.test_widget_send_key(fig.canvas, key, mod)
Copy link
Member

Choose a reason for hiding this comment

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

Could this be why it's getting stuck? Maybe you can check len(buf) and assert the result after shutting down?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually turns out that even locally this is not passing anymore, i.e. calls to Gtk.test_widget_send_event (or Gdk.simulate_key_event) don't result in the key_press_event handler being called at all. At some point it worked, so likely a Gtk version thing? I just xfailed the whole thing for now...

Copy link
Member

Choose a reason for hiding this comment

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

According to https://mail.gnome.org/archives/commits-list/2017-January/msg01173.html, those were never fully implemented (I only see an x11 version in that commit).

@anntzer anntzer force-pushed the gtkkeys branch 2 times, most recently from 4acfd3b to 7349d3e Compare September 12, 2020 10:36
@anntzer
Copy link
Contributor Author

anntzer commented Oct 8, 2020

rebased

@timhoffm timhoffm merged commit 2f0f7b4 into matplotlib:master Oct 8, 2020
@anntzer anntzer deleted the gtkkeys branch October 8, 2020 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants