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

wait_events() on X11 burns CPU after failing to process MappingNotify event #471

Closed
kevinmehall opened this issue May 24, 2015 · 1 comment

Comments

@kevinmehall
Copy link

Steps to reproduce:

  1. cargo run --example window (or any app that will stay blocked in wait_events and use no CPU)
  2. Suspend and resume the laptop, or switch to a virtual terminal and back (ctrl-alt-F1, ctrl-alt-F7)
  3. Observe CPU usage of the program

Ubuntu 15.04, Gnome 3.14.4, Intel Haswell Graphics

Poking at it with GDB, and the loop includes:

  1. XPeekEvent finds an event with type 34 == MappingNotify.
  2. XCheckMaskEvent and XCheckTypedEvent return 0, and the event is never processed.

My only knowledge of the X11 APIs comes from Googling these functions debugging this, but it seems like it might be more robust to use XNextEvent instead of XPeekEvent so that events can't get left in the queue like this?

@tomaka
Copy link
Contributor

tomaka commented Nov 3, 2016

Closing for rust-windowing/winit#42

@tomaka tomaka closed this as completed Nov 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants