Skip to content
This repository was archived by the owner on Nov 5, 2020. It is now read-only.

Aero snap on Windows #11

Open
ApoorvaJ opened this issue Apr 9, 2016 · 1 comment
Open

Aero snap on Windows #11

ApoorvaJ opened this issue Apr 9, 2016 · 1 comment

Comments

@ApoorvaJ
Copy link
Owner

ApoorvaJ commented Apr 9, 2016

Aero snap is the thing introduced in Windows Vista where if you drag the window to the left or right edges of the screen, it resizes and fits into that half of the screen. Similarly, if you drag it to the top of the screen, it maximizes.

Early on in development, I tried a number of things to get Aero Snap working in Windows, but failed. In Papaya, we want a borderless, captionless window that has proper minimization, maximization and restore functionality, and that does not cover the task bar. This turned out to be remarkably difficult, as one window style would break some essential feature. And so Papaya currently doesn't currently snap to screen edges as it should.

If you are familiar with the Windows API, please have a look at this if you can. The relevant code is located in the src/papaya_platform_win32.cpp file in the WinMain() function, in the // Create Window scope.

@GreenLightning
Copy link
Contributor

I found this question on stackoverflow very helpful (especially the edits and comments to the question itself).

Essentially, the WS_THICKFRAME window style enables Aero Snap, but you can respond to WM_NCCALCSIZE to hide the borders.

EDIT: Apparently this does not work everywhere. See pull request #13.

GreenLightning added a commit to GreenLightning/Papaya that referenced this issue Apr 10, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants