1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
//! Native popup / flyout window construction (spec 21 §2).
//!
//! Each popup and flyout is a borderless `WS_POPUP` window with the extended
//! styles that make it behave like a native menu surface:
//!
//! - `WS_EX_NOACTIVATE` — shown and clicked without stealing foreground
//! activation from the user's app (the Windows equivalent of macOS's
//! non-activating panel), so `PredefinedMenuItem` edit actions keep targeting
//! the previously focused window.
//! - `WS_EX_TOOLWINDOW` — kept out of the Alt-Tab list and the taskbar.
//! - `WS_EX_LAYERED` — enables the per-pixel-alpha [`present`](super::present)
//! blit so the rounded corners and the acrylic-see-through body work.
//! - `WS_EX_TOPMOST` — floats above the foreground app like a real menu.
//!
//! On Windows 11 the window also requests the transient-window **acrylic system
//! backdrop** (`DWMWA_SYSTEMBACKDROP_TYPE` = `DWMSBT_TRANSIENTWINDOW`), the exact
//! menu/flyout material (decision #6); where unavailable the OS simply ignores it
//! and the layered blit still shows the (opaque-or-tinted) panel the drawer
//! painted.
use null_mut;
use PCWSTR;
use ;
use ;
use UI;
/// Create a hidden, non-activating, layered, top-most popup window of the popup
/// class, tagged with `kind_tag` in `GWLP_USERDATA` so the shared window
/// procedure can route its events. The window is sized/positioned later by the
/// [`present`](super::present) blit; return `null` on failure.
///
/// # Safety
/// `class_name` must name a class registered with the shared window procedure on
/// this thread, and `hinstance` must be the owning module handle.
pub unsafe
/// Request the transient-window acrylic system backdrop. Best-effort: the call is
/// a no-op on OS builds that don't support it, and the layered blit remains the
/// source of truth for the panel pixels.
///
// DEVICE-VERIFY(0.9.0): the acrylic blur only appears on a real Windows 11
// compositor; on older builds / disabled-transparency the panel falls back to
// the drawer's (tinted or opaque) fill, which cannot be observed off-device.
unsafe
/// Reveal `hwnd` at the top of the z-order without activating it (so the user's
/// foreground app keeps focus). The pixels + position are already set by the
/// preceding [`present`](super::present) blit.
///
/// # Safety
/// `hwnd` must be a live window owned by the calling thread.
pub unsafe