summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Kümmerlin <jonas@kuemmerlin.eu>2020-05-31 20:39:02 +0200
committerJonas Kümmerlin <jonas@kuemmerlin.eu>2020-05-31 20:39:02 +0200
commita304be5509e4b7970fa18dcc3316a49269517c07 (patch)
treed770eb01eeb86cdeb09e48e7943db59f6a1b650e
parent77374f95c65b7e8892e0f75d308d2d9389e4d498 (diff)
toplevel: force WS_CLIPCHILDREN style
not only for performance, but also at least the combo box has subtly drawing bugs when the toplevel doesn't set this style
-rw-r--r--alf/alftoplevel.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/alf/alftoplevel.cpp b/alf/alftoplevel.cpp
index d54d4b3..2d2f52d 100644
--- a/alf/alftoplevel.cpp
+++ b/alf/alftoplevel.cpp
@@ -142,6 +142,13 @@ static LRESULT CALLBACK
ALF_Toplevel_WindowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
{
if (msg == WM_CREATE) {
+ // fixup default window style flags: we always want WS_CLIPCHILDREN
+ LONG style = GetWindowLong(hwnd, GWL_STYLE);
+ if (!(style & WS_CLIPCHILDREN)) {
+ style |= WS_CLIPCHILDREN;
+ SetWindowLong(hwnd, GWL_STYLE, style);
+ }
+
ALFToplevelPriv *priv = ALF_New(ALFToplevelPriv, 1);
SetWindowLongPtr(hwnd, DLGWINDOWEXTRA, (LONG_PTR)priv);
ALF_InitializeToplevelPriv(hwnd, priv);