Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Windows): ensure WS_CAPTION is set on undecorated windows #862

Merged
merged 5 commits into from
May 26, 2020

Conversation

zbaylin
Copy link
Member

@zbaylin zbaylin commented May 26, 2020

People in the Oni Discord were noting that an undecorated Window was covering the taskbar on Windows. Luckily, I found that Chrome had that same problem: https://chromium.googlesource.com/chromium/src.git/+/46.0.2478.0/chrome/browser/ui/views/apps/chrome_native_app_window_views_win.cc#71

This fixes that by adding an Revery_Native.initWindow function that sets the flag after all the SDL modifications are done.

This also renames Revery_Native's init to initApp to avoid confusion.

@github-actions
Copy link

I have updated your lock dirs and formatted the code.
Please @zbaylin pull the last commit before pushing any more changes.

@bryphe
Copy link
Member

bryphe commented May 26, 2020

Comment on lines +48 to +50
HWND window = (HWND)win;
int current_style = GetWindowLong(window, GWL_STYLE);
SetWindowLong(window, GWL_STYLE, current_style | WS_CAPTION);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zbaylin
Copy link
Member Author

zbaylin commented May 26, 2020

@CrossR I fixed that issue you mentioned in onivim/oni2#1823 about the window being maximized on start. Check this out locally and see if this fixes it!

@CrossR
Copy link
Member

CrossR commented May 26, 2020

Tested with your Oni2 PR again and it looks like its working now! Thanks again for the fix!

@zbaylin zbaylin merged commit bd3d702 into master May 26, 2020
@Et7f3 Et7f3 deleted the fix/windows/undecorated branch June 6, 2020 15:26
@vhanla
Copy link

vhanla commented Sep 16, 2020

I don't know if minimize from taskbar is not allowed by default on undecorated windows, but I suppose that can be modified by end user(developer) on his own if he/she wishes to do.

As shown in the GIF above, if you also add SysMenu and MinimizeBox styles SetWindowLong(window, GWL_STYLE, current_style | WS_CAPTION | WS_MINIMIZEBOX | WS_SYSMENU); it will allow to minimize Examples' window by clicking on its icon in Windows taskbar, and also by right clicking it while holding shift key, it will show the system contextual menu, which currently is not possible in Oni2, unfortunately that won't fix the lack of Alt+Space functionality (to resize/move manually using only keyboard).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants