winit: Can't resize window without decorations

When disabling decorations, the window can’t be resized anymore, even with .with_resizable(true) specified. Maximizing and other operations don’t seem to work either.

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 5
  • Comments: 27 (21 by maintainers)

Commits related to this issue

Most upvoted comments

I’m investigating this since it’s necessary for Cosmic to implement client-side decorations in Iced.

I’ve spent a few hours getting my head around this for windows, and as far as dragging with the mouse is concerned I agree this can be solved very similarly to Window::drag_window. It’s simply a matter of changing the Hit WPARAM to one of the resize options.

I tested this by changing winuser::HTCAPTION as WPARAM, to winuser::HTBOTTOMLEFT as WPARAM, in the drag window method for windows.

I’ll try and find some time to implement a solution.

Edit:: I take it back, changing the code to winuser::HTBOTTOMLEFT as WPARAM, results in a failure with a borderless window but not with winuser::HTCAPTION as WPARAM, line 92 may have something to do with it: const NO_DECORATIONS_AND_MASK = !WindowFlags::RESIZABLE.bits; Though this could just be a shortcut for saying bitwise Not 1.

@francesca64 I’ll look into this.