summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Xext/xvmc.c11
-rw-r--r--configure.ac18
-rw-r--r--fb/fb24_32.c4
-rw-r--r--fb/fbarc.c9
-rw-r--r--fb/fbfill.c6
-rw-r--r--fb/fbgc.c4
-rw-r--r--fb/fbpush.c2
-rw-r--r--glx/Makefile.am6
-rw-r--r--glx/glapi_gentable.c6
-rw-r--r--glx/glxdri2.c9
-rw-r--r--glx/glxscreens.c7
-rw-r--r--hw/dmx/config/xdmxconfig.c8
-rw-r--r--hw/dmx/examples/xbell.c3
-rw-r--r--hw/xfree86/dri2/dri2.h2
-rw-r--r--hw/xfree86/dri2/dri2ext.c7
-rw-r--r--hw/xquartz/X11Application.m25
-rw-r--r--hw/xquartz/mach-startup/Makefile.am4
-rw-r--r--hw/xwin/XWin.rc2
-rw-r--r--hw/xwin/windialogs.c2
-rw-r--r--hw/xwin/winmultiwindowwindow.c37
-rw-r--r--hw/xwin/winmultiwindowwndproc.c58
-rw-r--r--hw/xwin/winwindow.h1
-rw-r--r--miext/shadow/shpacked.c2
-rw-r--r--miext/shadow/shplanar.c2
-rw-r--r--miext/shadow/shplanar8.c2
-rw-r--r--miext/shadow/shrotate.c2
-rw-r--r--miext/shadow/shrotpack.h2
-rw-r--r--miext/shadow/shrotpackYX.h2
-rw-r--r--xfixes/cursor.c4
-rw-r--r--xfixes/region.c2
30 files changed, 171 insertions, 78 deletions
diff --git a/Xext/xvmc.c b/Xext/xvmc.c
index 4d29941ee..bc78b55ae 100644
--- a/Xext/xvmc.c
+++ b/Xext/xvmc.c
@@ -487,8 +487,8 @@ ProcXvMCListSubpictureTypes(ClientPtr client)
pScreen = pPort->pAdaptor->pScreen;
- if(XvMCScreenKey == NULL) /* No XvMC adaptors */
- return BadMatch;
+ if (!dixPrivateKeyRegistered(XvMCScreenKey))
+ return BadMatch; /* No XvMC adaptors */
if(!(pScreenPriv = XVMC_GET_PRIVATE(pScreen)))
return BadMatch; /* None this screen */
@@ -668,8 +668,8 @@ XvMCExtensionInit(void)
{
ExtensionEntry *extEntry;
- if(XvMCScreenKey == NULL) /* nobody supports it */
- return;
+ if (!dixPrivateKeyRegistered(XvMCScreenKey))
+ return;
if(!(XvMCRTContext = CreateNewResourceType(XvMCDestroyContextRes,
"XvMCRTContext")))
@@ -746,7 +746,8 @@ XvImagePtr XvMCFindXvImage(XvPortPtr pPort, CARD32 id)
XvMCAdaptorPtr adaptor = NULL;
int i;
- if(XvMCScreenKey == NULL) return NULL;
+ if (!dixPrivateKeyRegistered(XvMCScreenKey))
+ return NULL;
if(!(pScreenPriv = XVMC_GET_PRIVATE(pScreen)))
return NULL;
diff --git a/configure.ac b/configure.ac
index 67a7f1390..4656a83fb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -774,18 +774,18 @@ RECORDPROTO="recordproto >= 1.13.99.1"
SCRNSAVERPROTO="scrnsaverproto >= 1.1"
RESOURCEPROTO="resourceproto"
DRIPROTO="xf86driproto >= 2.1.0"
-DRI2PROTO="dri2proto >= 2.3"
+DRI2PROTO="dri2proto >= 2.6"
XINERAMAPROTO="xineramaproto"
BIGFONTPROTO="xf86bigfontproto >= 1.2.0"
DGAPROTO="xf86dgaproto >= 2.0.99.1"
-GLPROTO="glproto >= 1.4.10"
+GLPROTO="glproto >= 1.4.14"
DMXPROTO="dmxproto >= 2.2.99.1"
VIDMODEPROTO="xf86vidmodeproto >= 2.2.99.1"
WINDOWSWMPROTO="windowswmproto"
APPLEWMPROTO="applewmproto >= 1.4"
dnl Core modules for most extensions, et al.
-SDK_REQUIRED_MODULES="[xproto >= 7.0.17] [randrproto >= 1.2.99.3] [renderproto >= 0.11] [xextproto >= 7.1.99] [inputproto >= 1.9.99.902] [kbproto >= 1.0.3] fontsproto"
+SDK_REQUIRED_MODULES="[xproto >= 7.0.22] [randrproto >= 1.2.99.3] [renderproto >= 0.11] [xextproto >= 7.1.99] [inputproto >= 1.9.99.902] [kbproto >= 1.0.3] fontsproto"
# Make SDK_REQUIRED_MODULES available for inclusion in xorg-server.pc
AC_SUBST(SDK_REQUIRED_MODULES)
@@ -1735,14 +1735,6 @@ if test "x$XORG" = xyes; then
AC_SUBST([XORG_INCS])
AC_SUBST([XORG_OS])
AC_SUBST([XORG_OS_SUBDIR])
-
- AC_PATH_PROG(PERL, perl, no)
- dnl unlikely as this may be ...
- if test "x$PERL" = xno; then
- AC_MSG_ERROR([Perl is required to build the XFree86/Xorg DDX.])
- fi
- AC_SUBST(PERL)
-
AC_SUBST([XORG_CFLAGS])
dnl these only go in xorg-config.h
@@ -1889,8 +1881,8 @@ if test "x$XQUARTZ" = xyes; then
AC_DEFINE(XQUARTZ,1,[Have Quartz])
AC_DEFINE(ROOTLESS,1,[Build Rootless code])
- DARWIN_LIBS="$MI_LIB $OS_LIB $DIX_LIB $MAIN_LIB $FB_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $XPSTUBS_LIB"
- AC_SUBST([DARWIN_LIBS])
+ XQUARTZ_LIBS="$MAIN_LIB $FB_LIB $FIXES_LIB $XEXT_LIB $DBE_LIB $RECORD_LIB $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_SYNC_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $XKB_STUB_LIB $XPSTUBS_LIB"
+ AC_SUBST([XQUARTZ_LIBS])
AC_CHECK_LIB([Xplugin],[xp_init],[:])
diff --git a/fb/fb24_32.c b/fb/fb24_32.c
index 2e600edc0..033fa46c5 100644
--- a/fb/fb24_32.c
+++ b/fb/fb24_32.c
@@ -540,8 +540,8 @@ fb24_32ReformatTile(PixmapPtr pOldTile, int bitsPerPixel)
FbStride oldStride, newStride;
int oldBpp, newBpp;
fb24_32BltFunc blt;
- int oldXoff, oldYoff;
- int newXoff, newYoff;
+ _X_UNUSED int oldXoff, oldYoff;
+ _X_UNUSED int newXoff, newYoff;
pNewTile = pScreen->CreatePixmap(pScreen, pOldTile->drawable.width,
pOldTile->drawable.height,
diff --git a/fb/fbarc.c b/fb/fbarc.c
index a0c5343e0..e54c80491 100644
--- a/fb/fbarc.c
+++ b/fb/fbarc.c
@@ -68,15 +68,12 @@ fbPolyArc (DrawablePtr pDrawable,
BoxRec box;
int x2, y2;
RegionPtr cclip;
- int wrapped = 0;
+#ifdef FB_ACCESS_WRAPPER
+ int wrapped = 1;
+#endif
cclip = fbGetCompositeClip (pGC);
fbGetDrawable (pDrawable, dst, dstStride, dstBpp, dstXoff, dstYoff);
-#ifdef FB_ACCESS_WRAPPER
- wrapped = 1;
-#else
- wrapped = 0;
-#endif
while (narcs--)
{
if (miCanZeroArc (parcs))
diff --git a/fb/fbfill.c b/fb/fbfill.c
index 801a0d0a9..e62a48ae0 100644
--- a/fb/fbfill.c
+++ b/fb/fbfill.c
@@ -69,7 +69,7 @@ fbFill (DrawablePtr pDrawable,
FbBits *stip;
FbStride stipStride;
int stipBpp;
- int stipXoff, stipYoff; /* XXX assumed to be zero */
+ _X_UNUSED int stipXoff, stipYoff;
if (pGC->fillStyle == FillStippled)
alu = FbStipple1Rop(pGC->alu,pGC->fgPixel);
@@ -97,7 +97,7 @@ fbFill (DrawablePtr pDrawable,
FbStip *stip;
FbStride stipStride;
int stipBpp;
- int stipXoff, stipYoff; /* XXX assumed to be zero */
+ _X_UNUSED int stipXoff, stipYoff;
FbBits fgand, fgxor, bgand, bgxor;
fgand = pPriv->and;
@@ -139,7 +139,7 @@ fbFill (DrawablePtr pDrawable,
int tileBpp;
int tileWidth;
int tileHeight;
- int tileXoff, tileYoff; /* XXX assumed to be zero */
+ _X_UNUSED int tileXoff, tileYoff;
fbGetDrawable (&pTile->drawable, tile, tileStride, tileBpp, tileXoff, tileYoff);
tileWidth = pTile->drawable.width;
diff --git a/fb/fbgc.c b/fb/fbgc.c
index cc504c1b8..8108c3acb 100644
--- a/fb/fbgc.c
+++ b/fb/fbgc.c
@@ -89,7 +89,7 @@ fbPadPixmap (PixmapPtr pPixmap)
int w;
int stride;
int bpp;
- int xOff, yOff;
+ _X_UNUSED int xOff, yOff;
fbGetDrawable (&pPixmap->drawable, bits, stride, bpp, xOff, yOff);
@@ -163,7 +163,7 @@ fbCanEvenStipple (PixmapPtr pStipple, int bpp)
FbBits *bits;
int stride;
int stip_bpp;
- int stipXoff, stipYoff;
+ _X_UNUSED int stipXoff, stipYoff;
int h;
/* can't even stipple 24bpp drawables */
diff --git a/fb/fbpush.c b/fb/fbpush.c
index 9d827181d..8dd7c2b59 100644
--- a/fb/fbpush.c
+++ b/fb/fbpush.c
@@ -235,7 +235,7 @@ fbPushPixels (GCPtr pGC,
FbStip *stip;
FbStride stipStride;
int stipBpp;
- int stipXoff, stipYoff; /* Assumed to be zero */
+ _X_UNUSED int stipXoff, stipYoff;
fbGetStipDrawable (&pBitmap->drawable, stip, stipStride, stipBpp, stipXoff, stipYoff);
diff --git a/glx/Makefile.am b/glx/Makefile.am
index 7cc2521d5..34be4ae49 100644
--- a/glx/Makefile.am
+++ b/glx/Makefile.am
@@ -48,9 +48,7 @@ glapi_sources = \
glthread.c \
glthread.h
-libglxdri_la_SOURCES = \
- extension_string.c \
- extension_string.h
+libglxdri_la_SOURCES =
if DRI
libglxdri_la_SOURCES += glxdri.c
@@ -65,6 +63,8 @@ libglxdri_la_LIBADD = $(DLOPEN_LIBS)
libglx_la_SOURCES = \
$(indirect_sources) \
$(glapi_sources) \
+ extension_string.c \
+ extension_string.h \
indirect_util.c \
indirect_util.h \
indirect_program.c \
diff --git a/glx/glapi_gentable.c b/glx/glapi_gentable.c
index a9ba3af56..b49ae20f4 100644
--- a/glx/glapi_gentable.c
+++ b/glx/glapi_gentable.c
@@ -31,7 +31,10 @@
#include <dix-config.h>
#endif
+#ifdef HAVE_BACKTRACE
#include <execinfo.h>
+#endif
+
#include <dlfcn.h>
#include <stdlib.h>
#include <stdio.h>
@@ -46,6 +49,8 @@
static void
__glapi_gentable_NoOp(void) {
const char *fstr = "Unknown";
+
+#ifdef HAVE_BACKTRACE
void *frames[2];
if(backtrace(frames, 2) == 2) {
@@ -54,6 +59,7 @@ __glapi_gentable_NoOp(void) {
if(info.dli_sname)
fstr = info.dli_sname;
}
+#endif
LogMessage(X_ERROR, "GLX: Call to unimplemented API: %s\n", fstr);
}
diff --git a/glx/glxdri2.c b/glx/glxdri2.c
index d97971739..e8722585b 100644
--- a/glx/glxdri2.c
+++ b/glx/glxdri2.c
@@ -163,10 +163,10 @@ __glXDRIdrawableWaitGL(__GLXdrawable *drawable)
static void
__glXdriSwapEvent(ClientPtr client, void *data, int type, CARD64 ust,
- CARD64 msc, CARD64 sbc)
+ CARD64 msc, CARD32 sbc)
{
__GLXdrawable *drawable = data;
- xGLXBufferSwapComplete wire;
+ xGLXBufferSwapComplete2 wire;
if (!(drawable->eventMask & GLX_BUFFER_SWAP_COMPLETE_INTEL_MASK))
return;
@@ -192,8 +192,7 @@ __glXdriSwapEvent(ClientPtr client, void *data, int type, CARD64 ust,
wire.ust_lo = ust & 0xffffffff;
wire.msc_hi = msc >> 32;
wire.msc_lo = msc & 0xffffffff;
- wire.sbc_hi = sbc >> 32;
- wire.sbc_lo = sbc & 0xffffffff;
+ wire.sbc = sbc;
WriteEventsToClient(client, 1, (xEvent *) &wire);
}
@@ -222,7 +221,7 @@ __glXDRIdrawableSwapBuffers(ClientPtr client, __GLXdrawable *drawable)
#endif
if (DRI2SwapBuffers(client, drawable->pDraw, 0, 0, 0, &unused,
- __glXdriSwapEvent, drawable->pDraw) != Success)
+ __glXdriSwapEvent, drawable) != Success)
return FALSE;
return TRUE;
diff --git a/glx/glxscreens.c b/glx/glxscreens.c
index 496cf9e14..c4ad42648 100644
--- a/glx/glxscreens.c
+++ b/glx/glxscreens.c
@@ -395,8 +395,15 @@ void __glXScreenInit(__GLXscreen *pGlxScreen, ScreenPtr pScreen)
if (depth == pScreen->visuals[i].nplanes)
break;
}
+ /* if it can't, fix up the fbconfig to not advertise window support */
if (i == pScreen->numVisuals)
+ config->drawableType &= ~(GLX_WINDOW_BIT);
+
+ /* fbconfig must support window drawables */
+ if (!(config->drawableType & GLX_WINDOW_BIT)) {
+ config->visualID = 0;
continue;
+ }
/* Create a new X visual for our FBconfig. */
visual = AddScreenVisuals(pScreen, 1, depth);
diff --git a/hw/dmx/config/xdmxconfig.c b/hw/dmx/config/xdmxconfig.c
index c67077aec..2de7f2b85 100644
--- a/hw/dmx/config/xdmxconfig.c
+++ b/hw/dmx/config/xdmxconfig.c
@@ -877,8 +877,8 @@ int main(int argc, char **argv)
Widget parent, menubox, bottombox, databox, canvasbox;
Widget filebutton, helpbutton;
Widget filemenu, openbutton, savebutton, quitbutton;
- Widget helpmenu, aboutbutton, aboutbox, abouttext, aboutok;
- Widget quitbox, quittext, quitok, quitcan;
+ Widget helpmenu, aboutbutton, aboutbox, aboutok;
+ Widget quitbox, quitok, quitcan;
Widget ncbutton;
Widget canbutton;
Widget ecbox, ecokbutton, eccanbutton;
@@ -1096,7 +1096,7 @@ int main(int argc, char **argv)
toplevel, NULL);
aboutbox = XtVaCreateManagedWidget("aboutbox", boxWidgetClass,
aboutpopup, NULL);
- abouttext = XtVaCreateManagedWidget("abouttext", labelWidgetClass,
+ XtVaCreateManagedWidget("abouttext", labelWidgetClass,
aboutbox,
XtNlabel, DMX_INFO,
NULL);
@@ -1108,7 +1108,7 @@ int main(int argc, char **argv)
toplevel, NULL);
quitbox = XtVaCreateManagedWidget("quitbox", boxWidgetClass,
quitpopup, NULL);
- quittext = XtVaCreateManagedWidget("quittext", labelWidgetClass,
+ XtVaCreateManagedWidget("quittext", labelWidgetClass,
quitbox,
XtNlabel,
"Changes to the configuration\n"
diff --git a/hw/dmx/examples/xbell.c b/hw/dmx/examples/xbell.c
index f3e3be1b8..79419d324 100644
--- a/hw/dmx/examples/xbell.c
+++ b/hw/dmx/examples/xbell.c
@@ -71,7 +71,6 @@ int main(int argc, char **argv)
XKeyboardControl kc;
XKeyboardState ks;
unsigned long vm;
- int percent;
if (argc != 5) {
printf("Usage: xbell percent baseVolume pitch duration\n");
@@ -81,7 +80,7 @@ int main(int argc, char **argv)
vm = (KBBellPercent
| KBBellPitch
| KBBellDuration);
- percent = atoi(argv[1]);
+ kc.key_click_percent = atoi(argv[1]);
kc.bell_percent = atoi(argv[2]);
kc.bell_pitch = atoi(argv[3]);
kc.bell_duration = atoi(argv[4]);
diff --git a/hw/xfree86/dri2/dri2.h b/hw/xfree86/dri2/dri2.h
index fe0bf6ccb..2a41ead5b 100644
--- a/hw/xfree86/dri2/dri2.h
+++ b/hw/xfree86/dri2/dri2.h
@@ -51,7 +51,7 @@ extern CARD8 dri2_minor;
typedef DRI2BufferRec DRI2Buffer2Rec, *DRI2Buffer2Ptr;
typedef void (*DRI2SwapEventPtr)(ClientPtr client, void *data, int type,
- CARD64 ust, CARD64 msc, CARD64 sbc);
+ CARD64 ust, CARD64 msc, CARD32 sbc);
typedef DRI2BufferPtr (*DRI2CreateBuffersProcPtr)(DrawablePtr pDraw,
diff --git a/hw/xfree86/dri2/dri2ext.c b/hw/xfree86/dri2/dri2ext.c
index 4e48e65b2..552b26b7c 100644
--- a/hw/xfree86/dri2/dri2ext.c
+++ b/hw/xfree86/dri2/dri2ext.c
@@ -357,9 +357,9 @@ vals_to_card64(CARD32 lo, CARD32 hi)
static void
DRI2SwapEvent(ClientPtr client, void *data, int type, CARD64 ust, CARD64 msc,
- CARD64 sbc)
+ CARD32 sbc)
{
- xDRI2BufferSwapComplete event;
+ xDRI2BufferSwapComplete2 event;
DrawablePtr pDrawable = data;
event.type = DRI2EventBase + DRI2_BufferSwapComplete;
@@ -369,8 +369,7 @@ DRI2SwapEvent(ClientPtr client, void *data, int type, CARD64 ust, CARD64 msc,
event.ust_lo = ust & 0xffffffff;
event.msc_hi = (CARD64)msc >> 32;
event.msc_lo = msc & 0xffffffff;
- event.sbc_hi = (CARD64)sbc >> 32;
- event.sbc_lo = sbc & 0xffffffff;
+ event.sbc = sbc;
WriteEventsToClient(client, 1, (xEvent *)&event);
}
diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
index 31aa9b97f..3973110fe 100644
--- a/hw/xquartz/X11Application.m
+++ b/hw/xquartz/X11Application.m
@@ -338,18 +338,21 @@ static void message_kit_thread (SEL selector, NSObject *arg) {
case NSAppKitDefined:
switch ([e subtype]) {
+ static BOOL x_was_active = NO;
+
case NSApplicationActivatedEventType:
for_x = NO;
- if ([self modalWindow] == nil) {
+ if ([e window] == nil && x_was_active) {
BOOL order_all_windows = YES, workspaces, ok;
for_appkit = NO;
-
- /* FIXME: hack to avoid having to pass the event to appkit,
- which would cause it to raise one of its windows. */
+
+ /* FIXME: This is a hack to avoid passing the event to AppKit which
+ * would result in it raising one of its windows.
+ */
_appFlags._active = YES;
-
- [self activateX:YES];
-
+
+ X11ApplicationSetFrontProcess();
+
/* Get the Spaces preference for SwitchOnActivate */
(void)CFPreferencesAppSynchronize(CFSTR("com.apple.dock"));
workspaces = CFPreferencesGetAppBooleanValue(CFSTR("workspaces"), CFSTR("com.apple.dock"), &ok);
@@ -370,8 +373,9 @@ static void message_kit_thread (SEL selector, NSObject *arg) {
* If there are no active windows, and there are minimized windows, we should
* be restoring one of them.
*/
- if ([e data2] & 0x10) // 0x10 is set when we use cmd-tab or the dock icon
+ if ([e data2] & 0x10) { // 0x10 (bfCPSOrderAllWindowsForward) is set when we use cmd-tab or the dock icon
DarwinSendDDXEvent(kXquartzBringAllToFront, 1, order_all_windows);
+ }
}
break;
@@ -381,7 +385,10 @@ static void message_kit_thread (SEL selector, NSObject *arg) {
case NSApplicationDeactivatedEventType:
for_x = NO;
- [self activateX:NO];
+
+ x_was_active = _x_active;
+ if(_x_active)
+ [self activateX:NO];
break;
}
break;
diff --git a/hw/xquartz/mach-startup/Makefile.am b/hw/xquartz/mach-startup/Makefile.am
index 8e49ea8ac..0b1f8977e 100644
--- a/hw/xquartz/mach-startup/Makefile.am
+++ b/hw/xquartz/mach-startup/Makefile.am
@@ -22,7 +22,7 @@ X11_bin_LDADD = \
$(top_builddir)/dix/dixfonts.lo \
$(top_builddir)/miext/rootless/librootless.la \
$(top_builddir)/hw/xquartz/pbproxy/libxpbproxy.la \
- $(DARWIN_LIBS) $(MAIN_LIB) $(XSERVER_LIBS)
+ $(XQUARTZ_LIBS) $(XSERVER_LIBS)
X11_bin_LDFLAGS = \
$(XSERVER_SYS_LIBS) -lXplugin \
@@ -52,6 +52,8 @@ X11_bin_LDADD += \
$(top_builddir)/record/librecord.la
endif
+X11_bin_DEPENDENCIES = $(X11_bin_LDADD)
+
bin_PROGRAMS = Xquartz
dist_Xquartz_SOURCES = \
diff --git a/hw/xwin/XWin.rc b/hw/xwin/XWin.rc
index 539bd0e4d..a142f3070 100644
--- a/hw/xwin/XWin.rc
+++ b/hw/xwin/XWin.rc
@@ -50,7 +50,7 @@ BEGIN
LTEXT BUILDERSTRING, IDC_STATIC, 36, 28, 220, 8
LTEXT "This software is licensed under the terms of the MIT/X11 License.", IDC_STATIC, 36, 48, 220, 20
CONTROL __VENDORDWEBSUPPORT__, ID_ABOUT_WEBSITE, "Button",
- BS_OWNERDRAW | WS_TABSTOP, 36, 68, 68, 8
+ BS_OWNERDRAW | WS_TABSTOP, 36, 68, 220, 8
DEFPUSHBUTTON "&OK", IDOK, 105, 85, 50, 15
END
diff --git a/hw/xwin/windialogs.c b/hw/xwin/windialogs.c
index c3a149762..bb4f447e2 100644
--- a/hw/xwin/windialogs.c
+++ b/hw/xwin/windialogs.c
@@ -115,7 +115,7 @@ winDrawURLWindow (LPARAM lParam)
/* Draw it */
SetBkMode (draw->hDC, OPAQUE);
SelectObject (draw->hDC, font);
- DrawText (draw->hDC, str, strlen (str),&rect,DT_CENTER | DT_VCENTER);
+ DrawText (draw->hDC, str, strlen (str),&rect,DT_LEFT | DT_VCENTER);
/* Delete the created font, replace it with stock font */
DeleteObject (SelectObject (draw->hDC, GetStockObject (ANSI_VAR_FONT)));
}
diff --git a/hw/xwin/winmultiwindowwindow.c b/hw/xwin/winmultiwindowwindow.c
index 21b818b89..2d9a46e40 100644
--- a/hw/xwin/winmultiwindowwindow.c
+++ b/hw/xwin/winmultiwindowwindow.c
@@ -493,6 +493,8 @@ winCreateWindowsWindow (WindowPtr pWin)
winPrivScreenPtr pScreenPriv = pWinPriv->pScreenPriv;
WinXSizeHints hints;
WindowPtr pDaddy;
+ DWORD dwStyle, dwExStyle;
+ RECT rc;
winInitMultiWindowClass();
@@ -517,6 +519,8 @@ winCreateWindowsWindow (WindowPtr pWin)
iY = CW_USEDEFAULT;
}
+ winDebug("winCreateWindowsWindow - %dx%d @ %dx%d\n", iWidth, iHeight, iX, iY);
+
if (winMultiWindowGetTransientFor (pWin, &pDaddy))
{
if (pDaddy)
@@ -538,16 +542,35 @@ winCreateWindowsWindow (WindowPtr pWin)
}
}
- /* Create the window */
- /* Make it OVERLAPPED in create call since WS_POPUP doesn't support */
+ /* Make it WS_OVERLAPPED in create call since WS_POPUP doesn't support */
/* CW_USEDEFAULT, change back to popup after creation */
- hWnd = CreateWindowExA (WS_EX_TOOLWINDOW, /* Extended styles */
+ dwStyle = WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS;
+ dwExStyle = WS_EX_TOOLWINDOW;
+
+ /*
+ Calculate the window coordinates containing the requested client area,
+ being careful to preseve CW_USEDEFAULT
+ */
+ rc.top = (iY != CW_USEDEFAULT) ? iY : 0;
+ rc.left = (iX != CW_USEDEFAULT) ? iX : 0;
+ rc.bottom = rc.top + iHeight;
+ rc.right = rc.left + iWidth;
+ AdjustWindowRectEx(&rc, dwStyle, FALSE, dwExStyle);
+ if (iY != CW_USEDEFAULT) iY = rc.top;
+ if (iX != CW_USEDEFAULT) iX = rc.left;
+ iHeight = rc.bottom - rc.top;
+ iWidth = rc.right - rc.left;
+
+ winDebug("winCreateWindowsWindow - %dx%d @ %dx%d\n", iWidth, iHeight, iX, iY);
+
+ /* Create the window */
+ hWnd = CreateWindowExA (dwExStyle, /* Extended styles */
WINDOW_CLASS_X, /* Class name */
WINDOW_TITLE_X, /* Window name */
- WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS,
+ dwStyle, /* Styles */
iX, /* Horizontal position */
iY, /* Vertical position */
- iWidth, /* Right edge */
+ iWidth, /* Right edge */
iHeight, /* Bottom edge */
hFore, /* Null or Parent window if transient*/
(HMENU) NULL, /* No menu */
@@ -569,6 +592,10 @@ winCreateWindowsWindow (WindowPtr pWin)
SetWindowLongPtr(hWnd, GWL_STYLE, WS_POPUP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS);
SetWindowPos (hWnd, 0, 0, 0, 0, 0,
SWP_FRAMECHANGED | SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
+
+ /* Adjust the X window to match the window placement we actually got... */
+ winAdjustXWindow (pWin, hWnd);
+
/* Make sure it gets the proper system menu for a WS_POPUP, too */
GetSystemMenu (hWnd, TRUE);
diff --git a/hw/xwin/winmultiwindowwndproc.c b/hw/xwin/winmultiwindowwndproc.c
index b559cd8cf..1a3be78d5 100644
--- a/hw/xwin/winmultiwindowwndproc.c
+++ b/hw/xwin/winmultiwindowwndproc.c
@@ -1008,6 +1008,64 @@ winTopLevelWindowProc (HWND hwnd, UINT message,
winAdjustXWindow (pWin, hwnd);
return 0; /* end of WM_SIZE handler */
+ case WM_STYLECHANGING:
+ /*
+ When the style changes, adjust the Windows window size so the client area remains the same size,
+ and adjust the Windows window position so that the client area remains in the same place.
+ */
+ {
+ RECT newWinRect;
+ DWORD dwExStyle;
+ DWORD dwStyle;
+ DWORD newStyle = ((STYLESTRUCT *)lParam)->styleNew;
+ WINDOWINFO wi;
+
+ dwExStyle = GetWindowLongPtr (hwnd, GWL_EXSTYLE);
+ dwStyle = GetWindowLongPtr (hwnd, GWL_STYLE);
+
+ winDebug("winTopLevelWindowProc - WM_STYLECHANGING from %08x %08x\n", dwStyle, dwExStyle);
+
+ if (wParam == GWL_EXSTYLE)
+ dwExStyle = newStyle;
+
+ if (wParam == GWL_STYLE)
+ dwStyle = newStyle;
+
+ winDebug("winTopLevelWindowProc - WM_STYLECHANGING to %08x %08x\n", dwStyle, dwExStyle);
+
+ /* Get client rect in screen coordinates */
+ wi.cbSize = sizeof(WINDOWINFO);
+ GetWindowInfo(hwnd, &wi);
+
+ winDebug("winTopLevelWindowProc - WM_STYLECHANGING client area {%d, %d, %d, %d}, {%d x %d}\n", wi.rcClient.left, wi.rcClient.top, wi.rcClient.right, wi.rcClient.bottom, wi.rcClient.right - wi.rcClient.left, wi.rcClient.bottom - wi.rcClient.top);
+
+ newWinRect = wi.rcClient;
+ if (!AdjustWindowRectEx(&newWinRect, dwStyle, FALSE, dwExStyle))
+ winDebug("winTopLevelWindowProc - WM_STYLECHANGING AdjustWindowRectEx failed\n");
+
+ winDebug("winTopLevelWindowProc - WM_STYLECHANGING window area should be {%d, %d, %d, %d}, {%d x %d}\n", newWinRect.left, newWinRect.top, newWinRect.right, newWinRect.bottom, newWinRect.right - newWinRect.left, newWinRect.bottom - newWinRect.top);
+
+ /*
+ Style change hasn't happened yet, so we can't adjust the window size yet, as the winAdjustXWindow()
+ which WM_SIZE does will use the current (unchanged) style. Instead make a note to change it when
+ WM_STYLECHANGED is received...
+ */
+ pWinPriv->hDwp = BeginDeferWindowPos(1);
+ pWinPriv->hDwp = DeferWindowPos(pWinPriv->hDwp, hwnd, NULL, newWinRect.left, newWinRect.top, newWinRect.right - newWinRect.left, newWinRect.bottom - newWinRect.top, SWP_NOACTIVATE | SWP_NOZORDER);
+ }
+ return 0;
+
+ case WM_STYLECHANGED:
+ {
+ if (pWinPriv->hDwp)
+ {
+ EndDeferWindowPos(pWinPriv->hDwp);
+ pWinPriv->hDwp = NULL;
+ }
+ winDebug("winTopLevelWindowProc - WM_STYLECHANGED done\n");
+ }
+ return 0;
+
case WM_MOUSEACTIVATE:
/* Check if this window needs to be made active when clicked */
diff --git a/hw/xwin/winwindow.h b/hw/xwin/winwindow.h
index cf2f93f0a..ebe43091f 100644
--- a/hw/xwin/winwindow.h
+++ b/hw/xwin/winwindow.h
@@ -79,6 +79,7 @@ typedef struct
HWND hWnd;
winPrivScreenPtr pScreenPriv;
Bool fXKilled;
+ HDWP hDwp;
/* Privates used by primary fb DirectDraw server */
LPDDSURFACEDESC pddsdPrimary;
diff --git a/miext/shadow/shpacked.c b/miext/shadow/shpacked.c
index 06606bcf3..c37dca175 100644
--- a/miext/shadow/shpacked.c
+++ b/miext/shadow/shpacked.c
@@ -52,7 +52,7 @@ shadowUpdatePacked (ScreenPtr pScreen,
FbStride shaStride;
int scrBase, scrLine, scr;
int shaBpp;
- int shaXoff, shaYoff; /* XXX assumed to be zero */
+ _X_UNUSED int shaXoff, shaYoff;
int x, y, w, h, width;
int i;
FbBits *winBase = NULL, *win;
diff --git a/miext/shadow/shplanar.c b/miext/shadow/shplanar.c
index 9ca3f3f89..350405186 100644
--- a/miext/shadow/shplanar.c
+++ b/miext/shadow/shplanar.c
@@ -98,7 +98,7 @@ shadowUpdatePlanar4 (ScreenPtr pScreen,
FbStride shaStride;
int scrBase, scrLine, scr;
int shaBpp;
- int shaXoff, shaYoff; /* XXX assumed to be zero */
+ _X_UNUSED int shaXoff, shaYoff;
int x, y, w, h, width;
int i;
CARD32 *winBase = NULL, *win;
diff --git a/miext/shadow/shplanar8.c b/miext/shadow/shplanar8.c
index f8b255d8f..d0648147a 100644
--- a/miext/shadow/shplanar8.c
+++ b/miext/shadow/shplanar8.c
@@ -102,7 +102,7 @@ shadowUpdatePlanar4x8 (ScreenPtr pScreen,
FbStride shaStride;
int scrBase, scrLine, scr;
int shaBpp;
- int shaXoff, shaYoff; /* XXX assumed to be zero */
+ _X_UNUSED int shaXoff, shaYoff;
int x, y, w, h, width;
int i;
CARD32 *winBase = NULL, *win;
diff --git a/miext/shadow/shrotate.c b/miext/shadow/shrotate.c
index c3898266c..090120387 100644
--- a/miext/shadow/shrotate.c
+++ b/miext/shadow/shrotate.c
@@ -59,7 +59,7 @@ shadowUpdateRotatePacked (ScreenPtr pScreen,
FbBits *shaBits;
FbStride shaStride;
int shaBpp;
- int shaXoff, shaYoff;
+ _X_UNUSED int shaXoff, shaYoff;
int box_x1, box_x2, box_y1, box_y2;
int sha_x1 = 0, sha_y1 = 0;
int scr_x1 = 0, scr_x2 = 0, scr_y1 = 0, scr_y2 = 0, scr_w, scr_h;
diff --git a/miext/shadow/shrotpack.h b/miext/shadow/shrotpack.h
index 2d1a87c19..16afff184 100644
--- a/miext/shadow/shrotpack.h
+++ b/miext/shadow/shrotpack.h
@@ -106,7 +106,7 @@ FUNC (ScreenPtr pScreen,
FbStride shaStride;
int scrBase, scrLine, scr;
int shaBpp;
- int shaXoff, shaYoff; /* XXX assumed to be zero */
+ _X_UNUSED int shaXoff, shaYoff;
int x, y, w, h, width;
int i;
Data *winBase = NULL, *win;
diff --git a/miext/shadow/shrotpackYX.h b/miext/shadow/shrotpackYX.h
index 7d36bd1bd..d7b01ec2a 100644
--- a/miext/shadow/shrotpackYX.h
+++ b/miext/shadow/shrotpackYX.h
@@ -69,7 +69,7 @@ FUNC (ScreenPtr pScreen,
Data *shaBase, *shaLine, *sha;
FbStride shaStride, winStride;
int shaBpp;
- int shaXoff, shaYoff; /* XXX assumed to be zero */
+ _X_UNUSED int shaXoff, shaYoff;
int x, y, w, h;
Data *winBase, *win, *winLine;
CARD32 winSize;
diff --git a/xfixes/cursor.c b/xfixes/cursor.c
index 01eb70d92..ecbed4016 100644
--- a/xfixes/cursor.c
+++ b/xfixes/cursor.c
@@ -196,8 +196,8 @@ CursorCloseScreen (int index, ScreenPtr pScreen)
{
CursorScreenPtr cs = GetCursorScreen (pScreen);
Bool ret;
- CloseScreenProcPtr close_proc;
- DisplayCursorProcPtr display_proc;
+ _X_UNUSED CloseScreenProcPtr close_proc;
+ _X_UNUSED DisplayCursorProcPtr display_proc;
ConstrainCursorHarderProcPtr constrain_proc;
Unwrap (cs, pScreen, CloseScreen, close_proc);
diff --git a/xfixes/region.c b/xfixes/region.c
index f49349629..be2d391dd 100644
--- a/xfixes/region.c
+++ b/xfixes/region.c
@@ -756,12 +756,10 @@ ProcXFixesSetPictureClipRegion (ClientPtr client)
{
PicturePtr pPicture;
RegionPtr pRegion;
- ScreenPtr pScreen;
REQUEST(xXFixesSetPictureClipRegionReq);
REQUEST_SIZE_MATCH (xXFixesSetPictureClipRegionReq);
VERIFY_PICTURE(pPicture, stuff->picture, client, DixSetAttrAccess);
- pScreen = pPicture->pDrawable->pScreen;
VERIFY_REGION_OR_NONE(pRegion, stuff->region, client, DixReadAccess);
return SetPictureClipRegion (pPicture, stuff->xOrigin, stuff->yOrigin,