Changeset 4140 for trunk/src


Ignore:
Timestamp:
Sep 1, 2000, 3:36:15 AM (25 years ago)
Author:
phaller
Message:

.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gdi32/dibitmap.cpp

    r4034 r4140  
    1 /* $Id: dibitmap.cpp,v 1.8 2000-08-18 18:14:56 sandervl Exp $ */
     1/* $Id: dibitmap.cpp,v 1.9 2000-09-01 01:36:14 phaller Exp $ */
    22
    33/*
     
    2929  HBITMAP rc;
    3030
    31     //TEMPORARY HACK TO PREVENT CRASH IN OPEN32 (WSeB GA)
    32 
    33     iHeight = lpbmih->biHeight;
    34     if(lpbmih->biHeight < 0)
    35     {
    36         dprintf(("GDI32: CreateDIBitmap negative height! (%d,%d)", lpbmih->biWidth, lpbmih->biHeight));
    37         ((BITMAPINFOHEADER *)lpbmih)->biHeight = -lpbmih->biHeight;
    38     }
    39 
    40     rc = O32_CreateDIBitmap(hdc, lpbmih, fdwInit, lpbInit, lpbmi, fuUsage);
    41 
    42     dprintf(("GDI32: CreateDIBitmap %x %x %x %x returned %x", hdc, fdwInit, lpbInit, fuUsage, rc));
    43 
    44     ((BITMAPINFOHEADER *)lpbmih)->biHeight = iHeight;
    45 
    46     return rc;
     31  //TEMPORARY HACK TO PREVENT CRASH IN OPEN32 (WSeB GA)
     32
     33  iHeight = lpbmih->biHeight;
     34  if(lpbmih->biHeight < 0)
     35  {
     36    dprintf(("GDI32: CreateDIBitmap negative height! (%d,%d)", lpbmih->biWidth, lpbmih->biHeight));
     37    ((BITMAPINFOHEADER *)lpbmih)->biHeight = -lpbmih->biHeight;
     38  }
     39
     40  // 2000/09/01 PH Netscape 4.7
     41  // If color depth of lpbhmi is 16 bit and lpbmi is 8 bit,
     42  // Open32 will crash since it won't allocate any palette color memory,
     43  // however wants to copy it later on ...
     44  int biBitCount = lpbmih->biBitCount;
     45 
     46  if (lpbmih->biBitCount != lpbmi->bmiHeader.biBitCount)
     47  {
     48    dprintf(("GDI32: CreateDIBitmap: color depths of bitmaps differ! (%d,%d\n",
     49             lpbmih->biBitCount,
     50             lpbmi->bmiHeader.biBitCount));
     51             
     52    ((BITMAPINFOHEADER *)lpbmih)->biBitCount = lpbmi->bmiHeader.biBitCount;
     53  }
     54
     55  rc = O32_CreateDIBitmap(hdc, lpbmih, fdwInit, lpbInit, lpbmi, fuUsage);
     56
     57  dprintf(("GDI32: CreateDIBitmap %x %x %x %x returned %x", hdc, fdwInit, lpbInit, fuUsage, rc));
     58
     59  ((BITMAPINFOHEADER *)lpbmih)->biHeight   = iHeight;
     60  ((BITMAPINFOHEADER *)lpbmih)->biBitCount = biBitCount;
     61
     62  return rc;
    4763}
    4864//******************************************************************************
  • trunk/src/user32/pmwindow.cpp

    r4122 r4140  
    1 /* $Id: pmwindow.cpp,v 1.101 2000-08-30 13:55:28 sandervl Exp $ */
     1/* $Id: pmwindow.cpp,v 1.102 2000-09-01 01:36:15 phaller Exp $ */
    22/*
    33 * Win32 Window Managment Code for OS/2
     
    783783                return (MRESULT)rc;
    784784        }
    785         if(usSetFocus)
    786         {
    787           Win32BaseWindow *winfocus = Win32BaseWindow::GetWindowFromOS2Handle(hwndLoseFocus);
    788           if(!(fsFocusChange & FC_NOLOSEACTIVE)) {
    789                 if(!winfocus || (winfocus->GetTopParent() != win32wnd->GetTopParent())) {
    790                         if(winfocus) {
    791                                 WinSendMsg(winfocus->GetTopParent()->getOS2WindowHandle(), WM_ACTIVATE, (MPARAM)0, (MPARAM)hwndGainFocus);
    792                         }
    793                         else    WinSendMsg(hwndLoseFocus, WM_ACTIVATE, (MPARAM)0, (MPARAM)hwndGainFocus);
    794                 }
    795           }
    796           //SvL: Check if window is still valid
    797           win32wnd = Win32BaseWindow::GetWindowFromOS2Handle(hwnd);
    798           if(win32wnd == NULL) {
    799                 return (MRESULT)rc;
    800           }
    801           if(!(fsFocusChange & FC_NOSETACTIVE))
    802           {
    803                 Win32BaseWindow *topparent = win32wnd->GetTopParent();
    804                 if(!winfocus || (winfocus->GetTopParent() != topparent))
    805                 {
    806                         if(!(fsFocusChange & FC_NOBRINGTOTOP))
    807                         {
    808                                 if(topparent) {
    809                                         //put window at the top of z order
    810                                         WinSetWindowPos(topparent->getOS2WindowHandle(), HWND_TOP, 0, 0, 0, 0, SWP_ZORDER);
    811                                 }
    812                         }
    813                         WinSendMsg(topparent->getOS2WindowHandle(), WM_ACTIVATE, (MPARAM)1, (MPARAM)hwndLoseFocus);
    814                 }
    815           }
    816         }
    817         else
    818         {
    819           Win32BaseWindow *winfocus = Win32BaseWindow::GetWindowFromOS2Handle(hwndGainFocus);
    820           if(!(fsFocusChange & FC_NOLOSEACTIVE)) {
    821                 if(!winfocus || (winfocus->GetTopParent() != win32wnd->GetTopParent())) {
    822                         WinSendMsg(win32wnd->GetTopParent()->getOS2WindowHandle(), WM_ACTIVATE, (MPARAM)0, (MPARAM)hwndGainFocus);
    823                 }
    824           }
    825           //SvL: Check if window is still valid
    826           win32wnd = Win32BaseWindow::GetWindowFromOS2Handle(hwnd);
    827           if(win32wnd == NULL) {
    828                 return (MRESULT)rc;
    829           }
    830           if(!(fsFocusChange & FC_NOSETACTIVE)) {
    831                 if(!winfocus || (winfocus->GetTopParent() != win32wnd->GetTopParent())) {
    832                         if(winfocus) {
    833                                 WinSendMsg(winfocus->GetTopParent()->getOS2WindowHandle(), WM_ACTIVATE, (MPARAM)1, (MPARAM)hwndLoseFocus);
    834                         }
    835                         else    WinSendMsg(hwndGainFocus, WM_ACTIVATE, (MPARAM)1, (MPARAM)hwndLoseFocus);
    836                 }
    837           }
    838         }
     785     
     786     
     787      if(usSetFocus)
     788      {
     789        Win32BaseWindow *winfocus = Win32BaseWindow::GetWindowFromOS2Handle(hwndLoseFocus);
     790        if(!(fsFocusChange & FC_NOLOSEACTIVE))
     791        {
     792          if(!winfocus || (winfocus->GetTopParent() != win32wnd->GetTopParent()))
     793          {
     794            if(winfocus)
     795              WinSendMsg(winfocus->GetTopParent()->getOS2WindowHandle(), WM_ACTIVATE, (MPARAM)0, (MPARAM)hwndGainFocus);
     796            else       
     797              WinSendMsg(hwndLoseFocus, WM_ACTIVATE, (MPARAM)0, (MPARAM)hwndGainFocus);
     798          }
     799        }
     800        //SvL: Check if window is still valid
     801        win32wnd = Win32BaseWindow::GetWindowFromOS2Handle(hwnd);
     802        if(win32wnd == NULL)
     803          return (MRESULT)rc;
     804
     805        if(!(fsFocusChange & FC_NOSETACTIVE))
     806        {
     807          Win32BaseWindow *topparent = win32wnd->GetTopParent();
     808          if(!winfocus || (winfocus->GetTopParent() != topparent))
     809          {
     810            if(!(fsFocusChange & FC_NOBRINGTOTOP))
     811            {
     812              if(topparent) {
     813                //put window at the top of z order
     814                WinSetWindowPos(topparent->getOS2WindowHandle(), HWND_TOP, 0, 0, 0, 0, SWP_ZORDER);
     815              }
     816            }
     817
     818            // PH 2000/09/01 Netscape 4.7
     819            // check if topparent is valid
     820            if (topparent)
     821              WinSendMsg(topparent->getOS2WindowHandle(), WM_ACTIVATE, (MPARAM)1, (MPARAM)hwndLoseFocus);
     822          }
     823        }
     824      }
     825      else /* no usSetFocus */
     826      {
     827        Win32BaseWindow *winfocus = Win32BaseWindow::GetWindowFromOS2Handle(hwndGainFocus);
     828        if(!(fsFocusChange & FC_NOLOSEACTIVE))
     829        {
     830          Win32BaseWindow *topparent = win32wnd->GetTopParent();
     831         
     832          if(!winfocus || (winfocus->GetTopParent() != topparent))
     833          {
     834            // PH 2000/09/01 Netscape 4.7
     835            // check if topparent is valid
     836            if (topparent)
     837              WinSendMsg(topparent->getOS2WindowHandle(), WM_ACTIVATE, (MPARAM)0, (MPARAM)hwndGainFocus);
     838          }
     839        }
     840        //SvL: Check if window is still valid
     841        win32wnd = Win32BaseWindow::GetWindowFromOS2Handle(hwnd);
     842        if(win32wnd == NULL)
     843          return (MRESULT)rc;
     844
     845        if(!(fsFocusChange & FC_NOSETACTIVE))
     846        {
     847          if(!winfocus || (winfocus->GetTopParent() != win32wnd->GetTopParent()))
     848          {
     849            if(winfocus)
     850            {
     851              // PH 2000/09/01 Netscape 4.7
     852              // check if topparent is valid
     853              Win32BaseWindow *topparent = winfocus->GetTopParent();
     854              if (topparent)
     855                WinSendMsg(topparent->getOS2WindowHandle(), WM_ACTIVATE, (MPARAM)1, (MPARAM)hwndLoseFocus);
     856            }
     857            else       
     858              WinSendMsg(hwndGainFocus, WM_ACTIVATE, (MPARAM)1, (MPARAM)hwndLoseFocus);
     859          }
     860        }
     861      }
     862     
     863     
    839864        //TODO: Don't send WM_SETSELECTION to child window if frame already has selection
    840865        if(!(fsFocusChange & FC_NOSETSELECTION)) {
Note: See TracChangeset for help on using the changeset viewer.