changeset 1726:a02ce34692f0

Enable toolbar double buffering during packing on Windows if the window isn't composited. We may need to do this differently but seems to work for now.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Mon, 14 May 2012 23:08:24 +0000
parents 2e0f87ec24fe
children 38a0e75bc59c
files makefile.vc win/dw.c
diffstat 2 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/makefile.vc	Mon May 14 22:26:26 2012 +0000
+++ b/makefile.vc	Mon May 14 23:08:24 2012 +0000
@@ -69,7 +69,7 @@
 !endif
 
 CC = cl
-CFLAGS = -c $(PLATFORM_DEF) -D__WIN32__ -DMSVC -DGDIPLUS -DAEROGLASS -D_UNICODE -DUNICODE -DBUILD_DLL -DISOLATION_AWARE_ENABLED=1 -I$(SRCDIR)\platform -I$(SRCDIR) $(SVNVERSION)
+CFLAGS = -c $(PLATFORM_DEF) -D__WIN32__ -DMSVC -DTOOLBAR -DGDIPLUS -DAEROGLASS -D_UNICODE -DUNICODE -DBUILD_DLL -DISOLATION_AWARE_ENABLED=1 -I$(SRCDIR)\platform -I$(SRCDIR) $(SVNVERSION)
 LIBS = wsock32.lib kernel32.lib user32.lib comctl32.lib gdi32.lib advapi32.lib shell32.lib comdlg32.lib ole32.lib oleaut32.lib userenv.lib msimg32.lib gdiplus.lib
 RES =
 LINKFLAGS = -machine:$(TARGET_CPU) -manifest $(LINK_DEBUG)
--- a/win/dw.c	Mon May 14 22:26:26 2012 +0000
+++ b/win/dw.c	Mon May 14 23:08:24 2012 +0000
@@ -7122,6 +7122,16 @@
             SendMessage(item, UDM_SETBUDDY, (WPARAM)cinfo->buddy, 0);
          }
       }
+#ifdef TOOLBAR      
+      else if(_tcsnicmp(tmpbuf, TOOLBARCLASSNAME, _tcslen(TOOLBARCLASSNAME)+1) == 0)
+      {
+         if(!(_dw_composition && (GetWindowLongPtr(_toplevel_window(box), GWL_EXSTYLE) & WS_EX_LAYERED)))
+         { 
+            /* Enable double buffering if our window isn't composited */
+            SendMessage(item, TB_SETEXTENDEDSTYLE, 0, (LPARAM)TBSTYLE_EX_DOUBLEBUFFER);
+         }
+      }
+#endif      
       /* Queue a redraw on the top-level window */
       _dw_redraw(_toplevel_window(box), TRUE);
    }