Implement tooltip level on Windows platform #1737
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implement
WindowLevel::Tooltip
on Windows platform.Before change:
After change:
tooltip.rs
)Details
The change adds
SWP_NOACTIVATE
in many calls toShowWindow()
to prevent unwanted Win32 activation stealing the focus.SWP_NOOWNERZORDER
is also added, inspired by Qt5 (see here).Some
is_focusable
boolean is added to the state to discriminate between a regular "restore" and a non-activating show whenShowWindow()
is called, because the former implicitly activates the window, stealing focus from the main app window and giving it to the tooltip.Tentative
WS_
andWS_EX_
flags are set forWindowLevel::Modal
andWindowLevel::DropDown
. They have not been tested, but feel like a good starting point for whoever's coming next to implement those. In particular note thatDropDown
almost surely wants to beWS_CHILD
to allow keyboard focus while not graying out the main app window title bar. However, because they have not been tested,WindowBuilder::set_level()
continues to emit a warning for those levels, and ignore them for now for consistency with the current behavior.