Skip to content

Commit a968caf

Browse files
committed
windisplay: Fix parented window receiving WS_POPUP style
Fixes panda3d#915
1 parent ce4690b commit a968caf

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

panda/src/windisplay/winGraphicsWindow.cxx

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -973,17 +973,25 @@ make_style(const WindowProperties &properties) {
973973
// Additionally, the window class attribute should not include the
974974
// CS_PARENTDC style.
975975

976-
DWORD window_style = WS_POPUP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS;
976+
DWORD window_style = WS_CLIPCHILDREN | WS_CLIPSIBLINGS;
977977

978978
if (properties.get_fullscreen()) {
979-
window_style |= WS_SYSMENU;
980-
} else if (!properties.get_undecorated()) {
981-
window_style |= (WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX);
982-
983-
if (!properties.get_fixed_size()) {
984-
window_style |= (WS_SIZEBOX | WS_MAXIMIZEBOX);
979+
window_style |= WS_POPUP | WS_SYSMENU;
980+
} else {
981+
if (_parent_window_handle) {
982+
window_style |= WS_CHILD;
985983
} else {
986-
window_style |= WS_BORDER;
984+
window_style |= WS_POPUP;
985+
}
986+
987+
if (!properties.get_undecorated()) {
988+
window_style |= (WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX);
989+
990+
if (!properties.get_fixed_size()) {
991+
window_style |= (WS_SIZEBOX | WS_MAXIMIZEBOX);
992+
} else {
993+
window_style |= WS_BORDER;
994+
}
987995
}
988996
}
989997
return window_style;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy