@@ -801,7 +801,10 @@ fn handle_hit_test_msg(
lparam: LPARAM,
state_ptr: Rc<WindowsWindowStatePtr>,
) -> Option<isize> {
- if !state_ptr.hide_title_bar {
+ if !state_ptr.is_movable {
+ return None;
+ }
+ if state_ptr.hide_title_bar {
return None;
}
@@ -57,6 +57,7 @@ pub(crate) struct WindowsWindowStatePtr {
pub(crate) state: RefCell<WindowsWindowState>,
pub(crate) handle: AnyWindowHandle,
pub(crate) hide_title_bar: bool,
+ pub(crate) is_movable: bool,
pub(crate) executor: ForegroundExecutor,
}
@@ -212,6 +213,7 @@ impl WindowsWindowStatePtr {
hwnd,
handle: context.handle,
hide_title_bar: context.hide_title_bar,
+ is_movable: context.is_movable,
executor: context.executor.clone(),
})
}
@@ -235,6 +237,7 @@ struct WindowCreateContext {
hide_title_bar: bool,
display: WindowsDisplay,
transparent: bool,
+ is_movable: bool,
executor: ForegroundExecutor,
current_cursor: HCURSOR,
}
@@ -261,7 +264,14 @@ impl WindowsWindow {
.map(|title| title.as_ref())
.unwrap_or(""),
);
- let dwstyle = WS_THICKFRAME | WS_SYSMENU | WS_MAXIMIZEBOX | WS_MINIMIZEBOX;
+ let (dwexstyle, dwstyle) = if params.kind == WindowKind::PopUp {
+ (WS_EX_TOOLWINDOW, WINDOW_STYLE(0x0))
+ } else {
+ (
+ WS_EX_OVERLAPPEDWINDOW,
+ WS_THICKFRAME | WS_SYSMENU | WS_MAXIMIZEBOX | WS_MINIMIZEBOX,
+ )
+ };
let hinstance = get_module_handle();
let display = if let Some(display_id) = params.display_id {
// if we obtain a display_id, then this ID must be valid.
@@ -275,13 +285,14 @@ impl WindowsWindow {
hide_title_bar,
display,
transparent: true,
+ is_movable: params.is_movable,
executor,
current_cursor,
};
let lpparam = Some(&context as *const _ as *const _);
let raw_hwnd = unsafe {
CreateWindowExW(
- WS_EX_APPWINDOW,
+ dwexstyle,
classname,
&windowname,
dwstyle,