0

I use Qt/C++ and my main window is a frameless window. Therefore, I have to handle all the move/resize events myself. However, there's one visual hint I don't know how to trigger, it's when the user drag the top of the window to the top of screen to maximize it.
On Windows, it triggers a blue wave animation that tells the user it's going to be maximized. But such visual cue does not automatically happen with my frameless window.
How can I trigger that programmatically ? Or is there a setting that allows me to have that automatically ?

Robin Lobel
  • 630
  • 1
  • 5
  • 16
  • 3
    I'm guessing here, but; I'd *guess* that that is a function of the window manager and outside your applications control. – Jesper Juhl Mar 13 '18 at 16:15
  • One might chase HWND, the native window handle form OS, [like here](https://stackoverflow.com/questions/19970688/how-can-i-obtain-hwnd-of-a-class-derived-from-qmainwindow) .. to see possibility to pass it to a native library that might process further requirements .. only an assumption. – Mohammad Kanan Mar 13 '18 at 16:52
  • 1
    _"I have to handle all the move/resize events myself"_ -- you don't. Just handle [`WM_NCHITTEST`](https://msdn.microsoft.com/en-us/library/windows/desktop/ms645618(v=vs.85).aspx) to tell the window manager which parts of your frameless window correspond to title bar and resize border and it will do the actual moving, resizing and maximize/restore for you. I believe in this case you would see the same "wave" effect as on a window with standard frame. – zett42 Mar 13 '18 at 17:18
  • I wish I could go for the simple solution (handling WM_NCHITTEST) but I already tried (using this approach https://bugreports.qt.io/browse/QTBUG-40578 ), and as long as my Qt window does not uses OpenGL it works, but as soon as it uses OpenGL, the layout is completely screwed up just because of that :/ So I fallback to having to handle every standard case myself. – Robin Lobel Mar 14 '18 at 10:39

0 Answers0