BorderlessWindowQt-Modern-Gui
BorderlessWindowQt-Modern-Gui copied to clipboard
Only the first maximize using aero snap is working.
This may only be affecting me, I don't know. I am on Windows 10 using Qt 5.9. When I grab the title bar of the window and drag it to the top of the screen to take advantage of the aero snap feature to maximize the window, it only works correctly the first time I do it. The window fills the screen edge to edge while accounting for the task bar at the bottom. When I restore the window and then try to maximize it again using aero snap, the window doesn't fit the screen properly. The top of the window is clipping through by 8px, and the bottom of the window seems to be extending a little beyond the task bar. After some digging, I found that the result of GetWindowRect is changing from the first time I maximize to the second time.
The first time I maximize, the values of the RECT are set as follows: left: -8 top: -8 right: 3848 bottom: 2128
(my resolution is 3840x2160)
With those values, the window fits the screen perfectly. But when I maximize it again, I get these values: left: -8 top: 8 right: 3848 bottom: 2160
Since the value of the top position changes to positive 8, I guess that's why the 8px at the top of the window disappears. And judging by value of the bottom position, it looks like it stops accounting for the task bar and uses the full height of the display.
I have found that if I perform another action after I restore it from the first maximize, such as scaling the window or clicking another window to lose focus, then the next maximize won't mess up. But strangely, after the first time it starts messing up, the workarounds don't fix it anymore. Another thing to note is that after I restore from the first maximize, if I give another window focus, I see the problem window nudge upward some like it's adjusting itself.
I would try to solve this myself, but I am not really familiar with the windows api. I have tried other solutions to get a borderless window in Qt with aero features, but none of them were simple enough for me to implement with any of my programs besides yours since I found your solution was the only one that inherited from QMainWindow. Any help is greatly appreciated. Aside from this issue, your borderless window is exactly what I've been looking for.
Example of the top of the window clipping through allowing me to view the desktop:
Thank you for having warned me to this error, I will try to solve it very quickly.
I added the event WM_GETMINMAXINFO on the code recompile it to see.
I'd try it, but the repo still says the last commit was made Jan 28, so I'm not sure if there's a delay happening or your commit never went through.
See
2018-06-10 12:56 GMT+00:00 huntermalm [email protected]:
I'd try it, but the repo still says the last commit was made Jan 28, so I'm not sure if there's a delay happening or your commit never went through.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Moussa-Ball/BorderlessWindowQt-Modern-Gui/issues/2#issuecomment-396047159, or mute the thread https://github.com/notifications/unsubscribe-auth/AQeay6jvJ6dKgV1g4SP676Gk6WmZBZljks5t7RdpgaJpZM4UYO1Q .
I have tried it, but the issue persists, exactly as I originally described it. I wonder, were you able to reproduce this issue or is yours working okay?
It works at home properly, but I use the sdk windows 10 with visual studio
It works at home properly, but i use the sdk Windows
Le dimanche 10 juin 2018, Moussa Ball [email protected] a écrit :
It works at home properly, but I use the sdk windows 10 with visual studio
I could solve the problem I think, it happened at home.
So were you ever able to figure it out?
I already had this problem with the latest build of windows 10, but I had found a solution.
The problem comes from wm_nccalcsize. Windows adds 8px to an unframed window, you have to eliminate that with the event manager. Another way to create a window without a frame is to use a win32 window and then to host the content qt in this window.