Add InternalWM mode.
This commit is contained in:
parent
522c878fca
commit
1aef106064
|
@ -1,3 +1,28 @@
|
||||||
|
2004-11-04 Kensuke Matsuzaki <zakki@peppermint.jp>
|
||||||
|
|
||||||
|
* InitOutput.c: (winUseMsg):
|
||||||
|
* win.h:
|
||||||
|
* winmultiwindowwindow.c: (winMinimizeWindow):
|
||||||
|
* winmultiwindowwm.c: (PushMessage), (UpdateName),
|
||||||
|
(PreserveWin32Stack), (winMultiWindowWMProc),
|
||||||
|
(winMultiWindowXMsgProc), (winInitWM), (winInitMultiWindowWM),
|
||||||
|
(CheckAnotherWindowManager):
|
||||||
|
* winprocarg.c: (winInitializeDefaultScreens),
|
||||||
|
(ddxProcessArgument):
|
||||||
|
* winscrinit.c: (winFinishScreenInitFB):
|
||||||
|
* wintrayicon.c: (winHandleIconMessage):
|
||||||
|
* winwin32rootless.c: (InitWin32RootlessEngine),
|
||||||
|
(winMWExtWMResizeFrame), (winMWExtWMRestackFrame),
|
||||||
|
(winMWExtWMStartDrawing), (winMWExtWMRootlessSwitchWindow),
|
||||||
|
(winMWExtWMSetNativeProperty):
|
||||||
|
* winwin32rootlesswindow.c: (winMWExtWMReorderWindows),
|
||||||
|
(winMWExtWMDecorateWindow), (winMWExtWMUpdateWindowDecoration),
|
||||||
|
(winIsInternalWMRunning), (winMWExtWMRestackWindows):
|
||||||
|
* winwin32rootlesswndproc.c: (winMWExtWMWindowProc):
|
||||||
|
* winwindow.h:
|
||||||
|
* winwndproc.c: (winWindowProc):
|
||||||
|
Add internalwm mode.
|
||||||
|
|
||||||
2004-10-28 Alexander Gottwald <ago at freedesktop dot org>
|
2004-10-28 Alexander Gottwald <ago at freedesktop dot org>
|
||||||
|
|
||||||
* win.h:
|
* win.h:
|
||||||
|
|
|
@ -451,6 +451,9 @@ winUseMsg (void)
|
||||||
#ifdef XWIN_MULTIWINDOWEXTWM
|
#ifdef XWIN_MULTIWINDOWEXTWM
|
||||||
ErrorF ("-mwextwm\n"
|
ErrorF ("-mwextwm\n"
|
||||||
"\tRun the server in multi-window external window manager mode.\n");
|
"\tRun the server in multi-window external window manager mode.\n");
|
||||||
|
|
||||||
|
ErrorF ("-internalwm\n"
|
||||||
|
"\tRun the internal window manager.\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ErrorF ("-rootless\n"
|
ErrorF ("-rootless\n"
|
||||||
|
|
|
@ -420,6 +420,8 @@ typedef struct
|
||||||
Bool fDecoration;
|
Bool fDecoration;
|
||||||
#ifdef XWIN_MULTIWINDOWEXTWM
|
#ifdef XWIN_MULTIWINDOWEXTWM
|
||||||
Bool fMWExtWM;
|
Bool fMWExtWM;
|
||||||
|
Bool fInternalWM;
|
||||||
|
Bool fAnotherWMRunning;
|
||||||
#endif
|
#endif
|
||||||
Bool fRootless;
|
Bool fRootless;
|
||||||
#ifdef XWIN_MULTIWINDOW
|
#ifdef XWIN_MULTIWINDOW
|
||||||
|
@ -1391,6 +1393,19 @@ winMWExtWMMoveResizeXWindow (WindowPtr pWin, int x, int y, int w, int h);
|
||||||
|
|
||||||
void
|
void
|
||||||
winMWExtWMUpdateIcon (Window id);
|
winMWExtWMUpdateIcon (Window id);
|
||||||
|
|
||||||
|
void
|
||||||
|
winMWExtWMUpdateWindowDecoration (win32RootlessWindowPtr pRLWinPriv,
|
||||||
|
winScreenInfoPtr pScreenInfo);
|
||||||
|
|
||||||
|
BOOL CALLBACK
|
||||||
|
winMWExtWMDecorateWindow (HWND hwnd, LPARAM lParam);
|
||||||
|
|
||||||
|
Bool
|
||||||
|
winIsInternalWMRunning (winScreenInfoPtr pScreenInfo);
|
||||||
|
|
||||||
|
void
|
||||||
|
winMWExtWMRestackWindows (ScreenPtr pScreen);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -813,16 +813,34 @@ winMinimizeWindow (Window id)
|
||||||
{
|
{
|
||||||
WindowPtr pWin;
|
WindowPtr pWin;
|
||||||
winPrivWinPtr pWinPriv;
|
winPrivWinPtr pWinPriv;
|
||||||
|
win32RootlessWindowPtr pRLWinPriv;
|
||||||
|
HWND hWnd;
|
||||||
|
ScreenPtr pScreen = NULL;
|
||||||
|
winPrivScreenPtr pScreenPriv = NULL;
|
||||||
|
winScreenInfo *pScreenInfo = NULL;
|
||||||
|
|
||||||
#if CYGWINDOWING_DEBUG
|
#if CYGWINDOWING_DEBUG
|
||||||
ErrorF ("winMinimizeWindow\n");
|
ErrorF ("winMinimizeWindow\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
pWin = LookupIDByType (id, RT_WINDOW);
|
pWin = LookupIDByType (id, RT_WINDOW);
|
||||||
|
|
||||||
pWinPriv = winGetWindowPriv (pWin);
|
pScreen = pWin->drawable.pScreen;
|
||||||
|
if (pScreen) pScreenPriv = winGetScreenPriv(pScreen);
|
||||||
ShowWindow (pWinPriv->hWnd, SW_MINIMIZE);
|
if (pScreenPriv) pScreenInfo = pScreenPriv->pScreenInfo;
|
||||||
|
|
||||||
|
if (pScreenPriv && pScreenInfo->fInternalWM)
|
||||||
|
{
|
||||||
|
pRLWinPriv = (win32RootlessWindowPtr) RootlessFrameForWindow (pWin, FALSE);
|
||||||
|
hWnd = pRLWinPriv->hWnd;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pWinPriv = winGetWindowPriv (pWin);
|
||||||
|
hWnd = pWinPriv->hWnd;
|
||||||
|
}
|
||||||
|
|
||||||
|
ShowWindow (hWnd, SW_MINIMIZE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -54,10 +54,11 @@
|
||||||
#include "obj_base.h"
|
#include "obj_base.h"
|
||||||
#include "ddraw.h"
|
#include "ddraw.h"
|
||||||
#include "winwindow.h"
|
#include "winwindow.h"
|
||||||
|
#include "windowswmstr.h"
|
||||||
|
|
||||||
extern void winDebug(const char *format, ...);
|
extern void winDebug(const char *format, ...);
|
||||||
|
|
||||||
#ifndef CYGDEBUG
|
#ifndef CYGDEBUG
|
||||||
#define CYGDEBUG NO
|
#define CYGDEBUG NO
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -108,6 +109,7 @@ typedef struct _XMsgProcArgRec {
|
||||||
DWORD dwScreen;
|
DWORD dwScreen;
|
||||||
WMInfoPtr pWMInfo;
|
WMInfoPtr pWMInfo;
|
||||||
pthread_mutex_t *ppmServerStarted;
|
pthread_mutex_t *ppmServerStarted;
|
||||||
|
HWND hwndScreen;
|
||||||
} XMsgProcArgRec, *XMsgProcArgPtr;
|
} XMsgProcArgRec, *XMsgProcArgPtr;
|
||||||
|
|
||||||
|
|
||||||
|
@ -170,6 +172,9 @@ static void
|
||||||
PreserveWin32Stack(WMInfoPtr pWMInfo, Window iWindow, UINT direction);
|
PreserveWin32Stack(WMInfoPtr pWMInfo, Window iWindow, UINT direction);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static Bool
|
||||||
|
CheckAnotherWindowManager (Display *pDisplay, DWORD dwScreen);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Local globals
|
* Local globals
|
||||||
|
@ -177,8 +182,9 @@ PreserveWin32Stack(WMInfoPtr pWMInfo, Window iWindow, UINT direction);
|
||||||
|
|
||||||
static jmp_buf g_jmpWMEntry;
|
static jmp_buf g_jmpWMEntry;
|
||||||
static jmp_buf g_jmpXMsgProcEntry;
|
static jmp_buf g_jmpXMsgProcEntry;
|
||||||
static Bool g_shutdown = FALSE;
|
static Bool g_shutdown = FALSE;
|
||||||
static Bool redirectError = FALSE;
|
static Bool redirectError = FALSE;
|
||||||
|
static Bool g_fAnotherWMRunnig = FALSE;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -212,11 +218,14 @@ PushMessage (WMMsgQueuePtr pQueue, WMMsgNodePtr pNode)
|
||||||
case WM_WM_MOVE:
|
case WM_WM_MOVE:
|
||||||
ErrorF ("\tWM_WM_MOVE\n");
|
ErrorF ("\tWM_WM_MOVE\n");
|
||||||
break;
|
break;
|
||||||
|
case WM_WM_SIZE:
|
||||||
|
ErrorF ("\tWM_WM_SIZE\n");
|
||||||
|
break;
|
||||||
case WM_WM_RAISE:
|
case WM_WM_RAISE:
|
||||||
ErrorF ("\tWM_WM_RAISE\n");
|
ErrorF ("\tWM_WM_RAISE\n");
|
||||||
break;
|
break;
|
||||||
case WM_WM_LOWER:
|
case WM_WM_LOWER:
|
||||||
ErrorF ("\tWM_WM_RAISE\n");
|
ErrorF ("\tWM_WM_LOWER\n");
|
||||||
break;
|
break;
|
||||||
case WM_WM_MAP:
|
case WM_WM_MAP:
|
||||||
ErrorF ("\tWM_WM_MAP\n");
|
ErrorF ("\tWM_WM_MAP\n");
|
||||||
|
@ -227,8 +236,11 @@ PushMessage (WMMsgQueuePtr pQueue, WMMsgNodePtr pNode)
|
||||||
case WM_WM_KILL:
|
case WM_WM_KILL:
|
||||||
ErrorF ("\tWM_WM_KILL\n");
|
ErrorF ("\tWM_WM_KILL\n");
|
||||||
break;
|
break;
|
||||||
|
case WM_WM_ACTIVATE:
|
||||||
|
ErrorF ("\tWM_WM_ACTIVATE\n");
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
ErrorF ("Unknown Message.\n");
|
ErrorF ("\tUnknown Message.\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -482,7 +494,7 @@ UpdateName (WMInfoPtr pWMInfo, Window iWindow)
|
||||||
0,
|
0,
|
||||||
1,
|
1,
|
||||||
False,
|
False,
|
||||||
pWMInfo->atmPrivMap,
|
XA_INTEGER,//pWMInfo->atmPrivMap,
|
||||||
&atmType,
|
&atmType,
|
||||||
&fmtRet,
|
&fmtRet,
|
||||||
&items,
|
&items,
|
||||||
|
@ -499,7 +511,7 @@ UpdateName (WMInfoPtr pWMInfo, Window iWindow)
|
||||||
/* Some sanity checks */
|
/* Some sanity checks */
|
||||||
if (!hWnd) return;
|
if (!hWnd) return;
|
||||||
if (!IsWindow (hWnd)) return;
|
if (!IsWindow (hWnd)) return;
|
||||||
|
|
||||||
/* Set the Windows window name */
|
/* Set the Windows window name */
|
||||||
GetWindowName (pWMInfo->pDisplay, iWindow, &pszName);
|
GetWindowName (pWMInfo->pDisplay, iWindow, &pszName);
|
||||||
if (pszName)
|
if (pszName)
|
||||||
|
@ -543,7 +555,7 @@ PreserveWin32Stack(WMInfoPtr pWMInfo, Window iWindow, UINT direction)
|
||||||
0,
|
0,
|
||||||
1,
|
1,
|
||||||
False,
|
False,
|
||||||
pWMInfo->atmPrivMap,
|
XA_INTEGER,//pWMInfo->atmPrivMap,
|
||||||
&atmType,
|
&atmType,
|
||||||
&fmtRet,
|
&fmtRet,
|
||||||
&items,
|
&items,
|
||||||
|
@ -609,6 +621,12 @@ winMultiWindowWMProc (void *pArg)
|
||||||
{
|
{
|
||||||
WMMsgNodePtr pNode;
|
WMMsgNodePtr pNode;
|
||||||
|
|
||||||
|
if(g_fAnotherWMRunnig)/* Another Window manager exists. */
|
||||||
|
{
|
||||||
|
Sleep (1000);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
/* Pop a message off of our queue */
|
/* Pop a message off of our queue */
|
||||||
pNode = PopMessage (&pWMInfo->wmMsgQueue, pWMInfo);
|
pNode = PopMessage (&pWMInfo->wmMsgQueue, pWMInfo);
|
||||||
if (pNode == NULL)
|
if (pNode == NULL)
|
||||||
|
@ -623,7 +641,7 @@ winMultiWindowWMProc (void *pArg)
|
||||||
ErrorF ("winMultiWindowWMProc - %d ms MSG: %d ID: %d\n",
|
ErrorF ("winMultiWindowWMProc - %d ms MSG: %d ID: %d\n",
|
||||||
GetTickCount (), (int)pNode->msg.msg, (int)pNode->msg.dwID);
|
GetTickCount (), (int)pNode->msg.msg, (int)pNode->msg.dwID);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Branch on the message type */
|
/* Branch on the message type */
|
||||||
switch (pNode->msg.msg)
|
switch (pNode->msg.msg)
|
||||||
{
|
{
|
||||||
|
@ -665,7 +683,7 @@ winMultiWindowWMProc (void *pArg)
|
||||||
XChangeProperty (pWMInfo->pDisplay,
|
XChangeProperty (pWMInfo->pDisplay,
|
||||||
pNode->msg.iWindow,
|
pNode->msg.iWindow,
|
||||||
pWMInfo->atmPrivMap,
|
pWMInfo->atmPrivMap,
|
||||||
pWMInfo->atmPrivMap,
|
XA_INTEGER,//pWMInfo->atmPrivMap,
|
||||||
32,
|
32,
|
||||||
PropModeReplace,
|
PropModeReplace,
|
||||||
(unsigned char *) &(pNode->msg.hwndWindow),
|
(unsigned char *) &(pNode->msg.hwndWindow),
|
||||||
|
@ -897,19 +915,7 @@ winMultiWindowXMsgProc (void *pArg)
|
||||||
"successfully opened the display.\n");
|
"successfully opened the display.\n");
|
||||||
|
|
||||||
/* Check if another window manager is already running */
|
/* Check if another window manager is already running */
|
||||||
redirectError = FALSE;
|
g_fAnotherWMRunnig = CheckAnotherWindowManager (pProcArg->pDisplay, pProcArg->dwScreen);
|
||||||
XSetErrorHandler (winRedirectErrorHandler);
|
|
||||||
XSelectInput(pProcArg->pDisplay,
|
|
||||||
RootWindow (pProcArg->pDisplay, pProcArg->dwScreen),
|
|
||||||
SubstructureNotifyMask | ButtonPressMask);
|
|
||||||
XSync (pProcArg->pDisplay, 0);
|
|
||||||
XSetErrorHandler (winMultiWindowXMsgProcErrorHandler);
|
|
||||||
if (redirectError)
|
|
||||||
{
|
|
||||||
ErrorF ("winMultiWindowXMsgProc - "
|
|
||||||
"another window manager is running. Exiting.\n");
|
|
||||||
pthread_exit (NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Set up the supported icon sizes */
|
/* Set up the supported icon sizes */
|
||||||
xis = XAllocIconSize ();
|
xis = XAllocIconSize ();
|
||||||
|
@ -938,15 +944,49 @@ winMultiWindowXMsgProc (void *pArg)
|
||||||
/* Loop until we explicitly break out */
|
/* Loop until we explicitly break out */
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
|
if (!XPending (pProcArg->pDisplay))
|
||||||
|
{
|
||||||
|
if (CheckAnotherWindowManager (pProcArg->pDisplay, pProcArg->dwScreen))
|
||||||
|
{
|
||||||
|
if (!g_fAnotherWMRunnig)
|
||||||
|
{
|
||||||
|
g_fAnotherWMRunnig = TRUE;
|
||||||
|
SendMessage(*(HWND*)pProcArg->hwndScreen, WM_UNMANAGE, 0, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (g_fAnotherWMRunnig)
|
||||||
|
{
|
||||||
|
g_fAnotherWMRunnig = FALSE;
|
||||||
|
SendMessage(*(HWND*)pProcArg->hwndScreen, WM_MANAGE, 0, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Sleep (500);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
/* Fetch next event */
|
/* Fetch next event */
|
||||||
XNextEvent (pProcArg->pDisplay, &event);
|
XNextEvent (pProcArg->pDisplay, &event);
|
||||||
|
|
||||||
/* Branch on event type */
|
/* Branch on event type */
|
||||||
if (event.type == CreateNotify)
|
if (event.type == CreateNotify)
|
||||||
{
|
{
|
||||||
|
XWindowAttributes attr;
|
||||||
|
|
||||||
XSelectInput (pProcArg->pDisplay,
|
XSelectInput (pProcArg->pDisplay,
|
||||||
event.xcreatewindow.window,
|
event.xcreatewindow.window,
|
||||||
PropertyChangeMask);
|
PropertyChangeMask);
|
||||||
|
|
||||||
|
/* Get the window attributes */
|
||||||
|
XGetWindowAttributes (pProcArg->pDisplay,
|
||||||
|
event.xcreatewindow.window,
|
||||||
|
&attr);
|
||||||
|
|
||||||
|
if (!attr.override_redirect)
|
||||||
|
XSetWindowBorderWidth(pProcArg->pDisplay,
|
||||||
|
event.xcreatewindow.window,
|
||||||
|
0);
|
||||||
}
|
}
|
||||||
else if (event.type == PropertyNotify
|
else if (event.type == PropertyNotify
|
||||||
&& event.xproperty.atom == atmWmName)
|
&& event.xproperty.atom == atmWmName)
|
||||||
|
@ -998,7 +1038,8 @@ winInitWM (void **ppWMInfo,
|
||||||
pthread_t *ptWMProc,
|
pthread_t *ptWMProc,
|
||||||
pthread_t *ptXMsgProc,
|
pthread_t *ptXMsgProc,
|
||||||
pthread_mutex_t *ppmServerStarted,
|
pthread_mutex_t *ppmServerStarted,
|
||||||
int dwScreen)
|
int dwScreen,
|
||||||
|
HWND hwndScreen)
|
||||||
{
|
{
|
||||||
WMProcArgPtr pArg = (WMProcArgPtr) malloc (sizeof(WMProcArgRec));
|
WMProcArgPtr pArg = (WMProcArgPtr) malloc (sizeof(WMProcArgRec));
|
||||||
WMInfoPtr pWMInfo = (WMInfoPtr) malloc (sizeof(WMInfoRec));
|
WMInfoPtr pWMInfo = (WMInfoPtr) malloc (sizeof(WMInfoRec));
|
||||||
|
@ -1043,6 +1084,7 @@ winInitWM (void **ppWMInfo,
|
||||||
pXMsgArg->dwScreen = dwScreen;
|
pXMsgArg->dwScreen = dwScreen;
|
||||||
pXMsgArg->pWMInfo = pWMInfo;
|
pXMsgArg->pWMInfo = pWMInfo;
|
||||||
pXMsgArg->ppmServerStarted = ppmServerStarted;
|
pXMsgArg->ppmServerStarted = ppmServerStarted;
|
||||||
|
pXMsgArg->hwndScreen = hwndScreen;
|
||||||
if (pthread_create (ptXMsgProc, NULL, winMultiWindowXMsgProc, pXMsgArg))
|
if (pthread_create (ptXMsgProc, NULL, winMultiWindowXMsgProc, pXMsgArg))
|
||||||
{
|
{
|
||||||
/* Bail if thread creation failed */
|
/* Bail if thread creation failed */
|
||||||
|
@ -1182,7 +1224,7 @@ winInitMultiWindowWM (WMInfoPtr pWMInfo, WMProcArgPtr pProcArg)
|
||||||
"WM_DELETE_WINDOW",
|
"WM_DELETE_WINDOW",
|
||||||
False);
|
False);
|
||||||
pWMInfo->atmPrivMap = XInternAtom (pWMInfo->pDisplay,
|
pWMInfo->atmPrivMap = XInternAtom (pWMInfo->pDisplay,
|
||||||
WIN_HWND_CACHE,
|
WINDOWSWM_NATIVE_HWND,
|
||||||
False);
|
False);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1299,6 +1341,36 @@ winRedirectErrorHandler (Display *pDisplay, XErrorEvent *pErr)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Check if another window manager is running
|
||||||
|
*/
|
||||||
|
|
||||||
|
static Bool
|
||||||
|
CheckAnotherWindowManager (Display *pDisplay, DWORD dwScreen)
|
||||||
|
{
|
||||||
|
redirectError = FALSE;
|
||||||
|
XSetErrorHandler (winRedirectErrorHandler);
|
||||||
|
XSelectInput(pDisplay, RootWindow (pDisplay, dwScreen),
|
||||||
|
// SubstructureNotifyMask | ButtonPressMask
|
||||||
|
ColormapChangeMask | EnterWindowMask | PropertyChangeMask |
|
||||||
|
SubstructureRedirectMask | KeyPressMask |
|
||||||
|
ButtonPressMask | ButtonReleaseMask);
|
||||||
|
XSync (pDisplay, 0);
|
||||||
|
XSetErrorHandler (winMultiWindowXMsgProcErrorHandler);
|
||||||
|
XSelectInput(pDisplay, RootWindow (pDisplay, dwScreen),
|
||||||
|
SubstructureNotifyMask);
|
||||||
|
XSync (pDisplay, 0);
|
||||||
|
if (redirectError)
|
||||||
|
{
|
||||||
|
//ErrorF ("CheckAnotherWindowManager() - another window manager is running. Exiting.\n");
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Notify the MWM thread we're exiting and not to reconnect
|
* Notify the MWM thread we're exiting and not to reconnect
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -123,6 +123,7 @@ winInitializeDefaultScreens (void)
|
||||||
g_ScreenInfo[i].fDecoration = TRUE;
|
g_ScreenInfo[i].fDecoration = TRUE;
|
||||||
#ifdef XWIN_MULTIWINDOWEXTWM
|
#ifdef XWIN_MULTIWINDOWEXTWM
|
||||||
g_ScreenInfo[i].fMWExtWM = FALSE;
|
g_ScreenInfo[i].fMWExtWM = FALSE;
|
||||||
|
g_ScreenInfo[i].fInternalWM = FALSE;
|
||||||
#endif
|
#endif
|
||||||
g_ScreenInfo[i].fRootless = FALSE;
|
g_ScreenInfo[i].fRootless = FALSE;
|
||||||
#ifdef XWIN_MULTIWINDOW
|
#ifdef XWIN_MULTIWINDOW
|
||||||
|
@ -502,6 +503,33 @@ ddxProcessArgument (int argc, char *argv[], int i)
|
||||||
g_ScreenInfo[g_iLastScreen].fMWExtWM = TRUE;
|
g_ScreenInfo[g_iLastScreen].fMWExtWM = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Indicate that we have processed this argument */
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* Look for the '-internalwm' argument
|
||||||
|
*/
|
||||||
|
if (IS_OPTION ("-internalwm"))
|
||||||
|
{
|
||||||
|
/* Is this parameter attached to a screen or is it global? */
|
||||||
|
if (-1 == g_iLastScreen)
|
||||||
|
{
|
||||||
|
int j;
|
||||||
|
|
||||||
|
/* Parameter is for all screens */
|
||||||
|
for (j = 0; j < MAXSCREENS; j++)
|
||||||
|
{
|
||||||
|
g_ScreenInfo[j].fMWExtWM = TRUE;
|
||||||
|
g_ScreenInfo[j].fInternalWM = TRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Parameter is for a single screen */
|
||||||
|
g_ScreenInfo[g_iLastScreen].fMWExtWM = TRUE;
|
||||||
|
g_ScreenInfo[g_iLastScreen].fInternalWM = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
/* Indicate that we have processed this argument */
|
/* Indicate that we have processed this argument */
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -592,12 +592,13 @@ winFinishScreenInitFB (int index,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Initialize multi window mode */
|
/* Initialize multi window mode */
|
||||||
if (pScreenInfo->fMultiWindow
|
if ((pScreenInfo->fMultiWindow || pScreenInfo->fInternalWM)
|
||||||
&& !winInitWM (&pScreenPriv->pWMInfo,
|
&& !winInitWM (&pScreenPriv->pWMInfo,
|
||||||
&pScreenPriv->ptWMProc,
|
&pScreenPriv->ptWMProc,
|
||||||
&pScreenPriv->ptXMsgProc,
|
&pScreenPriv->ptXMsgProc,
|
||||||
&pScreenPriv->pmServerStarted,
|
&pScreenPriv->pmServerStarted,
|
||||||
pScreenInfo->dwScreen))
|
pScreenInfo->dwScreen,
|
||||||
|
(HWND)&pScreenPriv->hwndScreen))
|
||||||
{
|
{
|
||||||
ErrorF ("winFinishScreenInitFB - winInitWM () failed.\n");
|
ErrorF ("winFinishScreenInitFB - winInitWM () failed.\n");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
|
@ -115,6 +115,14 @@ winHandleIconMessage (HWND hwnd, UINT message,
|
||||||
|
|
||||||
switch (lParam)
|
switch (lParam)
|
||||||
{
|
{
|
||||||
|
case WM_LBUTTONUP:
|
||||||
|
/* Restack and bring all windows to top */
|
||||||
|
SetForegroundWindow (hwnd);
|
||||||
|
|
||||||
|
if (pScreenInfo->fMWExtWM)
|
||||||
|
winMWExtWMRestackWindows (pScreenInfo->pScreen);
|
||||||
|
break;
|
||||||
|
|
||||||
case WM_LBUTTONDBLCLK:
|
case WM_LBUTTONDBLCLK:
|
||||||
/* Display Exit dialog box */
|
/* Display Exit dialog box */
|
||||||
winDisplayExitDialog (pScreenPriv);
|
winDisplayExitDialog (pScreenPriv);
|
||||||
|
|
|
@ -203,7 +203,7 @@ InitWin32RootlessEngine (win32RootlessWindowPtr pRLWinPriv)
|
||||||
+ 256 * sizeof (RGBQUAD));
|
+ 256 * sizeof (RGBQUAD));
|
||||||
if (pRLWinPriv->pbmihShadow == NULL)
|
if (pRLWinPriv->pbmihShadow == NULL)
|
||||||
{
|
{
|
||||||
ErrorF ("winMWExtWMCreateFrame - malloc () failed\n");
|
ErrorF ("InitWin32RootlessEngine - malloc () failed\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -478,7 +478,7 @@ winMWExtWMResizeFrame (RootlessFrameID wid, ScreenPtr pScreen,
|
||||||
DWORD dwExStyle;
|
DWORD dwExStyle;
|
||||||
DWORD dwStyle;
|
DWORD dwStyle;
|
||||||
int iX, iY;
|
int iX, iY;
|
||||||
|
|
||||||
#if CYGMULTIWINDOW_DEBUG
|
#if CYGMULTIWINDOW_DEBUG
|
||||||
winDebug ("winMWExtWMResizeFrame (%08x) (%d %d)-(%d %d)\n",
|
winDebug ("winMWExtWMResizeFrame (%08x) (%d %d)-(%d %d)\n",
|
||||||
(int) pRLWinPriv, iNewX, iNewY, uiNewWidth, uiNewHeight);
|
(int) pRLWinPriv, iNewX, iNewY, uiNewWidth, uiNewHeight);
|
||||||
|
@ -525,6 +525,7 @@ winMWExtWMRestackFrame (RootlessFrameID wid, RootlessFrameID nextWid)
|
||||||
win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) wid;
|
win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) wid;
|
||||||
win32RootlessWindowPtr pRLNextWinPriv = (win32RootlessWindowPtr) nextWid;
|
win32RootlessWindowPtr pRLNextWinPriv = (win32RootlessWindowPtr) nextWid;
|
||||||
winScreenPriv(pRLWinPriv->pFrame->win->drawable.pScreen);
|
winScreenPriv(pRLWinPriv->pFrame->win->drawable.pScreen);
|
||||||
|
winScreenInfo *pScreenInfo = NULL;
|
||||||
DWORD dwCurrentProcessID = GetCurrentProcessId ();
|
DWORD dwCurrentProcessID = GetCurrentProcessId ();
|
||||||
DWORD dwWindowProcessID = 0;
|
DWORD dwWindowProcessID = 0;
|
||||||
HWND hWnd;
|
HWND hWnd;
|
||||||
|
@ -536,6 +537,8 @@ winMWExtWMRestackFrame (RootlessFrameID wid, RootlessFrameID nextWid)
|
||||||
|
|
||||||
if (pScreenPriv->fRestacking) return;
|
if (pScreenPriv->fRestacking) return;
|
||||||
|
|
||||||
|
if (pScreenPriv) pScreenInfo = pScreenPriv->pScreenInfo;
|
||||||
|
|
||||||
pRLWinPriv->fRestackingNow = TRUE;
|
pRLWinPriv->fRestackingNow = TRUE;
|
||||||
|
|
||||||
/* Show window */
|
/* Show window */
|
||||||
|
@ -551,8 +554,9 @@ winMWExtWMRestackFrame (RootlessFrameID wid, RootlessFrameID nextWid)
|
||||||
SetWindowPos (pRLWinPriv->hWnd, HWND_TOP,
|
SetWindowPos (pRLWinPriv->hWnd, HWND_TOP,
|
||||||
0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE);
|
0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE);
|
||||||
}
|
}
|
||||||
else
|
else if (winIsInternalWMRunning(pScreenInfo))
|
||||||
{
|
{
|
||||||
|
/* using mulwinidow wm */
|
||||||
#if CYGMULTIWINDOW_DEBUG
|
#if CYGMULTIWINDOW_DEBUG
|
||||||
winDebug ("Win %08x is not top\n", pRLWinPriv);
|
winDebug ("Win %08x is not top\n", pRLWinPriv);
|
||||||
#endif
|
#endif
|
||||||
|
@ -613,6 +617,19 @@ winMWExtWMRestackFrame (RootlessFrameID wid, RootlessFrameID nextWid)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* using general wm like twm, wmaker etc.
|
||||||
|
Interleave X window and Windows window will cause problem. */
|
||||||
|
SetWindowPos (pRLWinPriv->hWnd, pRLNextWinPriv->hWnd,
|
||||||
|
0, 0, 0, 0,
|
||||||
|
SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE);
|
||||||
|
#if 0
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
#if CYGMULTIWINDOW_DEBUG
|
||||||
|
winDebug ("winMWExtWMRestackFrame - done (%08x)\n", (int) pRLWinPriv);
|
||||||
|
#endif
|
||||||
|
|
||||||
pRLWinPriv->fRestackingNow = FALSE;
|
pRLWinPriv->fRestackingNow = FALSE;
|
||||||
}
|
}
|
||||||
|
@ -676,7 +693,7 @@ winMWExtWMStartDrawing (RootlessFrameID wid, char **pixelData, int *bytesPerRow)
|
||||||
Bool fReturn = TRUE;
|
Bool fReturn = TRUE;
|
||||||
HDC hdcNew;
|
HDC hdcNew;
|
||||||
HBITMAP hbmpNew;
|
HBITMAP hbmpNew;
|
||||||
#if CYGMULTIWINDOW_DEBUG
|
#if CYGMULTIWINDOW_DEBUG && FALSE
|
||||||
winDebug ("winMWExtWMStartDrawing (%08x) %08x\n", (int) pRLWinPriv, pRLWinPriv->fDestroyed);
|
winDebug ("winMWExtWMStartDrawing (%08x) %08x\n", (int) pRLWinPriv, pRLWinPriv->fDestroyed);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -686,9 +703,11 @@ winMWExtWMStartDrawing (RootlessFrameID wid, char **pixelData, int *bytesPerRow)
|
||||||
if (pScreen) pScreenPriv = winGetScreenPriv(pScreen);
|
if (pScreen) pScreenPriv = winGetScreenPriv(pScreen);
|
||||||
if (pScreenPriv) pScreenInfo = pScreenPriv->pScreenInfo;
|
if (pScreenPriv) pScreenInfo = pScreenPriv->pScreenInfo;
|
||||||
|
|
||||||
#if CYGMULTIWINDOW_DEBUG
|
#if CYGMULTIWINDOW_DEBUG && FALSE
|
||||||
winDebug ("pScreenPriv %08X\n", (int) pScreenPriv);
|
winDebug ("\tpScreenPriv %08X\n", (int) pScreenPriv);
|
||||||
winDebug ("pScreenInfo %08X\n", (int) pScreenInfo);
|
winDebug ("\tpScreenInfo %08X\n", (int) pScreenInfo);
|
||||||
|
winDebug ("\t(%d, %d)\n", (int)pRLWinPriv->pFrame->width,
|
||||||
|
(int) -pRLWinPriv->pFrame->height);
|
||||||
#endif
|
#endif
|
||||||
if (pRLWinPriv->hdcScreen == NULL)
|
if (pRLWinPriv->hdcScreen == NULL)
|
||||||
{
|
{
|
||||||
|
@ -786,7 +805,7 @@ winMWExtWMStartDrawing (RootlessFrameID wid, char **pixelData, int *bytesPerRow)
|
||||||
|
|
||||||
pRLWinPriv->fResized = FALSE;
|
pRLWinPriv->fResized = FALSE;
|
||||||
}
|
}
|
||||||
#if CYGMULTIWINDOW_DEBUG
|
#if CYGMULTIWINDOW_DEBUG && FALSE
|
||||||
winDebug ("winMWExtWMStartDrawing - 0x%08x %d\n",
|
winDebug ("winMWExtWMStartDrawing - 0x%08x %d\n",
|
||||||
(unsigned int)pRLWinPriv->pfb, (unsigned int)dibsection.dsBm.bmWidthBytes);
|
(unsigned int)pRLWinPriv->pfb, (unsigned int)dibsection.dsBm.bmWidthBytes);
|
||||||
#endif
|
#endif
|
||||||
|
@ -795,8 +814,8 @@ winMWExtWMStartDrawing (RootlessFrameID wid, char **pixelData, int *bytesPerRow)
|
||||||
{
|
{
|
||||||
ErrorF ("winMWExtWMStartDrawing - Already window was destroyed \n");
|
ErrorF ("winMWExtWMStartDrawing - Already window was destroyed \n");
|
||||||
}
|
}
|
||||||
#if CYGMULTIWINDOW_DEBUG
|
#if CYGMULTIWINDOW_DEBUG && FALSE
|
||||||
winDebug ("winMWExtWMStartDrawing - done (0x08x) 0x%08x %d\n",
|
winDebug ("winMWExtWMStartDrawing - done (0x08%x) 0x%08x %d\n",
|
||||||
(int) pRLWinPriv,
|
(int) pRLWinPriv,
|
||||||
(unsigned int)pRLWinPriv->pfb, (unsigned int)pRLWinPriv->dwWidthBytes);
|
(unsigned int)pRLWinPriv->pfb, (unsigned int)pRLWinPriv->dwWidthBytes);
|
||||||
#endif
|
#endif
|
||||||
|
@ -914,6 +933,13 @@ winMWExtWMRootlessSwitchWindow (RootlessWindowPtr pFrame, WindowPtr oldWin)
|
||||||
pRLWinPriv->pFrame = pFrame;
|
pRLWinPriv->pFrame = pFrame;
|
||||||
pRLWinPriv->fResized = TRUE;
|
pRLWinPriv->fResized = TRUE;
|
||||||
|
|
||||||
|
/* Set the window extended style flags */
|
||||||
|
SetWindowLongPtr (pRLWinPriv->hWnd, GWL_EXSTYLE, WS_EX_TOOLWINDOW);
|
||||||
|
|
||||||
|
/* Set the window standard style flags */
|
||||||
|
SetWindowLongPtr (pRLWinPriv->hWnd, GWL_STYLE,
|
||||||
|
WS_POPUP | WS_CLIPCHILDREN);
|
||||||
|
|
||||||
DeleteProperty (oldWin, AtmWindowsWmNativeHwnd ());
|
DeleteProperty (oldWin, AtmWindowsWmNativeHwnd ());
|
||||||
winMWExtWMSetNativeProperty (pFrame);
|
winMWExtWMSetNativeProperty (pFrame);
|
||||||
#if CYGMULTIWINDOW_DEBUG
|
#if CYGMULTIWINDOW_DEBUG
|
||||||
|
@ -1029,7 +1055,7 @@ winMWExtWMSetNativeProperty (RootlessWindowPtr pFrame)
|
||||||
|
|
||||||
/* FIXME: move this to WindowsWM extension */
|
/* FIXME: move this to WindowsWM extension */
|
||||||
|
|
||||||
lData = pRLWinPriv->hWnd;
|
lData = (long) pRLWinPriv->hWnd;
|
||||||
ChangeWindowProperty (pFrame->win, AtmWindowsWmNativeHwnd (),
|
ChangeWindowProperty (pFrame->win, AtmWindowsWmNativeHwnd (),
|
||||||
XA_INTEGER, 32, PropModeReplace, 1, &lData, TRUE);
|
XA_INTEGER, 32, PropModeReplace, 1, &lData, TRUE);
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,7 @@ winMWExtWMReorderWindows (ScreenPtr pScreen)
|
||||||
XID vlist[2];
|
XID vlist[2];
|
||||||
|
|
||||||
#if CYGMULTIWINDOW_DEBUG && FALSE
|
#if CYGMULTIWINDOW_DEBUG && FALSE
|
||||||
ErrorF ("winMWExtWMReorderWindows\n");
|
winDebug ("winMWExtWMReorderWindows\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
pScreenPriv->fRestacking = TRUE;
|
pScreenPriv->fRestacking = TRUE;
|
||||||
|
@ -58,7 +58,7 @@ winMWExtWMReorderWindows (ScreenPtr pScreen)
|
||||||
if (pScreenPriv->fWindowOrderChanged)
|
if (pScreenPriv->fWindowOrderChanged)
|
||||||
{
|
{
|
||||||
#if CYGMULTIWINDOW_DEBUG
|
#if CYGMULTIWINDOW_DEBUG
|
||||||
ErrorF ("winMWExtWMReorderWindows - Need to restack\n");
|
winDebug ("winMWExtWMReorderWindows - Need to restack\n");
|
||||||
#endif
|
#endif
|
||||||
hwnd = GetTopWindow (NULL);
|
hwnd = GetTopWindow (NULL);
|
||||||
|
|
||||||
|
@ -182,3 +182,271 @@ winMWExtWMUpdateIcon (Window id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* winMWExtWMDecorateWindow - Update window style. Called by EnumWindows.
|
||||||
|
*/
|
||||||
|
|
||||||
|
BOOL CALLBACK
|
||||||
|
winMWExtWMDecorateWindow (HWND hwnd, LPARAM lParam)
|
||||||
|
{
|
||||||
|
win32RootlessWindowPtr pRLWinPriv = NULL;
|
||||||
|
ScreenPtr pScreen = NULL;
|
||||||
|
winPrivScreenPtr pScreenPriv = NULL;
|
||||||
|
winScreenInfo *pScreenInfo = NULL;
|
||||||
|
|
||||||
|
/* Check if the Windows window property for our X window pointer is valid */
|
||||||
|
if ((pRLWinPriv = (win32RootlessWindowPtr)GetProp (hwnd, WIN_WINDOW_PROP)) != NULL)
|
||||||
|
{
|
||||||
|
pScreen = pRLWinPriv->pFrame->win->drawable.pScreen;
|
||||||
|
if (pScreen) pScreenPriv = winGetScreenPriv(pScreen);
|
||||||
|
if (pScreenPriv) pScreenInfo = pScreenPriv->pScreenInfo;
|
||||||
|
if (pRLWinPriv && pScreenInfo) winMWExtWMUpdateWindowDecoration (pRLWinPriv, pScreenInfo);
|
||||||
|
}
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* winMWExtWMUpdateWindowDecoration - Update window style.
|
||||||
|
*/
|
||||||
|
|
||||||
|
void
|
||||||
|
winMWExtWMUpdateWindowDecoration (win32RootlessWindowPtr pRLWinPriv,
|
||||||
|
winScreenInfoPtr pScreenInfo)
|
||||||
|
{
|
||||||
|
Bool fDecorate = FALSE;
|
||||||
|
DWORD dwExStyle = 0;
|
||||||
|
DWORD dwStyle = 0;
|
||||||
|
WINDOWPLACEMENT wndPlace;
|
||||||
|
UINT showCmd = 0;
|
||||||
|
|
||||||
|
wndPlace.length = sizeof (WINDOWPLACEMENT);
|
||||||
|
|
||||||
|
/* Get current window placement */
|
||||||
|
GetWindowPlacement (pRLWinPriv->hWnd, &wndPlace);
|
||||||
|
|
||||||
|
if (winIsInternalWMRunning(pScreenInfo))
|
||||||
|
{
|
||||||
|
if (!pRLWinPriv->pFrame->win->overrideRedirect)
|
||||||
|
fDecorate = TRUE;
|
||||||
|
}
|
||||||
|
#if 0
|
||||||
|
if (wndPlace.showCmd == SW_HIDE)
|
||||||
|
return;//showCmd = SWP_HIDEWINDOW;
|
||||||
|
else
|
||||||
|
showCmd = SWP_SHOWWINDOW;
|
||||||
|
#else
|
||||||
|
if (wndPlace.showCmd == SW_HIDE)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (IsWindowVisible (pRLWinPriv->hWnd))
|
||||||
|
showCmd = SWP_SHOWWINDOW;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
showCmd |= SWP_NOMOVE | SWP_FRAMECHANGED | SWP_NOACTIVATE | SWP_NOZORDER;
|
||||||
|
|
||||||
|
winDebug ("winMWExtWMUpdateWindowDecoration %08x %s\n",
|
||||||
|
(int)pRLWinPriv, fDecorate?"Decorate":"Bare");
|
||||||
|
|
||||||
|
/* Get the standard and extended window style information */
|
||||||
|
dwExStyle = GetWindowLongPtr (pRLWinPriv->hWnd, GWL_EXSTYLE);
|
||||||
|
dwStyle = GetWindowLongPtr (pRLWinPriv->hWnd, GWL_STYLE);
|
||||||
|
|
||||||
|
if (fDecorate)
|
||||||
|
{
|
||||||
|
RECT rcNew;
|
||||||
|
int iDx, iDy;
|
||||||
|
winWMMessageRec wmMsg;
|
||||||
|
winScreenPriv(pScreenInfo->pScreen);
|
||||||
|
|
||||||
|
/* */
|
||||||
|
if (!(dwExStyle & WS_EX_APPWINDOW))
|
||||||
|
{
|
||||||
|
winDebug ("\tBare=>Decorate\n");
|
||||||
|
/* Setup a rectangle with the X window position and size */
|
||||||
|
SetRect (&rcNew,
|
||||||
|
pRLWinPriv->pFrame->x,
|
||||||
|
pRLWinPriv->pFrame->y,
|
||||||
|
pRLWinPriv->pFrame->x + pRLWinPriv->pFrame->width,
|
||||||
|
pRLWinPriv->pFrame->y + pRLWinPriv->pFrame->height);
|
||||||
|
|
||||||
|
/* */
|
||||||
|
AdjustWindowRectEx (&rcNew,
|
||||||
|
WS_POPUP | WS_SIZEBOX | WS_OVERLAPPEDWINDOW,
|
||||||
|
FALSE,
|
||||||
|
WS_EX_APPWINDOW);
|
||||||
|
|
||||||
|
/* Calculate position deltas */
|
||||||
|
iDx = pRLWinPriv->pFrame->x - rcNew.left;
|
||||||
|
iDy = pRLWinPriv->pFrame->y - rcNew.top;
|
||||||
|
|
||||||
|
/* Calculate new rectangle */
|
||||||
|
rcNew.left += iDx;
|
||||||
|
rcNew.right += iDx;
|
||||||
|
rcNew.top += iDy;
|
||||||
|
rcNew.bottom += iDy;
|
||||||
|
|
||||||
|
/* Set the window extended style flags */
|
||||||
|
SetWindowLongPtr (pRLWinPriv->hWnd, GWL_EXSTYLE, WS_EX_APPWINDOW);
|
||||||
|
|
||||||
|
/* Set the window standard style flags */
|
||||||
|
SetWindowLongPtr (pRLWinPriv->hWnd, GWL_STYLE,
|
||||||
|
WS_POPUP | WS_SIZEBOX | WS_OVERLAPPEDWINDOW);
|
||||||
|
|
||||||
|
/* Position the Windows window */
|
||||||
|
SetWindowPos (pRLWinPriv->hWnd, NULL,
|
||||||
|
rcNew.left, rcNew.top,
|
||||||
|
rcNew.right - rcNew.left, rcNew.bottom - rcNew.top,
|
||||||
|
showCmd);
|
||||||
|
|
||||||
|
wmMsg.hwndWindow = pRLWinPriv->hWnd;
|
||||||
|
wmMsg.iWindow = (Window)pRLWinPriv->pFrame->win->drawable.id;
|
||||||
|
wmMsg.msg = WM_WM_NAME_EVENT;
|
||||||
|
winSendMessageToWM (pScreenPriv->pWMInfo, &wmMsg);
|
||||||
|
|
||||||
|
winMWExtWMReshapeFrame ((RootlessFrameID)pRLWinPriv ,
|
||||||
|
wBoundingShape(pRLWinPriv->pFrame->win));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
RECT rcNew;
|
||||||
|
|
||||||
|
/* */
|
||||||
|
if (dwExStyle & WS_EX_APPWINDOW)
|
||||||
|
{
|
||||||
|
winDebug ("\tDecorate=>Bare\n");
|
||||||
|
/* Setup a rectangle with the X window position and size */
|
||||||
|
SetRect (&rcNew,
|
||||||
|
pRLWinPriv->pFrame->x,
|
||||||
|
pRLWinPriv->pFrame->y,
|
||||||
|
pRLWinPriv->pFrame->x + pRLWinPriv->pFrame->width,
|
||||||
|
pRLWinPriv->pFrame->y + pRLWinPriv->pFrame->height);
|
||||||
|
#if 0
|
||||||
|
/* */
|
||||||
|
AdjustWindowRectEx (&rcNew,
|
||||||
|
WS_POPUP | WS_CLIPCHILDREN,
|
||||||
|
FALSE,
|
||||||
|
WS_EX_TOOLWINDOW);
|
||||||
|
|
||||||
|
/* Calculate position deltas */
|
||||||
|
iDx = pRLWinPriv->pFrame->x - rcNew.left;
|
||||||
|
iDy = pRLWinPriv->pFrame->y - rcNew.top;
|
||||||
|
|
||||||
|
/* Calculate new rectangle */
|
||||||
|
rcNew.left += iDx;
|
||||||
|
rcNew.right += iDx;
|
||||||
|
rcNew.top += iDy;
|
||||||
|
rcNew.bottom += iDy;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Hide window temporary to remove from taskbar. */
|
||||||
|
ShowWindow( pRLWinPriv->hWnd, SW_HIDE );
|
||||||
|
|
||||||
|
/* Set the window extended style flags */
|
||||||
|
SetWindowLongPtr (pRLWinPriv->hWnd, GWL_EXSTYLE, WS_EX_TOOLWINDOW);
|
||||||
|
|
||||||
|
/* Set the window standard style flags */
|
||||||
|
SetWindowLongPtr (pRLWinPriv->hWnd, GWL_STYLE,
|
||||||
|
WS_POPUP | WS_CLIPCHILDREN);
|
||||||
|
|
||||||
|
/* Position the Windows window */
|
||||||
|
SetWindowPos (pRLWinPriv->hWnd, NULL,
|
||||||
|
rcNew.left, rcNew.top,
|
||||||
|
rcNew.right - rcNew.left, rcNew.bottom - rcNew.top,
|
||||||
|
showCmd);
|
||||||
|
|
||||||
|
winMWExtWMReshapeFrame ((RootlessFrameID)pRLWinPriv ,
|
||||||
|
wBoundingShape(pRLWinPriv->pFrame->win));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* winIsInternalWMRunning (winScreenInfoPtr pScreenInfo)
|
||||||
|
*/
|
||||||
|
Bool
|
||||||
|
winIsInternalWMRunning (winScreenInfoPtr pScreenInfo)
|
||||||
|
{
|
||||||
|
return pScreenInfo->fInternalWM && !pScreenInfo->fAnotherWMRunning;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
* winMWExtWMRestackWindows
|
||||||
|
*/
|
||||||
|
|
||||||
|
void
|
||||||
|
winMWExtWMRestackWindows (ScreenPtr pScreen)
|
||||||
|
{
|
||||||
|
winScreenPriv(pScreen);
|
||||||
|
WindowPtr pRoot = WindowTable[pScreen->myNum];
|
||||||
|
WindowPtr pWin = NULL;
|
||||||
|
WindowPtr pWinPrev = NULL;
|
||||||
|
win32RootlessWindowPtr pRLWin = NULL;
|
||||||
|
win32RootlessWindowPtr pRLWinPrev = NULL;
|
||||||
|
int nWindow = 0;
|
||||||
|
HDWP hWinPosInfo = NULL;
|
||||||
|
|
||||||
|
#if CYGMULTIWINDOW_DEBUG
|
||||||
|
winDebug ("winMWExtWMRestackWindows\n");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
pScreenPriv->fRestacking = TRUE;
|
||||||
|
|
||||||
|
if (pRoot != NULL)
|
||||||
|
{
|
||||||
|
for (pWin = pRoot->firstChild; pWin; pWin = pWin->nextSib)
|
||||||
|
nWindow ++;
|
||||||
|
|
||||||
|
hWinPosInfo = BeginDeferWindowPos(nWindow);
|
||||||
|
|
||||||
|
for (pWin = pRoot->firstChild; pWin; pWin = pWin->nextSib)
|
||||||
|
{
|
||||||
|
if (pWin->realized)
|
||||||
|
{
|
||||||
|
UINT uFlags;
|
||||||
|
|
||||||
|
pRLWin = (win32RootlessWindowPtr) RootlessFrameForWindow (pWin, FALSE);
|
||||||
|
if (pRLWin == NULL) continue;
|
||||||
|
|
||||||
|
if (pWinPrev)
|
||||||
|
pRLWinPrev = (win32RootlessWindowPtr) RootlessFrameForWindow (pWinPrev, FALSE);
|
||||||
|
|
||||||
|
uFlags = SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW;
|
||||||
|
if (pRLWinPrev != NULL) uFlags |= SWP_NOACTIVATE;
|
||||||
|
|
||||||
|
#if CYGMULTIWINDOW_DEBUG
|
||||||
|
winDebug ("winMWExtWMRestackWindows - DeferWindowPos (%08x, %08x)\n",
|
||||||
|
pRLWin->hWnd,
|
||||||
|
pRLWinPrev ? pRLWinPrev->hWnd : HWND_TOP);
|
||||||
|
#endif
|
||||||
|
hWinPosInfo = DeferWindowPos (hWinPosInfo, pRLWin->hWnd,
|
||||||
|
pRLWinPrev ? pRLWinPrev->hWnd : HWND_TOP,
|
||||||
|
0, 0, 0, 0,
|
||||||
|
uFlags);
|
||||||
|
if (hWinPosInfo == NULL)
|
||||||
|
{
|
||||||
|
ErrorF ("winMWExtWMRestackWindows - DeferWindowPos () failed: %d\n",
|
||||||
|
(int) GetLastError ());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
pWinPrev = pWin;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!EndDeferWindowPos (hWinPosInfo))
|
||||||
|
{
|
||||||
|
ErrorF ("winMWExtWMRestackWindows - EndDeferWindowPos () failed: %d\n",
|
||||||
|
(int) GetLastError ());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#if CYGMULTIWINDOW_DEBUG
|
||||||
|
winDebug ("winMWExtWMRestackWindows - done\n");
|
||||||
|
#endif
|
||||||
|
pScreenPriv->fRestacking = FALSE;
|
||||||
|
}
|
||||||
|
|
|
@ -37,6 +37,9 @@
|
||||||
#include "propertyst.h"
|
#include "propertyst.h"
|
||||||
#include "Xatom.h"
|
#include "Xatom.h"
|
||||||
#include "winmultiwindowclass.h"
|
#include "winmultiwindowclass.h"
|
||||||
|
#if CYGDEBUG
|
||||||
|
#include "winmessages.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -48,7 +51,6 @@
|
||||||
#define RAISE_ON_CLICK_DEFAULT FALSE
|
#define RAISE_ON_CLICK_DEFAULT FALSE
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Global variables
|
* Global variables
|
||||||
*/
|
*/
|
||||||
|
@ -412,7 +414,8 @@ winMWExtWMWindowProc (HWND hwnd, UINT message,
|
||||||
PAINTSTRUCT ps;
|
PAINTSTRUCT ps;
|
||||||
LPWINDOWPOS pWinPos = NULL;
|
LPWINDOWPOS pWinPos = NULL;
|
||||||
RECT rcClient;
|
RECT rcClient;
|
||||||
XID vlist[2];
|
winWMMessageRec wmMsg;
|
||||||
|
Bool fWMMsgInitialized = FALSE;
|
||||||
|
|
||||||
/* Check if the Windows window property for our X window pointer is valid */
|
/* Check if the Windows window property for our X window pointer is valid */
|
||||||
if ((pRLWinPriv = (win32RootlessWindowPtr)GetProp (hwnd, WIN_WINDOW_PROP)) != NULL)
|
if ((pRLWinPriv = (win32RootlessWindowPtr)GetProp (hwnd, WIN_WINDOW_PROP)) != NULL)
|
||||||
|
@ -422,11 +425,35 @@ winMWExtWMWindowProc (HWND hwnd, UINT message,
|
||||||
if (pScreen) pScreenPriv = winGetScreenPriv(pScreen);
|
if (pScreen) pScreenPriv = winGetScreenPriv(pScreen);
|
||||||
if (pScreenPriv) pScreenInfo = pScreenPriv->pScreenInfo;
|
if (pScreenPriv) pScreenInfo = pScreenPriv->pScreenInfo;
|
||||||
if (pScreenPriv) hwndScreen = pScreenPriv->hwndScreen;
|
if (pScreenPriv) hwndScreen = pScreenPriv->hwndScreen;
|
||||||
|
|
||||||
|
wmMsg.msg = 0;
|
||||||
|
wmMsg.hwndWindow = hwnd;
|
||||||
|
wmMsg.iWindow = (Window)pWin->drawable.id;
|
||||||
|
|
||||||
|
wmMsg.iX = pRLWinPriv->pFrame->x;
|
||||||
|
wmMsg.iY = pRLWinPriv->pFrame->y;
|
||||||
|
wmMsg.iWidth = pRLWinPriv->pFrame->width;
|
||||||
|
wmMsg.iHeight = pRLWinPriv->pFrame->height;
|
||||||
|
|
||||||
|
fWMMsgInitialized = TRUE;
|
||||||
#if 0
|
#if 0
|
||||||
winDebug ("hWnd %08X\n", hwnd);
|
if (message >= WM_USER)
|
||||||
winDebug ("pScreenPriv %08X\n", pScreenPriv);
|
{
|
||||||
winDebug ("pScreenInfo %08X\n", pScreenInfo);
|
winDebug("winMWExtWMWindowProc - Message WM_USER + %d",
|
||||||
winDebug ("hwndScreen %08X\n", hwndScreen);
|
message - WM_USER);
|
||||||
|
winDebug(" wParam 0x%x lParam 0x%x\n", wParam, lParam);
|
||||||
|
}
|
||||||
|
else if (message < MESSAGE_NAMES_LEN && MESSAGE_NAMES[message])
|
||||||
|
{
|
||||||
|
winDebug("winMWExtWMWindowProc - Message %s",
|
||||||
|
MESSAGE_NAMES[message]);
|
||||||
|
winDebug(" wParam 0x%x lParam 0x%x\n", wParam, lParam);
|
||||||
|
}
|
||||||
|
|
||||||
|
winDebug ("\thWnd %08X\n", hwnd);
|
||||||
|
winDebug ("\tpScreenPriv %08X\n", pScreenPriv);
|
||||||
|
winDebug ("\tpScreenInfo %08X\n", pScreenInfo);
|
||||||
|
winDebug ("\thwndScreen %08X\n", hwndScreen);
|
||||||
winDebug ("winMWExtWMWindowProc (%08x) %08x %08x %08x\n",
|
winDebug ("winMWExtWMWindowProc (%08x) %08x %08x %08x\n",
|
||||||
pRLWinPriv, message, wParam, lParam);
|
pRLWinPriv, message, wParam, lParam);
|
||||||
#endif
|
#endif
|
||||||
|
@ -455,7 +482,14 @@ winMWExtWMWindowProc (HWND hwnd, UINT message,
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
winWindowsWMSendEvent(WindowsWMControllerNotify,
|
if (winIsInternalWMRunning(pScreenInfo))
|
||||||
|
{
|
||||||
|
/* Tell our Window Manager thread to kill the window */
|
||||||
|
wmMsg.msg = WM_WM_KILL;
|
||||||
|
if (fWMMsgInitialized)
|
||||||
|
winSendMessageToWM (pScreenPriv->pWMInfo, &wmMsg);
|
||||||
|
}
|
||||||
|
winWindowsWMSendEvent(WindowsWMControllerNotify,
|
||||||
WindowsWMControllerNotifyMask,
|
WindowsWMControllerNotifyMask,
|
||||||
1,
|
1,
|
||||||
WindowsWMCloseWindow,
|
WindowsWMCloseWindow,
|
||||||
|
@ -677,9 +711,9 @@ winMWExtWMWindowProc (HWND hwnd, UINT message,
|
||||||
#if CYGMULTIWINDOW_DEBUG
|
#if CYGMULTIWINDOW_DEBUG
|
||||||
winDebug ("winMWExtWMWindowProc - WM_MOUSEACTIVATE\n");
|
winDebug ("winMWExtWMWindowProc - WM_MOUSEACTIVATE\n");
|
||||||
#endif
|
#endif
|
||||||
#if 0
|
#if 1
|
||||||
/* Check if this window needs to be made active when clicked */
|
/* Check if this window needs to be made active when clicked */
|
||||||
if (pWin->overrideRedirect)
|
if (winIsInternalWMRunning(pScreenInfo) && pWin->overrideRedirect)
|
||||||
{
|
{
|
||||||
#if CYGMULTIWINDOW_DEBUG
|
#if CYGMULTIWINDOW_DEBUG
|
||||||
winDebug ("winMWExtWMWindowProc - WM_MOUSEACTIVATE - "
|
winDebug ("winMWExtWMWindowProc - WM_MOUSEACTIVATE - "
|
||||||
|
@ -690,10 +724,11 @@ winMWExtWMWindowProc (HWND hwnd, UINT message,
|
||||||
return MA_NOACTIVATE;
|
return MA_NOACTIVATE;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (!IsMouseActive (pWin)) return MA_NOACTIVATE;
|
if (!winIsInternalWMRunning(pScreenInfo) && !IsMouseActive (pWin))
|
||||||
|
return MA_NOACTIVATE;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_KILLFOCUS:
|
case WM_KILLFOCUS:
|
||||||
/* Pop any pressed keys since we are losing keyboard focus */
|
/* Pop any pressed keys since we are losing keyboard focus */
|
||||||
winKeybdReleaseKeys ();
|
winKeybdReleaseKeys ();
|
||||||
|
@ -795,6 +830,20 @@ winMWExtWMWindowProc (HWND hwnd, UINT message,
|
||||||
#endif
|
#endif
|
||||||
if (LOWORD(wParam) != WA_INACTIVE)
|
if (LOWORD(wParam) != WA_INACTIVE)
|
||||||
{
|
{
|
||||||
|
if (winIsInternalWMRunning(pScreenInfo))
|
||||||
|
{
|
||||||
|
#if 0
|
||||||
|
/* Raise the window to the top in Z order */
|
||||||
|
wmMsg.msg = WM_WM_RAISE;
|
||||||
|
if (fWMMsgInitialized)
|
||||||
|
winSendMessageToWM (pScreenPriv->pWMInfo, &wmMsg);
|
||||||
|
#endif
|
||||||
|
/* Tell our Window Manager thread to activate the window */
|
||||||
|
wmMsg.msg = WM_WM_ACTIVATE;
|
||||||
|
if (fWMMsgInitialized)
|
||||||
|
if (!pWin || !pWin->overrideRedirect) /* for OOo menus */
|
||||||
|
winSendMessageToWM (pScreenPriv->pWMInfo, &wmMsg);
|
||||||
|
}
|
||||||
winWindowsWMSendEvent(WindowsWMControllerNotify,
|
winWindowsWMSendEvent(WindowsWMControllerNotify,
|
||||||
WindowsWMControllerNotifyMask,
|
WindowsWMControllerNotifyMask,
|
||||||
1,
|
1,
|
||||||
|
@ -804,13 +853,13 @@ winMWExtWMWindowProc (HWND hwnd, UINT message,
|
||||||
0, 0);
|
0, 0);
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
#if 1
|
#if 1
|
||||||
case WM_WINDOWPOSCHANGING:
|
case WM_WINDOWPOSCHANGING:
|
||||||
pWinPos = (LPWINDOWPOS)lParam;
|
pWinPos = (LPWINDOWPOS)lParam;
|
||||||
if (!(pWinPos->flags & SWP_NOZORDER))
|
if (!(pWinPos->flags & SWP_NOZORDER))
|
||||||
{
|
{
|
||||||
if (pRLWinPriv->fRestackingNow)
|
if (pRLWinPriv->fRestackingNow || pScreenPriv->fRestacking)
|
||||||
{
|
{
|
||||||
#if CYGMULTIWINDOW_DEBUG
|
#if CYGMULTIWINDOW_DEBUG
|
||||||
winDebug ("Win %08x is now restacking.\n", (unsigned int)pRLWinPriv);
|
winDebug ("Win %08x is now restacking.\n", (unsigned int)pRLWinPriv);
|
||||||
|
@ -818,7 +867,7 @@ winMWExtWMWindowProc (HWND hwnd, UINT message,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsRaiseOnClick (pWin))
|
if (winIsInternalWMRunning(pScreenInfo) || IsRaiseOnClick (pWin))
|
||||||
{
|
{
|
||||||
#if CYGMULTIWINDOW_DEBUG
|
#if CYGMULTIWINDOW_DEBUG
|
||||||
winDebug ("Win %08x has WINDOWSWM_RAISE_ON_CLICK.\n", (unsigned int)pRLWinPriv);
|
winDebug ("Win %08x has WINDOWSWM_RAISE_ON_CLICK.\n", (unsigned int)pRLWinPriv);
|
||||||
|
@ -867,19 +916,52 @@ winMWExtWMWindowProc (HWND hwnd, UINT message,
|
||||||
#endif
|
#endif
|
||||||
if (!pRLWinPriv->fMovingOrSizing)
|
if (!pRLWinPriv->fMovingOrSizing)
|
||||||
{
|
{
|
||||||
|
if (winIsInternalWMRunning(pScreenInfo))
|
||||||
|
winAdjustXWindow (pWin, hwnd);
|
||||||
|
|
||||||
winMWExtWMMoveXWindow (pWin,
|
winMWExtWMMoveXWindow (pWin,
|
||||||
(LOWORD(lParam) - wBorderWidth (pWin)
|
(LOWORD(lParam) - wBorderWidth (pWin)
|
||||||
- GetSystemMetrics (SM_XVIRTUALSCREEN)),
|
- GetSystemMetrics (SM_XVIRTUALSCREEN)),
|
||||||
(HIWORD(lParam) - wBorderWidth (pWin)
|
(HIWORD(lParam) - wBorderWidth (pWin)
|
||||||
- GetSystemMetrics (SM_YVIRTUALSCREEN)));
|
- GetSystemMetrics (SM_YVIRTUALSCREEN)));
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case WM_SHOWWINDOW:
|
case WM_SHOWWINDOW:
|
||||||
#if CYGMULTIWINDOW_DEBUG
|
#if CYGMULTIWINDOW_DEBUG || TRUE
|
||||||
winDebug ("winMWExtWMWindowProc - WM_SHOWWINDOW - %d ms\n",
|
winDebug ("winMWExtWMWindowProc - WM_SHOWWINDOW - %d ms\n",
|
||||||
(unsigned int)GetTickCount ());
|
(unsigned int)GetTickCount ());
|
||||||
#endif
|
#endif
|
||||||
|
/* Bail out if the window is being hidden */
|
||||||
|
if (!wParam)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if (!pScreenInfo->fInternalWM)//XXXX
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
winMWExtWMUpdateWindowDecoration (pRLWinPriv, pScreenInfo);
|
||||||
|
|
||||||
|
if (winIsInternalWMRunning(pScreenInfo))
|
||||||
|
{
|
||||||
|
#if CYGMULTIWINDOW_DEBUG || TRUE
|
||||||
|
winDebug ("\tMapWindow\n");
|
||||||
|
#endif
|
||||||
|
/* Tell X to map the window */
|
||||||
|
MapWindow (pWin, wClient(pWin));
|
||||||
|
|
||||||
|
if (!pRLWinPriv->pFrame->win->overrideRedirect)
|
||||||
|
/* Bring the Windows window to the foreground */
|
||||||
|
SetForegroundWindow (hwnd);
|
||||||
|
|
||||||
|
/* Setup the Window Manager message */
|
||||||
|
wmMsg.msg = WM_WM_MAP;
|
||||||
|
wmMsg.iWidth = pRLWinPriv->pFrame->width;
|
||||||
|
wmMsg.iHeight = pRLWinPriv->pFrame->height;
|
||||||
|
|
||||||
|
/* Tell our Window Manager thread to map the window */
|
||||||
|
if (fWMMsgInitialized)
|
||||||
|
winSendMessageToWM (pScreenPriv->pWMInfo, &wmMsg);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_SIZING:
|
case WM_SIZING:
|
||||||
|
@ -914,15 +996,23 @@ winMWExtWMWindowProc (HWND hwnd, UINT message,
|
||||||
/* Reorder if window z order was changed */
|
/* Reorder if window z order was changed */
|
||||||
if ((pScreenPriv != NULL)
|
if ((pScreenPriv != NULL)
|
||||||
&& !(pWinPos->flags & SWP_NOZORDER)
|
&& !(pWinPos->flags & SWP_NOZORDER)
|
||||||
&& !(pWinPos->flags & SWP_SHOWWINDOW))
|
&& !(pWinPos->flags & SWP_SHOWWINDOW)
|
||||||
|
&& winIsInternalWMRunning(pScreenInfo))
|
||||||
{
|
{
|
||||||
|
#if CYGMULTIWINDOW_DEBUG
|
||||||
|
winDebug ("\twindow z order was changed\n");
|
||||||
|
#endif
|
||||||
if (pWinPos->hwndInsertAfter == HWND_TOP
|
if (pWinPos->hwndInsertAfter == HWND_TOP
|
||||||
||pWinPos->hwndInsertAfter == HWND_TOPMOST
|
||pWinPos->hwndInsertAfter == HWND_TOPMOST
|
||||||
||pWinPos->hwndInsertAfter == HWND_NOTOPMOST)
|
||pWinPos->hwndInsertAfter == HWND_NOTOPMOST)
|
||||||
{
|
{
|
||||||
vlist[0] = Above;
|
#if CYGMULTIWINDOW_DEBUG
|
||||||
ConfigureWindow (pWin, CWStackMode,
|
winDebug ("\traise to top\n");
|
||||||
vlist, wClient(pWin));
|
#endif
|
||||||
|
/* Raise the window to the top in Z order */
|
||||||
|
wmMsg.msg = WM_WM_RAISE;
|
||||||
|
if (fWMMsgInitialized)
|
||||||
|
winSendMessageToWM (pScreenPriv->pWMInfo, &wmMsg);
|
||||||
}
|
}
|
||||||
#if 1
|
#if 1
|
||||||
else if (pWinPos->hwndInsertAfter == HWND_BOTTOM)
|
else if (pWinPos->hwndInsertAfter == HWND_BOTTOM)
|
||||||
|
@ -943,7 +1033,8 @@ winMWExtWMWindowProc (HWND hwnd, UINT message,
|
||||||
GetWindowThreadProcessId (hWndAbove, &dwWindowProcessID);
|
GetWindowThreadProcessId (hWndAbove, &dwWindowProcessID);
|
||||||
|
|
||||||
if ((dwWindowProcessID == dwCurrentProcessID)
|
if ((dwWindowProcessID == dwCurrentProcessID)
|
||||||
&& GetProp (Above, WIN_WINDOW_PROP)
|
&& GetProp (hWndAbove, WIN_WINDOW_PROP)
|
||||||
|
&& !IsWindowVisible (hWndAbove)
|
||||||
&& !IsIconic (hWndAbove) ) /* ignore minimized windows */
|
&& !IsIconic (hWndAbove) ) /* ignore minimized windows */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -951,9 +1042,13 @@ winMWExtWMWindowProc (HWND hwnd, UINT message,
|
||||||
raise it in X stack. */
|
raise it in X stack. */
|
||||||
if (hWndAbove == NULL)
|
if (hWndAbove == NULL)
|
||||||
{
|
{
|
||||||
vlist[0] = Above;
|
#if CYGMULTIWINDOW_DEBUG
|
||||||
ConfigureWindow (pWin, CWStackMode,
|
winDebug ("\traise to top\n");
|
||||||
vlist, wClient(pWin));
|
#endif
|
||||||
|
/* Raise the window to the top in Z order */
|
||||||
|
wmMsg.msg = WM_WM_RAISE;
|
||||||
|
if (fWMMsgInitialized)
|
||||||
|
winSendMessageToWM (pScreenPriv->pWMInfo, &wmMsg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -964,6 +1059,13 @@ winMWExtWMWindowProc (HWND hwnd, UINT message,
|
||||||
#if CYGMULTIWINDOW_DEBUG
|
#if CYGMULTIWINDOW_DEBUG
|
||||||
winDebug ("\tIconic -> MINIMIZED\n");
|
winDebug ("\tIconic -> MINIMIZED\n");
|
||||||
#endif
|
#endif
|
||||||
|
if (winIsInternalWMRunning(pScreenInfo))
|
||||||
|
{
|
||||||
|
/* Raise the window to the top in Z order */
|
||||||
|
wmMsg.msg = WM_WM_LOWER;
|
||||||
|
if (fWMMsgInitialized)
|
||||||
|
winSendMessageToWM (pScreenPriv->pWMInfo, &wmMsg);
|
||||||
|
}
|
||||||
winWindowsWMSendEvent(WindowsWMControllerNotify,
|
winWindowsWMSendEvent(WindowsWMControllerNotify,
|
||||||
WindowsWMControllerNotifyMask,
|
WindowsWMControllerNotifyMask,
|
||||||
1,
|
1,
|
||||||
|
@ -1004,33 +1106,42 @@ winMWExtWMWindowProc (HWND hwnd, UINT message,
|
||||||
#if CYGMULTIWINDOW_DEBUG
|
#if CYGMULTIWINDOW_DEBUG
|
||||||
winDebug ("\tmove & resize\n");
|
winDebug ("\tmove & resize\n");
|
||||||
#endif
|
#endif
|
||||||
|
if (winIsInternalWMRunning(pScreenInfo))
|
||||||
|
winAdjustXWindow (pWin, hwnd);
|
||||||
|
|
||||||
winMWExtWMMoveResizeXWindow (pWin,
|
winMWExtWMMoveResizeXWindow (pWin,
|
||||||
rcClient.left - wBorderWidth (pWin)
|
rcClient.left - wBorderWidth (pWin)
|
||||||
- GetSystemMetrics (SM_XVIRTUALSCREEN),
|
- GetSystemMetrics (SM_XVIRTUALSCREEN),
|
||||||
rcClient.top - wBorderWidth (pWin)
|
rcClient.top - wBorderWidth (pWin)
|
||||||
- GetSystemMetrics (SM_YVIRTUALSCREEN),
|
- GetSystemMetrics (SM_YVIRTUALSCREEN),
|
||||||
rcClient.right - rcClient.left
|
rcClient.right - rcClient.left
|
||||||
- wBorderWidth (pWin)*2,
|
- wBorderWidth (pWin)*2,
|
||||||
rcClient.bottom - rcClient.top
|
rcClient.bottom - rcClient.top
|
||||||
- wBorderWidth (pWin)*2);
|
- wBorderWidth (pWin)*2);
|
||||||
} else if (!(pWinPos->flags & SWP_NOMOVE)) {
|
} else if (!(pWinPos->flags & SWP_NOMOVE)) {
|
||||||
#if CYGMULTIWINDOW_DEBUG
|
#if CYGMULTIWINDOW_DEBUG
|
||||||
winDebug ("\tmove\n");
|
winDebug ("\tmove\n");
|
||||||
#endif
|
#endif
|
||||||
|
if (winIsInternalWMRunning(pScreenInfo))
|
||||||
|
winAdjustXWindow (pWin, hwnd);
|
||||||
|
|
||||||
winMWExtWMMoveXWindow (pWin,
|
winMWExtWMMoveXWindow (pWin,
|
||||||
rcClient.left - wBorderWidth (pWin)
|
rcClient.left - wBorderWidth (pWin)
|
||||||
- GetSystemMetrics (SM_XVIRTUALSCREEN),
|
- GetSystemMetrics (SM_XVIRTUALSCREEN),
|
||||||
rcClient.top - wBorderWidth (pWin)
|
rcClient.top - wBorderWidth (pWin)
|
||||||
- GetSystemMetrics (SM_YVIRTUALSCREEN));
|
- GetSystemMetrics (SM_YVIRTUALSCREEN));
|
||||||
} else if (!(pWinPos->flags & SWP_NOSIZE)) {
|
} else if (!(pWinPos->flags & SWP_NOSIZE)) {
|
||||||
#if CYGMULTIWINDOW_DEBUG
|
#if CYGMULTIWINDOW_DEBUG
|
||||||
winDebug ("\tresize\n");
|
winDebug ("\tresize\n");
|
||||||
#endif
|
#endif
|
||||||
|
if (winIsInternalWMRunning(pScreenInfo))
|
||||||
|
winAdjustXWindow (pWin, hwnd);
|
||||||
|
|
||||||
winMWExtWMResizeXWindow (pWin,
|
winMWExtWMResizeXWindow (pWin,
|
||||||
rcClient.right - rcClient.left
|
rcClient.right - rcClient.left
|
||||||
- wBorderWidth (pWin)*2,
|
- wBorderWidth (pWin)*2,
|
||||||
rcClient.bottom - rcClient.top
|
rcClient.bottom - rcClient.top
|
||||||
- wBorderWidth (pWin)*2);
|
- wBorderWidth (pWin)*2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1059,6 +1170,13 @@ winMWExtWMWindowProc (HWND hwnd, UINT message,
|
||||||
#if CYGMULTIWINDOW_DEBUG
|
#if CYGMULTIWINDOW_DEBUG
|
||||||
winDebug ("\tSIZE_MINIMIZED\n");
|
winDebug ("\tSIZE_MINIMIZED\n");
|
||||||
#endif
|
#endif
|
||||||
|
if (winIsInternalWMRunning(pScreenInfo))
|
||||||
|
{
|
||||||
|
/* Raise the window to the top in Z order */
|
||||||
|
wmMsg.msg = WM_WM_LOWER;
|
||||||
|
if (fWMMsgInitialized)
|
||||||
|
winSendMessageToWM (pScreenPriv->pWMInfo, &wmMsg);
|
||||||
|
}
|
||||||
winWindowsWMSendEvent(WindowsWMControllerNotify,
|
winWindowsWMSendEvent(WindowsWMControllerNotify,
|
||||||
WindowsWMControllerNotifyMask,
|
WindowsWMControllerNotifyMask,
|
||||||
1,
|
1,
|
||||||
|
@ -1098,17 +1216,30 @@ winMWExtWMWindowProc (HWND hwnd, UINT message,
|
||||||
/* Perform the resize and notify the X client */
|
/* Perform the resize and notify the X client */
|
||||||
if (!pRLWinPriv->fMovingOrSizing)
|
if (!pRLWinPriv->fMovingOrSizing)
|
||||||
{
|
{
|
||||||
|
if (winIsInternalWMRunning(pScreenInfo))
|
||||||
|
winAdjustXWindow (pWin, hwnd);
|
||||||
|
|
||||||
winMWExtWMResizeXWindow (pWin,
|
winMWExtWMResizeXWindow (pWin,
|
||||||
(short) LOWORD(lParam)
|
(short) LOWORD(lParam)
|
||||||
- wBorderWidth (pWin)*2,
|
- wBorderWidth (pWin)*2,
|
||||||
(short) HIWORD(lParam)
|
(short) HIWORD(lParam)
|
||||||
- wBorderWidth (pWin)*2);
|
- wBorderWidth (pWin)*2);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_ACTIVATEAPP:
|
case WM_ACTIVATEAPP:
|
||||||
|
#if CYGMULTIWINDOW_DEBUG
|
||||||
|
winDebug ("winMWExtWMWindowProc - WM_ACTIVATEAPP - %d ms\n",
|
||||||
|
(unsigned int)GetTickCount ());
|
||||||
|
#endif
|
||||||
if (wParam)
|
if (wParam)
|
||||||
{
|
{
|
||||||
|
if (winIsInternalWMRunning(pScreenInfo))
|
||||||
|
{
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
}
|
||||||
winWindowsWMSendEvent(WindowsWMActivationNotify,
|
winWindowsWMSendEvent(WindowsWMActivationNotify,
|
||||||
WindowsWMActivationNotifyMask,
|
WindowsWMActivationNotifyMask,
|
||||||
1,
|
1,
|
||||||
|
@ -1155,15 +1286,27 @@ winMWExtWMWindowProc (HWND hwnd, UINT message,
|
||||||
GetClientRect (hwnd, &rcClient);
|
GetClientRect (hwnd, &rcClient);
|
||||||
|
|
||||||
MapWindowPoints (hwnd, HWND_DESKTOP, (LPPOINT)&rcClient, 2);
|
MapWindowPoints (hwnd, HWND_DESKTOP, (LPPOINT)&rcClient, 2);
|
||||||
|
|
||||||
|
if (winIsInternalWMRunning(pScreenInfo))
|
||||||
|
winAdjustXWindow (pWin, hwnd);
|
||||||
|
|
||||||
winMWExtWMMoveResizeXWindow (pWin,
|
winMWExtWMMoveResizeXWindow (pWin,
|
||||||
rcClient.left - wBorderWidth (pWin)
|
rcClient.left - wBorderWidth (pWin)
|
||||||
- GetSystemMetrics (SM_XVIRTUALSCREEN),
|
- GetSystemMetrics (SM_XVIRTUALSCREEN),
|
||||||
rcClient.top - wBorderWidth (pWin)
|
rcClient.top - wBorderWidth (pWin)
|
||||||
- GetSystemMetrics (SM_YVIRTUALSCREEN),
|
- GetSystemMetrics (SM_YVIRTUALSCREEN),
|
||||||
rcClient.right - rcClient.left
|
rcClient.right - rcClient.left
|
||||||
- wBorderWidth (pWin)*2,
|
- wBorderWidth (pWin)*2,
|
||||||
rcClient.bottom - rcClient.top
|
rcClient.bottom - rcClient.top
|
||||||
- wBorderWidth (pWin)*2);
|
- wBorderWidth (pWin)*2);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case WM_MANAGE:
|
||||||
|
ErrorF ("winMWExtWMWindowProc - WM_MANAGE\n");
|
||||||
|
break;
|
||||||
|
|
||||||
|
case WM_UNMANAGE:
|
||||||
|
ErrorF ("winMWExtWMWindowProc - WM_UNMANAGE\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -49,7 +49,6 @@
|
||||||
#define WIN_MSG_QUEUE_FNAME "/dev/windows"
|
#define WIN_MSG_QUEUE_FNAME "/dev/windows"
|
||||||
#define WIN_WID_PROP "cyg_wid_prop_rl"
|
#define WIN_WID_PROP "cyg_wid_prop_rl"
|
||||||
#define WIN_NEEDMANAGE_PROP "cyg_override_redirect_prop_rl"
|
#define WIN_NEEDMANAGE_PROP "cyg_override_redirect_prop_rl"
|
||||||
#define WIN_HWND_CACHE "cyg_privmap_rl"
|
|
||||||
#ifndef CYGMULTIWINDOW_DEBUG
|
#ifndef CYGMULTIWINDOW_DEBUG
|
||||||
#define CYGMULTIWINDOW_DEBUG NO
|
#define CYGMULTIWINDOW_DEBUG NO
|
||||||
#endif
|
#endif
|
||||||
|
@ -105,9 +104,11 @@ typedef struct _winWMMessageRec{
|
||||||
#define WM_WM_UNMAP (WM_USER + 6)
|
#define WM_WM_UNMAP (WM_USER + 6)
|
||||||
#define WM_WM_KILL (WM_USER + 7)
|
#define WM_WM_KILL (WM_USER + 7)
|
||||||
#define WM_WM_ACTIVATE (WM_USER + 8)
|
#define WM_WM_ACTIVATE (WM_USER + 8)
|
||||||
#define WM_WM_NAME_EVENT (WM_USER + 9)
|
#define WM_WM_NAME_EVENT (WM_USER + 9)
|
||||||
#define WM_WM_HINTS_EVENT (WM_USER + 10)
|
#define WM_WM_HINTS_EVENT (WM_USER + 10)
|
||||||
#define WM_WM_CHANGE_STATE (WM_USER + 11)
|
#define WM_WM_CHANGE_STATE (WM_USER + 11)
|
||||||
|
#define WM_MANAGE (WM_USER + 100)
|
||||||
|
#define WM_UNMANAGE (WM_USER + 102)
|
||||||
|
|
||||||
void
|
void
|
||||||
winSendMessageToWM (void *pWMInfo, winWMMessagePtr msg);
|
winSendMessageToWM (void *pWMInfo, winWMMessagePtr msg);
|
||||||
|
@ -117,7 +118,8 @@ winInitWM (void **ppWMInfo,
|
||||||
pthread_t *ptWMProc,
|
pthread_t *ptWMProc,
|
||||||
pthread_t *ptXMsgProc,
|
pthread_t *ptXMsgProc,
|
||||||
pthread_mutex_t *ppmServerStarted,
|
pthread_mutex_t *ppmServerStarted,
|
||||||
int dwScreen);
|
int dwScreen,
|
||||||
|
HWND hwndScreen);
|
||||||
|
|
||||||
void
|
void
|
||||||
winDeinitMultiWindowWM (void);
|
winDeinitMultiWindowWM (void);
|
||||||
|
|
|
@ -56,7 +56,8 @@ extern Bool g_fClipboard;
|
||||||
extern HWND g_hDlgDepthChange;
|
extern HWND g_hDlgDepthChange;
|
||||||
extern Bool g_fKeyboardHookLL;
|
extern Bool g_fKeyboardHookLL;
|
||||||
extern HWND g_hwndKeyboardFocus;
|
extern HWND g_hwndKeyboardFocus;
|
||||||
extern Bool g_fSoftwareCursor;
|
extern Bool g_fSoftwareCursor;
|
||||||
|
extern DWORD g_dwCurrentThreadID;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Called by winWakeupHandler
|
* Called by winWakeupHandler
|
||||||
|
@ -1131,7 +1132,7 @@ winWindowProc (HWND hwnd, UINT message,
|
||||||
|| s_pScreenInfo->fIgnoreInput)
|
|| s_pScreenInfo->fIgnoreInput)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
#if CYGDEBUG
|
#if CYGDEBUG || TRUE
|
||||||
winDebug ("winWindowProc - WM_ACTIVATEAPP\n");
|
winDebug ("winWindowProc - WM_ACTIVATEAPP\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1152,6 +1153,14 @@ winWindowProc (HWND hwnd, UINT message,
|
||||||
|
|
||||||
/* Call engine specific screen activation/deactivation function */
|
/* Call engine specific screen activation/deactivation function */
|
||||||
(*s_pScreenPriv->pwinActivateApp) (s_pScreen);
|
(*s_pScreenPriv->pwinActivateApp) (s_pScreen);
|
||||||
|
|
||||||
|
if (s_pScreenPriv->fActive)
|
||||||
|
{
|
||||||
|
/* Restack all window unless using built-in wm. */
|
||||||
|
if (s_pScreenInfo->fInternalWM && s_pScreenInfo->fAnotherWMRunning)
|
||||||
|
winMWExtWMRestackWindows (s_pScreen);
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case WM_COMMAND:
|
case WM_COMMAND:
|
||||||
|
@ -1161,9 +1170,9 @@ winWindowProc (HWND hwnd, UINT message,
|
||||||
/* Display Exit dialog */
|
/* Display Exit dialog */
|
||||||
winDisplayExitDialog (s_pScreenPriv);
|
winDisplayExitDialog (s_pScreenPriv);
|
||||||
return 0;
|
return 0;
|
||||||
case ID_APP_SHOWCURSOR:
|
case ID_APP_SHOWCURSOR:
|
||||||
winDebug("ShowCursor: %d\n", ShowCursor(TRUE));
|
winDebug("ShowCursor: %d\n", ShowCursor(TRUE));
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
#ifdef XWIN_MULTIWINDOW
|
#ifdef XWIN_MULTIWINDOW
|
||||||
case ID_APP_HIDE_ROOT:
|
case ID_APP_HIDE_ROOT:
|
||||||
|
@ -1210,6 +1219,28 @@ winWindowProc (HWND hwnd, UINT message,
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case WM_MANAGE:
|
||||||
|
ErrorF ("winWindowProc - WM_MANAGE\n");
|
||||||
|
s_pScreenInfo->fAnotherWMRunning = FALSE;
|
||||||
|
|
||||||
|
if (s_pScreenInfo->fInternalWM)
|
||||||
|
{
|
||||||
|
EnumThreadWindows (g_dwCurrentThreadID, winMWExtWMDecorateWindow, 0);
|
||||||
|
//RootlessRepositionWindows (s_pScreen);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case WM_UNMANAGE:
|
||||||
|
ErrorF ("winWindowProc - WM_UNMANAGE\n");
|
||||||
|
s_pScreenInfo->fAnotherWMRunning = TRUE;
|
||||||
|
|
||||||
|
if (s_pScreenInfo->fInternalWM)
|
||||||
|
{
|
||||||
|
EnumThreadWindows (g_dwCurrentThreadID, winMWExtWMDecorateWindow, 0);
|
||||||
|
winMWExtWMRestackWindows (s_pScreen);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
if(message == s_uTaskbarRestart)
|
if(message == s_uTaskbarRestart)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user