Changeset 5950 for trunk/src


Ignore:
Timestamp:
Jun 10, 2001, 11:19:58 AM (24 years ago)
Author:
sandervl
Message:

bugfixes

Location:
trunk/src/user32
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/gen_object.cpp

    r5935 r5950  
    1 /* $Id: gen_object.cpp,v 1.8 2001-06-09 14:50:17 sandervl Exp $ */
     1/* $Id: gen_object.cpp,v 1.9 2001-06-10 09:19:57 sandervl Exp $ */
    22/*
    33 * Generic Object Class for OS/2
     
    8888//******************************************************************************
    8989//******************************************************************************
     90#ifdef DEBUG
     91LONG GenericObject::addRef()
     92{
     93  dprintf(("addRef %x -> refcount %x", this, refCount));
     94  return InterlockedIncrement(&refCount);
     95}
     96#endif
     97//******************************************************************************
     98//******************************************************************************
    9099LONG GenericObject::release()
    91100{
    92 ////  dprintf(("release -> refcount %x", refCount));
     101  dprintf(("release %x -> refcount %x", this, refCount));
    93102#ifdef DEBUG
    94103  if(refCount-1 < 0) {
  • trunk/src/user32/gen_object.h

    r5935 r5950  
    1 /* $Id: gen_object.h,v 1.6 2001-06-09 14:50:17 sandervl Exp $ */
     1/* $Id: gen_object.h,v 1.7 2001-06-10 09:19:57 sandervl Exp $ */
    22/*
    33 * Generic Object Class for OS/2
     
    2929         void  unlink();
    3030
     31#ifdef DEBUG
     32         LONG  addRef();
     33#else
    3134         LONG  addRef()         { return InterlockedIncrement(&refCount); };
     35#endif
    3236         LONG  getRefCount()    { return refCount; };
    3337         LONG  release();
  • trunk/src/user32/icontitle.cpp

    r5935 r5950  
    1 /* $Id: icontitle.cpp,v 1.7 2001-06-09 14:50:17 sandervl Exp $ */
     1/* $Id: icontitle.cpp,v 1.8 2001-06-10 09:19:57 sandervl Exp $ */
    22/*
    33 * Icontitle window class.
     
    5757    {
    5858        win32wnd->setOwner(parent);     /* MDI depends on this */
     59        //No RELEASE_WNDOBJ necessary. Done in dtor of window
    5960        win32wnd->setStyle(win32wnd->getStyle() & ~(WS_CAPTION | WS_BORDER));
    6061        if (parent->getStyle() & WS_DISABLED ) win32wnd->setStyle(win32wnd->getStyle() | WS_DISABLED);
    61         RELEASE_WNDOBJ(win32wnd);
    6262        return hWnd;
    6363    }
  • trunk/src/user32/win32dlg.cpp

    r5935 r5950  
    1 /* $Id: win32dlg.cpp,v 1.66 2001-06-09 14:50:20 sandervl Exp $ */
     1/* $Id: win32dlg.cpp,v 1.67 2001-06-10 09:19:58 sandervl Exp $ */
    22/*
    33 * Win32 Dialog Code for OS/2
     
    340340        //    this style was useful for Win3.1 but today there are threads
    341341        // solution: send only few WM_ENTERIDLE messages
    342 
    343 #if 1
    344342        while (TRUE)
    345343        {
     
    388386                break;
    389387        }
    390 #else
    391         while (TRUE) {
    392 //        while (OSLibWinPeekMsg(&msg, getWindowHandle(), owner, MSGF_DIALOGBOX,
    393 //                                       MSG_REMOVE, !(getStyle() & DS_NOIDLEMSG), NULL ))
    394 //            if(OSLibWinPeekMsg(&msg, topOwner->getOS2FrameWindowHandle(), 0, 0, MSG_REMOVE))
    395             if(OSLibWinPeekMsg(&msg, 0, 0, 0, PM_REMOVE))
    396             {
    397                 if(msg.message == WM_QUIT) {
    398                     dprintf(("Win32Dialog::doDialogBox: received  WM_QUIT"));
    399                     break;
    400                 }
    401                 if (!IsDialogMessageA( getWindowHandle(), &msg))
    402                 {
    403                     TranslateMessage( &msg );
    404                     DispatchMessageA( &msg );
    405                 }
    406                 if (dialogFlags & DF_END) break;
    407             }
    408             else {
    409                 if(!(getStyle() & DS_NOIDLEMSG)) {
    410                     topOwner->SendInternalMessageA(WM_ENTERIDLE, MSGF_DIALOGBOX, getWindowHandle());
    411                 }
    412             }
    413         }
    414 #endif
    415388        topOwner->setModalDialogOwner(bOldOwner);
    416389        topOwner->setOS2HwndModalDialog(hwndOldDialog);
    417390        if (!bOldOwner) topOwner->EnableWindow(TRUE);
    418         RELEASE_WNDOBJ(topOwner);
    419     }
     391    }
     392    RELEASE_WNDOBJ(topOwner);
    420393    retval = idResult;
    421394    DestroyWindow();
  • trunk/src/user32/win32wbase.cpp

    r5935 r5950  
    1 /* $Id: win32wbase.cpp,v 1.260 2001-06-09 14:50:21 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.261 2001-06-10 09:19:58 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    241241        RELEASE_WNDOBJ(wndparent);
    242242    }
     243    if(owner) {
     244        RELEASE_WNDOBJ(owner);
     245    }
    243246    if(windowClass) {
    244247        RELEASE_CLASSOBJ(windowClass);
     
    10551058
    10561059                    //SvL: Calling OSLibSetActiveWindow(hwndTop); causes focus problems
    1057                     if (win32top) OSLibWinSetFocus(win32top->getOS2FrameWindowHandle());
     1060                    if (win32top) {
     1061                        OSLibWinSetFocus(win32top->getOS2FrameWindowHandle());
     1062                        RELEASE_WNDOBJ(win32top);
     1063                    }
    10581064                }
    10591065        }
     
    17211727                siblingWindow->SendInternalMessageA (BM_CLICK, 0, 0);
    17221728            }
    1723 
    17241729            sibling = siblingWindow->GetNextWindow (GW_HWNDNEXT);
     1730            RELEASE_WNDOBJ(siblingWindow);
    17251731        }
    17261732
     
    21132119                else    PostMessageA(window->getWindowHandle(), msg, wParam, lParam);
    21142120            }
     2121            RELEASE_WNDOBJ(window);
    21152122        }
    21162123    }
     
    21372144                else    PostMessageW(window->getWindowHandle(), msg, wParam, lParam);
    21382145            }
     2146            RELEASE_WNDOBJ(window);
    21392147        }
    21402148    }
     
    24572465        if(wndBehind) {
    24582466            swp.hwndInsertBehind   = wndBehind->getOS2FrameWindowHandle();
     2467            RELEASE_WNDOBJ(wndBehind);
    24592468        }
    24602469        else {
     
    27362745        fShow = TRUE;
    27372746   }
    2738 
     2747   if(oldparent) {
     2748        RELEASE_WNDOBJ(oldparent);
     2749   }
    27392750   newparent = GetWindowFromHandle(hwndNewParent);
    27402751   if(newparent && !newparent->isDesktopWindow())
     
    29502961 Win32BaseWindow *parent = GetWindowFromHandle(hwndParent);
    29512962 Win32BaseWindow *child  = GetWindowFromHandle(hwndChildAfter);
     2963 Win32BaseWindow *firstchild = child;
    29522964
    29532965    dprintf(("FindWindowEx %x %x %x %s", hwndParent, hwndChildAfter, atom, lpszWindow));
     
    29562968       (hwndParent == 0 && hwndChildAfter != 0))
    29572969    {
     2970        if(parent)      RELEASE_WNDOBJ(parent);
     2971        if(firstchild)  RELEASE_WNDOBJ(firstchild);
    29582972        dprintf(("Win32BaseWindow::FindWindowEx: parent or child not found %x %x", hwndParent, hwndChildAfter));
    29592973        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
     
    29632977    if(hwndParent != 0)
    29642978    {//if the current process owns the window, just do a quick search
     2979        lock(&critsect);
    29652980        child = (Win32BaseWindow *)parent->getFirstChild();
    29662981        if(hwndChildAfter != 0)
     
    29832998            {
    29842999                dprintf(("FindWindowEx: Found window %x", child->getWindowHandle()));
    2985                 return child->getWindowHandle();
     3000                HWND hwndChild = child->getWindowHandle();
     3001                unlock(&critsect);
     3002                if(parent)      RELEASE_WNDOBJ(parent);
     3003                if(firstchild)  RELEASE_WNDOBJ(firstchild);
     3004                dprintf(("FindWindowEx: Found window %x", child->getWindowHandle()));
     3005                return hwndChild;
    29863006            }
    29873007            child = (Win32BaseWindow *)child->getNextChild();
    29883008        }
     3009        unlock(&critsect);
     3010        if(parent)      RELEASE_WNDOBJ(parent);
     3011        if(firstchild)  RELEASE_WNDOBJ(firstchild);
    29893012    }
    29903013    else {
     
    30193042        }
    30203043        OSLibWinEndEnumWindows(henum);
     3044        if(parent)      RELEASE_WNDOBJ(parent);
     3045        if(firstchild)  RELEASE_WNDOBJ(firstchild);
    30213046    }
    30223047    SetLastError(ERROR_CANNOT_FIND_WND_CLASS); //TODO: not always correct
     
    35323557HWND Win32BaseWindow::getNextDlgGroupItem(HWND hwndCtrl, BOOL fPrevious)
    35333558{
    3534  Win32BaseWindow *child, *nextchild, *lastchild;
     3559 Win32BaseWindow *firstchild = NULL, *child, *nextchild, *lastchild;
    35353560 HWND retvalue;
    35363561
     3562    lock();
    35373563    if (hwndCtrl)
    35383564    {
    3539         child = GetWindowFromHandle(hwndCtrl);
     3565        firstchild = child = GetWindowFromHandle(hwndCtrl);
    35403566        if (!child)
    35413567        {
     
    35493575            if(child == NULL) break;
    35503576        }
    3551 
    35523577        if (!child || (child->getParent() != this))
    35533578        {
     
    36113636    retvalue = lastchild->getWindowHandle();
    36123637END:
     3638    unlock();
     3639    if(firstchild) RELEASE_WNDOBJ(firstchild);
    36133640    return retvalue;
    36143641}
     
    36243651    if(HwGetWindowHandleData(hwnd, (DWORD *)&window) == TRUE) {
    36253652         if(window) {
    3626 ////             dprintf(("addRef %x; refcount %d", hwnd, window->getRefCount()+1));
     3653             dprintf(("addRef %x; refcount %d", hwnd, window->getRefCount()+1));
    36273654             window->addRef();
    36283655         }
Note: See TracChangeset for help on using the changeset viewer.