diff --git a/crates/gpui/src/platform/windows/events.rs b/crates/gpui/src/platform/windows/events.rs index 28e992a8e4c12c1235c570e75ddc4d6d21dc7eba..cdc8949b599cd3bb9b810efb5588ac62b43d5fb9 100644 --- a/crates/gpui/src/platform/windows/events.rs +++ b/crates/gpui/src/platform/windows/events.rs @@ -801,7 +801,10 @@ fn handle_hit_test_msg( lparam: LPARAM, state_ptr: Rc, ) -> Option { - if !state_ptr.hide_title_bar { + if !state_ptr.is_movable { + return None; + } + if state_ptr.hide_title_bar { return None; } diff --git a/crates/gpui/src/platform/windows/window.rs b/crates/gpui/src/platform/windows/window.rs index 1cb469bd0eb1af558027f5f60d303d4f7264cc6a..43de6ced62f17e9a2604777e88d4e7d68cd10706 100644 --- a/crates/gpui/src/platform/windows/window.rs +++ b/crates/gpui/src/platform/windows/window.rs @@ -57,6 +57,7 @@ pub(crate) struct WindowsWindowStatePtr { pub(crate) state: RefCell, 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,