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

Open settings with a long press on the Menu key #179

Merged
merged 8 commits into from
Sep 24, 2024

Conversation

guyonvarch
Copy link
Member

@guyonvarch guyonvarch commented Sep 24, 2024

Demo

2024-09-24_10-55-16.mp4

Using https://github.com/dividat/diviapps/pull/2161 locally, pressing the Menu key with a short press first, and then pressing the Menu key with a long press.

Limitations

Fixed by 891c1d5.

Keeping the long press longer after the settings have been shown, it will trigger again after the delay the settings toggle. For some reason, we get a release signal, followed by a Press signal, after we toggle the settings.

2024-09-24_10-55-59.mp4

Checklist

  • Changelog updated
  • Code documented
  • User manual updated

It shows unavailable options, for example Show Sources. As for back and
reload actions, the interface should already provide those actions.
Window was not shown in this context.

And we have to provide a size, otherwise on my WM (labwc), the window is
very small.
@guyonvarch guyonvarch added the reviewable Ready for initial or iterative review label Sep 24, 2024
@knuton
Copy link
Member

knuton commented Sep 24, 2024

Keeping the long press longer after the settings have been shown, it will trigger again after the delay the settings toggle. For some reason, we get a release signal, followed by a Press signal, after we toggle the settings.

Not sure I understand the problem yet, but maybe detect and ignore auto repeats? https://doc.qt.io/qt-5/qkeyevent.html#isAutoRepeat

@knuton knuton added details needed Further information requested to better evaluate changes and removed reviewable Ready for initial or iterative review labels Sep 24, 2024
Use auto repeat to prevent re-triggering toggling the settings more than
once when very long pressing the Menu key.
@guyonvarch
Copy link
Member Author

Not sure I understand the problem yet, but maybe detect and ignore auto repeats? https://doc.qt.io/qt-5/qkeyevent.html#isAutoRepeat

Good idea, this fixes it: 891c1d5

@guyonvarch guyonvarch added reviewable Ready for initial or iterative review and removed details needed Further information requested to better evaluate changes labels Sep 24, 2024
@knuton
Copy link
Member

knuton commented Sep 24, 2024

This change brings another side-effect: When pressing Ctrl-C in the terminal from which I launched the kiosk browser, I now get what looks like a crash.

^CTraceback (most recent call last):
  File "/home/emerij/Development/playos/kiosk/kiosk_browser/main_widget.py", line 85, in eventFilter
    def eventFilter(self, source, event):

KeyboardInterrupt
Aborted (core dumped)

Previously the Ctrl-C was ignored.

@guyonvarch
Copy link
Member Author

Previously the Ctrl-C was ignored.

We could continue to ignore Ctrl-C, which can be done with:

# Prevent closing the Kiosk with SIGINT https://stackoverflow.com/a/842807
signal.signal(signal.SIGINT, signal.SIG_IGN)

@knuton
Copy link
Member

knuton commented Sep 24, 2024

I think we could also change it to exiting, but gracefully instead of crashing.

@guyonvarch
Copy link
Member Author

I think we could also change it to exiting, but gracefully instead of crashing.

a8a3553

Copy link
Member

@knuton knuton left a comment

Choose a reason for hiding this comment

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

@knuton knuton removed the reviewable Ready for initial or iterative review label Sep 24, 2024
@knuton knuton merged commit 36f21c1 into dividat:main Sep 24, 2024
5 checks passed
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.

2 participants