Changeset 2956 for trunk/src


Ignore:
Timestamp:
Mar 1, 2000, 2:30:07 PM (25 years ago)
Author:
sandervl
Message:

focus fixes + changes for dinput

Location:
trunk/src/user32
Files:
8 edited

Legend:

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

    r2881 r2956  
    1 /* $Id: oslibmsgtranslate.cpp,v 1.18 2000-02-24 19:19:08 sandervl Exp $ */
     1/* $Id: oslibmsgtranslate.cpp,v 1.19 2000-03-01 13:30:04 sandervl Exp $ */
    22/*
    33 * Window message translation functions for OS/2
     
    3131#include "pmwindow.h"
    3232#include "oslibwin.h"
    33 
    34 #define DBG_LOCALLOG    DBG_oslibmsgtranslate
     33#include "winmouse.h"
     34
     35#define DBG_LOCALLOG    DBG_oslibmsgtranslate
    3536#include "dbglocal.h"
    3637
     
    326327        if (!win32wnd->CanReceiveSizeMsgs())    goto dummymessage;
    327328
    328         ULONG windowStyle = WinQueryWindowULong(os2Msg->hwnd, QWL_STYLE);
    329         win32wnd->setStyle(win32wnd->getStyle() & ~(WS_MAXIMIZE_W|WS_MINIMIZE_W));
    330         if (windowStyle & WS_MINIMIZED) {
    331                 win32wnd->setStyle(win32wnd->getStyle() | WS_MINIMIZE_W);
    332         }
    333         else
    334         if (windowStyle & WS_MAXIMIZED) {
    335                 win32wnd->setStyle(win32wnd->getStyle() | WS_MAXIMIZE_W);
    336         }
     329        ULONG windowStyle = WinQueryWindowULong(os2Msg->hwnd, QWL_STYLE);
     330        win32wnd->setStyle(win32wnd->getStyle() & ~(WS_MAXIMIZE_W|WS_MINIMIZE_W));
     331        if (windowStyle & WS_MINIMIZED) {
     332            win32wnd->setStyle(win32wnd->getStyle() | WS_MINIMIZE_W);
     333        }
     334        else
     335        if (windowStyle & WS_MAXIMIZED) {
     336            win32wnd->setStyle(win32wnd->getStyle() | WS_MAXIMIZE_W);
     337        }
    337338
    338339        if(pswp->fl & (SWP_MOVE | SWP_SIZE)) {
     
    436437            winMsg->lParam  = MAKELONG(ClientPoint.x, ClientPoint.y); //client coordinates
    437438        }
     439        if(ISMOUSE_CAPTURED())
     440        {
     441            if(DInputMouseHandler(win32wnd->getWindowHandle(), MOUSEMSG_BUTTON, winMsg->pt.x, winMsg->pt.y))
     442                goto dummymessage;
     443        }
    438444
    439445        break;
     
    467473          winMsg->lParam  = MAKELONG(SHORT1FROMMP(os2Msg->mp1),mapY(win32wnd,SHORT2FROMMP(os2Msg->mp1)));
    468474        }
     475        if(ISMOUSE_CAPTURED())
     476        {
     477            if(DInputMouseHandler(win32wnd->getWindowHandle(), MOUSEMSG_MOVE, winMsg->pt.x, winMsg->pt.y))
     478                goto dummymessage;
     479        }
    469480        //OS/2 Window coordinates -> Win32 Window coordinates
    470481        break;
     
    622633            }
    623634        }
    624 
     635        if(ISKDB_CAPTURED())
     636        {
     637            DInputKeyBoardHandler(winMsg);
     638        }
    625639        break;
    626640    }
  • trunk/src/user32/pmframe.cpp

    r2834 r2956  
    1 /* $Id: pmframe.cpp,v 1.43 2000-02-20 18:28:32 cbratschi Exp $ */
     1/* $Id: pmframe.cpp,v 1.44 2000-03-01 13:30:05 sandervl Exp $ */
    22/*
    33 * Win32 Frame Managment Code for OS/2
     
    434434
    435435        dprintf(("PMFRAME: WM_ACTIVATE %x %x", hwnd, mp2));
     436        if(win32wnd->IsWindowCreated())
     437          win32wnd->DispatchMsgA(pWinMsg);
     438
    436439        if (win32wnd->IsWindowCreated())
    437440        {
     
    451454          WinSetWindowUShort(hwnd,QWS_FLAGS,mp1 ? (flags | FF_ACTIVE):(flags & ~FF_ACTIVE));
    452455        }
    453         if(win32wnd->IsWindowCreated())
    454           win32wnd->DispatchMsgA(pWinMsg);
    455 
    456456        RestoreOS2TIB();
    457457        return 0;
  • trunk/src/user32/win32wbase.cpp

    r2948 r2956  
    1 /* $Id: win32wbase.cpp,v 1.170 2000-02-29 19:16:12 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.171 2000-03-01 13:30:05 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    4545#include "controls.h"
    4646#include <wprocess.h>
    47 #include "winmouse.h"
    4847#include <win\hook.h>
    4948#include <menu.h>
     
    864863{
    865864    switch(virtualkey) {
     865    case VK_LEFT:
     866    case VK_RIGHT:
    866867    case VK_DOWN:
    867868    case VK_UP:
     
    939940    }
    940941
    941     if(ISMOUSE_CAPTURED())
    942     {
    943         if(DInputMouseHandler(getWindowHandle(), MOUSEMSG_BUTTON, msg->pt.x, msg->pt.y))
    944             return 0;
    945     }
    946 
    947942    if(fClick)
    948943    {
     
    965960                   && (hwndTop != GetForegroundWindow()) )
    966961                {
    967                       ::SetActiveWindow(hwndTop);
     962                    //SvL: Calling OSLibSetActiveWindow(hwndTop); causes focus problems
     963                    OSLibWinSetFocus(getOS2FrameWindowHandle());
    968964                }
    969965        }
     
    10071003ULONG Win32BaseWindow::MsgMouseMove(MSG *msg)
    10081004{
    1009     if(ISMOUSE_CAPTURED()) {
    1010         if(DInputMouseHandler(getWindowHandle(), MOUSEMSG_MOVE, msg->pt.x, msg->pt.y))
    1011             return 0;
    1012     }
    1013 
    10141005    //TODO: hiword should be 0 if window enters menu mode (SDK docs)
    10151006    SendInternalMessageA(WM_SETCURSOR, Win32Hwnd, MAKELONG(lastHitTestVal, msg->message));
     
    10221013ULONG Win32BaseWindow::MsgChar(MSG *msg)
    10231014{
    1024     if(ISKDB_CAPTURED())
    1025     {
    1026         DInputKeyBoardHandler(msg);
    1027     }
    10281015    return DispatchMsgA(msg);
    10291016}
     
    24172404//the current process owns them.
    24182405//******************************************************************************
    2419 HWND Win32BaseWindow::FindWindowEx(HWND hwndParent, HWND hwndChildAfter, LPSTR lpszClass, LPSTR lpszWindow,
    2420                                    BOOL fUnicode)
     2406HWND Win32BaseWindow::FindWindowEx(HWND hwndParent, HWND hwndChildAfter, ATOM atom, LPSTR lpszWindow)
    24212407{
    24222408 Win32BaseWindow *parent = GetWindowFromHandle(hwndParent);
    24232409 Win32BaseWindow *child  = GetWindowFromHandle(hwndChildAfter);
    24242410
    2425     if((hwndParent != OSLIB_HWND_DESKTOP && !parent) ||
     2411    dprintf(("FindWindowEx %x %x %x %s", hwndParent, hwndChildAfter, atom, lpszWindow));
     2412    if((hwndParent != 0 && !parent) ||
    24262413       (hwndChildAfter != 0 && !child) ||
    2427        (hwndParent == OSLIB_HWND_DESKTOP && hwndChildAfter != 0))
     2414       (hwndParent == 0 && hwndChildAfter != 0))
    24282415    {
    24292416        dprintf(("Win32BaseWindow::FindWindowEx: parent or child not found %x %x", hwndParent, hwndChildAfter));
     
    24312418        return 0;
    24322419    }
    2433     if(hwndParent != OSLIB_HWND_DESKTOP)
     2420    SetLastError(0);
     2421    if(hwndParent != 0)
    24342422    {//if the current process owns the window, just do a quick search
    24352423        child = (Win32BaseWindow *)parent->getFirstChild();
     
    24482436        while(child)
    24492437        {
    2450             if(child->getWindowClass()->hasClassName(lpszClass, fUnicode) &&
    2451                (!lpszWindow || child->hasWindowName(lpszWindow, fUnicode)))
     2438            //According to Wine, the class doesn't need to be specified
     2439            if((!atom || child->getWindowClass()->getAtom() == atom) &&
     2440               (!lpszWindow || child->hasWindowName(lpszWindow)))
    24522441            {
    24532442                dprintf(("FindWindowEx: Found window %x", child->getWindowHandle()));
     
    24742463
    24752464            if(wnd) {
    2476                 if(wnd->getWindowClass()->hasClassName(lpszClass, fUnicode) &&
    2477                    (!lpszWindow || wnd->hasWindowName(lpszWindow, fUnicode)))
     2465                //According to Wine, the class doesn't need to be specified
     2466                if((!atom || wnd->getWindowClass()->getAtom() == atom) &&
     2467                   (!lpszWindow || wnd->hasWindowName(lpszWindow)))
    24782468                {
    24792469                    OSLibWinEndEnumWindows(henum);
     
    25722562    dprintf(("SetActiveWindow %x", getWindowHandle()));
    25732563    if(OSLibWinSetActiveWindow(OS2HwndFrame) == FALSE) {
    2574         dprintf(("OSLibWinSetActiveWindow %x returned FALSE!", OS2HwndFrame));
     2564        dprintf(("OSLibWinSetActiveWindow %x returned FALSE!", OS2HwndFrame));
    25752565    }
    25762566    hwndActive = GetActiveWindow();
  • trunk/src/user32/win32wbase.h

    r2881 r2956  
    1 /* $Id: win32wbase.h,v 1.86 2000-02-24 19:19:10 sandervl Exp $ */
     1/* $Id: win32wbase.h,v 1.87 2000-03-01 13:30:06 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    270270Win32BaseWindow *FindWindowById(int id);
    271271
    272     static HWND FindWindowEx(HWND hwndParent, HWND hwndChildAfter, LPSTR lpszClass, LPSTR lpszWindow,
    273                              BOOL fUnicode = 0);
     272    static HWND FindWindowEx(HWND hwndParent, HWND hwndChildAfter, ATOM atom, LPSTR lpszWindow);
    274273
    275274           BOOL EnumChildWindows(WNDENUMPROC lpfn, LPARAM lParam);
  • trunk/src/user32/win32wbasenonclient.cpp

    r2873 r2956  
    1 /* $Id: win32wbasenonclient.cpp,v 1.15 2000-02-23 17:05:19 cbratschi Exp $ */
     1/* $Id: win32wbasenonclient.cpp,v 1.16 2000-03-01 13:30:06 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2 (non-client methods)
     
    260260      Win32BaseWindow *topparent = GetTopParent();
    261261
    262       if (GetActiveWindow() != topparent->getWindowHandle())
    263         topparent->SetActiveWindow();
    264 
    265       if (GetActiveWindow() == topparent->getWindowHandle())
    266         SendInternalMessageA(WM_SYSCOMMAND,SC_MOVE+HTCAPTION,lParam);
    267       break;
     262        if (GetActiveWindow() != topparent->getWindowHandle())
     263        {
     264            //SvL: Calling topparent->SetActiveWindow() causes focus problems
     265            OSLibWinSetFocus(topparent->getOS2FrameWindowHandle());
     266        }
     267
     268        if (GetActiveWindow() == topparent->getWindowHandle())
     269            SendInternalMessageA(WM_SYSCOMMAND,SC_MOVE+HTCAPTION,lParam);
     270        break;
    268271    }
    269272
  • trunk/src/user32/window.cpp

    r2881 r2956  
    1 /* $Id: window.cpp,v 1.57 2000-02-24 19:19:10 sandervl Exp $ */
     1/* $Id: window.cpp,v 1.58 2000-03-01 13:30:07 sandervl Exp $ */
    22/*
    33 * Win32 window apis for OS/2
     
    3131#include "winicon.h"
    3232#include <win\winpos.h>
     33#include <heapstring.h>
    3334
    3435#define DBG_LOCALLOG    DBG_window
     
    187188    }
    188189    if(HIWORD(className)) {
    189          dprintf(("CreateWindowExW: class %s parent %x (%d,%d) (%d,%d), %x %x", className, parent, x, y, width, height, style, exStyle));
     190         dprintf(("CreateWindowExW: class %ls parent %x (%d,%d) (%d,%d), %x %x", className, parent, x, y, width, height, style, exStyle));
    190191    }
    191192    else dprintf(("CreateWindowExW: class %d parent %x (%d,%d) (%d,%d), %x %x", className, parent, x, y, width, height, style, exStyle));
     
    287288    if(!window) {
    288289        dprintf(("CreateMDIWindowW, window %x not found", hwndParent));
    289     SetLastError(ERROR_INVALID_WINDOW_HANDLE);
     290        SetLastError(ERROR_INVALID_WINDOW_HANDLE);
    290291        return 0;
    291292    }
     
    952953HWND WIN32API FindWindowA(LPCSTR lpszClass, LPCSTR lpszWindow)
    953954{
    954     if(!lpszClass) {
    955         SetLastError(ERROR_INVALID_PARAMETER);
    956         return 0;
    957     }
    958     if(HIWORD(lpszClass)) {
    959          dprintf(("USER32:  FindWindow %s %s\n", lpszClass, lpszWindow));
    960     }
    961     else dprintf(("USER32:  FindWindow %x %s\n", lpszClass, lpszWindow));
    962 
    963     return Win32BaseWindow::FindWindowEx(OSLIB_HWND_DESKTOP, 0, (LPSTR)lpszClass, (LPSTR)lpszWindow);
     955    return FindWindowExA( NULL, NULL, lpszClass, lpszWindow );
    964956}
    965957//******************************************************************************
     
    967959HWND WIN32API FindWindowW( LPCWSTR lpClassName, LPCWSTR lpWindowName)
    968960{
    969  char *astring1 = UnicodeToAsciiString((LPWSTR)lpClassName);
    970  char *astring2 = UnicodeToAsciiString((LPWSTR)lpWindowName);
    971  HWND rc;
    972 
    973     rc = FindWindowA(astring1, astring2);
    974     FreeAsciiString(astring1);
    975     FreeAsciiString(astring2);
    976     return rc;
     961    return FindWindowExW( NULL, NULL, lpClassName, lpWindowName );
    977962}
    978963//******************************************************************************
     
    980965HWND WIN32API FindWindowExA(HWND hwndParent, HWND hwndChildAfter, LPCSTR lpszClass, LPCSTR lpszWindow)
    981966{
    982     if(!lpszClass) {
    983         SetLastError(ERROR_INVALID_PARAMETER);
    984         return 0;
    985     }
    986     if(HIWORD(lpszClass)) {
    987          dprintf(("USER32:  FindWindowExA (%x,%x) %s %s\n", hwndParent, hwndChildAfter, lpszClass, lpszWindow));
    988     }
    989     else dprintf(("USER32:  FindWindowExA (%x,%x)%x %s\n", hwndParent, hwndChildAfter, lpszClass, lpszWindow));
    990 
    991     return Win32BaseWindow::FindWindowEx(hwndParent, hwndChildAfter, (LPSTR)lpszClass, (LPSTR)lpszWindow);
     967    ATOM atom = 0;
     968
     969    if (lpszClass)
     970    {
     971        /* If the atom doesn't exist, then no class */
     972        /* with this name exists either. */
     973        if (!(atom = GlobalFindAtomA( lpszClass )))
     974        {
     975            SetLastError(ERROR_CANNOT_FIND_WND_CLASS);
     976            return 0;
     977        }
     978    }
     979    return Win32BaseWindow::FindWindowEx(hwndParent, hwndChildAfter, atom, (LPSTR)lpszWindow);
    992980}
    993981/*****************************************************************************
     
    1007995 *               error information, call GetLastError.
    1008996 * Remark    :
    1009  * Status    : UNTESTED STUB
    1010997 *
    1011  * Author    : Patrick Haller [Thu, 1998/02/26 11:55]
    1012998 *****************************************************************************/
    1013999
    10141000HWND WIN32API FindWindowExW(HWND    hwndParent,
    1015                                HWND    hwndChildAfter,
    1016                                LPCWSTR lpszClass,
    1017                                LPCWSTR lpszWindow)
    1018 {
    1019     if(!lpszClass) {
    1020         SetLastError(ERROR_INVALID_PARAMETER);
    1021         return 0;
    1022     }
    1023     dprintf(("USER32:  FindWindowExW (%x,%x) %x %s\n", hwndParent, hwndChildAfter, lpszClass, lpszWindow));
    1024 
    1025     return Win32BaseWindow::FindWindowEx(hwndParent, hwndChildAfter, (LPSTR)lpszClass, (LPSTR)lpszWindow);
     1001                            HWND    hwndChildAfter,
     1002                            LPCWSTR lpszClass,
     1003                            LPCWSTR lpszWindow)
     1004{
     1005    ATOM atom = 0;
     1006    char *buffer;
     1007    HWND hwnd;
     1008
     1009    if (lpszClass)
     1010    {
     1011        /* If the atom doesn't exist, then no class */
     1012        /* with this name exists either. */
     1013        if (!(atom = GlobalFindAtomW( lpszClass )))
     1014        {
     1015            SetLastError(ERROR_CANNOT_FIND_WND_CLASS);
     1016            return 0;
     1017        }
     1018    }
     1019    buffer = HEAP_strdupWtoA( GetProcessHeap(), 0, lpszWindow );
     1020    hwnd = Win32BaseWindow::FindWindowEx(hwndParent, hwndChildAfter, atom, buffer);
     1021    HeapFree( GetProcessHeap(), 0, buffer );
     1022    return hwnd;
    10261023}
    10271024//******************************************************************************
  • trunk/src/user32/winmouse.cpp

    r2803 r2956  
    1 /* $Id: winmouse.cpp,v 1.5 2000-02-16 14:28:28 sandervl Exp $ */
     1/* $Id: winmouse.cpp,v 1.6 2000-03-01 13:30:07 sandervl Exp $ */
    22/*
    33 * Mouse handler for DINPUT
     
    1212#include <misc.h>
    1313#include "win32wbase.h"
     14#include <win\mouse.h>
    1415#include "winmouse.h"
    1516#include "oslibmsg.h"
  • trunk/src/user32/winmouse.h

    r2469 r2956  
    1 /* $Id: winmouse.h,v 1.4 2000-01-18 20:08:18 sandervl Exp $ */
     1/* $Id: winmouse.h,v 1.5 2000-03-01 13:30:07 sandervl Exp $ */
    22/*
    33 * Mouse handler for DINPUT
     
    1111#ifndef __WINMOUSE_H__
    1212#define __WINMOUSE_H__
    13 
    14 #include <win\mouse.h>
    1513
    1614extern LPMOUSE_EVENT_PROC mouseHandler;
Note: See TracChangeset for help on using the changeset viewer.