-
Notifications
You must be signed in to change notification settings - Fork 30
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
add MessageFilter to selectively block window message #183
Conversation
Blocking every window message blocks intentional user actions like minimizing, closing(Alt-F4 doesn't work either), resizing etc. This commit fixes that kind of problem by providing bitflag interface to block certain predefined range of window messages. To block every messages like before, you can return `MessageFilter::all()` on `set_message_filter()`.
Thank you for your contribution! 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution. I like this!
I'd like to have a few changes but otherwise this looks good. Also, could you please implement the new method in the test hook? This would be helpful both to users looking for an example and to us to check that the thing works correctly. Could e.g. ignore events according to time elapsed from first_time
(2s ignore keyboard, 4s ignore mouse etc).
There was some perspective mistake during naming the method. It's getter for pipeline, not setter for user code.
The method would(and maybe should) not be used in user code, so make it protected seems good idea.
- Explanation about using MessageFilter is added. - Wrap consts like `WM_USER` with backticks(`)
Harness doesn't seem to handle any input events, so only thing we can simply test is `MessageFilter::WindowControl`
In addition to your change requests, I made Test for only |
out.webm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks great, thank you again! 🙌
(p.s. what font is that in your editor? I like it!)
The font is NeoDunggeunmo Code. |
This PR introduces BREANKING changes described below;
Blocking every window message blocks intentional user actions like minimizing, closing(Alt-F4 doesn't work either), resizing, etc.
This commit fixes that kind of problem by providing bitflag interface to block certain predefined range of window messages.
To block every messages like before, you can return
MessageFilter::all()
onset_message_filter()
.This PR fixes #182.