plat/win_popup.rs (Windows)#
Source: lib/plat/win_popup.rs
win_popup -- OS popup windows on Windows (U3) [src/plat/win/win_popup.s]
Popups (menus, combo lists, tooltips) of a secondary UI window that do not fit into it are
shown in borderless popup windows owned by that window (WS_POPUP, WS_EX_TOOLWINDOW |
WS_EX_NOACTIVATE, class style CS_DROPSHADOW, a rounded window region). They never take the
keyboard; their pointer input is pushed as events of the OWNER window in owner client
coordinates, so the UI hit-tests them like the rest of the window.
popup(slot, owner, rect, frame)
show / move / present popup slot `slot` (0 .. PPW_MAX-1): rect = x, y, w, h in px of
the owner's client area (popup pixel 0, 0 = owner pixel x, y); the slot keeps a copy
of the frame's pixels (WM_PAINT repaints from it). rect None hides it.
popup_anchor(slot, anchor, kind, nat) / popup_placed(slot) (§6, Wayland's placement) the
UI places popups on Windows itself (inside the monitor's work area): nothing to do / None
win_popup_wheel(hwnd, sx, sy, data) -> true if hwnd is one of the popups: the wheel event
(screen point sx, sy) is pushed for its owner (win_api.rs: Windows sends the wheel to
the focus window)
win_popup_under(owner) -> true if the pointer is over a shown popup of owner (the owner's
WM_MOUSELEAVE is then no leave)
fn popup(slot: u32, owner: i32, rect: Option<[i32; 4]>, f: Option<&Frame>)show / move / present popup slot over window owner (rect None hides it) [plat_popup]fn popup_anchor(_slot: u32, _anchor: [i32; 4], _kind: u32, _nat: [i32; 2])(§6) how the next popup() hangs at its anchor: the UI already placed it on the screenfn popup_placed(_slot: u32) -> Option<[i32; 2]>(§6) the platform never moves a popup on Windows