#1080·glazewm

[Feature Request] Wait with managing a window if it's in an active drag operation

Author: lars-bergerCreated Jun 6, 2025Updated Aug 28, 2026
Labelstype: featurehelp wanted

Describe the problem/motivation

For example. when dragging out a tab from Chrome to be its own window, the WM tries to immediately tile the new window. This causes a bit of flickering back and forth - it'd be better to wait with positioning the new window until the drag operation has ended.

Attempted solution: GetGUIThreadInfo

We can check whether a window is being dragged via GetGUIThreadInfo and seeing if there is a hwndMoveSize member or if GUI_INMOVESIZE is present in its flags. The problem is that this doesn't seem to be toggled immediately, and so when the window is initially managed, it's reported as not being dragged.

Sample code for checking drag state:

rust
/// Checks if the window is currently being dragged by the user.
///
/// Returns `true` if the window is in a move/size operation (being
/// dragged).
pub fn has_active_drag(&self) -> anyhow::Result<bool> {
  let thread_id =
    unsafe { GetWindowThreadProcessId(HWND(self.handle), None) };

  let mut gui_info = GUITHREADINFO {
    cbSize: std::mem::size_of::<GUITHREADINFO>() as u32,
    ..Default::default()
  };

  unsafe { GetGUIThreadInfo(thread_id, &mut gui_info) }?;

  // Check if this window has capture and is in a move/size operation.
  Ok(
    gui_info.hwndCapture.0 == self.handle
      && (gui_info.flags.0 & GUI_INMOVESIZE.0) != 0,
  )
}

Example of GUITHREADINFO when a Chrome tab is initially dragged out:

GUITHREADINFO { cbSize: 72, flags: GUITHREADINFO_FLAGS(0), hwndActive: HWND(2951722), hwndFocus: HWND(2951722), hwndCapture: HWND(0), hwndMenuOwner: HWND(0), hwndMoveSize: HWND(0), hwndCaret: HWND(0), rcCaret: RECT { left: 0, top: 0, right: 0, bottom: 0 } }

Additionally, the WM receives a EVENT_SYSTEM_MOVESIZESTART event for the new window ~5ms after EVENT_OBJECT_SHOW (when the window gets initially managed). So this can likely also not be used for detecting active drag.

Describe the solution you'd like

Delay a window from being tiled if it's in an active drag operation when initially managed.

Alternatives considered

No response