changeset 2214:c60588f740ec

Win: Add IS_WIN8PLUS macro and disable DW_FCF_COMPOSITION for Windows 8 and higher. The method used in Vista and Windows 7 to control what is drawn as glass has adverse side effects on Windows 8 and 10. Mouse clicks on what would be "glass" passed through to underlying windows due to the use of LWA_COLORKEY to specify transparency color. Additionally the glass effect has been removed. Glass was the main reason for implementing DW_FCF_COMPOSITION so just ignore the flag on Windows 8 and higher. https://stackoverflow.com/questions/4768862/dwmextendframeintoclientarea-without-transparencykey
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Mon, 14 Dec 2020 13:14:27 +0000
parents 0132afc8c955
children 69b0d157bc9f
files win/dw.c
diffstat 1 files changed, 7 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/win/dw.c	Sun Dec 13 13:09:23 2020 +0000
+++ b/win/dw.c	Mon Dec 14 13:14:27 2020 +0000
@@ -266,6 +266,7 @@
 
 #define IS_XPPLUS (dwComctlVer >= PACKVERSION(5,82))
 #define IS_VISTAPLUS (dwComctlVer >= PACKVERSION(6,10))
+#define IS_WIN8PLUS (dwVersion >= PACKVERSION(6,1))
 
 #ifndef MIN
 #define MIN(a, b) (((a) < (b)) ? (a) : (b))
@@ -2769,7 +2770,7 @@
          {
             MARGINS mar = {-1,-1,-1,-1};
 
-            if(cinfo && (cinfo->style & DW_FCF_COMPOSITED))
+            if(cinfo && (cinfo->style & DW_FCF_COMPOSITED) && !IS_WIN8PLUS)
                SetLayeredWindowAttributes(hWnd, _dw_transparencykey, 0, LWA_COLORKEY);
             else
             {
@@ -3016,7 +3017,7 @@
       {
          ColorInfo *cinfo = _dw_window_get_cinfo(_toplevel_window(hWnd));
 
-         if(cinfo && cinfo->style & DW_FCF_COMPOSITED)
+         if(cinfo && cinfo->style & DW_FCF_COMPOSITED && !IS_WIN8PLUS)
          {
             static HBRUSH hbrush = 0;
             RECT rect;
@@ -3508,7 +3509,7 @@
                   {
                      ColorInfo *tlcinfo = _dw_window_get_cinfo(_toplevel_window(hWnd));
 
-                     if((_dw_composition && tlcinfo && (tlcinfo->style & DW_FCF_COMPOSITED)) &&
+                     if((_dw_composition && tlcinfo && (tlcinfo->style & DW_FCF_COMPOSITED)) && !IS_WIN8PLUS &&
                         (!thiscinfo || (thiscinfo && (thiscinfo->back == -1 || thiscinfo->back == DW_RGB_TRANSPARENT))))
                      {
                         if(!(msg == WM_CTLCOLORSTATIC && SendMessage((HWND)mp2, STM_GETIMAGE, IMAGE_BITMAP, 0)))
@@ -4164,7 +4165,7 @@
 
    /* If we don't require themed drawing */
    if(((cinfo->back != -1 && cinfo->back != DW_RGB_TRANSPARENT) || (parentcinfo && parentcinfo->back != -1))
-       || !_dw_composition || !tlcinfo || !(tlcinfo->style & DW_FCF_COMPOSITED))
+       || !_dw_composition || !tlcinfo || !(tlcinfo->style & DW_FCF_COMPOSITED) || IS_WIN8PLUS)
       return _colorwndproc(hwnd, msg, mp1, mp2);
 
    pOldProc = cinfo->pOldProc;
@@ -5878,7 +5879,7 @@
    newbox->cinfo.rect.top *= -1;
    newbox->cinfo.rect.left = newbox->cinfo.rect.right = newbox->cinfo.rect.bottom = 1;
 
-   if(flStyle & DW_FCF_COMPOSITED)
+   if((flStyle & DW_FCF_COMPOSITED) && !IS_WIN8PLUS)
    {
       /* Attempt to enable Aero glass background on the entire window */
       if(_DwmExtendFrameIntoClientArea && _dw_composition)
@@ -8527,7 +8528,7 @@
    {
       tmp = tmp & 0xffff0000;
 #ifdef AEROGLASS
-      if(mask & DW_FCF_COMPOSITED && _DwmExtendFrameIntoClientArea && _dw_composition)
+      if(mask & DW_FCF_COMPOSITED && _DwmExtendFrameIntoClientArea && _dw_composition && !IS_WIN8PLUS)
       {
          if(style & DW_FCF_COMPOSITED)
          {