Mercurial > dwindows
changeset 2142:81362474b5e9
Win: Post a WM_SIZE after WM_ACTIVATE when in full dark mode so the window
redraws after WM_NCALCSIZE changes the client area size.
Fix location of menu icon when there is no sysmenu.
Remove obsolete code from the main window procedure.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Thu, 16 Jul 2020 21:36:44 +0000 |
parents | 709f8bfa711f |
children | 628ffe85b946 |
files | win/dw.c |
diffstat | 1 files changed, 4 insertions(+), 20 deletions(-) [+] |
line wrap: on
line diff
--- a/win/dw.c Thu Jul 16 20:47:15 2020 +0000 +++ b/win/dw.c Thu Jul 16 21:36:44 2020 +0000 @@ -1007,7 +1007,7 @@ if(cinfo && cinfo->hmenu) { /* Draw an icon to use as a menu click location */ - DrawIconEx(hdcPaint, 32, 8, LoadIcon(NULL, MAKEINTRESOURCE(32516)), 16, 16, 0, NULL, DI_NORMAL); + DrawIconEx(hdcPaint, 8 + ((style & WS_SYSMENU) ? 24 : 0), 8, LoadIcon(NULL, MAKEINTRESOURCE(32516)), 16, 16, 0, NULL, DI_NORMAL); } /* Blit text to the frame. */ @@ -2220,9 +2220,9 @@ } else if(msg == WM_ACTIVATE && _DW_DARK_MODE_SUPPORTED && _DW_DARK_MODE_ALLOWED > DW_DARK_MODE_BASIC) { - RECT r; - GetWindowRect(hWnd, &r); - SetWindowPos(hWnd, NULL, r.left, r.top, RECTWIDTH(r), RECTHEIGHT(r), SWP_FRAMECHANGED); + RECT rect; + GetWindowRect(hWnd , &rect); + PostMessage(hWnd, WM_SIZE , 0 , MAKELPARAM(rect.right-rect.left, rect.bottom-rect.top)); } else if(msg == WM_PAINT && _DW_DARK_MODE_ALLOWED > DW_DARK_MODE_BASIC && _DW_DARK_MODE_SUPPORTED && GetParent(hWnd) == HWND_DESKTOP) { @@ -2785,22 +2785,6 @@ } break; #endif -#ifdef AEROGLASS1 - case WM_ERASEBKGND: - if(_dw_composition && (GetWindowLongPtr(hWnd, GWL_EXSTYLE) & WS_EX_LAYERED)) - { - static HBRUSH hbrush = 0; - RECT rect; - - if(!hbrush) - hbrush = CreateSolidBrush(_dw_transparencykey); - - GetClientRect(hWnd, &rect); - FillRect((HDC)mp1, &rect, hbrush); - return TRUE; - } - break; -#endif case WM_PAINT: { PAINTSTRUCT ps;