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

remarkable: fix button-listen when resuming from suspend #1145

Merged
merged 1 commit into from
Jul 19, 2020

Conversation

tcrs
Copy link
Contributor

@tcrs tcrs commented Jul 19, 2020

When the home button is used to wake the device from suspend the evdev
events have surprising time stamps. There is a pair of press & release
events, but the press has a timestamp from when the device went into
suspend and the release has a timestamp from after. This means that the
wake keypress will launch koreader as button-listen thinks the key was
held down for the whole time the device was suspended!

Instead, just record CLOCK_BOOTTIME timestamps for the events and use
those instead of the event timestamps. CLOCK_BOOTTIME is monotonic but
includes time spend in suspend.

Also keep track of whether button-listen saw a key press before each key
release. Probably not strictly required but seemed sensible to add.


This change is Reviewable

When the home button is used to wake the device from suspend the evdev
events have surprising time stamps. There is a pair of press & release
events, but the press has a timestamp from when the device went into
suspend and the release has a timestamp from after. This means that the
wake keypress will launch koreader as button-listen thinks the key was
held down for the whole time the device was suspended!

Instead, just record CLOCK_BOOTTIME timestamps for the events and use
those instead of the event timestamps. CLOCK_BOOTTIME is monotonic but
includes time spend in suspend.

Also keep track of whether button-listen saw a key press before each key
release. Probably not strictly required but seemed sensible to add.
@tcrs
Copy link
Contributor Author

tcrs commented Jul 19, 2020

Fixes koreader/koreader#6029

@Frenzie Frenzie merged commit 5956ba1 into koreader:master Jul 19, 2020
Frenzie added a commit to Frenzie/koreader that referenced this pull request Jul 19, 2020
Frenzie added a commit to koreader/koreader that referenced this pull request Jul 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants