diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2011-11-05 13:32:59 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2011-11-05 13:32:59 +0000 |
commit | bf781c5ff285301ad70ffc5f4321b8906f71edd8 (patch) | |
tree | 3b770f4bf9a8cd11dd9f14e7f758991a73a52d78 /xserver/composite | |
parent | e59d0622d3162f7b5a7420ef87dbebb200348c37 (diff) |
Update to xserver 1.11.2
Diffstat (limited to 'xserver/composite')
-rw-r--r-- | xserver/composite/Makefile.in | 69 | ||||
-rw-r--r-- | xserver/composite/compalloc.c | 198 | ||||
-rw-r--r-- | xserver/composite/compext.c | 361 | ||||
-rw-r--r-- | xserver/composite/compinit.c | 64 | ||||
-rw-r--r-- | xserver/composite/compint.h | 15 | ||||
-rw-r--r-- | xserver/composite/compoverlay.c | 19 | ||||
-rw-r--r-- | xserver/composite/compwindow.c | 65 |
7 files changed, 651 insertions, 140 deletions
diff --git a/xserver/composite/Makefile.in b/xserver/composite/Makefile.in index 2c4e4d4f6..4a841f78d 100644 --- a/xserver/composite/Makefile.in +++ b/xserver/composite/Makefile.in @@ -42,7 +42,10 @@ DIST_COMMON = $(am__sdk_HEADERS_DIST) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \ - $(top_srcdir)/m4/dolt.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/xorg-tls.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(install_sh) -d @@ -65,6 +68,9 @@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ @@ -88,8 +94,8 @@ ADMIN_MAN_DIR = @ADMIN_MAN_DIR@ ADMIN_MAN_SUFFIX = @ADMIN_MAN_SUFFIX@ AGP_FALSE = @AGP_FALSE@ AGP_TRUE = @AGP_TRUE@ -AIGLX_FALSE = @AIGLX_FALSE@ -AIGLX_TRUE = @AIGLX_TRUE@ +AIGLX_DRI_LOADER_FALSE = @AIGLX_DRI_LOADER_FALSE@ +AIGLX_DRI_LOADER_TRUE = @AIGLX_DRI_LOADER_TRUE@ ALLOCA = @ALLOCA@ ALPHA_VIDEO_FALSE = @ALPHA_VIDEO_FALSE@ ALPHA_VIDEO_TRUE = @ALPHA_VIDEO_TRUE@ @@ -102,7 +108,6 @@ APPLE_APPLICATION_NAME = @APPLE_APPLICATION_NAME@ APP_MAN_DIR = @APP_MAN_DIR@ APP_MAN_SUFFIX = @APP_MAN_SUFFIX@ AR = @AR@ -ARM_BACKTRACE_CFLAGS = @ARM_BACKTRACE_CFLAGS@ ARM_VIDEO_FALSE = @ARM_VIDEO_FALSE@ ARM_VIDEO_TRUE = @ARM_VIDEO_TRUE@ AS = @AS@ @@ -115,18 +120,19 @@ BSD_APM_FALSE = @BSD_APM_FALSE@ BSD_APM_TRUE = @BSD_APM_TRUE@ BSD_KQUEUE_APM_FALSE = @BSD_KQUEUE_APM_FALSE@ BSD_KQUEUE_APM_TRUE = @BSD_KQUEUE_APM_TRUE@ -BUILDDOCS_FALSE = @BUILDDOCS_FALSE@ -BUILDDOCS_TRUE = @BUILDDOCS_TRUE@ BUILD_DATE = @BUILD_DATE@ BUILD_KDRIVEFBDEVLIB_FALSE = @BUILD_KDRIVEFBDEVLIB_FALSE@ BUILD_KDRIVEFBDEVLIB_TRUE = @BUILD_KDRIVEFBDEVLIB_TRUE@ BUILD_TIME = @BUILD_TIME@ +BUNDLE_ID_PREFIX = @BUNDLE_ID_PREFIX@ CC = @CC@ CCAS = @CCAS@ CCASFLAGS = @CCASFLAGS@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CHANGELOG_CMD = @CHANGELOG_CMD@ +CLIENTIDS_FALSE = @CLIENTIDS_FALSE@ +CLIENTIDS_TRUE = @CLIENTIDS_TRUE@ COMPILEDDEFAULTFONTPATH = @COMPILEDDEFAULTFONTPATH@ COMPOSITE_FALSE = @COMPOSITE_FALSE@ COMPOSITE_TRUE = @COMPOSITE_TRUE@ @@ -143,12 +149,7 @@ CONFIG_WSCONS_TRUE = @CONFIG_WSCONS_TRUE@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CWARNFLAGS = @CWARNFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ -DARWIN_LIBS = @DARWIN_LIBS@ DBE_FALSE = @DBE_FALSE@ DBE_TRUE = @DBE_TRUE@ DBUS_CFLAGS = @DBUS_CFLAGS@ @@ -183,7 +184,6 @@ DMX_BUILD_USB_FALSE = @DMX_BUILD_USB_FALSE@ DMX_BUILD_USB_TRUE = @DMX_BUILD_USB_TRUE@ DMX_FALSE = @DMX_FALSE@ DMX_TRUE = @DMX_TRUE@ -DOLT_BASH = @DOLT_BASH@ DOXYGEN = @DOXYGEN@ DPMSExtension_FALSE = @DPMSExtension_FALSE@ DPMSExtension_TRUE = @DPMSExtension_TRUE@ @@ -204,7 +204,7 @@ DRI_LIBS = @DRI_LIBS@ DRI_TRUE = @DRI_TRUE@ DSYMUTIL = @DSYMUTIL@ DTRACE = @DTRACE@ -ECHO = @ECHO@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ @@ -213,11 +213,12 @@ ENABLE_DEVEL_DOCS_FALSE = @ENABLE_DEVEL_DOCS_FALSE@ ENABLE_DEVEL_DOCS_TRUE = @ENABLE_DEVEL_DOCS_TRUE@ ENABLE_DOCS_FALSE = @ENABLE_DOCS_FALSE@ ENABLE_DOCS_TRUE = @ENABLE_DOCS_TRUE@ +ENABLE_UNIT_TESTS_FALSE = @ENABLE_UNIT_TESTS_FALSE@ +ENABLE_UNIT_TESTS_TRUE = @ENABLE_UNIT_TESTS_TRUE@ EXEEXT = @EXEEXT@ -F77 = @F77@ FBDEVHW_FALSE = @FBDEVHW_FALSE@ FBDEVHW_TRUE = @FBDEVHW_TRUE@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ FILE_MAN_DIR = @FILE_MAN_DIR@ FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@ FONT100DPIDIR = @FONT100DPIDIR@ @@ -230,11 +231,10 @@ FONTTYPE1DIR = @FONTTYPE1DIR@ FOP = @FOP@ FREEBSD_KLDLOAD_FALSE = @FREEBSD_KLDLOAD_FALSE@ FREEBSD_KLDLOAD_TRUE = @FREEBSD_KLDLOAD_TRUE@ -GLIB_CFLAGS = @GLIB_CFLAGS@ -GLIB_LIBS = @GLIB_LIBS@ GLX_ARCH_DEFINES = @GLX_ARCH_DEFINES@ GLX_DEFINES = @GLX_DEFINES@ GLX_FALSE = @GLX_FALSE@ +GLX_TLS = @GLX_TLS@ GLX_TRUE = @GLX_TRUE@ GL_CFLAGS = @GL_CFLAGS@ GL_LIBS = @GL_LIBS@ @@ -247,12 +247,16 @@ HAVE_DOXYGEN_FALSE = @HAVE_DOXYGEN_FALSE@ HAVE_DOXYGEN_TRUE = @HAVE_DOXYGEN_TRUE@ HAVE_FOP_FALSE = @HAVE_FOP_FALSE@ HAVE_FOP_TRUE = @HAVE_FOP_TRUE@ +HAVE_LD_WRAP_FALSE = @HAVE_LD_WRAP_FALSE@ +HAVE_LD_WRAP_TRUE = @HAVE_LD_WRAP_TRUE@ HAVE_STYLESHEETS_FALSE = @HAVE_STYLESHEETS_FALSE@ HAVE_STYLESHEETS_TRUE = @HAVE_STYLESHEETS_TRUE@ HAVE_XMLTO_FALSE = @HAVE_XMLTO_FALSE@ HAVE_XMLTO_TEXT_FALSE = @HAVE_XMLTO_TEXT_FALSE@ HAVE_XMLTO_TEXT_TRUE = @HAVE_XMLTO_TEXT_TRUE@ HAVE_XMLTO_TRUE = @HAVE_XMLTO_TRUE@ +HAVE_XSLTPROC_FALSE = @HAVE_XSLTPROC_FALSE@ +HAVE_XSLTPROC_TRUE = @HAVE_XSLTPROC_TRUE@ HP300_VIDEO_FALSE = @HP300_VIDEO_FALSE@ HP300_VIDEO_TRUE = @HP300_VIDEO_TRUE@ HPPA_VIDEO_FALSE = @HPPA_VIDEO_FALSE@ @@ -298,7 +302,10 @@ KDRIVE_MOUSE_TRUE = @KDRIVE_MOUSE_TRUE@ KDRIVE_PURE_INCS = @KDRIVE_PURE_INCS@ KDRIVE_PURE_LIBS = @KDRIVE_PURE_LIBS@ KDRIVE_TRUE = @KDRIVE_TRUE@ -LAUNCHD_ID_PREFIX = @LAUNCHD_ID_PREFIX@ +KHRONOS_OPENGL_REGISTRY_CFLAGS = @KHRONOS_OPENGL_REGISTRY_CFLAGS@ +KHRONOS_OPENGL_REGISTRY_LIBS = @KHRONOS_OPENGL_REGISTRY_LIBS@ +KHRONOS_SPEC_DIR = @KHRONOS_SPEC_DIR@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LD_EXPORT_SYMBOLS_FLAG = @LD_EXPORT_SYMBOLS_FLAG@ LEX = @LEX@ @@ -317,19 +324,19 @@ LINUX_ALPHA_FALSE = @LINUX_ALPHA_FALSE@ LINUX_ALPHA_TRUE = @LINUX_ALPHA_TRUE@ LINUX_IA64_FALSE = @LINUX_IA64_FALSE@ LINUX_IA64_TRUE = @LINUX_IA64_TRUE@ +LIPO = @LIPO@ LNXACPI_FALSE = @LNXACPI_FALSE@ LNXACPI_TRUE = @LNXACPI_TRUE@ LNXAPM_FALSE = @LNXAPM_FALSE@ LNXAPM_TRUE = @LNXAPM_TRUE@ LN_S = @LN_S@ -LTCOMPILE = @LTCOMPILE@ -LTCXXCOMPILE = @LTCXXCOMPILE@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@ MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@ MAIN_LIB = @MAIN_LIB@ MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ MAN_SUBSTS = @MAN_SUBSTS@ MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@ @@ -339,6 +346,7 @@ NEED_STRLCAT_FALSE = @NEED_STRLCAT_FALSE@ NEED_STRLCAT_TRUE = @NEED_STRLCAT_TRUE@ NEED_VSNPRINTF_FALSE = @NEED_VSNPRINTF_FALSE@ NEED_VSNPRINTF_TRUE = @NEED_VSNPRINTF_TRUE@ +NM = @NM@ NMEDIT = @NMEDIT@ OBJC = @OBJC@ OBJCCLD = @OBJCCLD@ @@ -350,6 +358,8 @@ OBJEXT = @OBJEXT@ OPENSSL_CFLAGS = @OPENSSL_CFLAGS@ OPENSSL_LIBS = @OPENSSL_LIBS@ OS_LIB = @OS_LIB@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ @@ -360,7 +370,6 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ PCIACCESS_CFLAGS = @PCIACCESS_CFLAGS@ PCIACCESS_LIBS = @PCIACCESS_LIBS@ PCI_TXT_IDS_PATH = @PCI_TXT_IDS_PATH@ -PERL = @PERL@ PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ PIXMAN_LIBS = @PIXMAN_LIBS@ PKG_CONFIG = @PKG_CONFIG@ @@ -402,6 +411,7 @@ SPECIAL_DTRACE_OBJECTS_FALSE = @SPECIAL_DTRACE_OBJECTS_FALSE@ SPECIAL_DTRACE_OBJECTS_TRUE = @SPECIAL_DTRACE_OBJECTS_TRUE@ STANDALONE_XPBPROXY_FALSE = @STANDALONE_XPBPROXY_FALSE@ STANDALONE_XPBPROXY_TRUE = @STANDALONE_XPBPROXY_TRUE@ +STRICT_CFLAGS = @STRICT_CFLAGS@ STRIP = @STRIP@ STYLESHEET_SRCDIR = @STYLESHEET_SRCDIR@ SYSCONFDIR = @SYSCONFDIR@ @@ -411,8 +421,6 @@ TSLIB_LIBS = @TSLIB_LIBS@ TSLIB_TRUE = @TSLIB_TRUE@ UDEV_CFLAGS = @UDEV_CFLAGS@ UDEV_LIBS = @UDEV_LIBS@ -UNITTESTS_FALSE = @UNITTESTS_FALSE@ -UNITTESTS_TRUE = @UNITTESTS_TRUE@ UTILS_SYS_LIBS = @UTILS_SYS_LIBS@ VBE_FALSE = @VBE_FALSE@ VBE_TRUE = @VBE_TRUE@ @@ -429,8 +437,6 @@ XAA_FALSE = @XAA_FALSE@ XAA_TRUE = @XAA_TRUE@ XACE_FALSE = @XACE_FALSE@ XACE_TRUE = @XACE_TRUE@ -XCALIBRATE_FALSE = @XCALIBRATE_FALSE@ -XCALIBRATE_TRUE = @XCALIBRATE_TRUE@ XCSECURITY_FALSE = @XCSECURITY_FALSE@ XCSECURITY_TRUE = @XCSECURITY_TRUE@ XDMAUTH_FALSE = @XDMAUTH_FALSE@ @@ -466,6 +472,11 @@ XINERAMA_TRUE = @XINERAMA_TRUE@ XKB_BASE_DIRECTORY = @XKB_BASE_DIRECTORY@ XKB_BIN_DIRECTORY = @XKB_BIN_DIRECTORY@ XKB_COMPILED_DIR = @XKB_COMPILED_DIR@ +XKB_DFLT_LAYOUT = @XKB_DFLT_LAYOUT@ +XKB_DFLT_MODEL = @XKB_DFLT_MODEL@ +XKB_DFLT_OPTIONS = @XKB_DFLT_OPTIONS@ +XKB_DFLT_RULES = @XKB_DFLT_RULES@ +XKB_DFLT_VARIANT = @XKB_DFLT_VARIANT@ XKM_OUTPUT_DIR = @XKM_OUTPUT_DIR@ XLIB_CFLAGS = @XLIB_CFLAGS@ XLIB_LIBS = @XLIB_LIBS@ @@ -497,6 +508,7 @@ XORG_TRUE = @XORG_TRUE@ XPBPROXY_CFLAGS = @XPBPROXY_CFLAGS@ XPBPROXY_LIBS = @XPBPROXY_LIBS@ XQUARTZ_FALSE = @XQUARTZ_FALSE@ +XQUARTZ_LIBS = @XQUARTZ_LIBS@ XQUARTZ_SPARKLE = @XQUARTZ_SPARKLE@ XQUARTZ_SPARKLE_FALSE = @XQUARTZ_SPARKLE_FALSE@ XQUARTZ_SPARKLE_TRUE = @XQUARTZ_SPARKLE_TRUE@ @@ -515,6 +527,7 @@ XSERVER_DTRACE_FALSE = @XSERVER_DTRACE_FALSE@ XSERVER_DTRACE_TRUE = @XSERVER_DTRACE_TRUE@ XSERVER_LIBS = @XSERVER_LIBS@ XSERVER_SYS_LIBS = @XSERVER_SYS_LIBS@ +XSLTPROC = @XSLTPROC@ XSL_STYLESHEET = @XSL_STYLESHEET@ XTSTEXAMPLES_DEP_CFLAGS = @XTSTEXAMPLES_DEP_CFLAGS@ XTSTEXAMPLES_DEP_LIBS = @XTSTEXAMPLES_DEP_LIBS@ @@ -559,13 +572,11 @@ abi_ansic = @abi_ansic@ abi_extension = @abi_extension@ abi_videodrv = @abi_videodrv@ abi_xinput = @abi_xinput@ +ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ -am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ -am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ am__fastdepOBJC_FALSE = @am__fastdepOBJC_FALSE@ am__fastdepOBJC_TRUE = @am__fastdepOBJC_TRUE@ am__include = @am__include@ diff --git a/xserver/composite/compalloc.c b/xserver/composite/compalloc.c index 246e4c5fd..9857a92b2 100644 --- a/xserver/composite/compalloc.c +++ b/xserver/composite/compalloc.c @@ -1,5 +1,5 @@ /* - * Copyright © 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright (c) 2006, Oracle and/or its affiliates. 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"), @@ -48,6 +48,30 @@ #include "compint.h" static void +compScreenUpdate (ScreenPtr pScreen) +{ + compCheckTree (pScreen); + compPaintChildrenToWindow (pScreen->root); +} + +static void +compBlockHandler (int i, + pointer blockData, + pointer pTimeout, + pointer pReadmask) +{ + ScreenPtr pScreen = screenInfo.screens[i]; + CompScreenPtr cs = GetCompScreen (pScreen); + + pScreen->BlockHandler = cs->BlockHandler; + compScreenUpdate (pScreen); + (*pScreen->BlockHandler) (i, blockData, pTimeout, pReadmask); + + /* Next damage will restore the block handler */ + cs->BlockHandler = NULL; +} + +static void compReportDamage (DamagePtr pDamage, RegionPtr pRegion, void *closure) { WindowPtr pWin = (WindowPtr) closure; @@ -55,8 +79,20 @@ compReportDamage (DamagePtr pDamage, RegionPtr pRegion, void *closure) CompScreenPtr cs = GetCompScreen (pScreen); CompWindowPtr cw = GetCompWindow (pWin); - cs->damaged = TRUE; + if (!cs->BlockHandler) { + cs->BlockHandler = pScreen->BlockHandler; + pScreen->BlockHandler = compBlockHandler; + } cw->damaged = TRUE; + + /* Mark the ancestors */ + pWin = pWin->parent; + while (pWin) { + if (pWin->damagedDescendants) + break; + pWin->damagedDescendants = TRUE; + pWin = pWin->parent; + } } static void @@ -68,6 +104,35 @@ compDestroyDamage (DamagePtr pDamage, void *closure) cw->damage = 0; } +static Bool +compMarkWindows(WindowPtr pWin, + WindowPtr *ppLayerWin) +{ + ScreenPtr pScreen = pWin->drawable.pScreen; + WindowPtr pLayerWin = pWin; + + if (!pWin->viewable) + return FALSE; + + (*pScreen->MarkOverlappedWindows)(pWin, pWin, &pLayerWin); + (*pScreen->MarkWindow)(pLayerWin->parent); + + *ppLayerWin = pLayerWin; + + return TRUE; +} + +static void +compHandleMarkedWindows(WindowPtr pWin, WindowPtr pLayerWin) +{ + ScreenPtr pScreen = pWin->drawable.pScreen; + + (*pScreen->ValidateTree)(pLayerWin->parent, pLayerWin, VTOther); + (*pScreen->HandleExposures)(pLayerWin->parent); + if (pScreen->PostValidateTree) + (*pScreen->PostValidateTree)(pLayerWin->parent, pLayerWin, VTOther); +} + /* * Redirect one window for one client */ @@ -76,8 +141,9 @@ compRedirectWindow (ClientPtr pClient, WindowPtr pWin, int update) { CompWindowPtr cw = GetCompWindow (pWin); CompClientWindowPtr ccw; - Bool wasMapped = pWin->mapped; CompScreenPtr cs = GetCompScreen(pWin->drawable.pScreen); + WindowPtr pLayerWin; + Bool anyMarked = FALSE; if (pWin == cs->pOverlayWin) { return Success; @@ -127,16 +193,10 @@ compRedirectWindow (ClientPtr pClient, WindowPtr pWin, int update) free(cw); return BadAlloc; } - if (wasMapped) - { - DisableMapUnmapEvents (pWin); - UnmapWindow (pWin, FALSE); - EnableMapUnmapEvents (pWin); - } + + anyMarked = compMarkWindows (pWin, &pLayerWin); RegionNull(&cw->borderClip); - cw->borderClipX = 0; - cw->borderClipY = 0; cw->update = CompositeRedirectAutomatic; cw->clients = 0; cw->oldx = COMP_ORIGIN_INVALID; @@ -152,16 +212,9 @@ compRedirectWindow (ClientPtr pClient, WindowPtr pWin, int update) return BadAlloc; if (ccw->update == CompositeRedirectManual) { - /* If the window was CompositeRedirectAutomatic, then - * unmap the window so that the parent clip list will - * be correctly recomputed. - */ - if (pWin->mapped) - { - DisableMapUnmapEvents (pWin); - UnmapWindow (pWin, FALSE); - EnableMapUnmapEvents (pWin); - } + if (!anyMarked) + anyMarked = compMarkWindows (pWin, &pLayerWin); + if (cw->damageRegistered) { DamageUnregister (&pWin->drawable, cw->damage); @@ -169,25 +222,51 @@ compRedirectWindow (ClientPtr pClient, WindowPtr pWin, int update) } cw->update = CompositeRedirectManual; } + else if (cw->update == CompositeRedirectAutomatic && !cw->damageRegistered) { + if (!anyMarked) + anyMarked = compMarkWindows (pWin, &pLayerWin); + } if (!compCheckRedirect (pWin)) { FreeResource (ccw->id, RT_NONE); return BadAlloc; } - if (wasMapped && !pWin->mapped) - { - Bool overrideRedirect = pWin->overrideRedirect; - pWin->overrideRedirect = TRUE; - DisableMapUnmapEvents (pWin); - MapWindow (pWin, pClient); - EnableMapUnmapEvents (pWin); - pWin->overrideRedirect = overrideRedirect; - } + + if (anyMarked) + compHandleMarkedWindows (pWin, pLayerWin); return Success; } +void +compRestoreWindow (WindowPtr pWin, PixmapPtr pPixmap) +{ + ScreenPtr pScreen = pWin->drawable.pScreen; + WindowPtr pParent = pWin->parent; + + if (pParent->drawable.depth == pWin->drawable.depth) { + GCPtr pGC = GetScratchGC (pWin->drawable.depth, pScreen); + int bw = (int) pWin->borderWidth; + int x = bw; + int y = bw; + int w = pWin->drawable.width; + int h = pWin->drawable.height; + + if (pGC) { + ChangeGCVal val; + val.val = IncludeInferiors; + ChangeGC (NullClient, pGC, GCSubwindowMode, &val); + ValidateGC(&pWin->drawable, pGC); + (*pGC->ops->CopyArea) (&pPixmap->drawable, + &pWin->drawable, + pGC, + x, y, w, h, 0, 0); + FreeScratchGC (pGC); + } + } +} + /* * Free one of the per-client per-window resources, clearing * redirect and the per-window pointer as appropriate @@ -195,9 +274,12 @@ compRedirectWindow (ClientPtr pClient, WindowPtr pWin, int update) void compFreeClientWindow (WindowPtr pWin, XID id) { + ScreenPtr pScreen = pWin->drawable.pScreen; CompWindowPtr cw = GetCompWindow (pWin); CompClientWindowPtr ccw, *prev; - Bool wasMapped = pWin->mapped; + Bool anyMarked = FALSE; + WindowPtr pLayerWin; + PixmapPtr pPixmap = NULL; if (!cw) return; @@ -214,15 +296,12 @@ compFreeClientWindow (WindowPtr pWin, XID id) } if (!cw->clients) { - if (wasMapped) - { - DisableMapUnmapEvents (pWin); - UnmapWindow (pWin, FALSE); - EnableMapUnmapEvents (pWin); - } + anyMarked = compMarkWindows (pWin, &pLayerWin); - if (pWin->redirectDraw != RedirectDrawNone) - compFreePixmap (pWin); + if (pWin->redirectDraw != RedirectDrawNone) { + pPixmap = (*pScreen->GetWindowPixmap) (pWin); + compSetParentPixmap (pWin); + } if (cw->damage) DamageDestroy (cw->damage); @@ -235,19 +314,20 @@ compFreeClientWindow (WindowPtr pWin, XID id) else if (cw->update == CompositeRedirectAutomatic && !cw->damageRegistered && pWin->redirectDraw != RedirectDrawNone) { + anyMarked = compMarkWindows (pWin, &pLayerWin); + DamageRegister (&pWin->drawable, cw->damage); cw->damageRegistered = TRUE; pWin->redirectDraw = RedirectDrawAutomatic; DamageDamageRegion(&pWin->drawable, &pWin->borderSize); } - if (wasMapped && !pWin->mapped) - { - Bool overrideRedirect = pWin->overrideRedirect; - pWin->overrideRedirect = TRUE; - DisableMapUnmapEvents (pWin); - MapWindow (pWin, clients[CLIENT_ID(id)]); - EnableMapUnmapEvents (pWin); - pWin->overrideRedirect = overrideRedirect; + + if (anyMarked) + compHandleMarkedWindows (pWin, pLayerWin); + + if (pPixmap) { + compRestoreWindow (pWin, pPixmap); + (*pScreen->DestroyPixmap) (pPixmap); } } @@ -350,6 +430,7 @@ compRedirectSubwindows (ClientPtr pClient, WindowPtr pWin, int update) * critical output */ DamageExtSetCritical (pClient, TRUE); + pWin->inhibitBGPaint = TRUE; } return Success; } @@ -382,6 +463,7 @@ compFreeClientSubwindows (WindowPtr pWin, XID id) */ DamageExtSetCritical (pClient, FALSE); csw->update = CompositeRedirectAutomatic; + pWin->inhibitBGPaint = FALSE; if (pWin->mapped) (*pWin->drawable.pScreen->ClearToBackground)(pWin, 0, 0, 0, 0, TRUE); } @@ -487,22 +569,17 @@ compNewPixmap (WindowPtr pWin, int x, int y, int w, int h) pPixmap->screen_x = x; pPixmap->screen_y = y; - + if (pParent->drawable.depth == pWin->drawable.depth) { GCPtr pGC = GetScratchGC (pWin->drawable.depth, pScreen); - /* - * Copy bits from the parent into the new pixmap so that it will - * have "reasonable" contents in case for background None areas. - */ if (pGC) { ChangeGCVal val; val.val = IncludeInferiors; - + ChangeGC (NullClient, pGC, GCSubwindowMode, &val); ValidateGC(&pPixmap->drawable, pGC); - ChangeGC (serverClient, pGC, GCSubwindowMode, &val); (*pGC->ops->CopyArea) (&pParent->drawable, &pPixmap->drawable, pGC, @@ -577,14 +654,21 @@ compAllocPixmap (WindowPtr pWin) DamageRegister (&pWin->drawable, cw->damage); cw->damageRegistered = TRUE; } + + /* Make sure our borderClip is up to date */ + RegionUninit(&cw->borderClip); + RegionCopy(&cw->borderClip, &pWin->borderClip); + cw->borderClipX = pWin->drawable.x; + cw->borderClipY = pWin->drawable.y; + return TRUE; } void -compFreePixmap (WindowPtr pWin) +compSetParentPixmap (WindowPtr pWin) { ScreenPtr pScreen = pWin->drawable.pScreen; - PixmapPtr pRedirectPixmap, pParentPixmap; + PixmapPtr pParentPixmap; CompWindowPtr cw = GetCompWindow (pWin); if (cw->damageRegistered) @@ -600,11 +684,9 @@ compFreePixmap (WindowPtr pWin) * parent exposed area; regions beyond the parent cause crashes */ RegionCopy(&pWin->borderClip, &cw->borderClip); - pRedirectPixmap = (*pScreen->GetWindowPixmap) (pWin); pParentPixmap = (*pScreen->GetWindowPixmap) (pWin->parent); pWin->redirectDraw = RedirectDrawNone; compSetPixmap (pWin, pParentPixmap); - (*pScreen->DestroyPixmap) (pRedirectPixmap); } /* diff --git a/xserver/composite/compext.c b/xserver/composite/compext.c index 30d9dc2b6..e0d8e75e4 100644 --- a/xserver/composite/compext.c +++ b/xserver/composite/compext.c @@ -1,5 +1,5 @@ /* - * Copyright © 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright (c) 2006, Oracle and/or its affiliates. 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"), @@ -535,13 +535,6 @@ CompositeExtensionInit (void) if (GetPictureScreenIfSet(pScreen) == NULL) return; } -#ifdef PANORAMIX - /* Xinerama's rewriting of window drawing before Composite gets to it - * breaks Composite. - */ - if (!noPanoramiXExtension) - return; -#endif CompositeClientWindowType = CreateNewResourceType (FreeCompositeClientWindow, "CompositeClientWindow"); @@ -582,3 +575,355 @@ CompositeExtensionInit (void) /* Initialization succeeded */ noCompositeExtension = FALSE; } + +#ifdef PANORAMIX +#include "panoramiXsrv.h" + +int (*PanoramiXSaveCompositeVector[CompositeNumberRequests]) (ClientPtr); + +static int +PanoramiXCompositeRedirectWindow (ClientPtr client) +{ + PanoramiXRes *win; + int rc = 0, j; + REQUEST(xCompositeRedirectWindowReq); + + REQUEST_SIZE_MATCH(xCompositeRedirectWindowReq); + + if ((rc = dixLookupResourceByType((void **)&win, stuff->window, XRT_WINDOW, + client, DixUnknownAccess))) { + client->errorValue = stuff->window; + return rc; + } + + FOR_NSCREENS_FORWARD(j) { + stuff->window = win->info[j].id; + rc = (*PanoramiXSaveCompositeVector[stuff->compositeReqType]) (client); + if (rc != Success) break; + } + + return rc; +} + +static int +PanoramiXCompositeRedirectSubwindows (ClientPtr client) +{ + PanoramiXRes *win; + int rc = 0, j; + REQUEST(xCompositeRedirectSubwindowsReq); + + REQUEST_SIZE_MATCH(xCompositeRedirectSubwindowsReq); + + if ((rc = dixLookupResourceByType((void **)&win, stuff->window, XRT_WINDOW, + client, DixUnknownAccess))) { + client->errorValue = stuff->window; + return rc; + } + + FOR_NSCREENS_FORWARD(j) { + stuff->window = win->info[j].id; + rc = (*PanoramiXSaveCompositeVector[stuff->compositeReqType]) (client); + if (rc != Success) break; + } + + return rc; +} + +static int +PanoramiXCompositeUnredirectWindow (ClientPtr client) +{ + PanoramiXRes *win; + int rc = 0, j; + REQUEST(xCompositeUnredirectWindowReq); + + REQUEST_SIZE_MATCH(xCompositeUnredirectWindowReq); + + if ((rc = dixLookupResourceByType((void **)&win, stuff->window, XRT_WINDOW, + client, DixUnknownAccess))) { + client->errorValue = stuff->window; + return rc; + } + + FOR_NSCREENS_FORWARD(j) { + stuff->window = win->info[j].id; + rc = (*PanoramiXSaveCompositeVector[stuff->compositeReqType]) (client); + if (rc != Success) break; + } + + return rc; +} + +static int +PanoramiXCompositeUnredirectSubwindows (ClientPtr client) +{ + PanoramiXRes *win; + int rc = 0, j; + REQUEST(xCompositeUnredirectSubwindowsReq); + + REQUEST_SIZE_MATCH(xCompositeUnredirectSubwindowsReq); + + if ((rc = dixLookupResourceByType((void **)&win, stuff->window, XRT_WINDOW, + client, DixUnknownAccess))) { + client->errorValue = stuff->window; + return rc; + } + + FOR_NSCREENS_FORWARD(j) { + stuff->window = win->info[j].id; + rc = (*PanoramiXSaveCompositeVector[stuff->compositeReqType]) (client); + if (rc != Success) break; + } + + return rc; +} + +static int +PanoramiXCompositeNameWindowPixmap (ClientPtr client) +{ + WindowPtr pWin; + CompWindowPtr cw; + PixmapPtr pPixmap; + int rc; + PanoramiXRes *win, *newPix; + int i; + REQUEST(xCompositeNameWindowPixmapReq); + + REQUEST_SIZE_MATCH(xCompositeNameWindowPixmapReq); + + if ((rc = dixLookupResourceByType((void **)&win, stuff->window, XRT_WINDOW, + client, DixUnknownAccess))) { + client->errorValue = stuff->window; + return rc; + } + + LEGAL_NEW_RESOURCE (stuff->pixmap, client); + + if(!(newPix = malloc(sizeof(PanoramiXRes)))) + return BadAlloc; + + newPix->type = XRT_PIXMAP; + newPix->u.pix.shared = FALSE; + panoramix_setup_ids(newPix, client, stuff->pixmap); + + FOR_NSCREENS(i) { + rc = dixLookupResourceByType ((void **) &pWin, win->info[i].id, + RT_WINDOW, client, DixGetAttrAccess); + if (rc != Success) + { + client->errorValue = stuff->window; + free (newPix); + return rc; + } + + if (!pWin->viewable) + { + free (newPix); + return BadMatch; + } + + cw = GetCompWindow (pWin); + if (!cw) + { + free (newPix); + return BadMatch; + } + + pPixmap = (*pWin->drawable.pScreen->GetWindowPixmap) (pWin); + if (!pPixmap) + { + free (newPix); + return BadMatch; + } + + if (!AddResource (newPix->info[i].id, RT_PIXMAP, + (pointer) pPixmap)) + return BadAlloc; + + ++pPixmap->refcnt; + } + + if (!AddResource (stuff->pixmap, XRT_PIXMAP, (pointer) newPix)) + return BadAlloc; + + return Success; +} + + +static int +PanoramiXCompositeGetOverlayWindow (ClientPtr client) +{ + REQUEST(xCompositeGetOverlayWindowReq); + xCompositeGetOverlayWindowReply rep; + WindowPtr pWin; + ScreenPtr pScreen; + CompScreenPtr cs; + CompOverlayClientPtr pOc; + int rc; + PanoramiXRes *win, *overlayWin = NULL; + int i; + + REQUEST_SIZE_MATCH(xCompositeGetOverlayWindowReq); + + if ((rc = dixLookupResourceByType((void **)&win, stuff->window, XRT_WINDOW, + client, DixUnknownAccess))) { + client->errorValue = stuff->window; + return rc; + } + + cs = GetCompScreen(screenInfo.screens[0]); + if (!cs->pOverlayWin) + { + if(!(overlayWin = malloc(sizeof(PanoramiXRes)))) + return BadAlloc; + + overlayWin->type = XRT_WINDOW; + overlayWin->u.win.root = FALSE; + } + + FOR_NSCREENS_BACKWARD(i) { + rc = dixLookupResourceByType((pointer *)&pWin, win->info[i].id, + RT_WINDOW, client, DixGetAttrAccess); + if (rc != Success) + { + client->errorValue = stuff->window; + return rc; + } + pScreen = pWin->drawable.pScreen; + + /* + * Create an OverlayClient structure to mark this client's + * interest in the overlay window + */ + pOc = compCreateOverlayClient(pScreen, client); + if (pOc == NULL) + return BadAlloc; + + /* + * Make sure the overlay window exists + */ + cs = GetCompScreen(pScreen); + if (cs->pOverlayWin == NULL) + if (!compCreateOverlayWindow(pScreen)) + { + FreeResource (pOc->resource, RT_NONE); + return BadAlloc; + } + + rc = XaceHook(XACE_RESOURCE_ACCESS, client, + cs->pOverlayWin->drawable.id, + RT_WINDOW, cs->pOverlayWin, RT_NONE, NULL, + DixGetAttrAccess); + if (rc != Success) + { + FreeResource (pOc->resource, RT_NONE); + return rc; + } + } + + if (overlayWin) + { + FOR_NSCREENS(i) { + cs = GetCompScreen(screenInfo.screens[i]); + overlayWin->info[i].id = cs->pOverlayWin->drawable.id; + } + + AddResource(overlayWin->info[0].id, XRT_WINDOW, overlayWin); + } + + cs = GetCompScreen(screenInfo.screens[0]); + + rep.type = X_Reply; + rep.sequenceNumber = client->sequence; + rep.length = 0; + rep.overlayWin = cs->pOverlayWin->drawable.id; + + if (client->swapped) + { + int n; + swaps(&rep.sequenceNumber, n); + swapl(&rep.length, n); + swapl(&rep.overlayWin, n); + } + (void) WriteToClient(client, sz_xCompositeGetOverlayWindowReply, (char *)&rep); + + return Success; +} + +static int +PanoramiXCompositeReleaseOverlayWindow (ClientPtr client) +{ + REQUEST(xCompositeReleaseOverlayWindowReq); + WindowPtr pWin; + ScreenPtr pScreen; + CompOverlayClientPtr pOc; + PanoramiXRes *win; + int i, rc; + + REQUEST_SIZE_MATCH(xCompositeReleaseOverlayWindowReq); + + if ((rc = dixLookupResourceByType((void **)&win, stuff->window, XRT_WINDOW, + client, DixUnknownAccess))) { + client->errorValue = stuff->window; + return rc; + } + + FOR_NSCREENS_BACKWARD(i) { + if ((rc = dixLookupResourceByType((void **)&pWin, win->info[i].id, + XRT_WINDOW, client, + DixUnknownAccess))) { + client->errorValue = stuff->window; + return rc; + } + pScreen = pWin->drawable.pScreen; + + /* + * Has client queried a reference to the overlay window + * on this screen? If not, generate an error. + */ + pOc = compFindOverlayClient (pWin->drawable.pScreen, client); + if (pOc == NULL) + return BadMatch; + + /* The delete function will free the client structure */ + FreeResource (pOc->resource, RT_NONE); + } + + return Success; +} + +void +PanoramiXCompositeInit (void) +{ + int i; + + for (i = 0; i < CompositeNumberRequests; i++) + PanoramiXSaveCompositeVector[i] = ProcCompositeVector[i]; + /* + * Stuff in Xinerama aware request processing hooks + */ + ProcCompositeVector[X_CompositeRedirectWindow] = + PanoramiXCompositeRedirectWindow; + ProcCompositeVector[X_CompositeRedirectSubwindows] = + PanoramiXCompositeRedirectSubwindows; + ProcCompositeVector[X_CompositeUnredirectWindow] = + PanoramiXCompositeUnredirectWindow; + ProcCompositeVector[X_CompositeUnredirectSubwindows] = + PanoramiXCompositeUnredirectSubwindows; + ProcCompositeVector[X_CompositeNameWindowPixmap] = + PanoramiXCompositeNameWindowPixmap; + ProcCompositeVector[X_CompositeGetOverlayWindow] = + PanoramiXCompositeGetOverlayWindow; + ProcCompositeVector[X_CompositeReleaseOverlayWindow] = + PanoramiXCompositeReleaseOverlayWindow; +} + +void +PanoramiXCompositeReset (void) +{ + int i; + + for (i = 0; i < CompositeNumberRequests; i++) + ProcCompositeVector[i] = PanoramiXSaveCompositeVector[i]; +} + +#endif diff --git a/xserver/composite/compinit.c b/xserver/composite/compinit.c index 5db9f0282..90ee66c88 100644 --- a/xserver/composite/compinit.c +++ b/xserver/composite/compinit.c @@ -1,5 +1,5 @@ /* - * Copyright © 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright (c) 2006, Oracle and/or its affiliates. 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"), @@ -61,7 +61,6 @@ compCloseScreen (int index, ScreenPtr pScreen) free(cs->alternateVisuals); pScreen->CloseScreen = cs->CloseScreen; - pScreen->BlockHandler = cs->BlockHandler; pScreen->InstallColormap = cs->InstallColormap; pScreen->ChangeWindowAttributes = cs->ChangeWindowAttributes; pScreen->ReparentWindow = cs->ReparentWindow; @@ -78,6 +77,9 @@ compCloseScreen (int index, ScreenPtr pScreen) pScreen->CopyWindow = cs->CopyWindow; pScreen->PositionWindow = cs->PositionWindow; + pScreen->GetImage = cs->GetImage; + pScreen->SourceValidate = cs->SourceValidate; + free(cs); dixSetPrivate(&pScreen->devPrivates, CompScreenPrivateKey, NULL); ret = (*pScreen->CloseScreen) (index, pScreen); @@ -131,32 +133,40 @@ compChangeWindowAttributes(WindowPtr pWin, unsigned long mask) } static void -compScreenUpdate (ScreenPtr pScreen) +compGetImage (DrawablePtr pDrawable, + int sx, int sy, + int w, int h, + unsigned int format, + unsigned long planemask, + char *pdstLine) { - CompScreenPtr cs = GetCompScreen (pScreen); + ScreenPtr pScreen = pDrawable->pScreen; + CompScreenPtr cs = GetCompScreen (pScreen); - compCheckTree (pScreen); - if (cs->damaged) - { - compWindowUpdate (pScreen->root); - cs->damaged = FALSE; - } + pScreen->GetImage = cs->GetImage; + if (pDrawable->type == DRAWABLE_WINDOW) + compPaintChildrenToWindow ((WindowPtr) pDrawable); + (*pScreen->GetImage) (pDrawable, sx, sy, w, h, format, planemask, pdstLine); + cs->GetImage = pScreen->GetImage; + pScreen->GetImage = compGetImage; } -static void -compBlockHandler (int i, - pointer blockData, - pointer pTimeout, - pointer pReadmask) +static void compSourceValidate(DrawablePtr pDrawable, + int x, int y, + int width, int height, + unsigned int subWindowMode) { - ScreenPtr pScreen = screenInfo.screens[i]; - CompScreenPtr cs = GetCompScreen (pScreen); + ScreenPtr pScreen = pDrawable->pScreen; + CompScreenPtr cs = GetCompScreen (pScreen); - pScreen->BlockHandler = cs->BlockHandler; - compScreenUpdate (pScreen); - (*pScreen->BlockHandler) (i, blockData, pTimeout, pReadmask); - cs->BlockHandler = pScreen->BlockHandler; - pScreen->BlockHandler = compBlockHandler; + pScreen->SourceValidate = cs->SourceValidate; + if (pDrawable->type == DRAWABLE_WINDOW && subWindowMode == IncludeInferiors) + compPaintChildrenToWindow ((WindowPtr) pDrawable); + if (pScreen->SourceValidate) + (*pScreen->SourceValidate) (pDrawable, x, y, width, height, + subWindowMode); + cs->SourceValidate = pScreen->SourceValidate; + pScreen->SourceValidate = compSourceValidate; } /* @@ -331,7 +341,6 @@ compScreenInit (ScreenPtr pScreen) if (!cs) return FALSE; - cs->damaged = FALSE; cs->overlayWid = FakeClientID(0); cs->pOverlayWin = NULL; cs->pOverlayClients = NULL; @@ -387,12 +396,17 @@ compScreenInit (ScreenPtr pScreen) cs->ChangeWindowAttributes = pScreen->ChangeWindowAttributes; pScreen->ChangeWindowAttributes = compChangeWindowAttributes; - cs->BlockHandler = pScreen->BlockHandler; - pScreen->BlockHandler = compBlockHandler; + cs->BlockHandler = NULL; cs->CloseScreen = pScreen->CloseScreen; pScreen->CloseScreen = compCloseScreen; + cs->GetImage = pScreen->GetImage; + pScreen->GetImage = compGetImage; + + cs->SourceValidate = pScreen->SourceValidate; + pScreen->SourceValidate = compSourceValidate; + dixSetPrivate(&pScreen->devPrivates, CompScreenPrivateKey, cs); RegisterRealChildHeadProc(CompositeRealChildHead); diff --git a/xserver/composite/compint.h b/xserver/composite/compint.h index 80083b01d..bb5335d70 100644 --- a/xserver/composite/compint.h +++ b/xserver/composite/compint.h @@ -1,5 +1,5 @@ /* - * Copyright © 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright (c) 2006, Oracle and/or its affiliates. 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"), @@ -152,7 +152,6 @@ typedef struct _CompScreen { ScreenBlockHandlerProcPtr BlockHandler; CloseScreenProcPtr CloseScreen; - Bool damaged; int numAlternateVisuals; VisualID *alternateVisuals; @@ -160,6 +159,8 @@ typedef struct _CompScreen { Window overlayWid; CompOverlayClientPtr pOverlayClients; + GetImageProcPtr GetImage; + SourceValidateProcPtr SourceValidate; } CompScreenRec, *CompScreenPtr; extern DevPrivateKeyRec CompScreenPrivateKeyRec; @@ -214,7 +215,10 @@ Bool compAllocPixmap (WindowPtr pWin); void -compFreePixmap (WindowPtr pWin); +compSetParentPixmap (WindowPtr pWin); + +void +compRestoreWindow (WindowPtr pWin, PixmapPtr pPixmap); Bool compReallocPixmap (WindowPtr pWin, int x, int y, @@ -314,7 +318,7 @@ void compCopyWindow (WindowPtr pWin, DDXPointRec ptOldOrg, RegionPtr prgnSrc); void -compWindowUpdate (WindowPtr pWin); +compPaintChildrenToWindow (WindowPtr pWin); WindowPtr CompositeRealChildHead (WindowPtr pWin); @@ -326,4 +330,7 @@ int compConfigNotify(WindowPtr pWin, int x, int y, int w, int h, int bw, WindowPtr pSib); +void PanoramiXCompositeInit (void); +void PanoramiXCompositeReset (void); + #endif /* _COMPINT_H_ */ diff --git a/xserver/composite/compoverlay.c b/xserver/composite/compoverlay.c index 67b566c7f..047f069ff 100644 --- a/xserver/composite/compoverlay.c +++ b/xserver/composite/compoverlay.c @@ -1,5 +1,5 @@ /* - * Copyright © 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright (c) 2006, Oracle and/or its affiliates. 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"), @@ -48,6 +48,10 @@ #include "compint.h" #include "xace.h" +#ifdef PANORAMIX +#include "panoramiXsrv.h" +#endif + /* * Delete the given overlay client list element from its screen list. */ @@ -128,10 +132,19 @@ compCreateOverlayWindow (ScreenPtr pScreen) WindowPtr pWin; XID attrs[] = { None, TRUE }; /* backPixmap, overrideRedirect */ int result; + int w = pScreen->width; + int h = pScreen->height; + +#ifdef PANORAMIX + if (!noPanoramiXExtension) + { + w = PanoramiXPixWidth; + h = PanoramiXPixHeight; + } +#endif pWin = cs->pOverlayWin = - CreateWindow (cs->overlayWid, pRoot, - 0, 0, pScreen->width, pScreen->height, 0, + CreateWindow (cs->overlayWid, pRoot, 0, 0, w, h, 0, InputOutput, CWBackPixmap | CWOverrideRedirect, &attrs[0], pRoot->drawable.depth, serverClient, pScreen->rootVisual, &result); diff --git a/xserver/composite/compwindow.c b/xserver/composite/compwindow.c index 4dab13577..d2a866d6f 100644 --- a/xserver/composite/compwindow.c +++ b/xserver/composite/compwindow.c @@ -1,5 +1,5 @@ /* - * Copyright © 2006 Sun Microsystems, Inc. All rights reserved. + * Copyright (c) 2006, Oracle and/or its affiliates. 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"), @@ -47,6 +47,10 @@ #include "compint.h" +#ifdef PANORAMIX +#include "panoramiXsrv.h" +#endif + #ifdef COMPOSITE_DEBUG static int compCheckWindow (WindowPtr pWin, pointer data) @@ -160,8 +164,18 @@ compCheckRedirect (WindowPtr pWin) { if (should) return compAllocPixmap (pWin); + else { + ScreenPtr pScreen = pWin->drawable.pScreen; + PixmapPtr pPixmap = (*pScreen->GetWindowPixmap) (pWin); + compSetParentPixmap (pWin); + compRestoreWindow (pWin, pPixmap); + (*pScreen->DestroyPixmap) (pPixmap); + } + } else if (should) { + if (cw->update == CompositeRedirectAutomatic) + pWin->redirectDraw = RedirectDrawAutomatic; else - compFreePixmap (pWin); + pWin->redirectDraw = RedirectDrawManual; } return TRUE; } @@ -172,16 +186,26 @@ updateOverlayWindow(ScreenPtr pScreen) CompScreenPtr cs; WindowPtr pWin; /* overlay window */ XID vlist[2]; + int w = pScreen->width; + int h = pScreen->height; + +#ifdef PANORAMIX + if (!noPanoramiXExtension) + { + w = PanoramiXPixWidth; + h = PanoramiXPixHeight; + } +#endif cs = GetCompScreen(pScreen); if ((pWin = cs->pOverlayWin) != NULL) { - if ((pWin->drawable.width == pScreen->width) && - (pWin->drawable.height == pScreen->height)) + if ((pWin->drawable.width == w) && + (pWin->drawable.height == h)) return Success; /* Let's resize the overlay window. */ - vlist[0] = pScreen->width; - vlist[1] = pScreen->height; + vlist[0] = w; + vlist[1] = h; return ConfigureWindow(pWin, CWWidth | CWHeight, vlist, wClient(pWin)); } @@ -569,8 +593,11 @@ compDestroyWindow (WindowPtr pWin) while ((csw = GetCompSubwindows (pWin))) FreeResource (csw->clients->id, RT_NONE); - if (pWin->redirectDraw != RedirectDrawNone) - compFreePixmap (pWin); + if (pWin->redirectDraw != RedirectDrawNone) { + PixmapPtr pPixmap = (*pScreen->GetWindowPixmap) (pWin); + compSetParentPixmap (pWin); + (*pScreen->DestroyPixmap) (pPixmap); + } ret = (*pScreen->DestroyWindow) (pWin); cs->DestroyWindow = pScreen->DestroyWindow; pScreen->DestroyWindow = compDestroyWindow; @@ -706,13 +733,11 @@ compWindowUpdateAutomatic (WindowPtr pWin) DamageEmpty (cw->damage); } -void -compWindowUpdate (WindowPtr pWin) +static void +compPaintWindowToParent (WindowPtr pWin) { - WindowPtr pChild; + compPaintChildrenToWindow (pWin); - for (pChild = pWin->lastChild; pChild; pChild = pChild->prevSib) - compWindowUpdate (pChild); if (pWin->redirectDraw != RedirectDrawNone) { CompWindowPtr cw = GetCompWindow(pWin); @@ -725,6 +750,20 @@ compWindowUpdate (WindowPtr pWin) } } +void +compPaintChildrenToWindow (WindowPtr pWin) +{ + WindowPtr pChild; + + if (!pWin->damagedDescendants) + return; + + for (pChild = pWin->lastChild; pChild; pChild = pChild->prevSib) + compPaintWindowToParent (pChild); + + pWin->damagedDescendants = FALSE; +} + WindowPtr CompositeRealChildHead (WindowPtr pWin) { |