Ignore:
Timestamp:
Jan 14, 2000, 6:48:33 PM (26 years ago)
Author:
cbratschi
Message:

DrawCaption performance improvements for window text updates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/new/win32wbase.cpp

    r2437 r2440  
    1 /* $Id: win32wbase.cpp,v 1.41 2000-01-14 14:45:17 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.42 2000-01-14 17:48:32 cbratschi Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    12531253    {
    12541254        LPCSTR lpsz = (LPCSTR)lParam;
    1255 
    1256         if(windowNameA) free(windowNameA);
    1257         if(windowNameW) free(windowNameW);
     1255        CHAR* oldNameA = windowNameA;
     1256        WCHAR* oldNameW = windowNameW;
    12581257
    12591258        if (lParam)
     
    12721271        }
    12731272        dprintf(("WM_SETTEXT of %x to %s\n", Win32Hwnd, lParam));
    1274         if (dwStyle & WS_CAPTION)
    1275         {
    1276           //CB: optimize!
    1277           HandleNCPaint(0);
    1278         }
    1279 /* //CB: endless loop in trackbar.exe -> to fix
    1280         if(OS2HwndFrame && (dwStyle & WS_CAPTION) == WS_CAPTION)
    1281           return OSLibWinSetWindowText(OS2HwndFrame,(LPSTR)windowNameA);
    1282 */
     1273        if ((dwStyle & WS_CAPTION) && (lstrcmpA(oldNameA,windowNameA) != 0))
     1274        {
     1275          UpdateCaptionText();
     1276          OSLibWinSetWindowText(OS2HwndFrame,(LPSTR)windowNameA);
     1277        }
     1278
     1279        if(oldNameA) free(oldNameA);
     1280        if(oldNameW) free(oldNameW);
     1281
    12831282        return TRUE;
    12841283    }
     
    16791678        LPWSTR lpsz = (LPWSTR)lParam;
    16801679
    1681         if(windowNameA) free(windowNameA);
    1682         if(windowNameW) free(windowNameW);
     1680        CHAR* oldNameA = windowNameA;
     1681        WCHAR* oldNameW = windowNameW;
    16831682
    16841683        if (lParam)
     
    16961695          wndNameLength = 0;
    16971696        }
    1698 
    1699         if(OS2HwndFrame && (dwStyle & WS_CAPTION) == WS_CAPTION)
    1700           return OSLibWinSetWindowText(OS2HwndFrame,(LPSTR)windowNameA);
     1697        dprintf(("WM_SETTEXT of %x\n",Win32Hwnd));
     1698        if ((dwStyle & WS_CAPTION) && (lstrcmpW(oldNameW,windowNameW) != 0))
     1699        {
     1700          UpdateCaptionText();
     1701          OSLibWinSetWindowText(OS2HwndFrame,(LPSTR)windowNameA);
     1702        }
     1703
     1704        if(oldNameA) free(oldNameA);
     1705        if(oldNameW) free(oldNameW);
    17011706
    17021707        return TRUE;
Note: See TracChangeset for help on using the changeset viewer.