comparison win/dw.c @ 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
comparison
equal deleted inserted replaced
2141:709f8bfa711f 2142:81362474b5e9
1005 DrawIconEx(hdcPaint, 8, 8, icon ? icon : LoadIcon(NULL, MAKEINTRESOURCE(32512)), 16, 16, 0, NULL, DI_NORMAL); 1005 DrawIconEx(hdcPaint, 8, 8, icon ? icon : LoadIcon(NULL, MAKEINTRESOURCE(32512)), 16, 16, 0, NULL, DI_NORMAL);
1006 } 1006 }
1007 if(cinfo && cinfo->hmenu) 1007 if(cinfo && cinfo->hmenu)
1008 { 1008 {
1009 /* Draw an icon to use as a menu click location */ 1009 /* Draw an icon to use as a menu click location */
1010 DrawIconEx(hdcPaint, 32, 8, LoadIcon(NULL, MAKEINTRESOURCE(32516)), 16, 16, 0, NULL, DI_NORMAL); 1010 DrawIconEx(hdcPaint, 8 + ((style & WS_SYSMENU) ? 24 : 0), 8, LoadIcon(NULL, MAKEINTRESOURCE(32516)), 16, 16, 0, NULL, DI_NORMAL);
1011 } 1011 }
1012 1012
1013 /* Blit text to the frame. */ 1013 /* Blit text to the frame. */
1014 BitBlt(hdc, 0, 0, cx, cy, hdcPaint, 0, 0, SRCCOPY); 1014 BitBlt(hdc, 0, 0, cx, cy, hdcPaint, 0, 0, SRCCOPY);
1015 1015
2218 } 2218 }
2219 return lResult; 2219 return lResult;
2220 } 2220 }
2221 else if(msg == WM_ACTIVATE && _DW_DARK_MODE_SUPPORTED && _DW_DARK_MODE_ALLOWED > DW_DARK_MODE_BASIC) 2221 else if(msg == WM_ACTIVATE && _DW_DARK_MODE_SUPPORTED && _DW_DARK_MODE_ALLOWED > DW_DARK_MODE_BASIC)
2222 { 2222 {
2223 RECT r; 2223 RECT rect;
2224 GetWindowRect(hWnd, &r); 2224 GetWindowRect(hWnd , &rect);
2225 SetWindowPos(hWnd, NULL, r.left, r.top, RECTWIDTH(r), RECTHEIGHT(r), SWP_FRAMECHANGED); 2225 PostMessage(hWnd, WM_SIZE , 0 , MAKELPARAM(rect.right-rect.left, rect.bottom-rect.top));
2226 } 2226 }
2227 else if(msg == WM_PAINT && _DW_DARK_MODE_ALLOWED > DW_DARK_MODE_BASIC && _DW_DARK_MODE_SUPPORTED && GetParent(hWnd) == HWND_DESKTOP) 2227 else if(msg == WM_PAINT && _DW_DARK_MODE_ALLOWED > DW_DARK_MODE_BASIC && _DW_DARK_MODE_SUPPORTED && GetParent(hWnd) == HWND_DESKTOP)
2228 { 2228 {
2229 PAINTSTRUCT ps; 2229 PAINTSTRUCT ps;
2230 HDC hdc = BeginPaint(hWnd, &ps); 2230 HDC hdc = BeginPaint(hWnd, &ps);
2782 _dw_set_child_window_theme(hWnd, 0); 2782 _dw_set_child_window_theme(hWnd, 0);
2783 EnumChildWindows(hWnd, _dw_set_child_window_theme, 0); 2783 EnumChildWindows(hWnd, _dw_set_child_window_theme, 0);
2784 } 2784 }
2785 } 2785 }
2786 break; 2786 break;
2787 #endif
2788 #ifdef AEROGLASS1
2789 case WM_ERASEBKGND:
2790 if(_dw_composition && (GetWindowLongPtr(hWnd, GWL_EXSTYLE) & WS_EX_LAYERED))
2791 {
2792 static HBRUSH hbrush = 0;
2793 RECT rect;
2794
2795 if(!hbrush)
2796 hbrush = CreateSolidBrush(_dw_transparencykey);
2797
2798 GetClientRect(hWnd, &rect);
2799 FillRect((HDC)mp1, &rect, hbrush);
2800 return TRUE;
2801 }
2802 break;
2803 #endif 2787 #endif
2804 case WM_PAINT: 2788 case WM_PAINT:
2805 { 2789 {
2806 PAINTSTRUCT ps; 2790 PAINTSTRUCT ps;
2807 2791