hw/xwin: Remove mwextwm mode

This has always been described as 'experimental'

We don't think this has any users: This mode has been disabled in Cygwin
packages since March 2016. We've never provided the xwinwm WM for x86_64
Cygwin. No one has even asked where the option has gone.

This leaves XQuartz as the only user of the rootless extension.

Remove --enable-windowswm configure option
Remove multiwindowextwm stuff from Makefiles
Remove -mwextwm option
Remove -mwextwm from man-page and help
Un-ifdef XWIN_MULTIWINDOWEXTWM

v2:
Remove rootless include paths
Remove windowswmproto from meson.build
This commit is contained in:
Jon Turney 2016-10-13 14:20:14 +01:00
parent 504468d2cf
commit a2302de6fe
21 changed files with 19 additions and 3454 deletions

View File

@ -572,7 +572,6 @@ AC_ARG_ENABLE(xfree86-utils, AS_HELP_STRING([--enable-xfree86-utils], [Build
AC_ARG_ENABLE(vgahw, AS_HELP_STRING([--enable-vgahw], [Build Xorg with vga access (default: enabled)]), [VGAHW=$enableval], [VGAHW=yes])
AC_ARG_ENABLE(vbe, AS_HELP_STRING([--enable-vbe], [Build Xorg with VBE module (default: enabled)]), [VBE=$enableval], [VBE=yes])
AC_ARG_ENABLE(int10-module, AS_HELP_STRING([--enable-int10-module], [Build Xorg with int10 module (default: enabled)]), [INT10MODULE=$enableval], [INT10MODULE=yes])
AC_ARG_ENABLE(windowswm, AS_HELP_STRING([--enable-windowswm], [Build XWin with WindowsWM extension (default: no)]), [WINDOWSWM=$enableval], [WINDOWSWM=no])
AC_ARG_ENABLE(windowsdri, AS_HELP_STRING([--enable-windowsdri], [Build XWin with WindowsDRI extension (default: auto)]), [WINDOWSDRI=$enableval], [WINDOWSDRI=auto])
AC_ARG_ENABLE(libdrm, AS_HELP_STRING([--enable-libdrm], [Build Xorg with libdrm support (default: enabled)]), [DRM=$enableval],[DRM=yes])
AC_ARG_ENABLE(clientids, AS_HELP_STRING([--disable-clientids], [Build Xorg with client ID tracking (default: enabled)]), [CLIENTIDS=$enableval], [CLIENTIDS=yes])
@ -738,7 +737,6 @@ DGAPROTO="xf86dgaproto >= 2.0.99.1"
GLPROTO="glproto >= 1.4.17"
DMXPROTO="dmxproto >= 2.2.99.1"
VIDMODEPROTO="xf86vidmodeproto >= 2.2.99.1"
WINDOWSWMPROTO="windowswmproto"
APPLEWMPROTO="applewmproto >= 1.4"
LIBXSHMFENCE="xshmfence >= 1.1"
@ -2079,15 +2077,6 @@ if test "x$XWIN" = xyes; then
PKG_CHECK_MODULES([XWINMODULES],[x11 xdmcp xau xfixes x11-xcb xcb-aux xcb-image xcb-ewmh xcb-icccm])
if test "x$WINDOWSWM" = xauto; then
PKG_CHECK_EXISTS($WINDOWSWMPROTO, [WINDOWSWM=yes], [WINDOWSWM=no])
fi
if test "x$WINDOWSWM" = xyes ; then
PKG_CHECK_MODULES(WINDOWSWM, $WINDOWSWMPROTO)
XWINMODULES_CFLAGS="$XWINMODULES_CFLAGS $WINDOWSWM_CFLAGS"
AC_DEFINE(ROOTLESS,1,[Build Rootless code])
fi
if test "x$WINDOWSDRI" = xauto; then
PKG_CHECK_EXISTS([windowsdriproto], [WINDOWSDRI=yes], [WINDOWSDRI=no])
fi
@ -2144,7 +2133,6 @@ dnl XWin requires OpenGL spec files in order to generate wrapper code for native
fi
AM_CONDITIONAL(XWIN, [test "x$XWIN" = xyes])
AM_CONDITIONAL(XWIN_MULTIWINDOWEXTWM, [test "x$XWIN" = xyes && test "x$WINDOWSWM" = xyes])
AM_CONDITIONAL(XWIN_GLX_WINDOWS, [test "x$XWIN" = xyes && test "x$GLX" = xyes])
AM_CONDITIONAL(XWIN_WINDOWS_DRI, [test "x$XWIN" = xyes && test "x$WINDOWSDRI" = xyes])

View File

@ -783,11 +783,6 @@ winUseMsg(void)
ErrorF("-multiwindow\n" "\tRun the server in multi-window mode.\n");
#ifdef XWIN_MULTIWINDOWEXTWM
ErrorF("-mwextwm\n"
"\tRun the server in multi-window external window manager mode.\n");
#endif
ErrorF("-nodecoration\n"
"\tDo not draw a window border, title bar, etc. Windowed\n"
"\tmode only.\n");

View File

@ -29,17 +29,6 @@ SRCS_MULTIWINDOW = \
winSetAppUserModelID.c
MULTIWINDOW_SYS_LIBS = -lshlwapi -lole32
if XWIN_MULTIWINDOWEXTWM
SRCS_MULTIWINDOWEXTWM = \
winwin32rootless.c \
winwin32rootlesswindow.c \
winwin32rootlesswndproc.c \
winwindowswm.c
DEFS_MULTIWINDOWEXTWM = -DXWIN_MULTIWINDOWEXTWM
MULTIWINDOWEXTWM_LIBS = $(top_builddir)/miext/rootless/librootless.la
MULTIWINDOWEXTWM_CFLAGS = -I$(top_srcdir)/miext/rootless
endif
SRCS_RANDR = \
winrandr.c
@ -101,7 +90,6 @@ SRCS = InitInput.c \
$(top_srcdir)/mi/miinitext.c \
$(SRCS_CLIPBOARD) \
$(SRCS_MULTIWINDOW) \
$(SRCS_MULTIWINDOWEXTWM) \
$(SRCS_RANDR)
DEFS = \
@ -117,7 +105,6 @@ XWIN_LIBS += \
$(top_builddir)/Xi/libXistubs.la
XWin_DEPENDENCIES = \
$(MULTIWINDOWEXTWM_LIBS) \
$(XWIN_GLX_LIBS) \
$(XWIN_LIBS) \
$(CLIPBOARD_LIBS) \
@ -125,7 +112,6 @@ XWin_DEPENDENCIES = \
XWin_LDADD = \
$(MULTIWINDOWEXTWM_LIBS) \
$(XWIN_GLX_LIBS) \
$(XWIN_LIBS) \
$(CLIPBOARD_LIBS) \
@ -154,7 +140,6 @@ AM_LFLAGS = -i
AM_CFLAGS = -DHAVE_XWIN_CONFIG_H $(DIX_CFLAGS) \
$(XWINMODULES_CFLAGS) \
-I$(top_srcdir) \
$(MULTIWINDOWEXTWM_CFLAGS) \
-Wno-bad-function-cast
xwinconfigdir = $(sysconfdir)/X11

View File

@ -20,20 +20,13 @@ endif
libnativeGLthunk_la_SOURCES = \
glthunk.c
if XWIN_MULTIWINDOWEXTWM
DEFS_MULTIWINDOWEXTWM = -DXWIN_MULTIWINDOWEXTWM
endif
if XWIN_GLX_WINDOWS
DEFS_GLX_WINDOWS = -DXWIN_GLX_WINDOWS
endif
DEFS = \
$(DEFS_MULTIWINDOWEXTWM) \
$(DEFS_GLX_WINDOWS)
AM_CPPFLAGS = -I$(top_srcdir)/miext/rootless
AM_CFLAGS = -DHAVE_XWIN_CONFIG_H $(DIX_CFLAGS) \
$(XWINMODULES_CFLAGS) \
-I$(top_srcdir) \

View File

@ -63,24 +63,6 @@ winGetWindowInfo(WindowPtr pWin)
return hwnd;
}
#ifdef XWIN_MULTIWINDOWEXTWM
/* check for multiwindow external wm mode */
if (pScreenInfo->fMWExtWM) {
win32RootlessWindowPtr pRLWinPriv
= (win32RootlessWindowPtr) RootlessFrameForWindow(pWin, FALSE);
if (pRLWinPriv == NULL) {
ErrorF("winGetWindowInfo: window has no privates\n");
return hwnd;
}
if (pRLWinPriv->hWnd != NULL) {
/* copy window handle */
hwnd = pRLWinPriv->hWnd;
}
return hwnd;
}
#endif
}
else {
ScreenPtr pScreen = g_ScreenInfo[0].pScreen;
@ -108,11 +90,6 @@ winCheckScreenAiglxIsSupported(ScreenPtr pScreen)
if (pScreenInfo->fMultiWindow)
return TRUE;
#ifdef XWIN_MULTIWINDOWEXTWM
if (pScreenInfo->fMWExtWM)
return TRUE;
#endif
return FALSE;
}

View File

@ -51,11 +51,6 @@ Also start the integrated \fIWindows\fP-based window manager.
Run the server in rootless mode.
The X server works on a window covering the whole screen but the root window
is hidden from view.
.TP 8
.B \-mwextwm
Experimental.
The mode combines \fB\-rootless\fP mode drawing with native \fIWindows\fP
window frames managed by the experimental external window manager \fIxwinwm\fP.
.PP
\fBNOTE:\fP \fI-multiwindow\fP mode uses its own internal window manager.
All other modes require an external window manager in order to move, resize, and perform other

View File

@ -163,9 +163,6 @@
#include "miline.h"
#include "shadow.h"
#include "fb.h"
#ifdef XWIN_MULTIWINDOWEXTWM
#include "rootless.h"
#endif
#include "mipict.h"
#include "picturestr.h"
@ -390,9 +387,6 @@ typedef struct {
#endif
Bool fFullScreen;
Bool fDecoration;
#ifdef XWIN_MULTIWINDOWEXTWM
Bool fMWExtWM;
#endif
Bool fRootless;
Bool fMultiWindow;
Bool fMultiMonitorOverride;
@ -464,18 +458,10 @@ typedef struct _winPrivScreenRec {
LPDIRECTDRAWCLIPPER pddcPrimary;
BOOL fRetryCreateSurface;
#ifdef XWIN_MULTIWINDOWEXTWM
/* Privates used by multi-window external window manager */
RootlessFrameID widTop;
Bool fRestacking;
#endif
/* Privates used by multi-window */
pthread_t ptWMProc;
pthread_t ptXMsgProc;
void *pWMInfo;
/* Privates used by both multi-window and rootless */
Bool fRootWindowShown;
/* Privates used for any module running in a seperate thread */
@ -527,24 +513,6 @@ typedef struct _winPrivScreenRec {
Bool fNativeGlActive;
} winPrivScreenRec;
#ifdef XWIN_MULTIWINDOWEXTWM
typedef struct {
RootlessWindowPtr pFrame;
HWND hWnd;
int dwWidthBytes;
BITMAPINFOHEADER *pbmihShadow;
HBITMAP hbmpShadow;
HDC hdcShadow;
HDC hdcScreen;
BOOL fResized;
BOOL fRestackingNow;
BOOL fClose;
BOOL fMovingOrSizing;
BOOL fDestroyed; //for debug
char *pfb;
} win32RootlessWindowRec, *win32RootlessWindowPtr;
#endif
typedef struct {
void *value;
XID id;
@ -1009,105 +977,6 @@ winHandleIconMessage(HWND hwnd, UINT message,
LRESULT CALLBACK
winWindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
#ifdef XWIN_MULTIWINDOWEXTWM
/*
* winwin32rootless.c
*/
Bool
winMWExtWMCreateFrame(RootlessWindowPtr pFrame, ScreenPtr pScreen,
int newX, int newY, RegionPtr pShape);
void
winMWExtWMDestroyFrame(RootlessFrameID wid);
void
winMWExtWMMoveFrame(RootlessFrameID wid, ScreenPtr pScreen, int newX, int newY);
void
winMWExtWMResizeFrame(RootlessFrameID wid, ScreenPtr pScreen,
int newX, int newY, unsigned int newW, unsigned int newH,
unsigned int gravity);
void
winMWExtWMRestackFrame(RootlessFrameID wid, RootlessFrameID nextWid);
void
winMWExtWMReshapeFrame(RootlessFrameID wid, RegionPtr pShape);
void
winMWExtWMUnmapFrame(RootlessFrameID wid);
void
winMWExtWMStartDrawing(RootlessFrameID wid, char **pixelData, int *bytesPerRow);
void
winMWExtWMStopDrawing(RootlessFrameID wid, Bool flush);
void
winMWExtWMUpdateRegion(RootlessFrameID wid, RegionPtr pDamage);
void
winMWExtWMDamageRects(RootlessFrameID wid, int count, const BoxRec * rects,
int shift_x, int shift_y);
void
winMWExtWMRootlessSwitchWindow(RootlessWindowPtr pFrame, WindowPtr oldWin);
void
winMWExtWMCopyBytes(unsigned int width, unsigned int height,
const void *src, unsigned int srcRowBytes,
void *dst, unsigned int dstRowBytes);
void
winMWExtWMCopyWindow(RootlessFrameID wid, int dstNrects,
const BoxRec * dstRects, int dx, int dy);
#endif
#ifdef XWIN_MULTIWINDOWEXTWM
/*
* winwin32rootlesswindow.c
*/
void
winMWExtWMReorderWindows(ScreenPtr pScreen);
void
winMWExtWMMoveXWindow(WindowPtr pWin, int x, int y);
void
winMWExtWMResizeXWindow(WindowPtr pWin, int w, int h);
void
winMWExtWMMoveResizeXWindow(WindowPtr pWin, int x, int y, int w, int h);
void
winMWExtWMUpdateWindowDecoration(win32RootlessWindowPtr pRLWinPriv,
winScreenInfoPtr pScreenInfo);
wBOOL CALLBACK winMWExtWMDecorateWindow(HWND hwnd, LPARAM lParam);
void
winMWExtWMRestackWindows(ScreenPtr pScreen);
#endif
#ifdef XWIN_MULTIWINDOWEXTWM
/*
* winwin32rootlesswndproc.c
*/
LRESULT CALLBACK
winMWExtWMWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
#endif
/*
* winwindowswm.c
*/

View File

@ -152,9 +152,6 @@ winCreateBoundingWindowWindowed(ScreenPtr pScreen)
/* Decorated or undecorated window */
if (pScreenInfo->fDecoration
#ifdef XWIN_MULTIWINDOWEXTWM
&& !pScreenInfo->fMWExtWM
#endif
&& !pScreenInfo->fRootless
&& !pScreenInfo->fMultiWindow
) {
@ -214,9 +211,6 @@ winCreateBoundingWindowWindowed(ScreenPtr pScreen)
/* Clean up the scrollbars flag, if necessary */
if ((!pScreenInfo->fDecoration
#ifdef XWIN_MULTIWINDOWEXTWM
|| pScreenInfo->fMWExtWM
#endif
|| pScreenInfo->fRootless
|| pScreenInfo->fMultiWindow
)
@ -235,9 +229,6 @@ winCreateBoundingWindowWindowed(ScreenPtr pScreen)
/* Adjust the window width and height for borders and title bar */
if (pScreenInfo->fDecoration
#ifdef XWIN_MULTIWINDOWEXTWM
&& !pScreenInfo->fMWExtWM
#endif
&& !pScreenInfo->fRootless
&& !pScreenInfo->fMultiWindow
) {
@ -284,9 +275,6 @@ winCreateBoundingWindowWindowed(ScreenPtr pScreen)
/* Make sure window is no bigger than work area */
if (TRUE
#ifdef XWIN_MULTIWINDOWEXTWM
&& !pScreenInfo->fMWExtWM
#endif
&& !pScreenInfo->fMultiWindow
) {
/* Trim window width to fit work area */
@ -419,9 +407,6 @@ winCreateBoundingWindowWindowed(ScreenPtr pScreen)
/* Show the window */
if (FALSE
#ifdef XWIN_MULTIWINDOWEXTWM
|| pScreenInfo->fMWExtWM
#endif
|| pScreenInfo->fMultiWindow
) {
pScreenPriv->fRootWindowShown = FALSE;
@ -436,9 +421,6 @@ winCreateBoundingWindowWindowed(ScreenPtr pScreen)
/* Attempt to bring our window to the top of the display */
if (TRUE
#ifdef XWIN_MULTIWINDOWEXTWM
&& !pScreenInfo->fMWExtWM
#endif
&& !pScreenInfo->fRootless
&& !pScreenInfo->fMultiWindow
) {

View File

@ -147,9 +147,6 @@ winSetEngine(ScreenPtr pScreen)
/* ShadowGDI is the only engine that supports Multi Window Mode */
if (FALSE
#ifdef XWIN_MULTIWINDOWEXTWM
|| pScreenInfo->fMWExtWM
#endif
|| pScreenInfo->fMultiWindow
) {
winErrorFVerb(2,

View File

@ -82,10 +82,6 @@ extern DWORD g_dwCurrentThreadID;
extern Bool g_fKeyboardHookLL;
extern Bool g_fButton[3];
#ifdef XWIN_MULTIWINDOWEXTWM
extern Bool g_fNoConfigureWindow;
#endif
extern pthread_mutex_t g_pmTerminating;
#endif /* WINGLOBALS_H */

View File

@ -126,9 +126,6 @@ winInitializeScreenDefaults(void)
defaultScreenInfo.pfb = NULL;
defaultScreenInfo.fFullScreen = FALSE;
defaultScreenInfo.fDecoration = TRUE;
#ifdef XWIN_MULTIWINDOWEXTWM
defaultScreenInfo.fMWExtWM = FALSE;
#endif
defaultScreenInfo.fRootless = FALSE;
defaultScreenInfo.fMultiWindow = FALSE;
defaultScreenInfo.fMultiMonitorOverride = FALSE;
@ -550,29 +547,6 @@ ddxProcessArgument(int argc, char *argv[], int i)
return 1;
}
#ifdef XWIN_MULTIWINDOWEXTWM
/*
* Look for the '-mwextwm' argument
*/
if (IS_OPTION("-mwextwm")) {
if (!screenInfoPtr->fMultiMonitorOverride)
screenInfoPtr->fMultipleMonitors = TRUE;
screenInfoPtr->fMWExtWM = TRUE;
/* Indicate that we have processed this argument */
return 1;
}
/*
* Look for the '-internalwm' argument
*/
if (IS_OPTION("-internalwm")) {
ErrorF("Ignoring obsolete -internalwm option\n");
/* Ignored, but we still accept the arg for backwards compatibility */
/* Indicate that we have processed this argument */
return 1;
}
#endif
/*
* Look for the '-rootless' argument
*/

View File

@ -170,9 +170,6 @@ winRandRScreenSetSize(ScreenPtr pScreen,
resize the native display size
*/
if (FALSE
#ifdef XWIN_MULTIWINDOWEXTWM
|| pScreenInfo->fMWExtWM
#endif
|| pScreenInfo->fRootless
|| pScreenInfo->fMultiWindow
) {

View File

@ -38,31 +38,6 @@
#include "win.h"
#include "winmsg.h"
#ifdef XWIN_MULTIWINDOWEXTWM
static RootlessFrameProcsRec winMWExtWMProcs = {
winMWExtWMCreateFrame,
winMWExtWMDestroyFrame,
winMWExtWMMoveFrame,
winMWExtWMResizeFrame,
winMWExtWMRestackFrame,
winMWExtWMReshapeFrame,
winMWExtWMUnmapFrame,
winMWExtWMStartDrawing,
winMWExtWMStopDrawing,
winMWExtWMUpdateRegion,
winMWExtWMDamageRects,
winMWExtWMRootlessSwitchWindow,
NULL, //winMWExtWMDoReorderWindow,
NULL, //winMWExtWMHideWindow,
NULL, //winMWExtWMUpdateColorMap,
NULL, //winMWExtWMCopyBytes,
winMWExtWMCopyWindow
};
#endif
/*
* Determine what type of screen we are initializing
* and call the appropriate procedure to intiailize
@ -370,11 +345,7 @@ winFinishScreenInitFB(int i, ScreenPtr pScreen, int argc, char **argv)
/* Initialize the shadow framebuffer layer */
if ((pScreenInfo->dwEngine == WIN_SERVER_SHADOW_GDI
|| pScreenInfo->dwEngine == WIN_SERVER_SHADOW_DDNL)
#ifdef XWIN_MULTIWINDOWEXTWM
&& !pScreenInfo->fMWExtWM
#endif
) {
|| pScreenInfo->dwEngine == WIN_SERVER_SHADOW_DDNL)) {
#if CYGDEBUG
winDebug("winFinishScreenInitFB - Calling shadowSetup ()\n");
#endif
@ -389,23 +360,6 @@ winFinishScreenInitFB(int i, ScreenPtr pScreen, int argc, char **argv)
pScreen->CreateScreenResources = winCreateScreenResources;
}
#ifdef XWIN_MULTIWINDOWEXTWM
/* Handle multi-window external window manager mode */
if (pScreenInfo->fMWExtWM) {
winDebug("winScreenInit - MultiWindowExtWM - Calling RootlessInit\n");
RootlessInit(pScreen, &winMWExtWMProcs);
winDebug("winScreenInit - MultiWindowExtWM - RootlessInit returned\n");
rootless_CopyBytes_threshold = 0;
/* FIXME: How many? Profiling needed? */
rootless_CopyWindow_threshold = 1;
winWindowsWMExtensionInit();
}
#endif
/* Handle rootless mode */
if (pScreenInfo->fRootless) {
/* Define the WRAP macro temporarily for local use */
@ -505,9 +459,6 @@ winFinishScreenInitFB(int i, ScreenPtr pScreen, int argc, char **argv)
/* Set the ServerStarted flag to false */
pScreenPriv->fServerStarted = FALSE;
#ifdef XWIN_MULTIWINDOWEXTWM
pScreenPriv->fRestacking = FALSE;
#endif
if (pScreenInfo->fMultiWindow) {
#if CYGDEBUG || YES

View File

@ -115,11 +115,6 @@ winHandleIconMessage(HWND hwnd, UINT message,
case WM_LBUTTONUP:
/* Restack and bring all windows to top */
SetForegroundWindow (pScreenPriv->hwndScreen);
#ifdef XWIN_MULTIWINDOWEXTWM
if (pScreenInfo->fMWExtWM)
winMWExtWMRestackWindows(pScreenInfo->pScreen);
#endif
break;
case WM_LBUTTONDBLCLK:

View File

@ -80,7 +80,7 @@ winValidateArgs(void)
for (i = 0; i < g_iNumScreens; ++i) {
/*
* Check for any combination of
* -multiwindow, -mwextwm, and -rootless.
* -multiwindow and -rootless.
*/
{
int iCount = 0;
@ -88,10 +88,7 @@ winValidateArgs(void)
/* Count conflicting options */
if (g_ScreenInfo[i].fMultiWindow)
++iCount;
#ifdef XWIN_MULTIWINDOWEXTWM
if (g_ScreenInfo[i].fMWExtWM)
++iCount;
#endif
if (g_ScreenInfo[i].fRootless)
++iCount;
@ -101,52 +98,42 @@ winValidateArgs(void)
/* Fail if two or more conflicting options */
if (iCount > 1) {
ErrorF("winValidateArgs - Only one of -multiwindow, -mwextwm, "
ErrorF("winValidateArgs - Only one of -multiwindow "
"and -rootless can be specific at a time.\n");
return FALSE;
}
}
/* Check for -multiwindow or -mwextwm and Xdmcp */
/* Check for -multiwindow and Xdmcp */
/* allow xdmcp if screen 0 is normal. */
if (g_fXdmcpEnabled && !fHasNormalScreen0 && (FALSE
|| g_ScreenInfo[i].
fMultiWindow
#ifdef XWIN_MULTIWINDOWEXTWM
|| g_ScreenInfo[i].
fMWExtWM
#endif
)
) {
ErrorF("winValidateArgs - Xdmcp (-query, -broadcast, or -indirect) "
"is invalid with -multiwindow or -mwextwm.\n");
"is invalid with -multiwindow.\n");
return FALSE;
}
/* Check for -multiwindow, -mwextwm, or -rootless and -fullscreen */
/* Check for -multiwindow or -rootless and -fullscreen */
if (g_ScreenInfo[i].fFullScreen && (FALSE
|| g_ScreenInfo[i].fMultiWindow
#ifdef XWIN_MULTIWINDOWEXTWM
|| g_ScreenInfo[i].fMWExtWM
#endif
|| g_ScreenInfo[i].fRootless)
) {
ErrorF("winValidateArgs - -fullscreen is invalid with "
"-multiwindow, -mwextwm, or -rootless.\n");
"-multiwindow or -rootless.\n");
return FALSE;
}
/* Check for -multiwindow, -mwextwm, or -rootless and -nodecoration */
/* Check for -multiwindow or -rootless and -nodecoration */
if (!g_ScreenInfo[i].fDecoration && (FALSE
|| g_ScreenInfo[i].fMultiWindow
#ifdef XWIN_MULTIWINDOWEXTWM
|| g_ScreenInfo[i].fMWExtWM
#endif
|| g_ScreenInfo[i].fRootless)
) {
ErrorF("winValidateArgs - -nodecoration is invalid with "
"-multiwindow, -mwextwm, or -rootless.\n");
"-multiwindow or -rootless.\n");
return FALSE;
}

View File

@ -1,965 +0,0 @@
/*
*Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
*
*Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
*"Software"), to deal in the Software without restriction, including
*without limitation the rights to use, copy, modify, merge, publish,
*distribute, sublicense, and/or sell copies of the Software, and to
*permit persons to whom the Software is furnished to do so, subject to
*the following conditions:
*
*The above copyright notice and this permission notice shall be
*included in all copies or substantial portions of the Software.
*
*THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
*EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
*MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
*NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
*ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
*CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
*WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*Except as contained in this notice, the name of the XFree86 Project
*shall not be used in advertising or otherwise to promote the sale, use
*or other dealings in this Software without prior written authorization
*from the XFree86 Project.
*
* Authors: Kensuke Matsuzaki
* Earle F. Philhower, III
* Harold L Hunt II
*/
/*
* Look at hw/darwin/quartz/xpr/xprFrame.c and hw/darwin/quartz/cr/crFrame.c
*/
#ifdef HAVE_XWIN_CONFIG_H
#include <xwin-config.h>
#endif
#include "win.h"
#include <winuser.h>
#define _WINDOWSWM_SERVER_
#include <X11/extensions/windowswmstr.h>
#include "winmultiwindowclass.h"
#include "winmultiwindowicons.h"
#include <X11/Xatom.h>
/*
* Constant defines
*/
#ifndef ULW_COLORKEY
#define ULW_COLORKEY 0x00000001
#endif
#ifndef ULW_ALPHA
#define ULW_ALPHA 0x00000002
#endif
#ifndef ULW_OPAQUE
#define ULW_OPAQUE 0x00000004
#endif
#define AC_SRC_ALPHA 0x01
/*
* Local function
*/
DEFINE_ATOM_HELPER(AtmWindowsWmNativeHwnd, WINDOWSWM_NATIVE_HWND)
static void
winMWExtWMSetNativeProperty(RootlessWindowPtr pFrame);
/*
* Global variables
*/
Bool g_fNoConfigureWindow = FALSE;
/*
* Internal function to get the DIB format that is compatible with the screen
* Fixme: Share code with winshadgdi.c
*/
static
Bool
winMWExtWMQueryDIBFormat(win32RootlessWindowPtr pRLWinPriv,
BITMAPINFOHEADER * pbmih)
{
HBITMAP hbmp;
#if CYGMULTIWINDOW_DEBUG
LPDWORD pdw = NULL;
#endif
/* Create a memory bitmap compatible with the screen */
hbmp = CreateCompatibleBitmap(pRLWinPriv->hdcScreen, 1, 1);
if (hbmp == NULL) {
ErrorF("winMWExtWMQueryDIBFormat - CreateCompatibleBitmap failed\n");
return FALSE;
}
/* Initialize our bitmap info header */
ZeroMemory(pbmih, sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD));
pbmih->biSize = sizeof(BITMAPINFOHEADER);
/* Get the biBitCount */
if (!GetDIBits(pRLWinPriv->hdcScreen,
hbmp, 0, 1, NULL, (BITMAPINFO *) pbmih, DIB_RGB_COLORS)) {
ErrorF("winMWExtWMQueryDIBFormat - First call to GetDIBits failed\n");
DeleteObject(hbmp);
return FALSE;
}
#if CYGMULTIWINDOW_DEBUG
/* Get a pointer to bitfields */
pdw = (DWORD *) ((CARD8 *) pbmih + sizeof(BITMAPINFOHEADER));
winDebug("winMWExtWMQueryDIBFormat - First call masks: %08x %08x %08x\n",
(unsigned int) pdw[0], (unsigned int) pdw[1],
(unsigned int) pdw[2]);
#endif
/* Get optimal color table, or the optimal bitfields */
if (!GetDIBits(pRLWinPriv->hdcScreen,
hbmp, 0, 1, NULL, (BITMAPINFO *) pbmih, DIB_RGB_COLORS)) {
ErrorF("winMWExtWMQueryDIBFormat - Second call to GetDIBits "
"failed\n");
DeleteObject(hbmp);
return FALSE;
}
/* Free memory */
DeleteObject(hbmp);
return TRUE;
}
static HRGN
winMWExtWMCreateRgnFromRegion(RegionPtr pShape)
{
int nRects;
BoxPtr pRects, pEnd;
HRGN hRgn, hRgnRect;
if (pShape == NULL)
return NULL;
nRects = RegionNumRects(pShape);
pRects = RegionRects(pShape);
hRgn = CreateRectRgn(0, 0, 0, 0);
if (hRgn == NULL) {
ErrorF("winReshape - Initial CreateRectRgn (%d, %d, %d, %d) "
"failed: %d\n", 0, 0, 0, 0, (int) GetLastError());
}
/* Loop through all rectangles in the X region */
for (pEnd = pRects + nRects; pRects < pEnd; pRects++) {
/* Create a Windows region for the X rectangle */
hRgnRect = CreateRectRgn(pRects->x1,
pRects->y1, pRects->x2, pRects->y2);
if (hRgnRect == NULL) {
ErrorF("winReshape - Loop CreateRectRgn (%d, %d, %d, %d) "
"failed: %d\n",
pRects->x1,
pRects->y1, pRects->x2, pRects->y2, (int) GetLastError());
}
/* Merge the Windows region with the accumulated region */
if (CombineRgn(hRgn, hRgn, hRgnRect, RGN_OR) == ERROR) {
ErrorF("winReshape - CombineRgn () failed: %d\n",
(int) GetLastError());
}
/* Delete the temporary Windows region */
DeleteObject(hRgnRect);
}
return hRgn;
}
static void
InitWin32RootlessEngine(win32RootlessWindowPtr pRLWinPriv)
{
pRLWinPriv->hdcScreen = GetDC(pRLWinPriv->hWnd);
pRLWinPriv->hdcShadow = CreateCompatibleDC(pRLWinPriv->hdcScreen);
pRLWinPriv->hbmpShadow = NULL;
/* Allocate bitmap info header */
pRLWinPriv->pbmihShadow =
malloc(sizeof(BITMAPINFOHEADER)
+ 256 * sizeof(RGBQUAD));
if (pRLWinPriv->pbmihShadow == NULL) {
ErrorF("InitWin32RootlessEngine - malloc () failed\n");
return;
}
/* Query the screen format */
winMWExtWMQueryDIBFormat(pRLWinPriv, pRLWinPriv->pbmihShadow);
}
Bool
winMWExtWMCreateFrame(RootlessWindowPtr pFrame, ScreenPtr pScreen,
int newX, int newY, RegionPtr pShape)
{
#define CLASS_NAME_LENGTH 512
Bool fResult = TRUE;
win32RootlessWindowPtr pRLWinPriv;
WNDCLASSEX wc;
char pszClass[CLASS_NAME_LENGTH], pszWindowID[12];
HICON hIcon;
HICON hIconSmall;
char *res_name, *res_class, *res_role;
static int s_iWindowID = 0;
#if CYGMULTIWINDOW_DEBUG
winDebug("winMWExtWMCreateFrame %d %d - %d %d\n",
newX, newY, pFrame->width, pFrame->height);
#endif
pRLWinPriv = malloc(sizeof(win32RootlessWindowRec));
pRLWinPriv->pFrame = pFrame;
pRLWinPriv->pfb = NULL;
pRLWinPriv->hbmpShadow = NULL;
pRLWinPriv->hdcShadow = NULL;
pRLWinPriv->hdcScreen = NULL;
pRLWinPriv->pbmihShadow = NULL;
pRLWinPriv->fResized = TRUE;
pRLWinPriv->fClose = FALSE;
pRLWinPriv->fRestackingNow = FALSE;
pRLWinPriv->fDestroyed = FALSE;
pRLWinPriv->fMovingOrSizing = FALSE;
// Store the implementation private frame ID
pFrame->wid = (RootlessFrameID) pRLWinPriv;
winSelectIcons(&hIcon, &hIconSmall);
/* Set standard class name prefix so we can identify window easily */
strncpy(pszClass, WINDOW_CLASS_X, sizeof(pszClass));
if (winMultiWindowGetClassHint(pFrame->win, &res_name, &res_class)) {
strncat(pszClass, "-", 1);
strncat(pszClass, res_name, CLASS_NAME_LENGTH - strlen(pszClass));
strncat(pszClass, "-", 1);
strncat(pszClass, res_class, CLASS_NAME_LENGTH - strlen(pszClass));
/* Check if a window class is provided by the WM_WINDOW_ROLE property,
* if not use the WM_CLASS information.
* For further information see:
* http://tronche.com/gui/x/icccm/sec-5.html
*/
if (winMultiWindowGetWindowRole(pFrame->win, &res_role)) {
strcat(pszClass, "-");
strcat(pszClass, res_role);
free(res_role);
}
free(res_name);
free(res_class);
}
/* Add incrementing window ID to make unique class name */
snprintf(pszWindowID, sizeof(pszWindowID), "-%x", s_iWindowID++);
pszWindowID[sizeof(pszWindowID) - 1] = 0;
strcat(pszClass, pszWindowID);
#if CYGMULTIWINDOW_DEBUG
winDebug("winMWExtWMCreateFrame - Creating class: %s\n", pszClass);
#endif
/* Setup our window class */
wc.cbSize = sizeof(wc);
wc.style = CS_HREDRAW | CS_VREDRAW;
wc.lpfnWndProc = winMWExtWMWindowProc;
wc.cbClsExtra = 0;
wc.cbWndExtra = 0;
wc.hInstance = g_hInstance;
wc.hIcon = hIcon;
wc.hIconSm = hIconSmall;
wc.hCursor = 0;
wc.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH);
wc.lpszMenuName = NULL;
wc.lpszClassName = pszClass;
RegisterClassEx(&wc);
/* Create the window */
g_fNoConfigureWindow = TRUE;
pRLWinPriv->hWnd = CreateWindowExA(WS_EX_TOOLWINDOW, /* Extended styles */
pszClass, /* Class name */
WINDOW_TITLE_X, /* Window name */
WS_POPUP | WS_CLIPCHILDREN, newX, /* Horizontal position */
newY, /* Vertical position */
pFrame->width, /* Right edge */
pFrame->height, /* Bottom edge */
(HWND) NULL, /* No parent or owner window */
(HMENU) NULL, /* No menu */
GetModuleHandle(NULL), /* Instance handle */
pRLWinPriv); /* ScreenPrivates */
if (pRLWinPriv->hWnd == NULL) {
ErrorF("winMWExtWMCreateFrame - CreateWindowExA () failed: %d\n",
(int) GetLastError());
fResult = FALSE;
}
#if CYGMULTIWINDOW_DEBUG
winDebug("winMWExtWMCreateFrame - ShowWindow\n");
#endif
//ShowWindow (pRLWinPriv->hWnd, SW_SHOWNOACTIVATE);
g_fNoConfigureWindow = FALSE;
if (pShape != NULL) {
winMWExtWMReshapeFrame(pFrame->wid, pShape);
}
#if CYGMULTIWINDOW_DEBUG
winDebug("winMWExtWMCreateFrame - (%p) %p\n",
pFrame->wid, pRLWinPriv->hWnd);
#if 0
{
WindowPtr pWin2 = NULL;
win32RootlessWindowPtr pRLWinPriv2 = NULL;
/* Check if the Windows window property for our X window pointer is valid */
if ((pWin2 =
(WindowPtr) GetProp(pRLWinPriv->hWnd, WIN_WINDOW_PROP)) != NULL) {
pRLWinPriv2 =
(win32RootlessWindowPtr) RootlessFrameForWindow(pWin2, FALSE);
}
winDebug("winMWExtWMCreateFrame2 (%08x) %08x\n",
pRLWinPriv2, pRLWinPriv2->hWnd);
if (pRLWinPriv != pRLWinPriv2 || pRLWinPriv->hWnd != pRLWinPriv2->hWnd) {
winDebug("Error param missmatch\n");
}
}
#endif
#endif
winMWExtWMSetNativeProperty(pFrame);
return fResult;
}
void
winMWExtWMDestroyFrame(RootlessFrameID wid)
{
win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) wid;
HICON hIcon;
HICON hIconSm;
HMODULE hInstance;
int iReturn;
char pszClass[CLASS_NAME_LENGTH];
#if CYGMULTIWINDOW_DEBUG
winDebug("winMWExtWMDestroyFrame (%p) %p\n",
pRLWinPriv, pRLWinPriv->hWnd);
#if 0
{
WindowPtr pWin2 = NULL;
win32RootlessWindowPtr pRLWinPriv2 = NULL;
/* Check if the Windows window property for our X window pointer is valid */
if ((pWin2 =
(WindowPtr) GetProp(pRLWinPriv->hWnd, WIN_WINDOW_PROP)) != NULL) {
pRLWinPriv2 =
(win32RootlessWindowPtr) RootlessFrameForWindow(pWin2, FALSE);
}
winDebug("winMWExtWMDestroyFrame2 (%08x) %08x\n",
pRLWinPriv2, pRLWinPriv2->hWnd);
if (pRLWinPriv != pRLWinPriv2 || pRLWinPriv->hWnd != pRLWinPriv2->hWnd) {
winDebug("Error param missmatch\n");
*(int *) 0 = 1; //raise exseption
}
}
#endif
#endif
/* Store the info we need to destroy after this window is gone */
hInstance = (HINSTANCE) GetClassLongPtr(pRLWinPriv->hWnd, GCLP_HMODULE);
hIcon = (HICON) SendMessage(pRLWinPriv->hWnd, WM_GETICON, ICON_BIG, 0);
hIconSm = (HICON) SendMessage(pRLWinPriv->hWnd, WM_GETICON, ICON_SMALL, 0);
iReturn = GetClassName(pRLWinPriv->hWnd, pszClass, CLASS_NAME_LENGTH);
pRLWinPriv->fClose = TRUE;
pRLWinPriv->fDestroyed = TRUE;
/* Destroy the Windows window */
DestroyWindow(pRLWinPriv->hWnd);
/* Only if we were able to get the name */
if (iReturn) {
#if CYGMULTIWINDOW_DEBUG
winDebug("winMWExtWMDestroyFrame - Unregistering %s: ", pszClass);
#endif
iReturn = UnregisterClass(pszClass, hInstance);
}
#if CYGMULTIWINDOW_DEBUG
winDebug("winMWExtWMDestroyFramew - Deleting Icon\n");
#endif
winDestroyIcon(hIcon);
winDestroyIcon(hIconSm);
#if CYGMULTIWINDOW_DEBUG
winDebug("winMWExtWMDestroyFrame - done\n");
#endif
}
void
winMWExtWMMoveFrame(RootlessFrameID wid, ScreenPtr pScreen, int iNewX,
int iNewY)
{
win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) wid;
RECT rcNew;
DWORD dwExStyle;
DWORD dwStyle;
int iX, iY, iWidth, iHeight;
#if CYGMULTIWINDOW_DEBUG
winDebug("winMWExtWMMoveFrame (%p) (%d %d)\n", pRLWinPriv, iNewX,
iNewY);
#endif
/* Get the Windows window style and extended style */
dwExStyle = GetWindowLongPtr(pRLWinPriv->hWnd, GWL_EXSTYLE);
dwStyle = GetWindowLongPtr(pRLWinPriv->hWnd, GWL_STYLE);
/* Get the X and Y location of the X window */
iX = iNewX + GetSystemMetrics(SM_XVIRTUALSCREEN);
iY = iNewY + GetSystemMetrics(SM_YVIRTUALSCREEN);
/* Get the height and width of the X window */
iWidth = pRLWinPriv->pFrame->width;
iHeight = pRLWinPriv->pFrame->height;
/* Store the origin, height, and width in a rectangle structure */
SetRect(&rcNew, iX, iY, iX + iWidth, iY + iHeight);
#ifdef CYGMULTIWINDOW_DEBUG
winDebug("\tWindow {%d, %d, %d, %d}, {%d, %d}\n",
rcNew.left, rcNew.top, rcNew.right, rcNew.bottom,
rcNew.right - rcNew.left, rcNew.bottom - rcNew.top);
#endif
/*
* Calculate the required size of the Windows window rectangle,
* given the size of the Windows window client area.
*/
AdjustWindowRectEx(&rcNew, dwStyle, FALSE, dwExStyle);
#ifdef CYGMULTIWINDOW_DEBUG
winDebug("\tAdjusted {%d, %d, %d, %d}, {%d, %d}\n",
rcNew.left, rcNew.top, rcNew.right, rcNew.bottom,
rcNew.right - rcNew.left, rcNew.bottom - rcNew.top);
#endif
g_fNoConfigureWindow = TRUE;
SetWindowPos(pRLWinPriv->hWnd, NULL, rcNew.left, rcNew.top, 0, 0,
SWP_NOACTIVATE | SWP_NOSIZE | SWP_NOZORDER);
g_fNoConfigureWindow = FALSE;
#if CYGMULTIWINDOW_DEBUG
winDebug("winMWExtWMMoveFrame (%p) done\n", pRLWinPriv);
#endif
}
void
winMWExtWMResizeFrame(RootlessFrameID wid, ScreenPtr pScreen,
int iNewX, int iNewY,
unsigned int uiNewWidth, unsigned int uiNewHeight,
unsigned int uiGravity)
{
win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) wid;
RECT rcNew;
RECT rcOld;
DWORD dwExStyle;
DWORD dwStyle;
int iX, iY;
#if CYGMULTIWINDOW_DEBUG
winDebug("winMWExtWMResizeFrame (%p) (%d %d)-(%d %d)\n",
pRLWinPriv, iNewX, iNewY, uiNewWidth, uiNewHeight);
#endif
pRLWinPriv->fResized = TRUE;
/* Get the Windows window style and extended style */
dwExStyle = GetWindowLongPtr(pRLWinPriv->hWnd, GWL_EXSTYLE);
dwStyle = GetWindowLongPtr(pRLWinPriv->hWnd, GWL_STYLE);
/* Get the X and Y location of the X window */
iX = iNewX + GetSystemMetrics(SM_XVIRTUALSCREEN);
iY = iNewY + GetSystemMetrics(SM_YVIRTUALSCREEN);
/* Store the origin, height, and width in a rectangle structure */
SetRect(&rcNew, iX, iY, iX + uiNewWidth, iY + uiNewHeight);
/*
* Calculate the required size of the Windows window rectangle,
* given the size of the Windows window client area.
*/
AdjustWindowRectEx(&rcNew, dwStyle, FALSE, dwExStyle);
/* Get a rectangle describing the old Windows window */
GetWindowRect(pRLWinPriv->hWnd, &rcOld);
/* Check if the old rectangle and new rectangle are the same */
if (!EqualRect(&rcNew, &rcOld)) {
g_fNoConfigureWindow = TRUE;
MoveWindow(pRLWinPriv->hWnd,
rcNew.left, rcNew.top,
rcNew.right - rcNew.left, rcNew.bottom - rcNew.top, TRUE);
g_fNoConfigureWindow = FALSE;
}
}
void
winMWExtWMRestackFrame(RootlessFrameID wid, RootlessFrameID nextWid)
{
win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) wid;
win32RootlessWindowPtr pRLNextWinPriv = (win32RootlessWindowPtr) nextWid;
winScreenPriv(pRLWinPriv->pFrame->win->drawable.pScreen);
#if CYGMULTIWINDOW_DEBUG
winDebug("winMWExtWMRestackFrame (%p)\n", pRLWinPriv);
#endif
if (pScreenPriv && pScreenPriv->fRestacking)
return;
pRLWinPriv->fRestackingNow = TRUE;
/* Show window */
if (!IsWindowVisible(pRLWinPriv->hWnd))
ShowWindow(pRLWinPriv->hWnd, SW_SHOWNOACTIVATE);
if (pRLNextWinPriv == NULL) {
#if CYGMULTIWINDOW_DEBUG
winDebug("Win %p is top\n", pRLWinPriv);
#endif
pScreenPriv->widTop = wid;
SetWindowPos(pRLWinPriv->hWnd, HWND_TOP,
0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
}
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 CYGMULTIWINDOW_DEBUG
winDebug("winMWExtWMRestackFrame - done (%p)\n", pRLWinPriv);
#endif
pRLWinPriv->fRestackingNow = FALSE;
}
void
winMWExtWMReshapeFrame(RootlessFrameID wid, RegionPtr pShape)
{
win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) wid;
HRGN hRgn, hRgnWindow, hRgnClient;
RECT rcWindow, rcClient;
#if CYGMULTIWINDOW_DEBUG
winDebug("winMWExtWMReshapeFrame (%p)\n", pRLWinPriv);
#endif
hRgn = winMWExtWMCreateRgnFromRegion(pShape);
/* Create region for non-client area */
GetWindowRect(pRLWinPriv->hWnd, &rcWindow);
GetClientRect(pRLWinPriv->hWnd, &rcClient);
MapWindowPoints(pRLWinPriv->hWnd, HWND_DESKTOP, (LPPOINT) &rcClient, 2);
OffsetRgn(hRgn, rcClient.left - rcWindow.left, rcClient.top - rcWindow.top);
OffsetRect(&rcClient, -rcWindow.left, -rcWindow.top);
OffsetRect(&rcWindow, -rcWindow.left, -rcWindow.top);
hRgnWindow = CreateRectRgnIndirect(&rcWindow);
hRgnClient = CreateRectRgnIndirect(&rcClient);
CombineRgn(hRgnWindow, hRgnWindow, hRgnClient, RGN_DIFF);
CombineRgn(hRgn, hRgnWindow, hRgn, RGN_OR);
SetWindowRgn(pRLWinPriv->hWnd, hRgn, TRUE);
DeleteObject(hRgnWindow);
DeleteObject(hRgnClient);
}
void
winMWExtWMUnmapFrame(RootlessFrameID wid)
{
win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) wid;
#if CYGMULTIWINDOW_DEBUG
winDebug("winMWExtWMUnmapFrame (%p)\n", pRLWinPriv);
#endif
g_fNoConfigureWindow = TRUE;
//ShowWindow (pRLWinPriv->hWnd, SW_MINIMIZE);
ShowWindow(pRLWinPriv->hWnd, SW_HIDE);
g_fNoConfigureWindow = FALSE;
}
/*
* Fixme: Code sharing with winshadgdi.c and other engine support
*/
void
winMWExtWMStartDrawing(RootlessFrameID wid, char **pixelData, int *bytesPerRow)
{
win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) wid;
winPrivScreenPtr pScreenPriv = NULL;
winScreenInfo *pScreenInfo = NULL;
ScreenPtr pScreen = NULL;
DIBSECTION dibsection;
Bool fReturn = TRUE;
HDC hdcNew;
HBITMAP hbmpNew;
#if CYGMULTIWINDOW_DEBUG
winDebug("winMWExtWMStartDrawing (%p) %08x\n", pRLWinPriv,
pRLWinPriv->fDestroyed);
#endif
if (!pRLWinPriv->fDestroyed) {
pScreen = pRLWinPriv->pFrame->win->drawable.pScreen;
if (pScreen)
pScreenPriv = winGetScreenPriv(pScreen);
if (pScreenPriv)
pScreenInfo = pScreenPriv->pScreenInfo;
#if CYGMULTIWINDOW_DEBUG
winDebug("\tpScreenPriv %p\n", pScreenPriv);
winDebug("\tpScreenInfo %p\n", pScreenInfo);
winDebug("\t(%d, %d)\n", (int) pRLWinPriv->pFrame->width,
(int) pRLWinPriv->pFrame->height);
#endif
if (pRLWinPriv->hdcScreen == NULL) {
InitWin32RootlessEngine(pRLWinPriv);
}
if (pRLWinPriv->fResized) {
/* width * bpp must be multiple of 4 to match 32bit alignment */
int stridesize;
int misalignment;
pRLWinPriv->pbmihShadow->biWidth = pRLWinPriv->pFrame->width;
pRLWinPriv->pbmihShadow->biHeight = -pRLWinPriv->pFrame->height;
stridesize = pRLWinPriv->pFrame->width * (pScreenInfo->dwBPP >> 3);
misalignment = stridesize & 3;
if (misalignment != 0) {
stridesize += 4 - misalignment;
pRLWinPriv->pbmihShadow->biWidth =
stridesize / (pScreenInfo->dwBPP >> 3);
winDebug("\tresizing to %d (was %d)\n",
pRLWinPriv->pbmihShadow->biWidth,
pRLWinPriv->pFrame->width);
}
hdcNew = CreateCompatibleDC(pRLWinPriv->hdcScreen);
/* Create a DI shadow bitmap with a bit pointer */
hbmpNew = CreateDIBSection(pRLWinPriv->hdcScreen,
(BITMAPINFO *) pRLWinPriv->pbmihShadow,
DIB_RGB_COLORS,
(VOID **) &pRLWinPriv->pfb, NULL, 0);
if (hbmpNew == NULL || pRLWinPriv->pfb == NULL) {
ErrorF("winMWExtWMStartDrawing - CreateDIBSection failed\n");
//return FALSE;
}
else {
#if CYGMULTIWINDOW_DEBUG
winDebug("winMWExtWMStartDrawing - Shadow buffer allocated\n");
#endif
}
/* Get information about the bitmap that was allocated */
GetObject(hbmpNew, sizeof(dibsection), &dibsection);
#if CYGMULTIWINDOW_DEBUG
/* Print information about bitmap allocated */
winDebug("winMWExtWMStartDrawing - Dibsection width: %d height: %d "
"depth: %d size image: %d\n",
(unsigned int) dibsection.dsBmih.biWidth,
(unsigned int) dibsection.dsBmih.biHeight,
(unsigned int) dibsection.dsBmih.biBitCount,
(unsigned int) dibsection.dsBmih.biSizeImage);
#endif
/* Select the shadow bitmap into the shadow DC */
SelectObject(hdcNew, hbmpNew);
#if CYGMULTIWINDOW_DEBUG
winDebug("winMWExtWMStartDrawing - Attempting a shadow blit\n");
#endif
/* Blit from the old shadow to the new shadow */
fReturn = BitBlt(hdcNew,
0, 0,
pRLWinPriv->pFrame->width,
pRLWinPriv->pFrame->height, pRLWinPriv->hdcShadow,
0, 0, SRCCOPY);
if (fReturn) {
#if CYGMULTIWINDOW_DEBUG
winDebug("winMWExtWMStartDrawing - Shadow blit success\n");
#endif
}
else {
ErrorF("winMWExtWMStartDrawing - Shadow blit failure\n");
}
/* Look for height weirdness */
if (dibsection.dsBmih.biHeight < 0) {
/* FIXME: Figure out why biHeight is sometimes negative */
ErrorF("winMWExtWMStartDrawing - WEIRDNESS - "
"biHeight still negative: %d\n",
(int) dibsection.dsBmih.biHeight);
ErrorF("winMWExtWMStartDrawing - WEIRDNESS - "
"Flipping biHeight sign\n");
dibsection.dsBmih.biHeight = -dibsection.dsBmih.biHeight;
}
pRLWinPriv->dwWidthBytes = dibsection.dsBm.bmWidthBytes;
#if CYGMULTIWINDOW_DEBUG
winDebug("winMWExtWMStartDrawing - bytesPerRow: %d\n",
(unsigned int) dibsection.dsBm.bmWidthBytes);
#endif
/* Free the old shadow bitmap */
DeleteObject(pRLWinPriv->hdcShadow);
DeleteObject(pRLWinPriv->hbmpShadow);
pRLWinPriv->hdcShadow = hdcNew;
pRLWinPriv->hbmpShadow = hbmpNew;
pRLWinPriv->fResized = FALSE;
#if CYGMULTIWINDOW_DEBUG && FALSE
winDebug("winMWExtWMStartDrawing - 0x%08x %d\n",
(unsigned int) pRLWinPriv->pfb,
(unsigned int) dibsection.dsBm.bmWidthBytes);
#endif
}
}
else {
ErrorF("winMWExtWMStartDrawing - Already window was destroyed \n");
}
#if CYGMULTIWINDOW_DEBUG
winDebug("winMWExtWMStartDrawing - done (%p) %p %d\n",
pRLWinPriv,
pRLWinPriv->pfb,
(unsigned int) pRLWinPriv->dwWidthBytes);
#endif
*pixelData = pRLWinPriv->pfb;
*bytesPerRow = pRLWinPriv->dwWidthBytes;
}
void
winMWExtWMStopDrawing(RootlessFrameID wid, Bool fFlush)
{
#if 0
win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) wid;
BLENDFUNCTION bfBlend;
SIZE szWin;
POINT ptSrc;
#if CYGMULTIWINDOW_DEBUG || TRUE
winDebug("winMWExtWMStopDrawing (%08x)\n", pRLWinPriv);
#endif
szWin.cx = pRLWinPriv->dwWidth;
szWin.cy = pRLWinPriv->dwHeight;
ptSrc.x = 0;
ptSrc.y = 0;
bfBlend.BlendOp = AC_SRC_OVER;
bfBlend.BlendFlags = 0;
bfBlend.SourceConstantAlpha = 255;
bfBlend.AlphaFormat = AC_SRC_ALPHA;
if (!UpdateLayeredWindow(pRLWinPriv->hWnd,
NULL, NULL, &szWin,
pRLWinPriv->hdcShadow, &ptSrc,
0, &bfBlend, ULW_ALPHA)) {
ErrorF("winMWExtWMStopDrawing - UpdateLayeredWindow failed\n");
}
#endif
}
void
winMWExtWMUpdateRegion(RootlessFrameID wid, RegionPtr pDamage)
{
win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) wid;
#if 0
BLENDFUNCTION bfBlend;
SIZE szWin;
POINT ptSrc;
#endif
#if CYGMULTIWINDOW_DEBUG && 0
winDebug("winMWExtWMUpdateRegion (%08x)\n", pRLWinPriv);
#endif
#if 0
szWin.cx = pRLWinPriv->dwWidth;
szWin.cy = pRLWinPriv->dwHeight;
ptSrc.x = 0;
ptSrc.y = 0;
bfBlend.BlendOp = AC_SRC_OVER;
bfBlend.BlendFlags = 0;
bfBlend.SourceConstantAlpha = 255;
bfBlend.AlphaFormat = AC_SRC_ALPHA;
if (!UpdateLayeredWindow(pRLWinPriv->hWnd,
NULL, NULL, &szWin,
pRLWinPriv->hdcShadow, &ptSrc,
0, &bfBlend, ULW_ALPHA)) {
LPVOID lpMsgBuf;
/* Display a fancy error message */
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
GetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR) &lpMsgBuf, 0, NULL);
ErrorF("winMWExtWMUpdateRegion - UpdateLayeredWindow failed: %s\n",
(LPSTR) lpMsgBuf);
LocalFree(lpMsgBuf);
}
#endif
if (!g_fNoConfigureWindow)
UpdateWindow(pRLWinPriv->hWnd);
}
void
winMWExtWMDamageRects(RootlessFrameID wid, int nCount, const BoxRec * pRects,
int shift_x, int shift_y)
{
win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) wid;
const BoxRec *pEnd;
#if CYGMULTIWINDOW_DEBUG && 0
winDebug("winMWExtWMDamageRects (%08x, %d, %08x, %d, %d)\n",
pRLWinPriv, nCount, pRects, shift_x, shift_y);
#endif
for (pEnd = pRects + nCount; pRects < pEnd; pRects++) {
RECT rcDmg;
rcDmg.left = pRects->x1 + shift_x;
rcDmg.top = pRects->y1 + shift_y;
rcDmg.right = pRects->x2 + shift_x;
rcDmg.bottom = pRects->y2 + shift_y;
InvalidateRect(pRLWinPriv->hWnd, &rcDmg, FALSE);
}
}
void
winMWExtWMRootlessSwitchWindow(RootlessWindowPtr pFrame, WindowPtr oldWin)
{
win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) pFrame->wid;
#if CYGMULTIWINDOW_DEBUG
winDebug("winMWExtWMRootlessSwitchWindow (%p) %p\n",
pRLWinPriv, pRLWinPriv->hWnd);
#endif
pRLWinPriv->pFrame = pFrame;
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(serverClient, oldWin, AtmWindowsWmNativeHwnd());
winMWExtWMSetNativeProperty(pFrame);
#if CYGMULTIWINDOW_DEBUG
#if 0
{
WindowPtr pWin2 = NULL;
win32RootlessWindowPtr pRLWinPriv2 = NULL;
/* Check if the Windows window property for our X window pointer is valid */
if ((pWin2 =
(WindowPtr) GetProp(pRLWinPriv->hWnd, WIN_WINDOW_PROP)) != NULL) {
pRLWinPriv2 =
(win32RootlessWindowPtr) RootlessFrameForWindow(pWin2, FALSE);
}
winDebug("winMWExtWMSwitchFrame2 (%08x) %08x\n",
pRLWinPriv2, pRLWinPriv2->hWnd);
if (pRLWinPriv != pRLWinPriv2 || pRLWinPriv->hWnd != pRLWinPriv2->hWnd) {
winDebug("Error param missmatch\n");
}
}
#endif
#endif
}
void
winMWExtWMCopyBytes(unsigned int width, unsigned int height,
const void *src, unsigned int srcRowBytes,
void *dst, unsigned int dstRowBytes)
{
#if CYGMULTIWINDOW_DEBUG
winDebug("winMWExtWMCopyBytes - Not implemented\n");
#endif
}
void
winMWExtWMCopyWindow(RootlessFrameID wid, int nDstRects,
const BoxRec * pDstRects, int nDx, int nDy)
{
win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) wid;
const BoxRec *pEnd;
RECT rcDmg;
#if CYGMULTIWINDOW_DEBUG
winDebug("winMWExtWMCopyWindow (%p, %d, %p, %d, %d)\n",
pRLWinPriv, nDstRects, pDstRects, nDx, nDy);
#endif
for (pEnd = pDstRects + nDstRects; pDstRects < pEnd; pDstRects++) {
#if CYGMULTIWINDOW_DEBUG
winDebug("BitBlt (%d, %d, %d, %d) (%d, %d)\n",
pDstRects->x1, pDstRects->y1,
pDstRects->x2 - pDstRects->x1,
pDstRects->y2 - pDstRects->y1,
pDstRects->x1 + nDx, pDstRects->y1 + nDy);
#endif
if (!BitBlt(pRLWinPriv->hdcShadow,
pDstRects->x1, pDstRects->y1,
pDstRects->x2 - pDstRects->x1,
pDstRects->y2 - pDstRects->y1,
pRLWinPriv->hdcShadow,
pDstRects->x1 + nDx, pDstRects->y1 + nDy, SRCCOPY)) {
ErrorF("winMWExtWMCopyWindow - BitBlt failed.\n");
}
rcDmg.left = pDstRects->x1;
rcDmg.top = pDstRects->y1;
rcDmg.right = pDstRects->x2;
rcDmg.bottom = pDstRects->y2;
InvalidateRect(pRLWinPriv->hWnd, &rcDmg, FALSE);
}
#if CYGMULTIWINDOW_DEBUG
winDebug("winMWExtWMCopyWindow - done\n");
#endif
}
/*
* winMWExtWMSetNativeProperty
*/
static void
winMWExtWMSetNativeProperty(RootlessWindowPtr pFrame)
{
win32RootlessWindowPtr pRLWinPriv = (win32RootlessWindowPtr) pFrame->wid;
long lData;
/* FIXME: move this to WindowsWM extension */
lData = (long) pRLWinPriv->hWnd;
dixChangeWindowProperty(serverClient, pFrame->win, AtmWindowsWmNativeHwnd(),
XA_INTEGER, 32, PropModeReplace, 1, &lData, TRUE);
}

View File

@ -1,420 +0,0 @@
/*
*Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
*
*Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
*"Software"), to deal in the Software without restriction, including
*without limitation the rights to use, copy, modify, merge, publish,
*distribute, sublicense, and/or sell copies of the Software, and to
*permit persons to whom the Software is furnished to do so, subject to
*the following conditions:
*
*The above copyright notice and this permission notice shall be
*included in all copies or substantial portions of the Software.
*
*THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
*EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
*MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
*NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
*ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
*CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
*WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*Except as contained in this notice, the name of the XFree86 Project
*shall not be used in advertising or otherwise to promote the sale, use
*or other dealings in this Software without prior written authorization
*from the XFree86 Project.
*
* Authors: Kensuke Matsuzaki
* Earle F. Philhower, III
* Harold L Hunt II
*/
#ifdef HAVE_XWIN_CONFIG_H
#include <xwin-config.h>
#endif
#include "win.h"
#include "winprefs.h"
#if 0
/*
* winMWExtWMReorderWindows
*/
void
winMWExtWMReorderWindows(ScreenPtr pScreen)
{
winScreenPriv(pScreen);
HWND hwnd = NULL;
win32RootlessWindowPtr pRLWin = NULL;
win32RootlessWindowPtr pRLWinSib = NULL;
DWORD dwCurrentProcessID = GetCurrentProcessId();
DWORD dwWindowProcessID = 0;
XID vlist[2];
#if CYGMULTIWINDOW_DEBUG && FALSE
winDebug("winMWExtWMReorderWindows\n");
#endif
pScreenPriv->fRestacking = TRUE;
if (pScreenPriv->fWindowOrderChanged) {
#if CYGMULTIWINDOW_DEBUG
winDebug("winMWExtWMReorderWindows - Need to restack\n");
#endif
hwnd = GetTopWindow(NULL);
while (hwnd) {
GetWindowThreadProcessId(hwnd, &dwWindowProcessID);
if ((dwWindowProcessID == dwCurrentProcessID)
&& GetProp(hwnd, WIN_WINDOW_PROP)) {
pRLWinSib = pRLWin;
pRLWin =
(win32RootlessWindowPtr) GetProp(hwnd, WIN_WINDOW_PROP);
if (pRLWinSib) {
vlist[0] = pRLWinSib->pFrame->win->drawable.id;
vlist[1] = Below;
ConfigureWindow(pRLWin->pFrame->win,
CWSibling | CWStackMode, vlist,
wClient(pRLWin->pFrame->win));
}
else {
/* 1st window - raise to the top */
vlist[0] = Above;
ConfigureWindow(pRLWin->pFrame->win, CWStackMode,
vlist, wClient(pRLWin->pFrame->win));
}
}
hwnd = GetNextWindow(hwnd, GW_HWNDNEXT);
}
}
pScreenPriv->fRestacking = FALSE;
pScreenPriv->fWindowOrderChanged = FALSE;
}
#endif
/*
* winMWExtWMMoveXWindow
*/
void
winMWExtWMMoveXWindow(WindowPtr pWin, int x, int y)
{
CARD32 *vlist = malloc(sizeof(CARD32) * 2);
vlist[0] = x;
vlist[1] = y;
ConfigureWindow(pWin, CWX | CWY, vlist, wClient(pWin));
free(vlist);
}
/*
* winMWExtWMResizeXWindow
*/
void
winMWExtWMResizeXWindow(WindowPtr pWin, int w, int h)
{
CARD32 *vlist = malloc(sizeof(CARD32) * 2);
vlist[0] = w;
vlist[1] = h;
ConfigureWindow(pWin, CWWidth | CWHeight, vlist, wClient(pWin));
free(vlist);
}
/*
* winMWExtWMMoveResizeXWindow
*/
void
winMWExtWMMoveResizeXWindow(WindowPtr pWin, int x, int y, int w, int h)
{
CARD32 *vlist = malloc(sizeof(long) * 4);
vlist[0] = x;
vlist[1] = y;
vlist[2] = w;
vlist[3] = h;
ConfigureWindow(pWin, CWX | CWY | CWWidth | CWHeight, vlist, wClient(pWin));
free(vlist);
}
/*
* winMWExtWMDecorateWindow - Update window style. Called by EnumWindows.
*/
wBOOL 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) {
if (pRLWinPriv != NULL && pRLWinPriv->pFrame != NULL &&
pRLWinPriv->pFrame->win != 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;
WINDOWPLACEMENT wndPlace;
UINT showCmd = 0;
wndPlace.length = sizeof(WINDOWPLACEMENT);
/* Get current window placement */
GetWindowPlacement(pRLWinPriv->hWnd, &wndPlace);
#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 %p %s\n",
pRLWinPriv, fDecorate ? "Decorate" : "Bare");
/* Get the extended window style information */
dwExStyle = GetWindowLongPtr(pRLWinPriv->hWnd, GWL_EXSTYLE);
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);
#ifdef CYGMULTIWINDOW_DEBUG
winDebug("\tWindow extend {%d, %d, %d, %d}, {%d, %d}\n",
rcNew.left, rcNew.top, rcNew.right, rcNew.bottom,
rcNew.right - rcNew.left, rcNew.bottom - rcNew.top);
#endif
/* */
AdjustWindowRectEx(&rcNew,
WS_POPUP | WS_SIZEBOX | WS_OVERLAPPEDWINDOW,
FALSE, WS_EX_APPWINDOW);
#ifdef CYGMULTIWINDOW_DEBUG
winDebug("\tAdjusted {%d, %d, %d, %d}, {%d, %d}\n",
rcNew.left, rcNew.top, rcNew.right, rcNew.bottom,
rcNew.right - rcNew.left, rcNew.bottom - rcNew.top);
#endif
/* 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);
#ifdef CYGMULTIWINDOW_DEBUG
winDebug("\tWindowStyle: %08x %08x\n",
WS_POPUP | WS_SIZEBOX | WS_OVERLAPPEDWINDOW,
WS_EX_APPWINDOW);
#endif
/* Position the Windows window */
#ifdef CYGMULTIWINDOW_DEBUG
winDebug("\tMoved {%d, %d, %d, %d}, {%d, %d}\n",
rcNew.left, rcNew.top, rcNew.right, rcNew.bottom,
rcNew.right - rcNew.left, rcNew.bottom - rcNew.top);
#endif
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));
}
}
}
/*
* winMWExtWMRestackWindows
*/
void
winMWExtWMRestackWindows(ScreenPtr pScreen)
{
winScreenPriv(pScreen);
WindowPtr pRoot = pScreen->root;
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 (%p, %p)\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;
}

File diff suppressed because it is too large Load Diff

View File

@ -1,596 +0,0 @@
/* WindowsWM extension is based on AppleWM extension */
/**************************************************************************
Copyright (c) 2002 Apple Computer, Inc. All Rights Reserved.
Copyright (c) 2003 Torrey T. Lyons. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sub license, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice (including the
next paragraph) shall be included in all copies or substantial portions
of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
**************************************************************************/
#ifdef HAVE_XWIN_CONFIG_H
#include <xwin-config.h>
#endif
#include "win.h"
#include "misc.h"
#include "dixstruct.h"
#include "extnsionst.h"
#include "colormapst.h"
#include "cursorstr.h"
#include "scrnintstr.h"
#include "servermd.h"
#include "swaprep.h"
#define _WINDOWSWM_SERVER_
#include <X11/extensions/windowswmstr.h>
#include "protocol-versions.h"
static int WMErrorBase;
static unsigned char WMReqCode = 0;
static int WMEventBase = 0;
static RESTYPE ClientType, eventResourceType; /* resource types for event masks */
static XID eventResource;
/* Currently selected events */
static unsigned int eventMask = 0;
static int WMFreeClient(void *data, XID id);
static int WMFreeEvents(void *data, XID id);
static void SNotifyEvent(xWindowsWMNotifyEvent * from,
xWindowsWMNotifyEvent * to);
typedef struct _WMEvent *WMEventPtr;
typedef struct _WMEvent {
WMEventPtr next;
ClientPtr client;
XID clientResource;
unsigned int mask;
} WMEventRec;
static int
ProcWindowsWMQueryVersion(ClientPtr client)
{
xWindowsWMQueryVersionReply rep;
REQUEST_SIZE_MATCH(xWindowsWMQueryVersionReq);
rep.type = X_Reply;
rep.length = 0;
rep.sequenceNumber = client->sequence;
rep.majorVersion = SERVER_WINDOWSWM_MAJOR_VERSION;
rep.minorVersion = SERVER_WINDOWSWM_MINOR_VERSION;
rep.patchVersion = SERVER_WINDOWSWM_PATCH_VERSION;
if (client->swapped) {
swaps(&rep.sequenceNumber);
swapl(&rep.length);
}
WriteToClient(client, sizeof(xWindowsWMQueryVersionReply), &rep);
return Success;
}
/* events */
static inline void
updateEventMask(WMEventPtr * pHead)
{
WMEventPtr pCur;
eventMask = 0;
for (pCur = *pHead; pCur != NULL; pCur = pCur->next)
eventMask |= pCur->mask;
}
/*ARGSUSED*/ static int
WMFreeClient(void *data, XID id)
{
WMEventPtr pEvent;
WMEventPtr *pHead, pCur, pPrev;
pEvent = (WMEventPtr) data;
dixLookupResourceByType((void *) &pHead, eventResource, eventResourceType,
NullClient, DixUnknownAccess);
if (pHead) {
pPrev = 0;
for (pCur = *pHead; pCur && pCur != pEvent; pCur = pCur->next)
pPrev = pCur;
if (pCur) {
if (pPrev)
pPrev->next = pEvent->next;
else
*pHead = pEvent->next;
}
updateEventMask(pHead);
}
free((void *) pEvent);
return 1;
}
/*ARGSUSED*/ static int
WMFreeEvents(void *data, XID id)
{
WMEventPtr *pHead, pCur, pNext;
pHead = (WMEventPtr *) data;
for (pCur = *pHead; pCur; pCur = pNext) {
pNext = pCur->next;
FreeResource(pCur->clientResource, ClientType);
free((void *) pCur);
}
free((void *) pHead);
eventMask = 0;
return 1;
}
static int
ProcWindowsWMSelectInput(ClientPtr client)
{
REQUEST(xWindowsWMSelectInputReq);
WMEventPtr pEvent, pNewEvent, *pHead;
XID clientResource;
REQUEST_SIZE_MATCH(xWindowsWMSelectInputReq);
dixLookupResourceByType((void *) &pHead, eventResource, eventResourceType,
client, DixWriteAccess);
if (stuff->mask != 0) {
if (pHead) {
/* check for existing entry. */
for (pEvent = *pHead; pEvent; pEvent = pEvent->next) {
if (pEvent->client == client) {
pEvent->mask = stuff->mask;
updateEventMask(pHead);
return Success;
}
}
}
/* build the entry */
pNewEvent = malloc(sizeof(WMEventRec));
if (!pNewEvent)
return BadAlloc;
pNewEvent->next = 0;
pNewEvent->client = client;
pNewEvent->mask = stuff->mask;
/*
* add a resource that will be deleted when
* the client goes away
*/
clientResource = FakeClientID(client->index);
pNewEvent->clientResource = clientResource;
if (!AddResource(clientResource, ClientType, (void *) pNewEvent))
return BadAlloc;
/*
* create a resource to contain a pointer to the list
* of clients selecting input. This must be indirect as
* the list may be arbitrarily rearranged which cannot be
* done through the resource database.
*/
if (!pHead) {
pHead = malloc(sizeof(WMEventPtr));
if (!pHead ||
!AddResource(eventResource, eventResourceType, (void *) pHead))
{
FreeResource(clientResource, RT_NONE);
return BadAlloc;
}
*pHead = 0;
}
pNewEvent->next = *pHead;
*pHead = pNewEvent;
updateEventMask(pHead);
}
else if (stuff->mask == 0) {
/* delete the interest */
if (pHead) {
pNewEvent = 0;
for (pEvent = *pHead; pEvent; pEvent = pEvent->next) {
if (pEvent->client == client)
break;
pNewEvent = pEvent;
}
if (pEvent) {
FreeResource(pEvent->clientResource, ClientType);
if (pNewEvent)
pNewEvent->next = pEvent->next;
else
*pHead = pEvent->next;
free(pEvent);
updateEventMask(pHead);
}
}
}
else {
client->errorValue = stuff->mask;
return BadValue;
}
return Success;
}
/*
* deliver the event
*/
void
winWindowsWMSendEvent(int type, unsigned int mask, int which, int arg,
Window window, int x, int y, int w, int h)
{
WMEventPtr *pHead, pEvent;
ClientPtr client;
xWindowsWMNotifyEvent se;
#if CYGMULTIWINDOW_DEBUG
ErrorF("winWindowsWMSendEvent %d %d %d %d, %d %d - %d %d\n",
type, mask, which, arg, x, y, w, h);
#endif
dixLookupResourceByType((void *) &pHead, eventResource, eventResourceType,
NullClient, DixUnknownAccess);
if (!pHead)
return;
for (pEvent = *pHead; pEvent; pEvent = pEvent->next) {
client = pEvent->client;
#if CYGMULTIWINDOW_DEBUG
ErrorF("winWindowsWMSendEvent - %p\n", client);
#endif
if ((pEvent->mask & mask) == 0) {
continue;
}
#if CYGMULTIWINDOW_DEBUG
ErrorF("winWindowsWMSendEvent - send\n");
#endif
se.type = type + WMEventBase;
se.kind = which;
se.window = window;
se.arg = arg;
se.x = x;
se.y = y;
se.w = w;
se.h = h;
se.time = currentTime.milliseconds;
WriteEventsToClient(client, 1, (xEvent *) &se);
}
}
/* general utility functions */
static int
ProcWindowsWMDisableUpdate(ClientPtr client)
{
REQUEST_SIZE_MATCH(xWindowsWMDisableUpdateReq);
//winDisableUpdate();
return Success;
}
static int
ProcWindowsWMReenableUpdate(ClientPtr client)
{
REQUEST_SIZE_MATCH(xWindowsWMReenableUpdateReq);
//winEnableUpdate();
return Success;
}
/* window functions */
static int
ProcWindowsWMSetFrontProcess(ClientPtr client)
{
REQUEST_SIZE_MATCH(xWindowsWMSetFrontProcessReq);
//QuartzMessageMainThread(kWindowsSetFrontProcess, NULL, 0);
return Success;
}
/* frame functions */
static int
ProcWindowsWMFrameGetRect(ClientPtr client)
{
xWindowsWMFrameGetRectReply rep;
RECT rcNew;
REQUEST(xWindowsWMFrameGetRectReq);
#if CYGMULTIWINDOW_DEBUG
ErrorF("ProcWindowsWMFrameGetRect %zu %d\n",
(sizeof(xWindowsWMFrameGetRectReq) >> 2), (int) client->req_len);
#endif
REQUEST_SIZE_MATCH(xWindowsWMFrameGetRectReq);
rep.type = X_Reply;
rep.length = 0;
rep.sequenceNumber = client->sequence;
if (stuff->frame_rect != 0) {
ErrorF("ProcWindowsWMFrameGetRect - stuff->frame_rect != 0\n");
return BadValue;
}
/* Store the origin, height, and width in a rectangle structure */
SetRect(&rcNew, stuff->ix, stuff->iy,
stuff->ix + stuff->iw, stuff->iy + stuff->ih);
#if CYGMULTIWINDOW_DEBUG
ErrorF("ProcWindowsWMFrameGetRect - %d %d %d %d\n",
stuff->ix, stuff->iy, stuff->ix + stuff->iw, stuff->iy + stuff->ih);
#endif
/*
* Calculate the required size of the Windows window rectangle,
* given the size of the Windows window client area.
*/
AdjustWindowRectEx(&rcNew, stuff->frame_style, FALSE,
stuff->frame_style_ex);
rep.x = rcNew.left;
rep.y = rcNew.top;
rep.w = rcNew.right - rcNew.left;
rep.h = rcNew.bottom - rcNew.top;
#if CYGMULTIWINDOW_DEBUG
ErrorF("ProcWindowsWMFrameGetRect - %d %d %d %d\n",
rep.x, rep.y, rep.w, rep.h);
#endif
WriteToClient(client, sizeof(xWindowsWMFrameGetRectReply), &rep);
return Success;
}
static int
ProcWindowsWMFrameDraw(ClientPtr client)
{
REQUEST(xWindowsWMFrameDrawReq);
WindowPtr pWin;
win32RootlessWindowPtr pRLWinPriv;
RECT rcNew;
int nCmdShow, rc;
RegionRec newShape;
REQUEST_SIZE_MATCH(xWindowsWMFrameDrawReq);
#if CYGMULTIWINDOW_DEBUG
ErrorF("ProcWindowsWMFrameDraw\n");
#endif
rc = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess);
if (rc != Success)
return rc;
#if CYGMULTIWINDOW_DEBUG
ErrorF("ProcWindowsWMFrameDraw - Window found\n");
#endif
pRLWinPriv = (win32RootlessWindowPtr) RootlessFrameForWindow(pWin, TRUE);
if (pRLWinPriv == 0)
return BadWindow;
#if CYGMULTIWINDOW_DEBUG
ErrorF("ProcWindowsWMFrameDraw - HWND %p 0x%08x 0x%08x\n",
pRLWinPriv->hWnd, (int) stuff->frame_style,
(int) stuff->frame_style_ex);
ErrorF("ProcWindowsWMFrameDraw - %d %d %d %d\n",
stuff->ix, stuff->iy, stuff->iw, stuff->ih);
#endif
/* Store the origin, height, and width in a rectangle structure */
SetRect(&rcNew, stuff->ix, stuff->iy,
stuff->ix + stuff->iw, stuff->iy + stuff->ih);
/*
* Calculate the required size of the Windows window rectangle,
* given the size of the Windows window client area.
*/
AdjustWindowRectEx(&rcNew, stuff->frame_style, FALSE,
stuff->frame_style_ex);
/* Set the window extended style flags */
if (!SetWindowLongPtr(pRLWinPriv->hWnd, GWL_EXSTYLE, stuff->frame_style_ex)) {
return BadValue;
}
/* Set the window standard style flags */
if (!SetWindowLongPtr(pRLWinPriv->hWnd, GWL_STYLE, stuff->frame_style)) {
return BadValue;
}
/* Flush the window style */
if (!SetWindowPos(pRLWinPriv->hWnd, NULL,
rcNew.left, rcNew.top,
rcNew.right - rcNew.left, rcNew.bottom - rcNew.top,
SWP_NOZORDER | SWP_FRAMECHANGED | SWP_NOACTIVATE)) {
return BadValue;
}
if (!IsWindowVisible(pRLWinPriv->hWnd))
nCmdShow = SW_HIDE;
else
nCmdShow = SW_SHOWNA;
ShowWindow(pRLWinPriv->hWnd, nCmdShow);
if (wBoundingShape(pWin) != NULL) {
/* wBoundingShape is relative to *inner* origin of window.
Translate by borderWidth to get the outside-relative position. */
RegionNull(&newShape);
RegionCopy(&newShape, wBoundingShape(pWin));
RegionTranslate(&newShape, pWin->borderWidth, pWin->borderWidth);
winMWExtWMReshapeFrame(pRLWinPriv, &newShape);
RegionUninit(&newShape);
}
#if CYGMULTIWINDOW_DEBUG
ErrorF("ProcWindowsWMFrameDraw - done\n");
#endif
return Success;
}
static int
ProcWindowsWMFrameSetTitle(ClientPtr client)
{
unsigned int title_length, title_max;
char *title_bytes;
REQUEST(xWindowsWMFrameSetTitleReq);
WindowPtr pWin;
win32RootlessWindowPtr pRLWinPriv;
int rc;
#if CYGMULTIWINDOW_DEBUG
ErrorF("ProcWindowsWMFrameSetTitle\n");
#endif
REQUEST_AT_LEAST_SIZE(xWindowsWMFrameSetTitleReq);
rc = dixLookupWindow(&pWin, stuff->window, client, DixReadAccess);
if (rc != Success)
return rc;
#if CYGMULTIWINDOW_DEBUG
ErrorF("ProcWindowsWMFrameSetTitle - Window found\n");
#endif
title_length = stuff->title_length;
title_max = (stuff->length << 2) - sizeof(xWindowsWMFrameSetTitleReq);
if (title_max < title_length)
return BadValue;
#if CYGMULTIWINDOW_DEBUG
ErrorF("ProcWindowsWMFrameSetTitle - length is valid\n");
#endif
title_bytes = malloc(title_length + 1);
strncpy(title_bytes, (char *) &stuff[1], title_length);
title_bytes[title_length] = '\0';
pRLWinPriv = (win32RootlessWindowPtr) RootlessFrameForWindow(pWin, FALSE);
if (pRLWinPriv == 0) {
free(title_bytes);
return BadWindow;
}
/* Flush the window style */
SetWindowText(pRLWinPriv->hWnd, title_bytes);
free(title_bytes);
#if CYGMULTIWINDOW_DEBUG
ErrorF("ProcWindowsWMFrameSetTitle - done\n");
#endif
return Success;
}
/* dispatch */
static int
ProcWindowsWMDispatch(ClientPtr client)
{
REQUEST(xReq);
switch (stuff->data) {
case X_WindowsWMQueryVersion:
return ProcWindowsWMQueryVersion(client);
}
if (!client->local)
return WMErrorBase + WindowsWMClientNotLocal;
switch (stuff->data) {
case X_WindowsWMSelectInput:
return ProcWindowsWMSelectInput(client);
case X_WindowsWMDisableUpdate:
return ProcWindowsWMDisableUpdate(client);
case X_WindowsWMReenableUpdate:
return ProcWindowsWMReenableUpdate(client);
case X_WindowsWMSetFrontProcess:
return ProcWindowsWMSetFrontProcess(client);
case X_WindowsWMFrameGetRect:
return ProcWindowsWMFrameGetRect(client);
case X_WindowsWMFrameDraw:
return ProcWindowsWMFrameDraw(client);
case X_WindowsWMFrameSetTitle:
return ProcWindowsWMFrameSetTitle(client);
default:
return BadRequest;
}
}
static void
SNotifyEvent(xWindowsWMNotifyEvent * from, xWindowsWMNotifyEvent * to)
{
to->type = from->type;
to->kind = from->kind;
cpswaps(from->sequenceNumber, to->sequenceNumber);
cpswapl(from->window, to->window);
cpswapl(from->time, to->time);
cpswapl(from->arg, to->arg);
}
static int
SProcWindowsWMQueryVersion(ClientPtr client)
{
REQUEST(xWindowsWMQueryVersionReq);
swaps(&stuff->length);
return ProcWindowsWMQueryVersion(client);
}
static int
SProcWindowsWMDispatch(ClientPtr client)
{
REQUEST(xReq);
/* It is bound to be non-local when there is byte swapping */
if (!client->local)
return WMErrorBase + WindowsWMClientNotLocal;
/* only local clients are allowed WM access */
switch (stuff->data) {
case X_WindowsWMQueryVersion:
return SProcWindowsWMQueryVersion(client);
default:
return BadRequest;
}
}
void
winWindowsWMExtensionInit(void)
{
ExtensionEntry *extEntry;
ClientType = CreateNewResourceType(WMFreeClient, "WMClient");
eventResourceType = CreateNewResourceType(WMFreeEvents, "WMEvent");
eventResource = FakeClientID(0);
if (ClientType && eventResourceType &&
(extEntry = AddExtension(WINDOWSWMNAME,
WindowsWMNumberEvents,
WindowsWMNumberErrors,
ProcWindowsWMDispatch,
SProcWindowsWMDispatch,
NULL, StandardMinorOpcode))) {
size_t i;
WMReqCode = (unsigned char) extEntry->base;
WMErrorBase = extEntry->errorBase;
WMEventBase = extEntry->eventBase;
for (i = 0; i < WindowsWMNumberEvents; i++)
EventSwapVector[WMEventBase + i] = (EventSwapPtr) SNotifyEvent;
}
}

View File

@ -220,14 +220,7 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
use RandR to resize the X screen
*/
if ((!s_pScreenInfo->fUserGaveHeightAndWidth) &&
(s_pScreenInfo->iResizeMode == resizeWithRandr) && (FALSE
#ifdef XWIN_MULTIWINDOWEXTWM
||
s_pScreenInfo->
fMWExtWM
#endif
||
s_pScreenInfo->
(s_pScreenInfo->iResizeMode == resizeWithRandr) && (s_pScreenInfo->
fRootless
||
s_pScreenInfo->
@ -315,9 +308,6 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
/* Break if we do not allow resizing */
if ((s_pScreenInfo->iResizeMode == resizeNotAllowed)
|| !s_pScreenInfo->fDecoration
#ifdef XWIN_MULTIWINDOWEXTWM
|| s_pScreenInfo->fMWExtWM
#endif
|| s_pScreenInfo->fRootless
|| s_pScreenInfo->fMultiWindow
|| s_pScreenInfo->fFullScreen)
@ -616,9 +606,6 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
if (s_pScreenInfo == NULL
|| (s_pScreenInfo->iResizeMode != resizeWithScrollbars)
|| s_pScreenInfo->fFullScreen || !s_pScreenInfo->fDecoration
#ifdef XWIN_MULTIWINDOWEXTWM
|| s_pScreenInfo->fMWExtWM
#endif
|| s_pScreenInfo->fRootless
|| s_pScreenInfo->fMultiWindow
)
@ -799,22 +786,14 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
case WM_LBUTTONDOWN:
if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
break;
if (s_pScreenInfo->fRootless
#ifdef XWIN_MULTIWINDOWEXTWM
|| s_pScreenInfo->fMWExtWM
#endif
)
if (s_pScreenInfo->fRootless)
SetCapture(hwnd);
return winMouseButtonsHandle(s_pScreen, ButtonPress, Button1, wParam);
case WM_LBUTTONUP:
if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
break;
if (s_pScreenInfo->fRootless
#ifdef XWIN_MULTIWINDOWEXTWM
|| s_pScreenInfo->fMWExtWM
#endif
)
if (s_pScreenInfo->fRootless)
ReleaseCapture();
return winMouseButtonsHandle(s_pScreen, ButtonRelease, Button1, wParam);
@ -822,22 +801,14 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
case WM_MBUTTONDOWN:
if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
break;
if (s_pScreenInfo->fRootless
#ifdef XWIN_MULTIWINDOWEXTWM
|| s_pScreenInfo->fMWExtWM
#endif
)
if (s_pScreenInfo->fRootless)
SetCapture(hwnd);
return winMouseButtonsHandle(s_pScreen, ButtonPress, Button2, wParam);
case WM_MBUTTONUP:
if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
break;
if (s_pScreenInfo->fRootless
#ifdef XWIN_MULTIWINDOWEXTWM
|| s_pScreenInfo->fMWExtWM
#endif
)
if (s_pScreenInfo->fRootless)
ReleaseCapture();
return winMouseButtonsHandle(s_pScreen, ButtonRelease, Button2, wParam);
@ -845,22 +816,14 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
case WM_RBUTTONDOWN:
if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
break;
if (s_pScreenInfo->fRootless
#ifdef XWIN_MULTIWINDOWEXTWM
|| s_pScreenInfo->fMWExtWM
#endif
)
if (s_pScreenInfo->fRootless)
SetCapture(hwnd);
return winMouseButtonsHandle(s_pScreen, ButtonPress, Button3, wParam);
case WM_RBUTTONUP:
if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
break;
if (s_pScreenInfo->fRootless
#ifdef XWIN_MULTIWINDOWEXTWM
|| s_pScreenInfo->fMWExtWM
#endif
)
if (s_pScreenInfo->fRootless)
ReleaseCapture();
return winMouseButtonsHandle(s_pScreen, ButtonRelease, Button3, wParam);
@ -868,22 +831,14 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
case WM_XBUTTONDOWN:
if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
break;
if (s_pScreenInfo->fRootless
#ifdef XWIN_MULTIWINDOWEXTWM
|| s_pScreenInfo->fMWExtWM
#endif
)
if (s_pScreenInfo->fRootless)
SetCapture(hwnd);
return winMouseButtonsHandle(s_pScreen, ButtonPress, HIWORD(wParam) + 7,
wParam);
case WM_XBUTTONUP:
if (s_pScreenPriv == NULL || s_pScreenInfo->fIgnoreInput)
break;
if (s_pScreenInfo->fRootless
#ifdef XWIN_MULTIWINDOWEXTWM
|| s_pScreenInfo->fMWExtWM
#endif
)
if (s_pScreenInfo->fRootless)
ReleaseCapture();
return winMouseButtonsHandle(s_pScreen, ButtonRelease,
HIWORD(wParam) + 7, wParam);
@ -1166,14 +1121,6 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
/* Call engine specific screen activation/deactivation function */
(*s_pScreenPriv->pwinActivateApp) (s_pScreen);
#ifdef XWIN_MULTIWINDOWEXTWM
if (s_pScreenPriv->fActive) {
/* Restack all window unless using built-in wm. */
if (s_pScreenInfo->fMWExtWM)
winMWExtWMRestackWindows(s_pScreen);
}
#endif
return 0;
case WM_COMMAND:

View File

@ -82,7 +82,6 @@ dri3proto_dep = dependency('dri3proto', version: '>= 1.2', required: get_option(
xineramaproto_dep = dependency('xineramaproto')
xf86bigfontproto_dep = dependency('xf86bigfontproto', version: '>= 1.2.0')
xf86vidmodeproto_dep = dependency('xf86vidmodeproto', version: '>= 2.2.99.1')
windowswmproto_dep = dependency('windowswmproto', required: false)
applewmproto_dep = dependency('applewmproto', version: '>= 1.4', required: false)
xshmfence_dep = dependency('xshmfence', version: '>= 1.1', required: false)
@ -477,7 +476,6 @@ common_dep = [
xf86bigfontproto_dep,
xf86dgaproto_dep,
xf86vidmodeproto_dep,
windowswmproto_dep,
applewmproto_dep,
pixman_dep,