Changeset 3610 for trunk/src


Ignore:
Timestamp:
May 26, 2000, 8:43:35 PM (25 years ago)
Author:
sandervl
Message:

Tasklist fixes

Location:
trunk/src/user32
Files:
5 edited

Legend:

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

    r3603 r3610  
    1 /* $Id: oslibmsgtranslate.cpp,v 1.31 2000-05-24 19:30:05 sandervl Exp $ */
     1/* $Id: oslibmsgtranslate.cpp,v 1.32 2000-05-26 18:43:33 sandervl Exp $ */
    22/*
    33 * Window message translation functions for OS/2
     
    521521            winMsg->lParam  = MAKELONG(ClientPoint.x, ClientPoint.y); //client coordinates
    522522        }
    523         if(ISMOUSE_CAPTURED())
     523        if((fMsgRemoved == MSG_REMOVE) && ISMOUSE_CAPTURED())
    524524        {
    525525            if(DInputMouseHandler(win32wnd->getWindowHandle(), winMsg->message, winMsg->pt.x, winMsg->pt.y)) {
     
    575575          winMsg->lParam  = MAKELONG(SHORT1FROMMP(os2Msg->mp1),mapY(win32wnd,SHORT2FROMMP(os2Msg->mp1)));
    576576        }
    577         if(ISMOUSE_CAPTURED())
     577        if((fMsgRemoved == MSG_REMOVE) && ISMOUSE_CAPTURED())
    578578        {
    579579            if(DInputMouseHandler(win32wnd->getWindowHandle(), winMsg->message, winMsg->pt.x, winMsg->pt.y)) {
     
    767767            }
    768768        }
    769         if(ISKDB_CAPTURED())
     769        if((fMsgRemoved == MSG_REMOVE) && ISKDB_CAPTURED())
    770770        {
    771771            if(DInputKeyBoardHandler(winMsg)) {
  • trunk/src/user32/oslibwin.cpp

    r3581 r3610  
    1 /* $Id: oslibwin.cpp,v 1.77 2000-05-20 14:57:19 sandervl Exp $ */
     1/* $Id: oslibwin.cpp,v 1.78 2000-05-26 18:43:34 sandervl Exp $ */
    22/*
    33 * Window API wrappers for OS/2
     
    1313#define  INCL_WIN
    1414#define  INCL_PM
     15#define  INCL_WINSWITCHLIST
    1516#include <os2wrap.h>
    1617#include <stdlib.h>
     
    8485  if(fTaskList)
    8586  {
    86     dwFrameStyle |= FCF_TASKLIST | FCF_NOMOVEWITHOWNER;
     87        dwFrameStyle |= FCF_NOMOVEWITHOWNER;
    8788  }
    8889  if (fShellPosition) dwFrameStyle |= FCF_SHELLPOSITION;
     
    955956//******************************************************************************
    956957//******************************************************************************
     958BOOL OSLibWinRemoveFromTasklist(HANDLE hTaskList)
     959{
     960  return (WinRemoveSwitchEntry(hTaskList)) ? FALSE : TRUE;
     961}
     962//******************************************************************************
     963//******************************************************************************
     964HANDLE OSLibWinAddToTaskList(HWND hwndFrame, char *title, BOOL fVisible)
     965{
     966 SWCNTRL swctrl;
     967 ULONG   tid;
     968
     969  swctrl.hwnd          = hwndFrame;
     970  swctrl.hwndIcon      = 0;
     971  swctrl.hprog         = 0;
     972  WinQueryWindowProcess(hwndFrame, (PPID)&swctrl.idProcess, (PTID)&tid);
     973  swctrl.idSession     = 0;
     974  swctrl.uchVisibility = (fVisible) ? SWL_VISIBLE : SWL_INVISIBLE;
     975  swctrl.fbJump        = SWL_JUMPABLE;
     976  swctrl.bProgType     = PROG_PM;
     977  if(title) {
     978        strncpy(swctrl.szSwtitle, title, MAXNAMEL+4);
     979  }
     980  else {
     981        swctrl.szSwtitle[0] = 0;
     982        swctrl.uchVisibility    = SWL_INVISIBLE;
     983  }
     984  return WinAddSwitchEntry(&swctrl);
     985}
     986//******************************************************************************
     987//******************************************************************************
     988BOOL OSLibWinChangeTaskList(HANDLE hTaskList, HWND hwndFrame, char *title, BOOL fVisible)
     989{
     990 SWCNTRL swctrl;
     991 ULONG   tid;
     992 
     993  swctrl.hwnd          = hwndFrame;
     994  swctrl.hwndIcon      = 0;
     995  swctrl.hprog         = 0;
     996  WinQueryWindowProcess(hwndFrame, (PPID)&swctrl.idProcess, (PTID)&tid);
     997  swctrl.idSession     = 0;
     998  swctrl.uchVisibility = (fVisible) ? SWL_VISIBLE : SWL_INVISIBLE;
     999  swctrl.fbJump        = SWL_JUMPABLE;
     1000  swctrl.bProgType     = PROG_PM;
     1001  if(title) {
     1002        strncpy(swctrl.szSwtitle, title, MAXNAMEL+4);
     1003  }
     1004  else {
     1005        swctrl.szSwtitle[0] = 0;
     1006        swctrl.uchVisibility    = SWL_INVISIBLE;
     1007  }
     1008  return (WinChangeSwitchEntry(hTaskList, &swctrl)) ? FALSE : TRUE;
     1009}
     1010//******************************************************************************
     1011//******************************************************************************
  • trunk/src/user32/oslibwin.h

    r3581 r3610  
    1 /* $Id: oslibwin.h,v 1.44 2000-05-20 14:57:22 sandervl Exp $ */
     1/* $Id: oslibwin.h,v 1.45 2000-05-26 18:43:34 sandervl Exp $ */
    22/*
    33 * Window API wrappers for OS/2
     
    286286BOOL  OSLibWinSetCapture(HWND hwnd);
    287287
     288BOOL   OSLibWinRemoveFromTasklist(HANDLE hTaskList);
     289HANDLE OSLibWinAddToTaskList(HWND hwndFrame, char *title, BOOL fVisible);
     290BOOL   OSLibWinChangeTaskList(HANDLE hTaskList, HWND hwndFrame, char *title, BOOL fVisible);
     291
    288292#endif //__OSLIBWIN_H__
  • trunk/src/user32/win32wbase.cpp

    r3603 r3610  
    1 /* $Id: win32wbase.cpp,v 1.194 2000-05-24 19:30:06 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.195 2000-05-26 18:43:34 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    149149  hClipRegion        = 0;
    150150
     151  hTaskList          = 0;
     152
    151153  if(currentProcessId == -1)
    152154  {
     
    161163Win32BaseWindow::~Win32BaseWindow()
    162164{
     165    if(hTaskList) {
     166        OSLibWinRemoveFromTasklist(hTaskList);
     167    }
     168
    163169    OSLibWinSetVisibleRegionNotify(OS2HwndFrame, FALSE);
    164170    OSLibWinSetWindowULong(OS2Hwnd, OFFSET_WIN32WNDPTR, 0);
     
    240246    PrintWindowStyle(cs->style, cs->dwExStyle);
    241247#endif
     248
     249    //If window has no owner/parent window, then it will be added to the tasklist
     250    //(depending on visibility state)
     251    if (!cs->hwndParent) fTaskList = TRUE;
    242252
    243253    sw = SW_SHOW;
     
    501511
    502512  OSLibWinConvertStyle(dwStyle,dwExStyle,&dwOSWinStyle);
    503 #if 0
    504   if(((dwStyle & (WS_CAPTION|WS_POPUP)) == WS_CAPTION) && (getParent() == NULL || getParent() == windowDesktop)) {
    505         fTaskList = TRUE;
    506   }
    507 #else
    508   if (((dwStyle & (WS_CAPTION | WS_SYSMENU | 0xC0000000)) == (WS_CAPTION | WS_SYSMENU))) fTaskList = TRUE;
    509 #endif
    510513
    511514  OS2Hwnd = OSLibWinCreateWindow((getParent()) ? getParent()->getOS2WindowHandle() : OSLIB_HWND_DESKTOP,
     
    520523  }
    521524  OSLibWinSetVisibleRegionNotify(OS2HwndFrame, TRUE);
    522 
    523525  SetLastError(0);
    524526  return TRUE;
     
    664666  //Note: Solitaire crashes when receiving WM_SIZE messages before WM_CREATE
    665667  fCreated = TRUE;
     668
     669  if(fTaskList) {
     670        hTaskList = OSLibWinAddToTaskList(OS2HwndFrame, windowNameA, (cs->style & WS_VISIBLE) ? 1 : 0);
     671  }
    666672
    667673  if (SendInternalMessageA(WM_NCCREATE,0,(LPARAM)cs))
     
    13371343        {
    13381344          HandleNCPaint((HRGN)1);
    1339           OSLibWinSetWindowText(OS2HwndFrame,(LPSTR)windowNameA);
     1345          if(hTaskList) {
     1346                OSLibWinChangeTaskList(hTaskList, OS2HwndFrame, getWindowNameA(), (getStyle() & WS_VISIBLE) ? 1 : 0);
     1347          }
    13401348        }
    13411349
     
    17951803        {
    17961804          HandleNCPaint((HRGN)1);
    1797           OSLibWinSetWindowText(OS2HwndFrame,(LPSTR)windowNameA);
     1805          if(hTaskList) {
     1806                OSLibWinChangeTaskList(hTaskList, OS2HwndFrame, getWindowNameA(), (getStyle() & WS_VISIBLE) ? 1 : 0);
     1807          }
    17981808        }
    17991809
     
    20982108
    20992109    if(showstate & SWPOS_SHOW) {
    2100             setStyle(getStyle() | WS_VISIBLE);
    2101     }
    2102     else    setStyle(getStyle() & ~WS_VISIBLE);
    2103 
     2110         setStyle(getStyle() | WS_VISIBLE);
     2111         if(hTaskList) {
     2112                OSLibWinChangeTaskList(hTaskList, OS2HwndFrame, getWindowNameA(), (getStyle() & WS_VISIBLE) ? 1 : 0);
     2113         }
     2114    }
     2115    else {
     2116        if(hTaskList) {
     2117                OSLibWinChangeTaskList(hTaskList, OS2HwndFrame, getWindowNameA(), (getStyle() & WS_VISIBLE) ? 1 : 0);
     2118        }
     2119        setStyle(getStyle() & ~WS_VISIBLE);
     2120    }
    21042121    showFlag = (nCmdShow != SW_HIDE);
    21052122
     
    22482265        //SvL: TODO: Send WM_SHOWWINDOW??
    22492266        OSLibWinShowWindow(OS2Hwnd, SWPOS_SHOW);
     2267        if(hTaskList) {
     2268                OSLibWinChangeTaskList(hTaskList, OS2HwndFrame, getWindowNameA(), (getStyle() & WS_VISIBLE) ? 1 : 0);
     2269        }
    22502270    }
    22512271    else
     
    22542274        //SvL: TODO: Send WM_SHOWWINDOW??
    22552275        OSLibWinShowWindow(OS2Hwnd, SWPOS_HIDE);
     2276        if(hTaskList) {
     2277                OSLibWinChangeTaskList(hTaskList, OS2HwndFrame, getWindowNameA(), (getStyle() & WS_VISIBLE) ? 1 : 0);
     2278        }
    22562279    }
    22572280    rc = OSLibWinSetMultWindowPos(&swp, 1);
  • trunk/src/user32/win32wbase.h

    r3603 r3610  
    1 /* $Id: win32wbase.h,v 1.95 2000-05-24 19:30:07 sandervl Exp $ */
     1/* $Id: win32wbase.h,v 1.96 2000-05-26 18:43:35 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    389389
    390390    PROPERTY   *propertyList;
     391       
     392        HANDLE  hTaskList; //PM specific (switchentry handle)
    391393
    392394CREATESTRUCTA  *tmpcs; //temporary pointer to CREATESTRUCT used in CreateWindowEx
Note: See TracChangeset for help on using the changeset viewer.