From 9e3371021541dbb7d8428b419c2e77156b166f1a Mon Sep 17 00:00:00 2001 From: Reinhard Tartler Date: Mon, 10 Oct 2011 17:58:30 +0200 Subject: Imported nxagent-3.1.0-2.tar.gz Summary: Imported nxagent-3.1.0-2.tar.gz Keywords: Imported nxagent-3.1.0-2.tar.gz into Git repository --- nx-X11/programs/Xserver/hw/nxagent/Imakefile | 220 +++++++++++++++++++++++++++ 1 file changed, 220 insertions(+) create mode 100644 nx-X11/programs/Xserver/hw/nxagent/Imakefile (limited to 'nx-X11/programs/Xserver/hw/nxagent/Imakefile') diff --git a/nx-X11/programs/Xserver/hw/nxagent/Imakefile b/nx-X11/programs/Xserver/hw/nxagent/Imakefile new file mode 100644 index 000000000..804f95f78 --- /dev/null +++ b/nx-X11/programs/Xserver/hw/nxagent/Imakefile @@ -0,0 +1,220 @@ +# XCOMM $Xorg: Imakefile,v 1.3 2000/08/17 19:53:28 cpqbld Exp $ + +#include + +#ifdef OS2Architecture +SRCS1 = os2Stub.c +OBJS1 = os2Stub.o +#endif + +SRCS = NXrandr.c \ + NXwindow.c \ + NXevents.c \ + NXproperty.c \ + NXdixfonts.c \ + NXglyphcurs.c \ + NXdispatch.c \ + NXrender.c \ + NXglyph.c \ + NXpicture.c \ + NXextension.c \ + NXshm.c \ + NXglxext.c \ + NXxvdisp.c \ + NXmiglyph.c \ + NXmiexpose.c \ + NXresource.c \ + NXmiwindow.c \ + NXxrandr.c \ + NXdamage.c \ + NXmitrap.c \ + Args.c \ + Binder.c \ + Colormap.c \ + Cursor.c \ + Dialog.c \ + Display.c \ + Events.c \ + Font.c \ + GC.c \ + GCOps.c \ + Millis.c \ + Handlers.c \ + Init.c \ + Keyboard.c \ + Keystroke.c \ + Pointer.c \ + Screen.c \ + TestExt.c \ + Visual.c \ + Drawable.c \ + Window.c \ + Pixmap.c \ + Render.c \ + Client.c \ + Rootless.c \ + Extensions.c \ + Options.c \ + Clipboard.c \ + Splash.c \ + Split.c \ + Holder.c \ + Reconnect.c \ + Error.c \ + Atoms.c \ + Trap.c \ + Image.c \ + Composite.c \ + Pixels.c \ + stubs.c \ + miinitext.c \ + $(SRCS1) + +OBJS = NXrandr.o \ + NXwindow.o \ + NXevents.o \ + NXproperty.o \ + NXdixfonts.o \ + NXglyphcurs.o \ + NXdispatch.o \ + NXrender.o \ + NXglyph.o \ + NXpicture.o \ + NXextension.o \ + NXshm.o \ + NXglxext.o \ + NXxvdisp.o \ + NXmiglyph.o \ + NXmiexpose.o \ + NXresource.o \ + NXmiwindow.o \ + NXxrandr.o \ + NXdamage.o \ + NXmitrap.o \ + Args.o \ + Binder.o \ + Colormap.o \ + Cursor.o \ + Dialog.o \ + Display.o \ + Events.o \ + Font.o \ + GC.o \ + GCOps.o \ + Millis.o \ + Handlers.o \ + Init.o \ + Keyboard.o \ + Keystroke.o \ + Pointer.o \ + Screen.o \ + TestExt.o \ + Visual.o \ + Drawable.o \ + Window.o \ + Pixmap.o \ + Render.o \ + Client.o \ + Rootless.o \ + Extensions.o \ + Options.o \ + Clipboard.o \ + Splash.o \ + Split.o \ + Holder.o \ + Reconnect.o \ + Error.o \ + Atoms.o \ + Trap.o \ + Image.o \ + Composite.o \ + Pixels.o \ + stubs.o \ + miinitext.o \ + $(OBJS1) + +VFBINCLUDES = -I../../fb -I../../mfb -I../../render +NXFONTINCLUDES = -I../../../../lib/font/include +LIBXRANDRINCLUDES= -I../../../../lib/Xrandr + +INCLUDES = -I. -I../../../../../nxcomp -I../../../../../nxcompext -I../../../../../nxcompshad \ + -I../../../../extras/Mesa/include \ + -I$(XBUILDINCDIR) -I$(FONTINCSRC) \ + -I../../mi -I../../include -I../../os \ + -I../../miext/damage -I../../miext/cw \ + -I../../GL/glx -I../../GL/include -I../../../../lib/GL/include -I../../Xext \ + -I$(EXTINCSRC) -I$(XINCLUDESRC) \ + $(VFBINCLUDES) $(NXFONTINCLUDES) $(LIBXRANDRINCLUDES) +#ifdef SunArchitecture +INCLUDES = -I. -I../../../../../nxcomp -I../../../../../nxcompext -I../../../../../nxcompshad \ + -I../../../../extras/Mesa/include \ + -I$(XBUILDINCDIR) -I$(FONTINCSRC) \ + -I/usr/sfw/include \ + -I../../mi -I../../include -I../../os \ + -I../../GL/glx -I../../GL/include -I../../../../lib/GL/include -I../../Xext \ + -I../../miext/damage -I../../miext/cw \ + -I$(EXTINCSRC) -I$(XINCLUDESRC) \ + $(VFBINCLUDES) $(NXFONTINCLUDES) $(LIBXRANDRINCLUDES) +#else +#ifdef cygwinArchitecture +INCLUDES = -I. -I$(XBUILDINCDIR) -I$(FONTINCSRC) \ + -I../../mi -I../../include -I../../os \ + -I../../GL/glx -I../../GL/include -I../../../../lib/GL/include -I../../Xext \ + -I../../miext/damage -I../../miext/cw \ + -I../../../../../nxcomp -I../../../../../nxcompext -I../../../../../nxcompshad \ + -I../../../../extras/Mesa/include \ + -I$(EXTINCSRC) -I$(XINCLUDESRC) \ + $(VFBINCLUDES) $(NXFONTINCLUDES) $(LIBXRANDRINCLUDES) +#endif +#endif + +### NXAGENT Defines: +# +# NXAGENT_FONTCACHE_SIZE Number of cache slots +# NXAGENT_SHAPE Old shape code +# NXAGENT_GLYPHCACHE +# NXAGENT_GLYPHCACHE_SIZE Slots for glyph cache +# NXAGENT_SHAPE2 New shape code +# NXAGENT_FIXKEYS Force the release of pressed key when loosing focus +# NXAGENT_EXPOSURES Manage expose events +# NXAGENT_CLIPBOARD Enables clipboard cut and paste function between X servers. +# NXAGENT_FONTEXCLUDE Exclude some specific font names (only "-ult1mo" at this moment). +# NXAGENT FULLSCREEN Fullscreen mode +# + +#if NXUpgradeAgentServer +UPG_DEFINES=-DNXAGENT_UPGRADE +#else +UPG_DEFINES= +#endif + +DEFINES = -g $(OS_DEFINES) $(EXT_DEFINES) $(UPG_DEFINES) \ + -UXF86VIDMODE -UXFreeXDGA -UXF86MISC -UXF86DRI -UXFree86LOADER \ + -DNXAGENT_SERVER \ + -DNXAGENT_CONSTRAINCURSOR \ + -DNXAGENT_FONTCACHE_SIZE=50 \ + -DNXAGENT_GLYPHCACHE -DNXAGENT_GLYPHCACHE_SIZE=50 \ + -DNXAGENT_SHAPE2 \ + -DNXAGENT_FIXKEYS \ + -DNXAGENT_CLIPBOARD \ + -DNXAGENT_EXPOSURES \ + -DNXAGENT_FONTEXCLUDE \ + -DNXAGENT_PACKEDIMAGES \ + -DNXAGENT_VISIBILITY \ + -DNXAGENT_WAKEUP=1000 \ + -DNXAGENT_ONSTART \ + -DNXAGENT_SPLASH \ + -DNXAGENT_ARTSD \ + -UPANORAMIX + +all:: $(OBJS) + +LinkSourceFile(stubs.c,$(SERVERSRC)/Xi) +SpecialCObjectRule(Init,$(ICONFIGFILES),$(_NOOP_)) +LinkSourceFile(miinitext.c,$(SERVERSRC)/mi) +SpecialCObjectRule(miinitext,$(ICONFIGFILES), $(_NOOP_)) + +NormalLibraryObjectRule() +NormalLibraryTarget(nxagent,$(OBJS)) + +DependTarget() -- cgit v1.2.3 From 1a74e03235ced7003989b8c02bc4d955234431c1 Mon Sep 17 00:00:00 2001 From: Reinhard Tartler Date: Mon, 10 Oct 2011 17:58:55 +0200 Subject: Imported nxagent-3.3.0-10.tar.gz Summary: Imported nxagent-3.3.0-10.tar.gz Keywords: Imported nxagent-3.3.0-10.tar.gz into Git repository --- nx-X11/programs/Xserver/hw/nxagent/Args.c | 20 +- nx-X11/programs/Xserver/hw/nxagent/CHANGELOG | 93 +++++ nx-X11/programs/Xserver/hw/nxagent/Drawable.c | 116 ++++-- nx-X11/programs/Xserver/hw/nxagent/Events.c | 152 ++++++- nx-X11/programs/Xserver/hw/nxagent/Font.c | 188 ++++++++- nx-X11/programs/Xserver/hw/nxagent/Imakefile | 1 + nx-X11/programs/Xserver/hw/nxagent/Init.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Keyboard.c | 463 ++++++++++++++++++++- nx-X11/programs/Xserver/hw/nxagent/Keyboard.h | 4 + nx-X11/programs/Xserver/hw/nxagent/Reconnect.c | 31 +- nx-X11/programs/Xserver/hw/nxagent/Render.c | 9 +- nx-X11/programs/Xserver/hw/nxagent/Rootless.c | 63 ++- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 3 +- nx-X11/programs/Xserver/hw/nxagent/Window.c | 127 ++++++ nx-X11/programs/Xserver/hw/nxagent/Windows.h | 18 + nx-X11/programs/Xserver/hw/nxagent/X/NXevents.c | 119 +++++- .../Xserver/hw/nxagent/X/NXevents.c.NX.original | 119 +++++- nx-X11/programs/Xserver/hw/nxagent/X/NXproperty.c | 4 + .../Xserver/hw/nxagent/X/NXproperty.c.NX.original | 4 + 19 files changed, 1399 insertions(+), 137 deletions(-) (limited to 'nx-X11/programs/Xserver/hw/nxagent/Imakefile') diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.c b/nx-X11/programs/Xserver/hw/nxagent/Args.c index 5b336279e..5d344729c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Args.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c @@ -1140,13 +1140,13 @@ static void nxagentParseOptions(char *name, char *value) } else if (!strcmp(name, "resize")) { - if (!strcmp(value, "1")) + if (nxagentOption(DesktopResize) == 0 || strcmp(value, "0") == 0) { - nxagentResizeDesktopAtStartup = True; + nxagentResizeDesktopAtStartup = 0; } - else if (!strcmp(value, "0")) + else if (strcmp(value, "1") == 0) { - nxagentResizeDesktopAtStartup = False; + nxagentResizeDesktopAtStartup = 1; } else { @@ -2080,8 +2080,8 @@ void nxagentSetDeferLevel() deferTimeout = 200; - tileWidth = 65536; - tileHeight = 65536; + tileWidth = 4096; + tileHeight = 4096; break; } @@ -2091,8 +2091,8 @@ void nxagentSetDeferLevel() deferTimeout = 200; - tileWidth = 65536; - tileHeight = 65536; + tileWidth = 4096; + tileHeight = 4096; break; } @@ -2103,8 +2103,8 @@ void nxagentSetDeferLevel() deferTimeout = 200; - tileWidth = 65536; - tileHeight = 65536; + tileWidth = 4096; + tileHeight = 4096; break; } diff --git a/nx-X11/programs/Xserver/hw/nxagent/CHANGELOG b/nx-X11/programs/Xserver/hw/nxagent/CHANGELOG index c45c97bbb..9e746bb78 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/CHANGELOG +++ b/nx-X11/programs/Xserver/hw/nxagent/CHANGELOG @@ -1,5 +1,98 @@ ChangeLog: +nxagent-3.3.0-10 + +- Fixed TR12F02146. Compare the drawable and the bitmap data before + realizing the image update, in order to delay the data clean up that + caused the memcmp() failure. + +- Fixed TR01G02156. Reduce the exposing area by subtracting the ex- + posed region. + +- Fixed a compile warning in Drawable.c. + +- Added detailed logs in the nxagentSynchronizeRegion() function if + the data memory allocation fails. + +nxagent-3.3.0-9 + +- Added /usr/NX/share/base to alternate font paths. This would fix + TR11F02130 if fonts fixed and cursor are installed there. + +- Changed Keyboard initialization and reset. This change should fix + TR11F02129, TR11F02131, TR11F02132. + +nxagent-3.3.0-8 + +- Fixed TR12F02144. Image bits of render glyphs are copied before they + are cleaned. This will avoid a memory corruption. + +- Fixed TR12F02145. When dispatching a MotionNotify event, check if a + top-level window has been entered before trying to show the pulldown + dialog. + +nxagent-3.3.0-7 + +- Added debug code for pointer input. + +nxagent-3.3.0-6 + +- Fixed compile warnings. + +nxagent-3.3.0-5 + +- Disabled verbose logging in Rootless.c. + +nxagent-3.3.0-4 + +- Fix the XKB map load in the case of 64 bit server. + +nxagent-3.3.0-3 + +- Fixed TR10F02119. If the remote X display is using evdev keyboard + then copy maps from remote. + +- Upgraded VERSION to 3.3.0. + +nxagent-3.3.0-2 + +- Fixed TR10F02115. Painting errors occurred when screen areas beyond + the current viewport became viewable in the NX Client for Windows. + +- Using a new struct type nxagentWMHints to avoid type mismatch on + 64 bit platforms. + +- Added debug utilities for pointer input. + +nxagent-3.3.0-1 + +- Opened the 3.3.0 branch based on nxagent-3.2.0-12. + +nxagent-3.2.0-12 + +- Ignore 'resize' option at reconnection if viewport mode is on. + +- Fixed TR08E01814. Added shadow keymap initialization in order to + enable nxcompshad to translate keycodes across different layouts. + +nxagent-3.2.0-11 + +- Fixed TR08F02098. Function splitting font names has to be instruct- + ed to handle the right number of fields. + +nxagent-3.2.0-10 + +- Extended fix for TR07F02091 to include font names having zero in + fields RESOLUTION_X and RESOLUTION_Y. + +nxagent-3.2.0-9 + +- Fixed TR07F02091. Scalable fonts were not correctly listed among + available fonts. + +- Fixed TR06F02080. Use the corrupted area extents as maximum size of + the image data. + nxagent-3.2.0-8 - Fixed TR07F02082. The agent server could be unable to init core diff --git a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c index abc228e9c..82723b5a0 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c @@ -32,6 +32,7 @@ #include "Handlers.h" #include "Pixels.h" #include "Reconnect.h" +#include "GCOps.h" #include "NXlib.h" @@ -371,6 +372,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned int nBox; int x, y; int w, h; + int extentWidth, extentHeight; int tileWidth, tileHeight; int length, format, leftPad; int i; @@ -417,13 +419,14 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned if (useStoredBitmap != 0) { #ifdef TEST - fprintf(stderr, "nxagentSynchronizeRegion: Drawable [%s] at [%p] has a synchronization bitmap " + fprintf(stderr, "nxagentSynchronizeRegion: Drawable [%s] at [%p] has a synchronization bitmap at [%p] " "[%d,%d,%d,%d] with [%ld] rects.\n", nxagentDrawableType(pDrawable), - (void *) pDrawable, nxagentCorruptedRegion((DrawablePtr) nxagentDrawableBitmap(pDrawable)) -> extents.x1, - nxagentCorruptedRegion((DrawablePtr) nxagentDrawableBitmap(pDrawable)) -> extents.y1, - nxagentCorruptedRegion((DrawablePtr) nxagentDrawableBitmap(pDrawable)) -> extents.x2, - nxagentCorruptedRegion((DrawablePtr) nxagentDrawableBitmap(pDrawable)) -> extents.y2, - REGION_NUM_RECTS(nxagentCorruptedRegion((DrawablePtr) nxagentDrawableBitmap(pDrawable)))); + (void *) pDrawable, (void *) nxagentDrawableBitmap(pDrawable), + nxagentCorruptedRegion((DrawablePtr) nxagentDrawableBitmap(pDrawable)) -> extents.x1, + nxagentCorruptedRegion((DrawablePtr) nxagentDrawableBitmap(pDrawable)) -> extents.y1, + nxagentCorruptedRegion((DrawablePtr) nxagentDrawableBitmap(pDrawable)) -> extents.x2, + nxagentCorruptedRegion((DrawablePtr) nxagentDrawableBitmap(pDrawable)) -> extents.y2, + REGION_NUM_RECTS(nxagentCorruptedRegion((DrawablePtr) nxagentDrawableBitmap(pDrawable)))); #endif clipRegion = nxagentCreateRegion(pDrawable, NULL, 0, 0, pDrawable -> width, pDrawable -> height); @@ -580,8 +583,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned #ifdef TEST fprintf(stderr, "nxagentSynchronizeRegion: Going to synchronize [%ld] rects of [%s] at [%p].\n", - REGION_NUM_RECTS(clipRegion), (pDrawable -> type == DRAWABLE_PIXMAP ? "Pixmap" : "Window"), - (void *) pDrawable); + REGION_NUM_RECTS(clipRegion), nxagentDrawableType(pDrawable), (void *) pDrawable); fprintf(stderr, "nxagentSynchronizeRegion: Extents geometry [%d,%d,%d,%d].\n", clipRegion -> extents.x1, clipRegion -> extents.y1, clipRegion -> extents.x2, clipRegion -> extents.y2); @@ -590,8 +592,20 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned pDrawable -> x, pDrawable -> y, pDrawable -> width, pDrawable -> height); #endif - w = tileWidth = (nxagentOption(TileWidth) > pDrawable -> width ? pDrawable -> width : nxagentOption(TileWidth)); - h = tileHeight = (nxagentOption(TileHeight) > pDrawable -> height ? pDrawable -> height : nxagentOption(TileHeight)); + /* + * We are going to synchronize the corrupted + * area, so we use the corrupted extents as + * maximum size of the image data. It's im- + * portant to avoid using the drawable size, + * because in case of a huge window it had to + * result in a failed data memory allocation. + */ + + extentWidth = clipRegion -> extents.x2 - clipRegion -> extents.x1; + extentHeight = clipRegion -> extents.y2 - clipRegion -> extents.y1; + + w = tileWidth = (nxagentOption(TileWidth) > extentWidth ? extentWidth : nxagentOption(TileWidth)); + h = tileHeight = (nxagentOption(TileHeight) > extentHeight ? extentHeight : nxagentOption(TileHeight)); #ifdef DEBUG fprintf(stderr, "nxagentSynchronizeRegion: Using tiles of size [%dx%d].\n", tileWidth, tileHeight); @@ -602,7 +616,22 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned if (data == NULL) { #ifdef WARNING + fprintf(stderr, "nxagentSynchronizeRegion: WARNING! Failed to allocate memory for synchronization.\n"); + + /* + * Print detailed informations if the + * image length is zero. + */ + + if (length == 0) + { + fprintf(stderr, "nxagentSynchronizeRegion: Drawable [%s] at [%p] with region geometry [%ld][%d,%d,%d,%d].\n", + nxagentDrawableType(pDrawable), (void *) pDrawable, REGION_NUM_RECTS(clipRegion), + clipRegion -> extents.x1, clipRegion -> extents.y1, + clipRegion -> extents.x2, clipRegion -> extents.y2); + } + #endif goto nxagentSynchronizeRegionFree; @@ -657,10 +686,14 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned if (nxagentDrawableStatus(pDrawable) == Synchronized) { #ifdef WARNING + if (pDrawable -> type == DRAWABLE_WINDOW && pSrcDrawable != pDrawable) + { fprintf(stderr, "nxagentSynchronizeRegion: WARNING! Trying to synchronize " "the clean drawable type [%d] at [%p] with source at [%p].\n", pDrawable -> type, (void *) pDrawable, (void *) pSrcDrawable); + } + #endif goto nxagentSynchronizeRegionStop; @@ -735,9 +768,6 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned nxagentGetImage(pSrcDrawable, x, y, w, h, format, AllPlanes, data); - nxagentRealizeImage(pDrawable, pGC, pDrawable -> depth, - x, y, w, h, leftPad, format, data); - /* * Going to unmark the synchronized * region. @@ -792,6 +822,13 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned nxagentUnmarkCorruptedRegion(pDrawable, &tileRegion); } + #ifdef TEST + else + { + fprintf(stderr, "nxagentSynchronizeRegion: Tile [%d,%d,%d,%d] on drawable [%p] doesn't match.\n", + x, y, x + w, y + h, (void *) pDrawable); + } + #endif } else { @@ -822,6 +859,14 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned } } + /* + * Realize the image after comparing the + * source data with the bitmap data. + */ + + nxagentRealizeImage(pDrawable, pGC, pDrawable -> depth, + x, y, w, h, leftPad, format, data); + REGION_UNINIT(pDrawable -> pScreen, &tileRegion); #if !defined(COLLECTED_UPDATES) @@ -2542,16 +2587,13 @@ void nxagentCreateDrawableBitmap(DrawablePtr pDrawable) GCPtr pGC = NULL; RegionPtr pClipRegion = NullRegion; - char *data = NULL; - int x, y; int w, h; - int length, format; int saveTrap; #ifdef TEST - fprintf(stderr, "nxagentCreateDrawableBitmap: Creating synchronization bitmap for drawable at [%p].\n", - (void *) pDrawable); + fprintf(stderr, "nxagentCreateDrawableBitmap: Creating synchronization bitmap for [%s] at [%p].\n", + nxagentDrawableType(pDrawable), (void *) pDrawable); #endif /* @@ -2613,7 +2655,10 @@ void nxagentCreateDrawableBitmap(DrawablePtr pDrawable) * FIXME: A better way it would be create the bitmap * with the same extents of the clipRegion. This * requires to save the offset with respect to the - * drawable origin like in the backing store. + * drawable origin like in the backing store. This + * becomes particularly important when the drawable + * is a huge window, because the pixmap creation + * would fail. */ pBitmap = nxagentCreatePixmap(pDrawable -> pScreen, pDrawable -> width, pDrawable -> height, pDrawable -> depth); @@ -2636,24 +2681,8 @@ void nxagentCreateDrawableBitmap(DrawablePtr pDrawable) w = pClipRegion -> extents.x2 - pClipRegion -> extents.x1; h = pClipRegion -> extents.y2 - pClipRegion -> extents.y1; - data = nxagentAllocateImageData(w, h, pDrawable -> depth, &length, &format); - - if (data == NULL) - { - #ifdef WARNING - fprintf(stderr, "nxagentCreateDrawableBitmap: Cannot allocate memory for the bitmap data.\n"); - #endif - - nxagentDestroyPixmap(pBitmap); - - goto nxagentCreateDrawableBitmapEnd; - } + nxagentCopyArea(pDrawable, (DrawablePtr) pBitmap, pGC, x, y, w, h, x, y); - nxagentGetImage(pDrawable, x, y, w, h, format, AllPlanes, data); - - nxagentPutImage((DrawablePtr) pBitmap, pGC, pBitmap -> drawable.depth, x, y, w, h, - 0, format, data); - REGION_UNION(pDrawable -> pScreen, nxagentCorruptedRegion((DrawablePtr) pBitmap), nxagentCorruptedRegion((DrawablePtr) pBitmap), pClipRegion); @@ -2695,11 +2724,6 @@ nxagentCreateDrawableBitmapEnd: nxagentFreeRegion(pDrawable, pClipRegion); } - if (data != NULL) - { - xfree(data); - } - if (pGC != NULL) { FreeScratchGC(pGC); @@ -3075,6 +3099,16 @@ void nxagentSendBackgroundExpose(WindowPtr pWin, PixmapPtr pBackground, RegionPt REGION_INTERSECT(pWin -> pScreen, &expose, &expose, &pWin -> clipList); + /* + * Reduce the overall region to expose. + */ + + REGION_TRANSLATE(pWin -> pScreen, &expose, -pWin -> drawable.x, -pWin -> drawable.y); + + REGION_SUBTRACT(pWin -> pScreen, pExpose, pExpose, &expose); + + REGION_TRANSLATE(pWin -> pScreen, &expose, pWin -> drawable.x, pWin -> drawable.y); + miWindowExposures(pWin, &expose, &expose); nxagentSendBackgroundExposeEnd: diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index b37d81adf..3c1458cb7 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -63,7 +63,13 @@ #include "NXproto.h" #include "xfixesproto.h" +#define Window XlibWindow +#define Atom XlibAtom +#define Time XlibXID #include +#undef Window +#undef Atom +#undef Time #ifdef NXAGENT_FIXKEYS #include "inputstr.h" @@ -113,6 +119,10 @@ extern int nxagentSplashCount; extern int nxagentLastClipboardClient; +#ifdef NX_DEBUG_INPUT +int nxagentDebugInput = 0; +#endif + #ifdef DEBUG extern Bool nxagentRootlessTreesMatch(void); #endif @@ -172,6 +182,8 @@ static Cursor viewportCursor; static Mask defaultEventMask; +static int lastEventSerial = 0; + #define MAX_INC 200 #define INC_STEP 5 #define nextinc(x) ((x) < MAX_INC ? (x) += INC_STEP : (x)) @@ -252,6 +264,13 @@ void nxagentRemoveDuplicatedKeys(XEvent *X); void ProcessInputEvents() { + #ifdef NX_DEBUG_INPUT + if (nxagentDebugInput == 1) + { + fprintf(stderr, "ProcessInputEvents: Processing input.\n"); + } + #endif + mieqProcessInputEvents(); } @@ -282,6 +301,11 @@ void nxagentSwitchResizeMode(ScreenPtr pScreen) nxagentRRSetScreenConfig(pScreen, nxagentOption(Width), nxagentOption(Height)); + if (nxagentOption(ClientOs) == ClientOsWinnt) + { + NXSetExposeParameters(nxagentDisplay, 0, 0, 0); + } + sizeHints.max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); sizeHints.max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); } @@ -771,8 +795,9 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) } x.u.u.type = KeyRelease; - x.u.u.detail = X.xkey.keycode; - x.u.keyButtonPointer.time = nxagentLastKeyPressTime + (X.xkey.time - nxagentLastServerTime); + x.u.u.detail = nxagentConvertKeycode(X.xkey.keycode); + x.u.keyButtonPointer.time = nxagentLastKeyPressTime + + (X.xkey.time - nxagentLastServerTime); nxagentLastServerTime = X.xkey.time; @@ -794,8 +819,11 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) } case ButtonPress: { - #ifdef TEST - fprintf(stderr, "nxagentDispatchEvents: Going to handle new ButtonPress event.\n"); + #ifdef NX_DEBUG_INPUT + if (nxagentDebugInput == 1) + { + fprintf(stderr, "nxagentDispatchEvents: Going to handle new ButtonPress event.\n"); + } #endif nxagentInputEvent = 1; @@ -860,6 +888,13 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) x.u.keyButtonPointer.rootY = X.xmotion.y - nxagentOption(RootY); } + #ifdef NX_DEBUG_INPUT + if (nxagentDebugInput == 1) + { + fprintf(stderr, "nxagentDispatchEvents: Adding ButtonPress event.\n"); + } + #endif + mieqEnqueue(&x); CriticalOutputPending = 1; @@ -887,8 +922,11 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) } case ButtonRelease: { - #ifdef TEST - fprintf(stderr, "nxagentDispatchEvents: Going to handle new ButtonRelease event.\n"); + #ifdef NX_DEBUG_INPUT + if (nxagentDebugInput == 1) + { + fprintf(stderr, "nxagentDispatchEvents: Going to handle new ButtonRelease event.\n"); + } #endif nxagentInputEvent = 1; @@ -923,6 +961,13 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) x.u.keyButtonPointer.rootY = X.xmotion.y - nxagentOption(RootY); } + #ifdef NX_DEBUG_INPUT + if (nxagentDebugInput == 1) + { + fprintf(stderr, "nxagentDispatchEvents: Adding ButtonRelease event.\n"); + } + #endif + mieqEnqueue(&x); CriticalOutputPending = 1; @@ -956,12 +1001,15 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) fprintf(stderr, "nxagentDispatchEvents: Going to handle new MotionNotify event.\n"); #endif - #ifdef TEST - fprintf(stderr, "nxagentDispatchEvents: Handling motion notify window [%ld] root [%ld] child [%ld].\n", + #ifdef NX_DEBUG_INPUT + if (nxagentDebugInput == 1) + { + fprintf(stderr, "nxagentDispatchEvents: Handling motion notify window [%ld] root [%ld] child [%ld].\n", X.xmotion.window, X.xmotion.root, X.xmotion.subwindow); - fprintf(stderr, "nxagentDispatchEvents: Pointer at [%d][%d] relative root [%d][%d].\n", + fprintf(stderr, "nxagentDispatchEvents: Pointer at [%d][%d] relative root [%d][%d].\n", X.xmotion.x, X.xmotion.y, X.xmotion.x_root, X.xmotion.y_root); + } #endif x.u.u.type = MotionNotify; @@ -975,18 +1023,17 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) nxagentLastEnteredWindow = pWin; } - if (nxagentPulldownDialogPid == 0 && (X.xmotion.y_root < - nxagentLastEnteredTopLevelWindow -> drawable.y + 4)) + if (nxagentPulldownDialogPid == 0 && nxagentLastEnteredTopLevelWindow && + (X.xmotion.y_root < nxagentLastEnteredTopLevelWindow -> drawable.y + 4)) { - if (pWin && nxagentLastEnteredTopLevelWindow && - nxagentClientIsDialog(wClient(pWin)) == 0 && - nxagentLastEnteredTopLevelWindow -> parent == WindowTable[0] && - nxagentLastEnteredTopLevelWindow -> overrideRedirect == False && - X.xmotion.x_root > (nxagentLastEnteredTopLevelWindow -> drawable.x + - (nxagentLastEnteredTopLevelWindow -> drawable.width >> 1) - 50) && - X.xmotion.x_root < (nxagentLastEnteredTopLevelWindow -> drawable.x + - (nxagentLastEnteredTopLevelWindow -> drawable.width >> 1) + 50) && - nxagentOption(Menu) == 1) + if (pWin && nxagentClientIsDialog(wClient(pWin)) == 0 && + nxagentLastEnteredTopLevelWindow -> parent == WindowTable[0] && + nxagentLastEnteredTopLevelWindow -> overrideRedirect == False && + X.xmotion.x_root > (nxagentLastEnteredTopLevelWindow -> drawable.x + + (nxagentLastEnteredTopLevelWindow -> drawable.width >> 1) - 50) && + X.xmotion.x_root < (nxagentLastEnteredTopLevelWindow -> drawable.x + + (nxagentLastEnteredTopLevelWindow -> drawable.width >> 1) + 50) && + nxagentOption(Menu) == 1) { nxagentPulldownDialog(nxagentLastEnteredTopLevelWindow -> drawable.id); } @@ -1008,6 +1055,14 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) X.xmotion.window == nxagentDefaultWindows[pScreen -> myNum] && X.xmotion.subwindow == None)) { + #ifdef NX_DEBUG_INPUT + if (nxagentDebugInput == 1) + { + fprintf(stderr, "nxagentDispatchEvents: Adding motion event [%d, %d] to the queue.\n", + x.u.keyButtonPointer.rootX, x.u.keyButtonPointer.rootY); + } + #endif + mieqEnqueue(&x); } @@ -1644,6 +1699,21 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) } /* End of switch (X.type) */ + if (X.xany.serial < lastEventSerial) + { + /* + * Start over. + */ + + nxagentDeleteStaticResizedWindow(0); + } + else + { + nxagentDeleteStaticResizedWindow(X.xany.serial - 1); + } + + lastEventSerial = X.xany.serial; + } /* End of while (...) */ /* @@ -1848,8 +1918,9 @@ int nxagentHandleKeyPress(XEvent *X, enum HandleEventResult *result) nxagentLastEventTime = nxagentLastKeyPressTime = GetTimeInMillis(); + x.u.u.type = KeyPress; - x.u.u.detail = X -> xkey.keycode; + x.u.u.detail = nxagentConvertKeycode(X -> xkey.keycode); x.u.keyButtonPointer.time = nxagentLastKeyPressTime; nxagentLastServerTime = X -> xkey.time; @@ -1914,6 +1985,8 @@ int nxagentHandleExposeEvent(XEvent *X) int index = 0; int overlap = 0; + StaticResizedWindowStruct *resizedWinPtr = NULL; + #ifdef DEBUG fprintf(stderr, "nxagentHandleExposeEvent: Checking remote expose events.\n"); #endif @@ -1944,6 +2017,19 @@ FIXME: This can be maybe optimized by consuming the box.x1 = pWin -> drawable.x + wBorderWidth(pWin) + X -> xexpose.x; box.y1 = pWin -> drawable.y + wBorderWidth(pWin) + X -> xexpose.y; + resizedWinPtr = nxagentFindStaticResizedWindow(X -> xany.serial); + + while (resizedWinPtr) + { + if (resizedWinPtr -> pWin == pWin) + { + box.x1 += resizedWinPtr -> offX; + box.y1 += resizedWinPtr -> offY; + } + + resizedWinPtr = resizedWinPtr -> prev; + } + box.x2 = box.x1 + X -> xexpose.width; box.y2 = box.y1 + X -> xexpose.height; @@ -3913,3 +3999,27 @@ int nxagentWaitEvents(Display *dpy, struct timeval *tm) return 1; } + +#ifdef NX_DEBUG_INPUT + +void nxagentDumpInputInfo(void) +{ + fprintf(stderr, "Dumping input info ON.\n"); +} + +void nxagentGuessDumpInputInfo(ClientPtr client, Atom property, char *data) +{ + if (strcmp(validateString(NameForAtom(property)), "NX_DEBUG_INPUT") == 0) + { + if (*data != 0) + { + nxagentDebugInput = 1; + } + else + { + nxagentDebugInput = 0; + } + } +} + +#endif diff --git a/nx-X11/programs/Xserver/hw/nxagent/Font.c b/nx-X11/programs/Xserver/hw/nxagent/Font.c index 6fb34f221..87f9f0201 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Font.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Font.c @@ -65,26 +65,34 @@ is" without express or implied warranty. #define NXAGENT_ALTERNATE_FONT_DIR "/usr/share/X11/fonts" #define NXAGENT_ALTERNATE_FONT_DIR_2 "/usr/share/fonts/X11" #define NXAGENT_ALTERNATE_FONT_DIR_3 "/usr/share/fonts" +#define NXAGENT_ALTERNATE_FONT_DIR_4 "/usr/NX/share/fonts" #define NXAGENT_DEFAULT_FONT_PATH \ "/usr/X11R6/lib/X11/fonts/misc/,/usr/X11R6/lib/X11/fonts/Speedo/,\ /usr/X11R6/lib/X11/fonts/Type1/,/usr/X11R6/lib/X11/fonts/75dpi/,\ -/usr/X11R6/lib/X11/fonts/100dpi/,/usr/X11R6/lib/X11/fonts/TTF/" +/usr/X11R6/lib/X11/fonts/100dpi/,/usr/X11R6/lib/X11/fonts/TTF/,\ +/usr/NX/share/fonts/base" #define NXAGENT_ALTERNATE_FONT_PATH \ "/usr/share/X11/fonts/misc/,/usr/share/X11/fonts/Speedo/,\ /usr/share/X11/fonts/Type1/,/usr/share/X11/fonts/75dpi/,\ -/usr/share/X11/fonts/100dpi/,/usr/share/X11/fonts/TTF/" +/usr/share/X11/fonts/100dpi/,/usr/share/X11/fonts/TTF/,\ +/usr/NX/share/fonts/base" #define NXAGENT_ALTERNATE_FONT_PATH_2 \ "/usr/share/fonts/X11/misc/,/usr/share/fonts/X11/Speedo/,\ /usr/share/fonts/X11/Type1/,/usr/share/fonts/X11/75dpi/,\ -/usr/share/fonts/X11/100dpi/,/usr/share/fonts/X11/TTF/" +/usr/share/fonts/X11/100dpi/,/usr/share/fonts/X11/TTF/,\ +/usr/NX/share/fonts/base" #define NXAGENT_ALTERNATE_FONT_PATH_3 \ "/usr/share/fonts/misc/,/usr/share/fonts/Speedo/,\ /usr/share/fonts/Type1/,/usr/share/fonts/75dpi/,\ -/usr/share/fonts/100dpi/,/usr/share/fonts/TTF/" +/usr/share/fonts/100dpi/,/usr/share/fonts/TTF/,\ +/usr/NX/share/fonts/base" + +#define NXAGENT_ALTERNATE_FONT_PATH_4 \ +"/usr/NX/share/fonts/base" #undef NXAGENT_FONTCACHE_DEBUG #undef NXAGENT_RECONNECT_FONT_DEBUG @@ -101,6 +109,8 @@ static XFontStruct *nxagentLoadQueryFont(register Display *dpy , char *fontName int nxagentFreeFont(XFontStruct *fs); static Bool nxagentGetFontServerPath(char * fontServerPath); +static char * nxagentMakeScalableFontName(const char *fontName, int scalableResolution); + RESTYPE RT_NX_FONT; #ifdef NXAGENT_RECONNECT_FONT_DEBUG @@ -419,13 +429,59 @@ Bool nxagentFontFind(const char *name, int *pos) Bool nxagentFontLookUp(const char *name) { int i; - if (name) - if (!strlen(name)) - return 0; - if (nxagentFontFind(name, &i)) - return (nxagentRemoteFontList.list[i]->status > 0); - else + int result; + + char *scalable; + + if (name != NULL && strlen(name) == 0) + { return 0; + } + + result = nxagentFontFind(name, &i); + + scalable = NULL; + + /* + * Let's try with the scalable font description. + */ + + if (result == 0) + { + scalable = nxagentMakeScalableFontName(name, 0); + + if (scalable != NULL) + { + result = nxagentFontFind(scalable, &i); + + free(scalable); + } + } + + /* + * Let's try again after replacing zero to xdpi and ydpi in the pattern. + */ + + if (result == 0) + { + scalable = nxagentMakeScalableFontName(name, 1); + + if (scalable != NULL) + { + result = nxagentFontFind(scalable, &i); + + free(scalable); + } + } + + if (result == 0) + { + return 0; + } + else + { + return (nxagentRemoteFontList.list[i]->status > 0); + } } Bool nxagentRealizeFont(ScreenPtr pScreen, FontPtr pFont) @@ -700,7 +756,7 @@ static XFontStruct *nxagentLoadBestQueryFont(Display* dpy, char *fontName, FontP substFontBuf = (char *) xalloc(sizeof(char) * 512); - numFontFields = nxagentSplitString(fontName, fontNameFields, FIELDS, "-"); + numFontFields = nxagentSplitString(fontName, fontNameFields, FIELDS + 1, "-"); memcpy(substFontBuf, "fixed\0", strlen("fixed") + 1); @@ -1505,6 +1561,31 @@ void nxagentVerifyDefaultFontPath(void) strcat(fontPath, NXAGENT_ALTERNATE_FONT_PATH_3); } + if (stat(NXAGENT_ALTERNATE_FONT_DIR_4, &dirStat) == 0 && + S_ISDIR(dirStat.st_mode) != 0) + { + /* + * Let's use the "/usr/NX/share/fonts" path. + */ + + #ifdef TEST + fprintf(stderr, "nxagentVerifyDefaultFontPath: Assuming fonts in directory [%s].\n", + validateString(NXAGENT_ALTERNATE_FONT_DIR_4)); + #endif + + if (*fontPath != '\0') + { + fontPath = realloc(fontPath, strlen(fontPath) + strlen(NXAGENT_ALTERNATE_FONT_PATH_4) + 2); + strcat(fontPath, ","); + } + else + { + fontPath = realloc(fontPath, strlen(fontPath) + strlen(NXAGENT_ALTERNATE_FONT_PATH_4) + 1); + } + + strcat(fontPath, NXAGENT_ALTERNATE_FONT_PATH_4); + } + if (*fontPath == '\0') { #ifdef WARNING @@ -1698,3 +1779,88 @@ int nxagentSplitString(char *string, char *fields[], int nfields, char *sep) return i; } +char *nxagentMakeScalableFontName(const char *fontName, int scalableResolution) +{ + char *scalableFontName; + const char *s; + int len; + int field; + + len = strlen(fontName) + 1; + + scalableFontName = malloc(len); + + if (scalableFontName == NULL) + { + #ifdef PANIC + fprintf(stderr, "nxagentMakeScalableFontName: PANIC! malloc() failed.\n"); + #endif + + return NULL; + } + + scalableFontName[0] = 0; + + if (*fontName != '-') + { + goto MakeScalableFontNameError; + } + + s = fontName; + + field = 0; + + while (s != NULL) + { + s = strchr(s + 1, '-'); + + if (s != NULL) + { + if (field == 6 || field == 7 || field == 11) + { + /* + * PIXEL_SIZE || POINT_SIZE || AVERAGE_WIDTH + */ + + strcat(scalableFontName, "-0"); + } + else if (scalableResolution == 1 && (field == 8 || field == 9)) + { + /* + * RESOLUTION_X || RESOLUTION_Y + */ + + strcat(scalableFontName, "-0"); + } + else + { + strncat(scalableFontName, fontName, s - fontName); + } + + fontName = s; + } + else + { + strcat(scalableFontName, fontName); + } + + field++; + } + + if (field != 14) + { + goto MakeScalableFontNameError; + } + + return scalableFontName; + +MakeScalableFontNameError: + + free(scalableFontName); + + #ifdef DEBUG + fprintf(stderr, "nxagentMakeScalableFontName: Invalid font name.\n"); + #endif + + return NULL; +} diff --git a/nx-X11/programs/Xserver/hw/nxagent/Imakefile b/nx-X11/programs/Xserver/hw/nxagent/Imakefile index 804f95f78..633e17a22 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Imakefile +++ b/nx-X11/programs/Xserver/hw/nxagent/Imakefile @@ -205,6 +205,7 @@ DEFINES = -g $(OS_DEFINES) $(EXT_DEFINES) $(UPG_DEFINES) \ -DNXAGENT_ONSTART \ -DNXAGENT_SPLASH \ -DNXAGENT_ARTSD \ + -UNX_DEBUG_INPUT \ -UPANORAMIX all:: $(OBJS) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Init.c b/nx-X11/programs/Xserver/hw/nxagent/Init.c index 4e47f8f81..81ed0c43e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Init.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Init.c @@ -74,7 +74,7 @@ is" without express or implied warranty. #undef DEBUG #undef DUMP -#define NXAGENT_VERSION "3.2.0" +#define NXAGENT_VERSION "3.3.0" /* * ProcVector array defined in tables.c. diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c index 88e99a1a0..6c14e20bf 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c @@ -55,12 +55,28 @@ is" without express or implied warranty. #include "NXlib.h" +#include "Shadow.h" + #ifdef XKB +#include "globals.h" +#include "property.h" + #include + +#define XKBSRV_NEED_FILE_FUNCS #include #include +#include "X11/extensions/XKBrules.h" + +#include "Xatom.h" + +static int nxagentXkbGetNames(char **rules, char **model, char **layout, + char **variant, char **options); + +static void nxagentKeycodeConversionSetup(void); + #endif /* XKB */ /* @@ -175,6 +191,281 @@ unsigned int nxagentAltMetaMask; void nxagentCheckAltMetaKeys(CARD8, int); +static CARD8 nxagentConvertedKeycodes[] = +{ + /* evdev pc105*/ + /* 0 */ 0, + /* 1 */ 1, + /* 2 */ 2, + /* 3 */ 3, + /* 4 */ 4, + /* 5 */ 5, + /* 6 */ 6, + /* 7 */ 7, + /* 8 */ 8, + /* 9 */ 9, + /* 10 */ 10, + /* 11 */ 11, + /* 12 */ 12, + /* 13 */ 13, + /* 14 */ 14, + /* 15 */ 15, + /* 16 */ 16, + /* 17 */ 17, + /* 18 */ 18, + /* 19 */ 19, + /* 20 */ 20, + /* 21 */ 21, + /* 22 */ 22, + /* 23 */ 23, + /* 24 */ 24, + /* 25 */ 25, + /* 26 */ 26, + /* 27 */ 27, + /* 28 */ 28, + /* 29 */ 29, + /* 30 */ 30, + /* 31 */ 31, + /* 32 */ 32, + /* 33 */ 33, + /* 34 */ 34, + /* 35 */ 35, + /* 36 */ 36, + /* 37 */ 37, + /* 38 */ 38, + /* 39 */ 39, + /* 40 */ 40, + /* 41 */ 41, + /* 42 */ 42, + /* 43 */ 43, + /* 44 */ 44, + /* 45 */ 45, + /* 46 */ 46, + /* 47 */ 47, + /* 48 */ 48, + /* 49 */ 49, + /* 50 */ 50, + /* 51 */ 51, + /* 52 */ 52, + /* 53 */ 53, + /* 54 */ 54, + /* 55 */ 55, + /* 56 */ 56, + /* 57 */ 57, + /* 58 */ 58, + /* 59 */ 59, + /* 60 */ 60, + /* 61 */ 61, + /* 62 */ 62, + /* 63 */ 63, + /* 64 */ 64, + /* 65 */ 65, + /* 66 */ 66, + /* 67 */ 67, + /* 68 */ 68, + /* 69 */ 69, + /* 70 */ 70, + /* 71 */ 71, + /* 72 */ 72, + /* 73 */ 73, + /* 74 */ 74, + /* 75 */ 75, + /* 76 */ 76, + /* 77 */ 77, + /* 78 */ 78, + /* 79 */ 79, + /* 80 */ 80, + /* 81 */ 81, + /* 82 */ 82, + /* 83 */ 83, + /* 84 */ 84, + /* 85 */ 85, + /* 86 */ 86, + /* 87 */ 87, + /* 88 */ 88, + /* 89 */ 89, + /* 90 */ 90, + /* 91 */ 91, + /* 92 */ 124, + /* 93 */ 93, + /* 94 */ 94, + /* 95 */ 95, + /* 96 */ 96, + /* 97 */ 211, + /* 98 */ 98, + /* 99 */ 99, + /* 100 */ 100, + /* 101 */ 208, + /* 102 */ 102, + /* 103 */ 103, + /* 104 */ 108, + /* 105 */ 109, + /* 106 */ 112, + /* 107 */ 111, + /* 108 */ 113, + /* 109 */ 109, + /* 110 */ 97, + /* 111 */ 98, + /* 112 */ 99, + /* 113 */ 100, + /* 114 */ 102, + /* 115 */ 103, + /* 116 */ 104, + /* 117 */ 105, + /* 118 */ 106, + /* 119 */ 107, + /* 120 */ 120, + /* 121 */ 121, + /* 122 */ 122, + /* 123 */ 123, + /* 124 */ 124, + /* 125 */ 126, + /* 126 */ 126, + /* 127 */ 110, + /* 128 */ 128, + /* 129 */ 129, + /* 130 */ 130, + /* 131 */ 131, + /* 132 */ 133, + /* 133 */ 115, + /* 134 */ 116, + /* 135 */ 117, + /* 136 */ 136, + /* 137 */ 137, + /* 138 */ 138, + /* 139 */ 139, + /* 140 */ 140, + /* 141 */ 141, + /* 142 */ 142, + /* 143 */ 143, + /* 144 */ 144, + /* 145 */ 145, + /* 146 */ 146, + /* 147 */ 147, + /* 148 */ 148, + /* 149 */ 149, + /* 150 */ 150, + /* 151 */ 151, + /* 152 */ 152, + /* 153 */ 153, + /* 154 */ 154, + /* 155 */ 155, + /* 156 */ 156, + /* 157 */ 157, + /* 158 */ 158, + /* 159 */ 159, + /* 160 */ 160, + /* 161 */ 161, + /* 162 */ 162, + /* 163 */ 163, + /* 164 */ 164, + /* 165 */ 165, + /* 166 */ 166, + /* 167 */ 167, + /* 168 */ 168, + /* 169 */ 169, + /* 170 */ 170, + /* 171 */ 171, + /* 172 */ 172, + /* 173 */ 173, + /* 174 */ 174, + /* 175 */ 175, + /* 176 */ 176, + /* 177 */ 177, + /* 178 */ 178, + /* 179 */ 179, + /* 180 */ 180, + /* 181 */ 181, + /* 182 */ 182, + /* 183 */ 183, + /* 184 */ 184, + /* 185 */ 185, + /* 186 */ 186, + /* 187 */ 187, + /* 188 */ 188, + /* 189 */ 189, + /* 190 */ 190, + /* 191 */ 118, + /* 192 */ 119, + /* 193 */ 120, + /* 194 */ 121, + /* 195 */ 122, + /* 196 */ 196, + /* 197 */ 197, + /* 198 */ 198, + /* 199 */ 199, + /* 200 */ 200, + /* 201 */ 201, + /* 202 */ 202, + /* 203 */ 93, + /* 204 */ 125, + /* 205 */ 156, + /* 206 */ 127, + /* 207 */ 128, + /* 208 */ 208, + /* 209 */ 209, + /* 210 */ 210, + /* 211 */ 211, + /* 212 */ 212, + /* 213 */ 213, + /* 214 */ 214, + /* 215 */ 215, + /* 216 */ 216, + /* 217 */ 217, + /* 218 */ 218, + /* 219 */ 219, + /* 220 */ 220, + /* 221 */ 221, + /* 222 */ 222, + /* 223 */ 223, + /* 224 */ 224, + /* 225 */ 225, + /* 226 */ 226, + /* 227 */ 227, + /* 228 */ 228, + /* 229 */ 229, + /* 230 */ 230, + /* 231 */ 231, + /* 232 */ 232, + /* 233 */ 233, + /* 234 */ 234, + /* 235 */ 235, + /* 236 */ 236, + /* 237 */ 237, + /* 238 */ 238, + /* 239 */ 239, + /* 240 */ 240, + /* 241 */ 241, + /* 242 */ 242, + /* 243 */ 243, + /* 244 */ 244, + /* 245 */ 245, + /* 246 */ 246, + /* 247 */ 247, + /* 248 */ 248, + /* 249 */ 249, + /* 250 */ 250, + /* 251 */ 251, + /* 252 */ 252, + /* 253 */ 253, + /* 254 */ 254, + /* 255 */ 255 +}; + +static int nxagentKeycodeConversion = 0; + +CARD8 nxagentConvertKeycode(CARD8 k) +{ + if (nxagentKeycodeConversion != 0) + { + return nxagentConvertedKeycodes[k]; + } + else + { + return k; + } +} + static int nxagentSaveKeyboardDeviceData(DeviceIntPtr dev, DeviceIntPtr devBackup); static int nxagentRestoreKeyboardDeviceData(DeviceIntPtr devBackup, DeviceIntPtr dev); @@ -655,14 +946,21 @@ XkbError: xkb = XkbGetKeyboard(nxagentDisplay, XkbGBN_AllComponentsMask, XkbUseCoreKbd); + nxagentKeycodeConversionSetup(); + if (xkb == NULL || xkb->geom == NULL) { #ifdef TEST fprintf(stderr, "nxagentKeyboardProc: No current keyboard.\n"); - #endif - - #ifdef TEST - fprintf(stderr, "nxagentKeyboardProc: No keyboard, going to set rules and init device.\n"); + if (xkb == NULL) + { + fprintf(stderr, "nxagentKeyboardProc: xkb is null.\n"); + } + else + { + fprintf(stderr, "nxagentKeyboardProc: xkb->geom is null.\n"); + } + fprintf(stderr, "nxagentKeyboardProc: Going to set rules and init device.\n"); #endif XkbSetRulesDflts(rules, model, layout, variants, options); @@ -777,6 +1075,12 @@ XkbError: XkbDDXChangeControls((pointer)pDev, xkb->ctrls, xkb->ctrls); XkbEnd: + + if (nxagentOption(Shadow) == 1 && pDev && pDev->key) + { + NXShadowInitKeymap(&(pDev->key->curKeySyms)); + } + if (free_model) { free_model = 0; @@ -790,7 +1094,6 @@ XkbEnd: } XkbFreeKeyboard(xkb, XkbAllComponentsMask, True); - xkb = NULL; } #endif @@ -1358,4 +1661,154 @@ void nxagentTuneXkbWrapper(void) } } +static int nxagentXkbGetNames(char **rules, char **model, char **layout, + char **variant, char **options) +{ + Atom atom; + #ifdef _XSERVER64 + Atom64 type; + #else + Atom type; + #endif + int format; + unsigned long n; + unsigned long after; + char *data; + char *name; + Status result; + + data = name = NULL; + + *rules = NULL; + *model = NULL; + *layout = NULL; + *variant = NULL; + *options = NULL; + + atom = XInternAtom(nxagentDisplay, "_XKB_RULES_NAMES", 1); + + if (atom == 0) + { + return 0; + } + + result = XGetWindowProperty(nxagentDisplay, DefaultRootWindow(nxagentDisplay), + atom, 0, 256, 0, XA_STRING, &type, &format, + &n, &after, (unsigned char **)&data); + + if (result !=Success || data == NULL) + { + return 0; + } + + if ((after > 0) || (type != XA_STRING) || (format != 8)) + { + if (data != NULL) + { + XFree(data); + return 0; + } + } + + name = data; + + if (name < data + n) + { + *rules = name; + name += strlen(name) + 1; + } + + if (name < data + n) + { + *model = name; + name += strlen(name) + 1; + } + + if (name < data + n) + { + *layout = name; + name += strlen(name) + 1; + } + + if (name < data + n) + { + *variant = name; + name += strlen(name) + 1; + } + + if (name < data + n) + { + *options = name; + name += strlen(name) + 1; + } + + return n; +} + +void nxagentKeycodeConversionSetup(void) +{ + char *drules = 0; + char *dmodel = 0; + char *dlayout = 0; + char *dvariant = 0; + char *doptions = 0; + unsigned int drulesLen; + + nxagentKeycodeConversion = 0; + + drulesLen = nxagentXkbGetNames(&drules, &dmodel, &dlayout, + &dvariant, &doptions); + + #ifdef DEBUG + if (drulesLen != 0 && drules != NULL && dmodel != NULL) + { + fprintf(stderr, "nxagentKeycodeConversionSetup: " + "Remote: [%s,%s,%s,%s,%s].\n", drules, dmodel, dlayout, + dvariant, doptions); + } + else + { + fprintf(stderr, "nxagentKeycodeConversionSetup: " + "Failed to retrieve remote rules.\n"); + } + #endif + + if (nxagentOption(ClientOs) == ClientOsLinux && + drules != NULL && dmodel != NULL && + (strcmp(drules, "evdev") == 0 || + strcmp(dmodel, "evdev") == 0)) + { + nxagentKeycodeConversion = 1; + } + + if (drules != NULL) + { + XFree(drules); + } +} + +void nxagentResetKeycodeConversion(void) +{ + int result; + XkbAgentInfoRec info; + + result = XkbQueryExtension(nxagentDisplay, &info.Opcode, &info.EventBase, + &info.ErrorBase, &info.MajorVersion, + &info.MinorVersion); + + if (result != 0) + { + nxagentKeycodeConversionSetup(); + } + else + { + #ifdef WARNING + fprintf(stderr, "nxagentResetKeycodeConversion: " + "WARNING! Failed to query XKB extension.\n"); + #endif + + nxagentKeycodeConversion = 0; + } +} + #endif diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.h b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.h index f292402d2..50dd2be78 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.h @@ -109,6 +109,10 @@ void nxagentEnableXkbExtension(void); void nxagentTuneXkbWrapper(void); +void nxagentResetKeycodeConversion(void); + #endif +CARD8 nxagentConvertKeycode(CARD8 k); + #endif /* __Keyboard_H__ */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c index ce3e6ee05..69b73a942 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c @@ -547,28 +547,29 @@ Bool nxagentReconnectSession(void) goto nxagentReconnectError; } - if (nxagentOption(ResetKeyboardAtResume)) + if (nxagentOption(ResetKeyboardAtResume) == 1 && + (nxagentKeyboard == NULL || nxagentOldKeyboard == NULL || + strcmp(nxagentKeyboard, nxagentOldKeyboard) != 0 || + strcmp(nxagentKeyboard, "query") == 0)) { - if (nxagentKeyboard == NULL || nxagentOldKeyboard == NULL || - strcmp(nxagentKeyboard, nxagentOldKeyboard) != 0 || - strcmp(nxagentKeyboard, "query") == 0) + if (nxagentResetKeyboard() == 0) { - - if (nxagentResetKeyboard() == 0) + #ifdef WARNING + if (nxagentVerbose == 1) { - #ifdef WARNING - if (nxagentVerbose == 1) - { - fprintf(stderr, "nxagentReconnect: Failed to reset keyboard device.\n"); - } - #endif + fprintf(stderr, "nxagentReconnect: Failed to reset keyboard device.\n"); + } + #endif - failedStep = WINDOW_STEP; + failedStep = WINDOW_STEP; - goto nxagentReconnectError; - } + goto nxagentReconnectError; } } + else + { + nxagentResetKeycodeConversion(); + } nxagentXkbState.Initialized = 0; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Render.c b/nx-X11/programs/Xserver/hw/nxagent/Render.c index b1ff219e7..f2d7b15f9 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Render.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Render.c @@ -2270,8 +2270,7 @@ void nxagentAddGlyphs(GlyphSetPtr glyphSet, Glyph *gids, xGlyphInfo *gi, normalizedImages = NULL; - if (glyphDepths[glyphSet -> fdepth] == 1 && - nxagentServerOrder() != BitmapBitOrder(nxagentDisplay)) + if (sizeImages > 0) { normalizedImages = xalloc(sizeImages); @@ -2279,7 +2278,11 @@ void nxagentAddGlyphs(GlyphSetPtr glyphSet, Glyph *gids, xGlyphInfo *gi, { memcpy(normalizedImages, images, sizeImages); - BitOrderInvert ((unsigned char *) normalizedImages, sizeImages); + if (glyphDepths[glyphSet -> fdepth] == 1 && + nxagentServerOrder() != BitmapBitOrder(nxagentDisplay)) + { + BitOrderInvert ((unsigned char *) normalizedImages, sizeImages); + } } else { diff --git a/nx-X11/programs/Xserver/hw/nxagent/Rootless.c b/nx-X11/programs/Xserver/hw/nxagent/Rootless.c index cd69af665..79cb74efa 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Rootless.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Rootless.c @@ -46,6 +46,20 @@ * initialized. */ +typedef struct +{ + CARD32 flags; + CARD32 input; + CARD32 initial_state; + CARD32 icon_pixmap; + CARD32 icon_window; + INT32 icon_x; + INT32 icon_y; + CARD32 icon_mask; + CARD32 window_group; +} +nxagentWMHints; + WindowPtr nxagentRootlessWindow = NULL; #define TOP_LEVEL_TABLE_UNIT 100 @@ -414,7 +428,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) char *propertyS, *typeS; Atom propertyX, typeX; char *output = NULL; - XWMHints wmHints; + nxagentWMHints wmHints; Bool export = False; Bool freeMem = False; @@ -470,7 +484,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) else if (strcmp(typeS, "WM_HINTS") == 0) { ClientPtr pClient = wClient(pWin); - wmHints = *(XWMHints*)value; + wmHints = *(nxagentWMHints*)value; wmHints.flags |= InputHint; wmHints.input = True; @@ -497,9 +511,10 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) wmHints.flags &= ~IconPixmapHint; #ifdef WARNING - fprintf(stderr, "nxagentExportProperty: WARNING! Failed to look up icon pixmap %lx from hint " + fprintf(stderr, "nxagentExportProperty: WARNING! Failed to look up icon pixmap %x from hint " "exporting property %s type %s on window %p.\n", - wmHints.icon_pixmap, propertyS, typeS, (void*)pWin); + (unsigned int) wmHints.icon_pixmap, propertyS, typeS, + (void*)pWin); #endif } } @@ -518,9 +533,10 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) wmHints.flags &= ~IconWindowHint; #ifdef WARNING - fprintf(stderr, "nxagentExportProperty: WARNING! Failed to look up icon window %lx from hint " + fprintf(stderr, "nxagentExportProperty: WARNING! Failed to look up icon window %x from hint " "exporting property %s type %s on window %p.\n", - wmHints.icon_window, propertyS, typeS, (void*)pWin); + (unsigned int) wmHints.icon_window, propertyS, typeS, + (void*)pWin); #endif } } @@ -539,9 +555,10 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) wmHints.flags &= ~IconMaskHint; #ifdef WARNING - fprintf(stderr, "nxagentExportProperty: WARNING! Failed to look up icon mask %lx from hint " + fprintf(stderr, "nxagentExportProperty: WARNING! Failed to look up icon mask %x from hint " "exporting property %s type %s on window %p.\n", - wmHints.icon_mask, propertyS, typeS, (void*)pWin); + (unsigned int) wmHints.icon_mask, propertyS, typeS, + (void*)pWin); #endif } } @@ -560,9 +577,10 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) wmHints.flags &= ~WindowGroupHint; #ifdef WARNING - fprintf(stderr, "nxagentExportProperty: WARNING! Failed to look up window group %lx from hint " + fprintf(stderr, "nxagentExportProperty: WARNING! Failed to look up window group %x from hint " "exporting property %s type %s on window %p.\n", - wmHints.window_group, propertyS, typeS, (void*)pWin); + (unsigned int) wmHints.window_group, propertyS, typeS, + (void*)pWin); #endif } } @@ -654,7 +672,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) { #ifdef TEST fprintf(stderr, "nxagentExportProperty: WARNING! Ignored ChangeProperty " - "on %swindow %lx property %s type %s nUnits %ld format %d\n", + "on %swindow %x property %s type %s nUnits %ld format %d\n", nxagentWindowTopLevel(pWin) ? "toplevel " : "", nxagentWindow(pWin), validateString(propertyS), validateString(typeS), nUnits, format); @@ -683,7 +701,7 @@ void nxagentImportProperty(Window window, WindowPtr pWin; Bool import = False; Bool freeMem = False; - XWMHints wmHints; + nxagentWMHints wmHints; typedef struct { CARD32 state; @@ -797,7 +815,7 @@ void nxagentImportProperty(Window window, } else if (strcmp(typeS, "WM_HINTS") == 0) { - wmHints = *(XWMHints*)buffer; + wmHints = *(nxagentWMHints*)buffer; output = (char*) &wmHints; import = True; @@ -815,8 +833,9 @@ void nxagentImportProperty(Window window, #ifdef WARNING fprintf(stderr, "nxagentImportProperty: WARNING! Failed to look up remote icon " - "pixmap %ld from hint importing property [%ld] type %s on window %p.\n", - wmHints.icon_pixmap, (long int) property, typeS, (void *) pWin); + "pixmap %d from hint importing property [%ld] type %s on window %p.\n", + (unsigned int) wmHints.icon_pixmap, (long int) property, + typeS, (void *) pWin); #endif } } @@ -835,8 +854,9 @@ void nxagentImportProperty(Window window, #ifdef WARNING fprintf(stderr, "nxagenImportProperty: WARNING! Failed to look up remote icon " - "window %lx from hint importing property [%ld] type %s on window %p.\n", - wmHints.icon_window, (long int) property, typeS, (void *) pWin); + "window %x from hint importing property [%ld] type %s on window %p.\n", + (unsigned int) wmHints.icon_window, + (long int) property, typeS, (void *) pWin); #endif } } @@ -855,8 +875,8 @@ void nxagentImportProperty(Window window, #ifdef WARNING fprintf(stderr, "nxagentImportProperty: WARNING! Failed to look up remote icon " - "mask %lx from hint importing property [%ld] type %s on window %p.\n", - wmHints.icon_mask, (long int) property, typeS, (void *) pWin); + "mask %x from hint importing property [%ld] type %s on window %p.\n", + (unsigned int) wmHints.icon_mask, (long int) property, typeS, (void *) pWin); #endif } } @@ -875,8 +895,9 @@ void nxagentImportProperty(Window window, #ifdef WARNING fprintf(stderr, "nxagentImportProperty: WARNING! Failed to look up remote window " - "group %lx from hint importing property [%ld] type %s on window %p.\n", - wmHints.window_group, (long int) property, typeS, (void *) pWin); + "group %x from hint importing property [%ld] type %s on window %p.\n", + (unsigned int) wmHints.window_group, + (long int) property, typeS, (void *) pWin); #endif } } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index 34d498fb0..524bafd10 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -958,7 +958,8 @@ Bool nxagentOpenScreen(int index, ScreenPtr pScreen, nxagentChangeOption(Fullscreen, True); - if (nxagentOption(ClientOs) == ClientOsWinnt) + if (nxagentOption(ClientOs) == ClientOsWinnt && + (nxagentReconnectTrap == False || nxagentResizeDesktopAtStartup)) { NXSetExposeParameters(nxagentDisplay, 0, 0, 0); } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index ff775f272..8da5d8bd1 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -1136,6 +1136,11 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask) { unsigned int valuemask; XWindowChanges values; + int offX, offY; + int i, j; + + offX = nxagentWindowPriv(pWin)->x - pWin->origin.x; + offY = nxagentWindowPriv(pWin)->y - pWin->origin.y; if (nxagentScreenTrap == 1) { @@ -1221,6 +1226,29 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask) (void *) pWin, nxagentWindow(pWin), valuemask); #endif + if (pWin->bitGravity == StaticGravity && + ((mask & CWX) || (mask & CWY)) && + ((mask & CWWidth) || (mask & CWHeight))) + { + #ifdef TEST + fprintf(stderr, "nxagentConfigureWindow: Window has StaticGravity. Going to translate Expose events by offset [%d, %d].\n", + offX, offY); + #endif + + nxagentAddStaticResizedWindow(pWin, XNextRequest(nxagentDisplay), offX, offY); + + for (j = 0; j < nxagentExposeQueue.length; j++) + { + i = (nxagentExposeQueue.start + j) % EXPOSED_SIZE; + + if (nxagentExposeQueue.exposures[i].pWindow == pWin && + nxagentExposeQueue.exposures[i].remoteRegion != NullRegion) + { + REGION_TRANSLATE(pWin -> drawable.pScreen, nxagentExposeQueue.exposures[i].remoteRegion, offX, offY); + } + } + } + XConfigureWindow(nxagentDisplay, nxagentWindow(pWin), valuemask, &values); MAKE_SYNC_CONFIGURE_WINDOW; @@ -3424,6 +3452,105 @@ void nxagentDeleteConfiguredWindow(WindowPtr pWin) return; } +void nxagentAddStaticResizedWindow(WindowPtr pWin, unsigned long sequence, int offX, int offY) +{ + if (nxagentStaticResizedWindowList == NULL) + { + nxagentStaticResizedWindowList = malloc(sizeof(StaticResizedWindowStruct)); + nxagentStaticResizedWindowList -> next = NULL; + nxagentStaticResizedWindowList -> prev = NULL; + } + else + { + StaticResizedWindowStruct *tmp; + + tmp = malloc(sizeof(StaticResizedWindowStruct)); + + tmp -> next = nxagentStaticResizedWindowList; + nxagentStaticResizedWindowList -> prev = tmp; + tmp -> prev = NULL; + nxagentStaticResizedWindowList = tmp; + } + + nxagentStaticResizedWindowList -> pWin = pWin; + nxagentStaticResizedWindowList -> sequence = sequence; + nxagentStaticResizedWindowList -> offX = offX; + nxagentStaticResizedWindowList -> offY = offY; +} + +void nxagentDeleteStaticResizedWindow(unsigned long sequence) +{ + StaticResizedWindowStruct *index, *previous, *tmp; + + index = nxagentStaticResizedWindowList; + + while (index) + { + if (index -> sequence <= sequence) + { + if (index -> prev == NULL && index -> next == NULL) + { + free(nxagentStaticResizedWindowList); + nxagentStaticResizedWindowList = NULL; + + return; + } + else if (index -> prev == NULL) + { + tmp = nxagentStaticResizedWindowList; + index = nxagentStaticResizedWindowList = tmp -> next; + free(tmp); + nxagentStaticResizedWindowList -> prev = NULL; + + continue; + } + else if (index -> next == NULL) + { + tmp = index; + index = index -> prev; + free(tmp); + index -> next = NULL; + + return; + } + + previous = index -> prev; + tmp = index; + index = index -> next; + previous -> next = index; + index -> prev = previous; + free(tmp); + + continue; + } + + index = index -> next; + } + + return; +} + +StaticResizedWindowStruct *nxagentFindStaticResizedWindow(unsigned long sequence) +{ + StaticResizedWindowStruct *index; + StaticResizedWindowStruct *ret = NULL; + + if (nxagentStaticResizedWindowList == NULL) + { + return NULL; + } + + index = nxagentStaticResizedWindowList; + + while (index && index -> sequence > sequence) + { + ret = index; + index = index -> next; + } + + return ret; +} + void nxagentEmptyBackingStoreRegion(pointer param0, XID param1, pointer data_buffer) { WindowPtr pWin = (WindowPtr) param0; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Windows.h b/nx-X11/programs/Xserver/hw/nxagent/Windows.h index 239d558b4..ca33f1448 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Windows.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Windows.h @@ -287,6 +287,18 @@ typedef struct _ConfiguredWindow ConfiguredWindowStruct *nxagentConfiguredWindowList; +typedef struct _StaticResizedWindow +{ + WindowPtr pWin; + struct _StaticResizedWindow *next; + struct _StaticResizedWindow *prev; + unsigned long sequence; + int offX; + int offY; +} StaticResizedWindowStruct; + +StaticResizedWindowStruct *nxagentStaticResizedWindowList; + void nxagentPostValidateTree(WindowPtr pParent, WindowPtr pChild, VTKind kind); void nxagentFlushConfigureWindow(void); @@ -295,6 +307,12 @@ void nxagentAddConfiguredWindow(WindowPtr pWin, unsigned int valuemask); void nxagentDeleteConfiguredWindow(WindowPtr pWin); +void nxagentAddStaticResizedWindow(WindowPtr pWin, unsigned long sequence, int offX, int offY); + +void nxagentDeleteStaticResizedWindow(unsigned long sequence); + +StaticResizedWindowStruct *nxagentFindStaticResizedWindow(unsigned long sequence); + void nxagentEmptyAllBackingStoreRegions(void); #endif /* __Window_H__ */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXevents.c b/nx-X11/programs/Xserver/hw/nxagent/X/NXevents.c index 91e290996..a8a2a68bd 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXevents.c +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXevents.c @@ -189,6 +189,10 @@ xEvent *xeviexE; #include "Windows.h" #include "Args.h" +#ifdef NX_DEBUG_INPUT +extern int nxagentDebugInput; +#endif + extern Display *nxagentDisplay; extern WindowPtr nxagentLastEnteredWindow; @@ -1682,10 +1686,27 @@ TryClientEvents (ClientPtr client, xEvent *pEvents, int count, Mask mask, int i; int type; -#ifdef DEBUG +#ifdef NX_DEBUG_INPUT + if (grab && nxagentDebugInput && grab->window) + { + fprintf(stderr, "TryClientEvents: Grab window is [0x%x].\n", + (unsigned int)grab->window->drawable.id); + if (!SameClient(grab, client)) + fprintf(stderr, "TryClientEvents: Events are going to be " + "discarded.\n"); + } +#endif +#if defined(DEBUG) || defined(NX_DEBUG_INPUT) +#ifdef NX_DEBUG_INPUT + if (nxagentDebugInput == 1) + fprintf(stderr, "Event([%d, %d], mask=0x%x), client=%d", + pEvents->u.u.type, pEvents->u.u.detail, (unsigned int)mask, + client->index); +#else if (debug_events) ErrorF( "Event([%d, %d], mask=0x%x), client=%d", pEvents->u.u.type, pEvents->u.u.detail, mask, client->index); +#endif #endif if ((client) && (client != serverClient) && (!client->clientGone) && ((filter == CantBeFiltered) || (mask & filter))) @@ -1700,9 +1721,16 @@ TryClientEvents (ClientPtr client, xEvent *pEvents, int count, Mask mask, if (WID(inputInfo.pointer->valuator->motionHintWindow) == pEvents->u.keyButtonPointer.event) { -#ifdef DEBUG +#if defined(DEBUG) || defined(NX_DEBUG_INPUT) +#ifdef NX_DEBUG_INPUT + if (nxagentDebugInput == 1) + { + fprintf(stderr,"\nmotionHintWindow == keyButtonPointer.event\n"); + } +#else if (debug_events) ErrorF("\n"); fprintf(stderr,"motionHintWindow == keyButtonPointer.event\n"); +#endif #endif return 1; /* don't send, but pretend we did */ } @@ -1740,15 +1768,25 @@ TryClientEvents (ClientPtr client, xEvent *pEvents, int count, Mask mask, } WriteEventsToClient(client, count, pEvents); -#ifdef DEBUG +#if defined(DEBUG) || defined(NX_DEBUG_INPUT) +#ifdef NX_DEBUG_INPUT + if (nxagentDebugInput == 1) + fprintf(stderr, " delivered\n"); +#else if (debug_events) ErrorF( " delivered\n"); +#endif #endif return 1; } else { -#ifdef DEBUG +#if defined(DEBUG) || defined(NX_DEBUG_INPUT) +#ifdef NX_DEBUG_INPUT + if (nxagentDebugInput == 1) + fprintf(stderr, "\n"); +#else if (debug_events) ErrorF("\n"); +#endif #endif return 0; } @@ -3116,6 +3154,12 @@ ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count xevieEventSent = 0; else { xeviemouse = mouse; + #ifdef NX_DEBUG_INPUT + if (nxagentDebugInput == 1) + { + fprintf(stderr, "ProcessPointerEvent: Going to send XEVIE event.\n"); + } + #endif WriteToClient(clients[xevieClientIndex], sizeof(xEvent), (char *)xE); return; } @@ -3170,14 +3214,38 @@ ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count #if !defined(XFree86Server) || !defined(XINPUT) xE->u.u.detail = butc->map[key]; #endif + #ifdef NX_DEBUG_INPUT + if (xE->u.u.detail == 0) + { + if (nxagentDebugInput == 1) + { + fprintf(stderr, "ProcessPointerEvent: WARNING! detail == 0" + " for ButtonPress.\n"); + } + return; + } + #else if (xE->u.u.detail == 0) return; + #endif if (xE->u.u.detail <= 5) butc->state |= (Button1Mask >> 1) << xE->u.u.detail; filters[MotionNotify] = Motion_Filter(butc); if (!grab) + #ifdef NX_DEBUG_INPUT + if (CheckDeviceGrabs(mouse, xE, 0, count)) + { + if (nxagentDebugInput == 1) + { + fprintf(stderr, "ProcessPointerEvent: CheckDeviceGrabs" + " returned True for ButtonPress.\n"); + } + return; + } + #else if (CheckDeviceGrabs(mouse, xE, 0, count)) return; + #endif break; case ButtonRelease: mouse->valuator->motionHintWindow = NullWindow; @@ -3189,8 +3257,20 @@ ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count #if !defined(XFree86Server) || !defined(XINPUT) xE->u.u.detail = butc->map[key]; #endif + #ifdef NX_DEBUG_INPUT if (xE->u.u.detail == 0) + { + if (nxagentDebugInput == 1) + { + fprintf(stderr, "ProcessPointerEvent: WARNING! detail == 0" + " for ButtonRelease.\n"); + } return; + } + #else + if (xE->u.u.detail == 0) + return; + #endif if (xE->u.u.detail <= 5) butc->state &= ~((Button1Mask >> 1) << xE->u.u.detail); filters[MotionNotify] = Motion_Filter(butc); @@ -3201,6 +3281,36 @@ ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count FatalError("bogus pointer event from ddx"); } } + #ifdef NX_DEBUG_INPUT + else if (!CheckMotion(xE)) + { + if (nxagentDebugInput == 1) + { + fprintf(stderr, "ProcessPointerEvent: CheckMotion returned False" + " for MotionNotify.\n"); + } + return; + } + if (grab) + { + if (nxagentDebugInput == 1) + { + fprintf(stderr, "ProcessPointerEvent: Going to deliver grabbed " + "events (count = %d).\n", count); + } + DeliverGrabbedEvent(xE, mouse, deactivateGrab, count); + } + else + { + if (nxagentDebugInput == 1) + { + fprintf(stderr, "ProcessPointerEvent: Going to deliver device " + "events (count = %d).\n", count); + } + DeliverDeviceEvents(sprite.win, xE, NullGrab, NullWindow, + mouse, count); + } + #else else if (!CheckMotion(xE)) return; if (grab) @@ -3208,6 +3318,7 @@ ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count else DeliverDeviceEvents(sprite.win, xE, NullGrab, NullWindow, mouse, count); + #endif if (deactivateGrab) (*mouse->DeactivateGrab)(mouse); } diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXevents.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXevents.c.NX.original index 91e290996..a8a2a68bd 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXevents.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXevents.c.NX.original @@ -189,6 +189,10 @@ xEvent *xeviexE; #include "Windows.h" #include "Args.h" +#ifdef NX_DEBUG_INPUT +extern int nxagentDebugInput; +#endif + extern Display *nxagentDisplay; extern WindowPtr nxagentLastEnteredWindow; @@ -1682,10 +1686,27 @@ TryClientEvents (ClientPtr client, xEvent *pEvents, int count, Mask mask, int i; int type; -#ifdef DEBUG +#ifdef NX_DEBUG_INPUT + if (grab && nxagentDebugInput && grab->window) + { + fprintf(stderr, "TryClientEvents: Grab window is [0x%x].\n", + (unsigned int)grab->window->drawable.id); + if (!SameClient(grab, client)) + fprintf(stderr, "TryClientEvents: Events are going to be " + "discarded.\n"); + } +#endif +#if defined(DEBUG) || defined(NX_DEBUG_INPUT) +#ifdef NX_DEBUG_INPUT + if (nxagentDebugInput == 1) + fprintf(stderr, "Event([%d, %d], mask=0x%x), client=%d", + pEvents->u.u.type, pEvents->u.u.detail, (unsigned int)mask, + client->index); +#else if (debug_events) ErrorF( "Event([%d, %d], mask=0x%x), client=%d", pEvents->u.u.type, pEvents->u.u.detail, mask, client->index); +#endif #endif if ((client) && (client != serverClient) && (!client->clientGone) && ((filter == CantBeFiltered) || (mask & filter))) @@ -1700,9 +1721,16 @@ TryClientEvents (ClientPtr client, xEvent *pEvents, int count, Mask mask, if (WID(inputInfo.pointer->valuator->motionHintWindow) == pEvents->u.keyButtonPointer.event) { -#ifdef DEBUG +#if defined(DEBUG) || defined(NX_DEBUG_INPUT) +#ifdef NX_DEBUG_INPUT + if (nxagentDebugInput == 1) + { + fprintf(stderr,"\nmotionHintWindow == keyButtonPointer.event\n"); + } +#else if (debug_events) ErrorF("\n"); fprintf(stderr,"motionHintWindow == keyButtonPointer.event\n"); +#endif #endif return 1; /* don't send, but pretend we did */ } @@ -1740,15 +1768,25 @@ TryClientEvents (ClientPtr client, xEvent *pEvents, int count, Mask mask, } WriteEventsToClient(client, count, pEvents); -#ifdef DEBUG +#if defined(DEBUG) || defined(NX_DEBUG_INPUT) +#ifdef NX_DEBUG_INPUT + if (nxagentDebugInput == 1) + fprintf(stderr, " delivered\n"); +#else if (debug_events) ErrorF( " delivered\n"); +#endif #endif return 1; } else { -#ifdef DEBUG +#if defined(DEBUG) || defined(NX_DEBUG_INPUT) +#ifdef NX_DEBUG_INPUT + if (nxagentDebugInput == 1) + fprintf(stderr, "\n"); +#else if (debug_events) ErrorF("\n"); +#endif #endif return 0; } @@ -3116,6 +3154,12 @@ ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count xevieEventSent = 0; else { xeviemouse = mouse; + #ifdef NX_DEBUG_INPUT + if (nxagentDebugInput == 1) + { + fprintf(stderr, "ProcessPointerEvent: Going to send XEVIE event.\n"); + } + #endif WriteToClient(clients[xevieClientIndex], sizeof(xEvent), (char *)xE); return; } @@ -3170,14 +3214,38 @@ ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count #if !defined(XFree86Server) || !defined(XINPUT) xE->u.u.detail = butc->map[key]; #endif + #ifdef NX_DEBUG_INPUT + if (xE->u.u.detail == 0) + { + if (nxagentDebugInput == 1) + { + fprintf(stderr, "ProcessPointerEvent: WARNING! detail == 0" + " for ButtonPress.\n"); + } + return; + } + #else if (xE->u.u.detail == 0) return; + #endif if (xE->u.u.detail <= 5) butc->state |= (Button1Mask >> 1) << xE->u.u.detail; filters[MotionNotify] = Motion_Filter(butc); if (!grab) + #ifdef NX_DEBUG_INPUT + if (CheckDeviceGrabs(mouse, xE, 0, count)) + { + if (nxagentDebugInput == 1) + { + fprintf(stderr, "ProcessPointerEvent: CheckDeviceGrabs" + " returned True for ButtonPress.\n"); + } + return; + } + #else if (CheckDeviceGrabs(mouse, xE, 0, count)) return; + #endif break; case ButtonRelease: mouse->valuator->motionHintWindow = NullWindow; @@ -3189,8 +3257,20 @@ ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count #if !defined(XFree86Server) || !defined(XINPUT) xE->u.u.detail = butc->map[key]; #endif + #ifdef NX_DEBUG_INPUT if (xE->u.u.detail == 0) + { + if (nxagentDebugInput == 1) + { + fprintf(stderr, "ProcessPointerEvent: WARNING! detail == 0" + " for ButtonRelease.\n"); + } return; + } + #else + if (xE->u.u.detail == 0) + return; + #endif if (xE->u.u.detail <= 5) butc->state &= ~((Button1Mask >> 1) << xE->u.u.detail); filters[MotionNotify] = Motion_Filter(butc); @@ -3201,6 +3281,36 @@ ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count FatalError("bogus pointer event from ddx"); } } + #ifdef NX_DEBUG_INPUT + else if (!CheckMotion(xE)) + { + if (nxagentDebugInput == 1) + { + fprintf(stderr, "ProcessPointerEvent: CheckMotion returned False" + " for MotionNotify.\n"); + } + return; + } + if (grab) + { + if (nxagentDebugInput == 1) + { + fprintf(stderr, "ProcessPointerEvent: Going to deliver grabbed " + "events (count = %d).\n", count); + } + DeliverGrabbedEvent(xE, mouse, deactivateGrab, count); + } + else + { + if (nxagentDebugInput == 1) + { + fprintf(stderr, "ProcessPointerEvent: Going to deliver device " + "events (count = %d).\n", count); + } + DeliverDeviceEvents(sprite.win, xE, NullGrab, NullWindow, + mouse, count); + } + #else else if (!CheckMotion(xE)) return; if (grab) @@ -3208,6 +3318,7 @@ ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count else DeliverDeviceEvents(sprite.win, xE, NullGrab, NullWindow, mouse, count); + #endif if (deactivateGrab) (*mouse->DeactivateGrab)(mouse); } diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXproperty.c b/nx-X11/programs/Xserver/hw/nxagent/X/NXproperty.c index f58163488..772a1fbe5 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXproperty.c +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXproperty.c @@ -336,6 +336,10 @@ ProcChangeProperty(ClientPtr client) nxagentGuessShadowHint(client, stuff->property); + #ifdef NX_DEBUG_INPUT + nxagentGuessDumpInputInfo(client, stuff->property, (char *) &stuff[1]); + #endif + return client->noClientException; } } diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXproperty.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXproperty.c.NX.original index f58163488..772a1fbe5 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXproperty.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXproperty.c.NX.original @@ -336,6 +336,10 @@ ProcChangeProperty(ClientPtr client) nxagentGuessShadowHint(client, stuff->property); + #ifdef NX_DEBUG_INPUT + nxagentGuessDumpInputInfo(client, stuff->property, (char *) &stuff[1]); + #endif + return client->noClientException; } } -- cgit v1.2.3 From e9132da09462b3d2607a97e2f580cbd3144819eb Mon Sep 17 00:00:00 2001 From: Reinhard Tartler Date: Mon, 10 Oct 2011 17:58:57 +0200 Subject: Imported nxagent-3.4.0-11.tar.gz Summary: Imported nxagent-3.4.0-11.tar.gz Keywords: Imported nxagent-3.4.0-11.tar.gz into Git repository --- nx-X11/programs/Xserver/hw/nxagent/Agent.h | 4 +- nx-X11/programs/Xserver/hw/nxagent/Args.c | 8 +- nx-X11/programs/Xserver/hw/nxagent/Args.h | 4 +- nx-X11/programs/Xserver/hw/nxagent/Atoms.c | 32 +- nx-X11/programs/Xserver/hw/nxagent/Atoms.h | 6 +- nx-X11/programs/Xserver/hw/nxagent/Binder.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/Binder.h | 4 +- nx-X11/programs/Xserver/hw/nxagent/CHANGELOG | 200 +++++ nx-X11/programs/Xserver/hw/nxagent/Client.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/Client.h | 4 +- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 28 +- nx-X11/programs/Xserver/hw/nxagent/Clipboard.h | 4 +- nx-X11/programs/Xserver/hw/nxagent/Colormap.c | 21 +- nx-X11/programs/Xserver/hw/nxagent/Colormap.h | 4 +- nx-X11/programs/Xserver/hw/nxagent/Composite.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/Composite.h | 4 +- nx-X11/programs/Xserver/hw/nxagent/Cursor.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/Cursor.h | 4 +- nx-X11/programs/Xserver/hw/nxagent/Dialog.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/Dialog.h | 6 +- nx-X11/programs/Xserver/hw/nxagent/Display.c | 40 +- nx-X11/programs/Xserver/hw/nxagent/Display.h | 4 +- nx-X11/programs/Xserver/hw/nxagent/Drawable.c | 98 ++- nx-X11/programs/Xserver/hw/nxagent/Drawable.h | 4 +- nx-X11/programs/Xserver/hw/nxagent/Error.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/Error.h | 4 +- nx-X11/programs/Xserver/hw/nxagent/Events.c | 924 ++++++++++++++++++--- nx-X11/programs/Xserver/hw/nxagent/Events.h | 9 +- nx-X11/programs/Xserver/hw/nxagent/Extensions.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/Extensions.h | 4 +- nx-X11/programs/Xserver/hw/nxagent/Font.c | 18 +- nx-X11/programs/Xserver/hw/nxagent/Font.h | 4 +- nx-X11/programs/Xserver/hw/nxagent/GC.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/GCOps.c | 91 +- nx-X11/programs/Xserver/hw/nxagent/GCOps.h | 4 +- nx-X11/programs/Xserver/hw/nxagent/GCs.h | 4 +- nx-X11/programs/Xserver/hw/nxagent/Handlers.c | 30 +- nx-X11/programs/Xserver/hw/nxagent/Handlers.h | 4 +- nx-X11/programs/Xserver/hw/nxagent/Holder.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/Holder.h | 4 +- nx-X11/programs/Xserver/hw/nxagent/Icons.h | 4 +- nx-X11/programs/Xserver/hw/nxagent/Image.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/Image.h | 4 +- nx-X11/programs/Xserver/hw/nxagent/Imakefile | 3 +- nx-X11/programs/Xserver/hw/nxagent/Init.c | 8 +- nx-X11/programs/Xserver/hw/nxagent/Init.h | 4 +- nx-X11/programs/Xserver/hw/nxagent/Keyboard.c | 5 +- nx-X11/programs/Xserver/hw/nxagent/Keyboard.h | 4 +- nx-X11/programs/Xserver/hw/nxagent/Keystroke.c | 121 ++- nx-X11/programs/Xserver/hw/nxagent/Keystroke.h | 4 +- nx-X11/programs/Xserver/hw/nxagent/LICENSE | 2 +- nx-X11/programs/Xserver/hw/nxagent/Literals.h | 4 +- nx-X11/programs/Xserver/hw/nxagent/Millis.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/Millis.h | 4 +- nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c | 4 +- .../Xserver/hw/nxagent/NXdispatch.c.NX.original | 4 +- nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c | 4 +- .../Xserver/hw/nxagent/NXdixfonts.c.NX.original | 4 +- nx-X11/programs/Xserver/hw/nxagent/NXevents.c | 4 +- .../Xserver/hw/nxagent/NXevents.c.NX.original | 4 +- nx-X11/programs/Xserver/hw/nxagent/NXextension.c | 4 +- .../Xserver/hw/nxagent/NXextension.c.NX.original | 4 +- nx-X11/programs/Xserver/hw/nxagent/NXglyph.c | 4 +- .../Xserver/hw/nxagent/NXglyph.c.NX.original | 4 +- nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c | 4 +- .../Xserver/hw/nxagent/NXglyphcurs.c.NX.original | 4 +- nx-X11/programs/Xserver/hw/nxagent/NXglyphstr.h | 4 +- .../Xserver/hw/nxagent/NXglyphstr.h.NX.original | 4 +- nx-X11/programs/Xserver/hw/nxagent/NXmiglyph.c | 4 +- .../Xserver/hw/nxagent/NXmiglyph.c.NX.original | 4 +- nx-X11/programs/Xserver/hw/nxagent/NXpicture.c | 4 +- .../Xserver/hw/nxagent/NXpicture.c.NX.original | 4 +- nx-X11/programs/Xserver/hw/nxagent/NXpicturestr.h | 4 +- .../Xserver/hw/nxagent/NXpicturestr.h.NX.original | 4 +- nx-X11/programs/Xserver/hw/nxagent/NXproperty.c | 4 +- .../Xserver/hw/nxagent/NXproperty.c.NX.original | 4 +- nx-X11/programs/Xserver/hw/nxagent/NXrandr.c | 4 +- .../Xserver/hw/nxagent/NXrandr.c.NX.original | 4 +- nx-X11/programs/Xserver/hw/nxagent/NXrender.c | 4 +- .../Xserver/hw/nxagent/NXrender.c.NX.original | 4 +- nx-X11/programs/Xserver/hw/nxagent/NXwindow.c | 4 +- .../Xserver/hw/nxagent/NXwindow.c.NX.original | 4 +- nx-X11/programs/Xserver/hw/nxagent/NXxrandr.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/NXxrandr.h | 4 +- nx-X11/programs/Xserver/hw/nxagent/NXxrandrint.h | 4 +- nx-X11/programs/Xserver/hw/nxagent/Options.c | 15 +- nx-X11/programs/Xserver/hw/nxagent/Options.h | 9 +- nx-X11/programs/Xserver/hw/nxagent/Pixels.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/Pixels.h | 22 +- nx-X11/programs/Xserver/hw/nxagent/Pixmap.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/Pixmaps.h | 4 +- nx-X11/programs/Xserver/hw/nxagent/Pointer.c | 38 +- nx-X11/programs/Xserver/hw/nxagent/Pointer.h | 13 +- nx-X11/programs/Xserver/hw/nxagent/Reconnect.c | 16 +- nx-X11/programs/Xserver/hw/nxagent/Reconnect.h | 4 +- nx-X11/programs/Xserver/hw/nxagent/Render.c | 285 ++++++- nx-X11/programs/Xserver/hw/nxagent/Render.h | 6 +- nx-X11/programs/Xserver/hw/nxagent/Rootless.c | 111 ++- nx-X11/programs/Xserver/hw/nxagent/Rootless.h | 4 +- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 424 +++------- nx-X11/programs/Xserver/hw/nxagent/Screen.h | 15 +- nx-X11/programs/Xserver/hw/nxagent/Splash.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/Splash.h | 4 +- nx-X11/programs/Xserver/hw/nxagent/Split.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/Split.h | 4 +- nx-X11/programs/Xserver/hw/nxagent/TestExt.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/Trap.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/Trap.h | 4 +- nx-X11/programs/Xserver/hw/nxagent/Utils.h | 4 +- nx-X11/programs/Xserver/hw/nxagent/Visual.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/Visual.h | 4 +- nx-X11/programs/Xserver/hw/nxagent/Window.c | 313 +++---- nx-X11/programs/Xserver/hw/nxagent/Windows.h | 4 +- nx-X11/programs/Xserver/hw/nxagent/X/NXdamage.c | 4 +- .../Xserver/hw/nxagent/X/NXdamage.c.NX.original | 4 +- nx-X11/programs/Xserver/hw/nxagent/X/NXdispatch.c | 26 +- .../Xserver/hw/nxagent/X/NXdispatch.c.NX.original | 26 +- nx-X11/programs/Xserver/hw/nxagent/X/NXdixfonts.c | 4 +- .../Xserver/hw/nxagent/X/NXdixfonts.c.NX.original | 4 +- nx-X11/programs/Xserver/hw/nxagent/X/NXevents.c | 110 ++- .../Xserver/hw/nxagent/X/NXevents.c.NX.original | 110 ++- nx-X11/programs/Xserver/hw/nxagent/X/NXextension.c | 4 +- .../Xserver/hw/nxagent/X/NXextension.c.NX.original | 4 +- nx-X11/programs/Xserver/hw/nxagent/X/NXglxext.c | 4 +- .../Xserver/hw/nxagent/X/NXglxext.c.NX.original | 4 +- nx-X11/programs/Xserver/hw/nxagent/X/NXglyph.c | 4 +- .../Xserver/hw/nxagent/X/NXglyph.c.NX.original | 4 +- nx-X11/programs/Xserver/hw/nxagent/X/NXglyphcurs.c | 4 +- .../Xserver/hw/nxagent/X/NXglyphcurs.c.NX.original | 4 +- nx-X11/programs/Xserver/hw/nxagent/X/NXglyphstr.h | 4 +- .../Xserver/hw/nxagent/X/NXglyphstr.h.NX.original | 4 +- nx-X11/programs/Xserver/hw/nxagent/X/NXmiexpose.c | 4 +- .../Xserver/hw/nxagent/X/NXmiexpose.c.NX.original | 4 +- nx-X11/programs/Xserver/hw/nxagent/X/NXmiglyph.c | 4 +- .../Xserver/hw/nxagent/X/NXmiglyph.c.NX.original | 4 +- nx-X11/programs/Xserver/hw/nxagent/X/NXmitrap.c | 4 +- .../Xserver/hw/nxagent/X/NXmitrap.c.NX.original | 4 +- nx-X11/programs/Xserver/hw/nxagent/X/NXmiwindow.c | 4 +- .../Xserver/hw/nxagent/X/NXmiwindow.c.NX.original | 4 +- nx-X11/programs/Xserver/hw/nxagent/X/NXpicture.c | 51 +- .../Xserver/hw/nxagent/X/NXpicture.c.NX.original | 51 +- .../programs/Xserver/hw/nxagent/X/NXpicturestr.h | 4 +- .../hw/nxagent/X/NXpicturestr.h.NX.original | 4 +- nx-X11/programs/Xserver/hw/nxagent/X/NXproperty.c | 4 +- .../Xserver/hw/nxagent/X/NXproperty.c.NX.original | 4 +- nx-X11/programs/Xserver/hw/nxagent/X/NXrandr.c | 4 +- .../Xserver/hw/nxagent/X/NXrandr.c.NX.original | 4 +- nx-X11/programs/Xserver/hw/nxagent/X/NXrender.c | 62 +- .../Xserver/hw/nxagent/X/NXrender.c.NX.original | 62 +- nx-X11/programs/Xserver/hw/nxagent/X/NXresource.c | 4 +- .../Xserver/hw/nxagent/X/NXresource.c.NX.original | 4 +- nx-X11/programs/Xserver/hw/nxagent/X/NXshm.c | 4 +- .../Xserver/hw/nxagent/X/NXshm.c.NX.original | 4 +- nx-X11/programs/Xserver/hw/nxagent/X/NXwindow.c | 4 +- .../Xserver/hw/nxagent/X/NXwindow.c.NX.original | 4 +- nx-X11/programs/Xserver/hw/nxagent/X/NXxvdisp.c | 4 +- .../Xserver/hw/nxagent/X/NXxvdisp.c.NX.original | 4 +- nx-X11/programs/Xserver/hw/nxagent/nxagent.xpm | 4 +- nx-X11/programs/Xserver/hw/nxagent/nxmissing.xpm | 4 +- nx-X11/programs/Xserver/hw/nxagent/os2Stub.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/screensaver | 4 +- 161 files changed, 2837 insertions(+), 1066 deletions(-) (limited to 'nx-X11/programs/Xserver/hw/nxagent/Imakefile') diff --git a/nx-X11/programs/Xserver/hw/nxagent/Agent.h b/nx-X11/programs/Xserver/hw/nxagent/Agent.h index f976fd768..3f2c93fdb 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Agent.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Agent.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.c b/nx-X11/programs/Xserver/hw/nxagent/Args.c index 5d344729c..c2e58bd58 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Args.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ @@ -1208,7 +1208,7 @@ static void nxagentParseOptions(char *name, char *value) { nxagentChangeOption(ClientOs, ClientOsSolaris); } - else if (strcmp(value, "mac") == 0) + else if (strcmp(value, "macosx") == 0) { nxagentChangeOption(ClientOs, ClientOsMac); } @@ -1512,7 +1512,7 @@ N/A int splitMode = 0; int splitSize = 0; - unsigned int packMethod = PACK_NONE; + unsigned int packMethod = PACK_NONE; unsigned int packQuality = 9; int dataLevel = 0; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.h b/nx-X11/programs/Xserver/hw/nxagent/Args.h index 43d7ec779..92650a4a0 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Args.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Args.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Atoms.c b/nx-X11/programs/Xserver/hw/nxagent/Atoms.c index ac26646ae..171df95a9 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Atoms.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Atoms.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ @@ -66,19 +66,21 @@ Atom nxagentAtoms[NXAGENT_NUMBER_OF_ATOMS]; static char *nxagentAtomNames[NXAGENT_NUMBER_OF_ATOMS + 1] = { - "NX_IDENTITY", /* 0 */ - "WM_PROTOCOLS", /* 1 */ - "WM_DELETE_WINDOW", /* 2 */ - "WM_NX_READY", /* 3 */ - "MCOPGLOBALS", /* 4 */ - "NX_CUT_BUFFER_SERVER", /* 5 */ - "TARGETS", /* 6 */ - "TEXT", /* 7 */ - "NX_AGENT_SIGNATURE", /* 8 */ - "NXDARWIN", /* 9 */ - "CLIPBOARD", /* 10 */ - "TIMESTAMP", /* 11 */ - "UTF8_STRING", /* 12 */ + "NX_IDENTITY", /* 0 */ + "WM_PROTOCOLS", /* 1 */ + "WM_DELETE_WINDOW", /* 2 */ + "WM_NX_READY", /* 3 */ + "MCOPGLOBALS", /* 4 */ + "NX_CUT_BUFFER_SERVER", /* 5 */ + "TARGETS", /* 6 */ + "TEXT", /* 7 */ + "NX_AGENT_SIGNATURE", /* 8 */ + "NXDARWIN", /* 9 */ + "CLIPBOARD", /* 10 */ + "TIMESTAMP", /* 11 */ + "UTF8_STRING", /* 12 */ + "_NET_WM_STATE", /* 13 */ + "_NET_WM_STATE_FULLSCREEN", /* 14 */ NULL, NULL }; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Atoms.h b/nx-X11/programs/Xserver/hw/nxagent/Atoms.h index 17b2d8f57..f49f2751e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Atoms.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Atoms.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ @@ -22,7 +22,7 @@ #include "../../include/window.h" #include "screenint.h" -#define NXAGENT_NUMBER_OF_ATOMS 14 +#define NXAGENT_NUMBER_OF_ATOMS 16 extern Atom nxagentAtoms[NXAGENT_NUMBER_OF_ATOMS]; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Binder.c b/nx-X11/programs/Xserver/hw/nxagent/Binder.c index cfea2cc77..34433bd2b 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Binder.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Binder.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Binder.h b/nx-X11/programs/Xserver/hw/nxagent/Binder.h index 928db74fb..e0da3e357 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Binder.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Binder.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/CHANGELOG b/nx-X11/programs/Xserver/hw/nxagent/CHANGELOG index 1f7f0df55..3f0a6abcd 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/CHANGELOG +++ b/nx-X11/programs/Xserver/hw/nxagent/CHANGELOG @@ -1,5 +1,205 @@ ChangeLog: +nxagent-3.4.0-11 + +- Corrected switching between viewport mode and resize mode. + +- Fixed TR04H02340. Keycode is correctly translated in shadow sessions + also if the remote X display is using evdev. + +nxagent-3.4.0-10 + +- Handled XGrabKeyboard() return value. + +- Fixed TR10D01512. NumLock and CapsLock keys are now synchronized + between local and remote. + +nxagent-3.4.0-9 + +- Fixed TR06H02362. No icon was swown in the task bar. + +- Fixed keyboard grab in fullscreen mode. + +- Fixed compiler warnings. + +nxagent-3.4.0-8 + +- Grab the keyboard in fullscreen mode on EnterNotify only if mode is + 'NotifyNormal'. + +- Yield control in the dispatch loop in case we stop the smart sche- + duler timer while waiting for a reply from the remote display. + +nxagent-3.4.0-7 + +- Fixed TR08D01478. The communication with the compiz window manager + by means of the _NET_WM_PING property was not handled properly. + +- Fixed a type mismatch in XKB events on 64 bit platforms. + +- Moved grab/ungrab keyboard from focus in/out event to enter/leave + notify event. + +- Removed nxagentIconWindow because it's not longer used. + +nxagent-3.4.0-6 + +- Fixed TR09F02102. Problem was with pointer buttons map. + +- Fixed TR02H02327. Some KeyRelease events was discarded. + +- Fixed up Num and Caps locks. + +- Fixed TR03H02335. Emulated right mouse button for Mac clients. + +- Added utilities to print info about internal and remote windows. + +- Fixed TR01F01995. Solved a picture resource leak by destroying remo- + te pictures only when their reference counter returns to zero. + +- Fixed TR04H02337. Errors occurred because pictures with no drawable + were handled badly. + +- Implemented handling nxagent's private for gradient pictures and so- + lid fill picture. + +- Fixed BadMatch condition check in function ProcRenderComposite. + +- Fixed nxagentComposite() to handle situations with source picture + drawable pointing to NULL. + +- Implemented render acceleration for requests: CreateSolidFill, + CreateLinearGradient, CreateRadialGradient, CreateConicalGradient. + +- Fixed TR03G02196. Dialogs are shown to the fore when the NX session + is in fullscreen mode. + +- Changed mechanism to switch to fullscreen mode. Now the override + redirect attribute is no longer used and _NET_WM_STATE_FULLSCREEN + hint is sent to the WM. + +nxagent-3.4.0-5 + +- Updated copyright to year 2010. + +nxagent-3.4.0-4 + +- Fixed TR07F02090. Now XDMCP sessions start without problems. + +- Fixed TR08G02259. Corrected window border granularity of rootless + session at reconnection on 64 bit platforms. + +- Fixed TR11G02290. Forcing null timeout with queued events only if + display connection is up. This prevents the flood of session log. + +- Fixed TR10G02287. Now QueryTree's loop is aborted in case of failure + and session log isn't filled anymore with repeated warning messages. + +- Fixed TR01G02154. Corrected window placement when switching between + fullscreen and windowed mode. + +- Fixed TR09G02276. Now the agent does not receive unwanted characters + while interacting with the local window manager. + +- Implemented FR02G02174. Added ability to do large screen pans in + viewport mode through key combination Ctrl+Alt+Shift+Arrow. + +- Corrected parsing of the 'client' option when the client OS is Mac. + +nxagent-3.4.0-3 + +- Fixed TR09G02271. The array containing the font name fields was not + correctly initialized for non-standard font names. + +nxagent-3.4.0-2 + +- Updated copyright to year 2009. + +nxagent-3.4.0-1 + +- Opened the 3.4.0 branch based on nxagent-3.3.0-19. + +- Changed the printed version number. + +nxagent-3.3.0-19 + +- Fixed TR09G02266. A proper error message is printed in the session + log if the shadowing initialization fails because of a mismatch in + the visual class. + +- Added a workaround for X servers that doesn't return 1 among the + available depths. + +nxagent-3.3.0-18 + +- The area to restore from the backing store is limited by the screen + size instead of the visible screen. + +nxagent-3.3.0-17 + +- Fixed TR12F02150. The agent could crash when copying text from VNC + viewer. Fixed by aborting the procedure in case the retrieved pro- + perty has not a valid format. + +nxagent-3.3.0-16 + +- Fixed TR07G02247. Don't try to call XSetWindowColormap() if the + window has no colormap, e.g. if its class is InputOnly. + +nxagent-3.3.0-15 + +- Fixed TR04G02210. Region is cut to the visible screen before re- + storing areas from the backing store. + +- Fixed TR07G02246. Box is shrinked if bounds can't stay in a short + signed integer. + +nxagent-3.3.0-14 + +- Fixed TR03G02206. waitpid() call was missing for the "Fonts replace- + ment" dialog type. + +- Fixed TR03G02195. Added a properties structure compatible with 32 + and 64 bit platform types. + +nxagent-3.3.0-13 + +- Handle the window unmap immediately. Don't add it to the configure + queue. + +nxagent-3.3.0-12 + +- Fixed TR03G02200. Timestamps could be in the future in KeyRelease + events sent to the X clients. + +- Added debug logging of input devices state Logging can be enabled + or disabled via the Ctrl+Alt+x shortcut. State info is dumped every + 5 seconds. + +- Added Ctrl+Alt+y shortcut used to deactivate input devices grab for + debug purposes. + +nxagent-3.3.0-11 + +- Changed the message logging the screen size changes, in order to + show the fullscreen state. + +- Handle the window unmapping in the nxagentConfigureWindow queue. + +nxagent-3.3.0-10 + +- Fixed TR12F02146. Compare the drawable and the bitmap data before + realizing the image update, in order to delay the data clean up that + caused the memcmp() failure. + +- Fixed TR01G02156. Reduce the exposing area by subtracting the ex- + posed region. + +- Fixed a compile warning in Drawable.c. + +- Added detailed logs in the nxagentSynchronizeRegion() function if + the data memory allocation fails. + nxagent-3.3.0-9 - Added /usr/NX/share/base to alternate font paths. This would fix diff --git a/nx-X11/programs/Xserver/hw/nxagent/Client.c b/nx-X11/programs/Xserver/hw/nxagent/Client.c index 7e86a03d2..acfaab7c0 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Client.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Client.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Client.h b/nx-X11/programs/Xserver/hw/nxagent/Client.h index 5f9fa1ebb..45f87fc66 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Client.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Client.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index a575cabe5..eb830234d 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ @@ -680,6 +680,30 @@ void nxagentCollectPropertyEvent(int resource) return; } + + if (resultFormat != 8 && resultFormat != 16 && resultFormat != 32) + { + + #ifdef DEBUG + fprintf (stderr, "nxagentCollectPropertyEvent: WARNING! Invalid property " + "value.\n"); + #endif + + if (lastClientClientPtr != NULL) + { + nxagentSendSelectionNotify(None); + } + + lastClientWindowPtr = NULL; + lastClientStage = SelectionStageNone; + + if (pszReturnData != NULL) + { + XFree(pszReturnData); + } + + return; + } switch (lastClientStage) { diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.h b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.h index 912260b8b..2750ddfd2 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Colormap.c b/nx-X11/programs/Xserver/hw/nxagent/Colormap.c index 75758679f..259aa3b24 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Colormap.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Colormap.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ @@ -291,9 +291,20 @@ void nxagentSetInstalledColormapWindows(ScreenPtr pScreen) pCmap = (ColormapPtr)LookupIDByType(pScreen->defColormap, RT_COLORMAP); - XSetWindowColormap(nxagentDisplay, - nxagentDefaultWindows[pScreen->myNum], - nxagentColormap(pCmap)); + if (pCmap != NULL) + { + XSetWindowColormap(nxagentDisplay, + nxagentDefaultWindows[pScreen->myNum], + nxagentColormap(pCmap)); + } + #ifdef WARNING + else + { + fprintf(stderr, "nxagentSetInstalledColormapWindows: WARNING! " + "Window at [%p] has no colormap with class [%d].\n", + pWin, pWin -> drawable.class); + } + #endif } #endif /* DUMB_WINDOW_MANAGERS */ } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Colormap.h b/nx-X11/programs/Xserver/hw/nxagent/Colormap.h index b0cb2dc5e..8321e8038 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Colormap.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Colormap.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Composite.c b/nx-X11/programs/Xserver/hw/nxagent/Composite.c index 9bdbac1b1..b0640ff11 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Composite.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Composite.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Composite.h b/nx-X11/programs/Xserver/hw/nxagent/Composite.h index 5ec1e9888..fb1d6d8e9 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Composite.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Composite.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Cursor.c b/nx-X11/programs/Xserver/hw/nxagent/Cursor.c index 3ca29fa5e..141ba3a64 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Cursor.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Cursor.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Cursor.h b/nx-X11/programs/Xserver/hw/nxagent/Cursor.h index ea1bb30f3..11e407efd 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Cursor.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Cursor.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Dialog.c b/nx-X11/programs/Xserver/hw/nxagent/Dialog.c index c1db78344..2f807b1dc 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Dialog.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Dialog.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Dialog.h b/nx-X11/programs/Xserver/hw/nxagent/Dialog.h index 135cd2df3..aa845c7c2 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Dialog.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Dialog.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ @@ -42,7 +42,7 @@ extern int nxagentKillDialogPid; extern int nxagentSuspendDialogPid; extern int nxagentRootlessDialogPid; extern int nxagentPulldownDialogPid; -extern int nxagentFontsReplacement; +extern int nxagentFontsReplacementDialogPid; extern int nxagentEnableRandRModeDialogPid; extern int nxagentDisableRandRModeDialogPid; extern int nxagentEnableDeferModePid; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Display.c b/nx-X11/programs/Xserver/hw/nxagent/Display.c index 9f257e508..1a57788e6 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Display.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Display.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ @@ -453,6 +453,21 @@ static void nxagentSigchldHandler(int signal) } } + if (pid == 0 && nxagentFontsReplacementDialogPid) + { + pid = waitpid(nxagentFontsReplacementDialogPid, &status, options); + + if (pid == -1 && errno == ECHILD) + { + #ifdef WARNING + fprintf(stderr, "nxagentSigchldHandler: Got ECHILD waiting for child %d (Fonts replacement).\n", + nxagentFontsReplacementDialogPid); + #endif + + pid = nxagentFontsReplacementDialogPid = 0; + } + } + if (pid == 0 && nxagentEnableRandRModeDialogPid) { pid = waitpid(nxagentEnableRandRModeDialogPid, &status, options); @@ -1609,19 +1624,30 @@ void nxagentInitPixmapFormats() nxagentNumPixmapFormats = 0; - nxagentPixmapFormats = xalloc(nxagentNumDepths * sizeof(XPixmapFormatValues)); +/* +XXX: Some X server doesn't list 1 among available depths... +*/ + + nxagentPixmapFormats = xalloc((nxagentNumDepths + 1) * sizeof(XPixmapFormatValues)); for (i = 1; i <= MAXDEPTH; i++) { depth = 0; - for (j = 0; j < nxagentNumDepths; j++) + if (i == 1) + { + depth = 1; + } + else { - if (nxagentDepths[j] == i) + for (j = 0; j < nxagentNumDepths; j++) { - depth = i; + if (nxagentDepths[j] == i) + { + depth = i; - break; + break; + } } } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Display.h b/nx-X11/programs/Xserver/hw/nxagent/Display.h index d18785b60..35b7857ad 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Display.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Display.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c index 2c1b07fa5..75057097a 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ @@ -32,6 +32,7 @@ #include "Handlers.h" #include "Pixels.h" #include "Reconnect.h" +#include "GCOps.h" #include "NXlib.h" @@ -418,13 +419,14 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned if (useStoredBitmap != 0) { #ifdef TEST - fprintf(stderr, "nxagentSynchronizeRegion: Drawable [%s] at [%p] has a synchronization bitmap " + fprintf(stderr, "nxagentSynchronizeRegion: Drawable [%s] at [%p] has a synchronization bitmap at [%p] " "[%d,%d,%d,%d] with [%ld] rects.\n", nxagentDrawableType(pDrawable), - (void *) pDrawable, nxagentCorruptedRegion((DrawablePtr) nxagentDrawableBitmap(pDrawable)) -> extents.x1, - nxagentCorruptedRegion((DrawablePtr) nxagentDrawableBitmap(pDrawable)) -> extents.y1, - nxagentCorruptedRegion((DrawablePtr) nxagentDrawableBitmap(pDrawable)) -> extents.x2, - nxagentCorruptedRegion((DrawablePtr) nxagentDrawableBitmap(pDrawable)) -> extents.y2, - REGION_NUM_RECTS(nxagentCorruptedRegion((DrawablePtr) nxagentDrawableBitmap(pDrawable)))); + (void *) pDrawable, (void *) nxagentDrawableBitmap(pDrawable), + nxagentCorruptedRegion((DrawablePtr) nxagentDrawableBitmap(pDrawable)) -> extents.x1, + nxagentCorruptedRegion((DrawablePtr) nxagentDrawableBitmap(pDrawable)) -> extents.y1, + nxagentCorruptedRegion((DrawablePtr) nxagentDrawableBitmap(pDrawable)) -> extents.x2, + nxagentCorruptedRegion((DrawablePtr) nxagentDrawableBitmap(pDrawable)) -> extents.y2, + REGION_NUM_RECTS(nxagentCorruptedRegion((DrawablePtr) nxagentDrawableBitmap(pDrawable)))); #endif clipRegion = nxagentCreateRegion(pDrawable, NULL, 0, 0, pDrawable -> width, pDrawable -> height); @@ -581,8 +583,7 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned #ifdef TEST fprintf(stderr, "nxagentSynchronizeRegion: Going to synchronize [%ld] rects of [%s] at [%p].\n", - REGION_NUM_RECTS(clipRegion), (pDrawable -> type == DRAWABLE_PIXMAP ? "Pixmap" : "Window"), - (void *) pDrawable); + REGION_NUM_RECTS(clipRegion), nxagentDrawableType(pDrawable), (void *) pDrawable); fprintf(stderr, "nxagentSynchronizeRegion: Extents geometry [%d,%d,%d,%d].\n", clipRegion -> extents.x1, clipRegion -> extents.y1, clipRegion -> extents.x2, clipRegion -> extents.y2); @@ -615,7 +616,22 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned if (data == NULL) { #ifdef WARNING + fprintf(stderr, "nxagentSynchronizeRegion: WARNING! Failed to allocate memory for synchronization.\n"); + + /* + * Print detailed informations if the + * image length is zero. + */ + + if (length == 0) + { + fprintf(stderr, "nxagentSynchronizeRegion: Drawable [%s] at [%p] with region geometry [%ld][%d,%d,%d,%d].\n", + nxagentDrawableType(pDrawable), (void *) pDrawable, REGION_NUM_RECTS(clipRegion), + clipRegion -> extents.x1, clipRegion -> extents.y1, + clipRegion -> extents.x2, clipRegion -> extents.y2); + } + #endif goto nxagentSynchronizeRegionFree; @@ -670,10 +686,14 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned if (nxagentDrawableStatus(pDrawable) == Synchronized) { #ifdef WARNING + if (pDrawable -> type == DRAWABLE_WINDOW && pSrcDrawable != pDrawable) + { fprintf(stderr, "nxagentSynchronizeRegion: WARNING! Trying to synchronize " "the clean drawable type [%d] at [%p] with source at [%p].\n", pDrawable -> type, (void *) pDrawable, (void *) pSrcDrawable); + } + #endif goto nxagentSynchronizeRegionStop; @@ -748,9 +768,6 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned nxagentGetImage(pSrcDrawable, x, y, w, h, format, AllPlanes, data); - nxagentRealizeImage(pDrawable, pGC, pDrawable -> depth, - x, y, w, h, leftPad, format, data); - /* * Going to unmark the synchronized * region. @@ -805,6 +822,13 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned nxagentUnmarkCorruptedRegion(pDrawable, &tileRegion); } + #ifdef TEST + else + { + fprintf(stderr, "nxagentSynchronizeRegion: Tile [%d,%d,%d,%d] on drawable [%p] doesn't match.\n", + x, y, x + w, y + h, (void *) pDrawable); + } + #endif } else { @@ -835,6 +859,14 @@ int nxagentSynchronizeRegion(DrawablePtr pDrawable, RegionPtr pRegion, unsigned } } + /* + * Realize the image after comparing the + * source data with the bitmap data. + */ + + nxagentRealizeImage(pDrawable, pGC, pDrawable -> depth, + x, y, w, h, leftPad, format, data); + REGION_UNINIT(pDrawable -> pScreen, &tileRegion); #if !defined(COLLECTED_UPDATES) @@ -2555,16 +2587,13 @@ void nxagentCreateDrawableBitmap(DrawablePtr pDrawable) GCPtr pGC = NULL; RegionPtr pClipRegion = NullRegion; - char *data = NULL; - int x, y; int w, h; - int length, format; int saveTrap; #ifdef TEST - fprintf(stderr, "nxagentCreateDrawableBitmap: Creating synchronization bitmap for drawable at [%p].\n", - (void *) pDrawable); + fprintf(stderr, "nxagentCreateDrawableBitmap: Creating synchronization bitmap for [%s] at [%p].\n", + nxagentDrawableType(pDrawable), (void *) pDrawable); #endif /* @@ -2652,24 +2681,8 @@ void nxagentCreateDrawableBitmap(DrawablePtr pDrawable) w = pClipRegion -> extents.x2 - pClipRegion -> extents.x1; h = pClipRegion -> extents.y2 - pClipRegion -> extents.y1; - data = nxagentAllocateImageData(w, h, pDrawable -> depth, &length, &format); - - if (data == NULL) - { - #ifdef WARNING - fprintf(stderr, "nxagentCreateDrawableBitmap: Cannot allocate memory for the bitmap data.\n"); - #endif - - nxagentDestroyPixmap(pBitmap); + nxagentCopyArea(pDrawable, (DrawablePtr) pBitmap, pGC, x, y, w, h, x, y); - goto nxagentCreateDrawableBitmapEnd; - } - - nxagentGetImage(pDrawable, x, y, w, h, format, AllPlanes, data); - - nxagentPutImage((DrawablePtr) pBitmap, pGC, pBitmap -> drawable.depth, x, y, w, h, - 0, format, data); - REGION_UNION(pDrawable -> pScreen, nxagentCorruptedRegion((DrawablePtr) pBitmap), nxagentCorruptedRegion((DrawablePtr) pBitmap), pClipRegion); @@ -2711,11 +2724,6 @@ nxagentCreateDrawableBitmapEnd: nxagentFreeRegion(pDrawable, pClipRegion); } - if (data != NULL) - { - xfree(data); - } - if (pGC != NULL) { FreeScratchGC(pGC); @@ -3091,6 +3099,16 @@ void nxagentSendBackgroundExpose(WindowPtr pWin, PixmapPtr pBackground, RegionPt REGION_INTERSECT(pWin -> pScreen, &expose, &expose, &pWin -> clipList); + /* + * Reduce the overall region to expose. + */ + + REGION_TRANSLATE(pWin -> pScreen, &expose, -pWin -> drawable.x, -pWin -> drawable.y); + + REGION_SUBTRACT(pWin -> pScreen, pExpose, pExpose, &expose); + + REGION_TRANSLATE(pWin -> pScreen, &expose, pWin -> drawable.x, pWin -> drawable.y); + miWindowExposures(pWin, &expose, &expose); nxagentSendBackgroundExposeEnd: diff --git a/nx-X11/programs/Xserver/hw/nxagent/Drawable.h b/nx-X11/programs/Xserver/hw/nxagent/Drawable.h index 62af0685d..146610efb 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Drawable.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Drawable.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Error.c b/nx-X11/programs/Xserver/hw/nxagent/Error.c index e60845dd3..963cfa287 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Error.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Error.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Error.h b/nx-X11/programs/Xserver/hw/nxagent/Error.h index 78e15592b..2d6083d4e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Error.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Error.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index 3c1458cb7..1576962fb 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ @@ -76,7 +76,9 @@ #include "input.h" #endif +#define Time XlibXID #include "XKBlib.h" +#undef Time #define GC XlibGC #define Font XlibFont @@ -203,6 +205,8 @@ CARD32 nxagentLastEventTime = 0; CARD32 nxagentLastKeyPressTime = 0; Time nxagentLastServerTime = 0; +int nxagentPointerAndKeyboardGrabbed = 0; + /* * Used for storing windows that need to * receive expose events from the agent. @@ -218,6 +222,16 @@ static void nxagentForwardRemoteExpose(void); static int nxagentClipAndSendExpose(WindowPtr pWin, pointer ptr); +/* + * This is from NXproperty.c. + */ + +int GetWindowProperty(WindowPtr pWin, Atom property, long longOffset, + long longLength, Bool delete, Atom type, + Atom *actualType, int *format, unsigned + long *nItems, unsigned long *bytesAfter, + unsigned char **propData); + /* * Associate a resource to a drawable and * store the region affected by the split @@ -274,6 +288,280 @@ void ProcessInputEvents() mieqProcessInputEvents(); } +#ifdef DEBUG_TREE + +/* + * Print ID and name of window. + */ + +void nxagentRemoteWindowID(Window window, Bool newline) +{ +#ifdef NO_I18N + char *winName; +#else + XTextProperty tp; +#endif + + fprintf(stderr, "0x%lx", window); + + if (!window) + { + fprintf(stderr, " (none) "); + } + else + { + if (window == DefaultRootWindow(nxagentDisplay)) + { + fprintf(stderr, " (the root window) "); + } + +#ifdef NO_I18N + + if (!XFetchName(nxagentDisplay, window, &winName)) + { + fprintf(stderr, " (has no name) "); + } + else if (winName) + { + fprintf(stderr, " \"%s\" ", winName); + XFree(winName); + } + +#else + + if (XGetWMName(nxagentDisplay, window, &tp) != 0) + { + fprintf(stderr, " (has no name) "); + } + else if (tp.nitems > 0) + { + int count = 0; + int i, ret; + char **list = NULL; + + fprintf(stderr, " \""); + + ret = XmbTextPropertyToTextList(nxagentDisplay, &tp, &list, &count); + + if ((ret == Success || ret > 0) && list != NULL) + { + for (i = 0; i < count; i++) + { + fprintf(stderr, "%s", list[i]); + } + + XFreeStringList(list); + } + else + { + fprintf(stderr, "%s", tp.value); + } + + fprintf(stderr, "\" "); + } + +#endif + + else + { + fprintf(stderr, " (has no name) "); + } + } + + if (newline == TRUE) + { + fprintf(stderr, "\n"); + } + + return; +} + +/* + * Print info about remote window. + */ + +void nxagentRemoteWindowInfo(Window win, int indent, Bool newLine) +{ + XWindowAttributes attributes; + int i; + + if (XGetWindowAttributes(nxagentDisplay, win, &attributes) == 0) + { + return; + } + + for (i = 0; i < indent; i++) + { + fprintf(stderr, " "); + } + + fprintf(stderr, "x=%d y=%d width=%d height=%d class=%s map_state=%s " + "override_redirect=%s\n", attributes.x, attributes.y, + attributes.width, attributes.height, (attributes.class == 0) ? + "InputOutput" : "InputOnly", (attributes.map_state == 0) ? + "IsUnmapped" : (attributes.map_state == 1 ? + "IsUnviewable" : "IsViewable"), + (attributes.override_redirect == 0) ? + "No" : "Yes" ); + + if (newLine == TRUE) + { + fprintf(stderr, "\n"); + } +} + +/* + * Walk remote windows tree. + */ + +void nxagentRemoteWindowsTree(Window window, int level) +{ + int i, j; + Window rootWin, parentWin; + unsigned int numChildren; + Window *childList; + + if (!XQueryTree(nxagentDisplay, window, &rootWin, &parentWin, &childList, + &numChildren)) + { + fprintf(stderr, "nxagentRemoteWindowsTree - XQueryTree failed.\n"); + + return; + } + + if (level == 0) + { + fprintf(stderr, "\n"); + + fprintf(stderr, " Root Window ID: "); + nxagentRemoteWindowID(rootWin, TRUE); + + fprintf(stderr, " Parent window ID: "); + nxagentRemoteWindowID(parentWin, TRUE); + } + + if (level == 0 || numChildren > 0) + { + fprintf(stderr, " "); + + for (j = 0; j < level; j++) + { + fprintf(stderr, " "); + } + + fprintf(stderr, "%d child%s%s\n", numChildren, (numChildren == 1) ? "" : + "ren", (numChildren == 1) ? ":" : "."); + } + + for (i = (int) numChildren - 1; i >= 0; i--) + { + fprintf(stderr, " "); + + for (j = 0; j < level; j++) + { + fprintf(stderr, " "); + } + + nxagentRemoteWindowID(childList[i], TRUE); + + nxagentRemoteWindowInfo(childList[i], (level * 5) + 6, TRUE); + + nxagentRemoteWindowsTree(childList[i], level + 1); + } + + if (childList) + { + XFree((char *) childList); + } +} + +/* + * Print info about internal window. + */ + +void nxagentInternalWindowInfo(WindowPtr pWin, int indent, Bool newLine) +{ + int i; + int result; + unsigned long ulReturnItems; + unsigned long ulReturnBytesLeft; + Atom atomReturnType; + int iReturnFormat; + unsigned char *pszReturnData = NULL; + + fprintf(stderr, "Window ID=[0x%lx] Remote ID=[0x%lx] ", pWin -> drawable.id, + nxagentWindow(pWin)); + + result = GetWindowProperty(pWin, MakeAtom("WM_NAME", 7, False) , 0, + sizeof(CARD32), False, AnyPropertyType, + &atomReturnType, &iReturnFormat, + &ulReturnItems, &ulReturnBytesLeft, + &pszReturnData); + + fprintf(stderr, "Name: "); + + if (result == Success && pszReturnData != NULL) + { + pszReturnData[ulReturnItems] = '\0'; + + fprintf(stderr, "\"%s\"\n", (char *) pszReturnData); + } + else + { + fprintf(stderr, "%s\n", "( has no name )"); + } + + for (i = 0; i < indent; i++) + { + fprintf(stderr, " "); + } + + fprintf(stderr, "x=%d y=%d width=%d height=%d class=%s map_state=%s " + "override_redirect=%s", pWin -> drawable.x, pWin -> drawable.y, + pWin -> drawable.width, pWin -> drawable.height, + (pWin -> drawable.class == 0) ? "InputOutput" : + "InputOnly", (pWin -> mapped == 0) ? + "IsUnmapped" : (pWin -> mapped == 1 ? + "IsUnviewable" : "IsViewable"), + (pWin -> overrideRedirect == 0) ? + "No" : "Yes"); + + if (newLine == TRUE) + { + fprintf(stderr, "\n"); + } +} + +/* + * Walk internal windows tree. + */ + +void nxagentInternalWindowsTree(WindowPtr pWin, int indent) +{ + WindowPtr pChild; + int i; + + while (pWin) + { + pChild = pWin -> firstChild; + + for (i = 0; i < indent; i++) + { + fprintf(stderr, " "); + } + + nxagentInternalWindowInfo(pWin, indent, TRUE); + + fprintf(stderr, "\n"); + + nxagentInternalWindowsTree(pChild, indent + 4); + + pWin = pWin -> nextSib; + } +} + +#endif /* DEBUG_TREE */ + void nxagentSwitchResizeMode(ScreenPtr pScreen) { XSizeHints sizeHints; @@ -290,8 +578,14 @@ void nxagentSwitchResizeMode(ScreenPtr pScreen) nxagentLaunchDialog(DIALOG_DISABLE_DESKTOP_RESIZE_MODE); - sizeHints.max_width = nxagentOption(RootWidth); - sizeHints.max_height = nxagentOption(RootHeight); + if (nxagentOption(Fullscreen) == 0) + { + sizeHints.max_width = nxagentOption(RootWidth); + sizeHints.max_height = nxagentOption(RootHeight); + + XSetWMNormalHints(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum], + &sizeHints); + } } else { @@ -299,7 +593,8 @@ void nxagentSwitchResizeMode(ScreenPtr pScreen) nxagentLaunchDialog(DIALOG_ENABLE_DESKTOP_RESIZE_MODE); - nxagentRRSetScreenConfig(pScreen, nxagentOption(Width), nxagentOption(Height)); + nxagentRRSetScreenConfig(pScreen, nxagentOption(Width), + nxagentOption(Height)); if (nxagentOption(ClientOs) == ClientOsWinnt) { @@ -308,10 +603,10 @@ void nxagentSwitchResizeMode(ScreenPtr pScreen) sizeHints.max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); sizeHints.max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); - } - XSetWMNormalHints(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum], - &sizeHints); + XSetWMNormalHints(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum], + &sizeHints); + } } void nxagentShadowSwitchResizeMode(ScreenPtr pScreen) @@ -655,6 +950,22 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) { break; } + + #ifdef DEBUG_TREE + + case doDebugTree: + { + fprintf(stderr, "\n ========== nxagentRemoteWindowsTree ==========\n"); + nxagentRemoteWindowsTree(nxagentWindow(WindowTable[0]), 0); + + fprintf(stderr, "\n========== nxagentInternalWindowsTree ==========\n"); + nxagentInternalWindowsTree(WindowTable[0], 0); + + break; + } + + #endif /* DEBUG_TREE */ + case doCloseSession: { closeSession = TRUE; @@ -679,6 +990,30 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) break; } + case doViewportMoveUp: + { + nxagentMoveViewport(pScreen, 0, -nxagentOption(Height)); + + break; + } + case doViewportMoveDown: + { + nxagentMoveViewport(pScreen, 0, nxagentOption(Height)); + + break; + } + case doViewportMoveLeft: + { + nxagentMoveViewport(pScreen, -nxagentOption(Width), 0); + + break; + } + case doViewportMoveRight: + { + nxagentMoveViewport(pScreen, nxagentOption(Width), 0); + + break; + } case doViewportUp: { nxagentMoveViewport(pScreen, 0, -nextinc(viewportInc)); @@ -755,6 +1090,8 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) if (nxagentOption(ViewOnly) == 0 && nxagentOption(Shadow) == 1 && result == doNothing) { + X.xkey.keycode = nxagentConvertKeycode(X.xkey.keycode); + NXShadowEvent(nxagentDisplay, X); } @@ -763,6 +1100,27 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) case KeyRelease: { enum HandleEventResult result; + int sendKey = 0; + +/* +FIXME: If we don't flush the queue here, it could happen + that the inputInfo structure will not be up to date + when we perform the following check on down keys. +*/ + ProcessInputEvents(); + +/* +FIXME: Don't enqueue the KeyRelease event if the key was + not already pressed. This workaround avoids a fake + KeyPress is enqueued by the XKEYBOARD extension. + Another solution would be to let the events are + enqueued and to remove the KeyPress afterwards. +*/ + if (BitIsOn(inputInfo.keyboard -> key -> down, + nxagentConvertKeycode(X.xkey.keycode))) + { + sendKey = 1; + } #ifdef TEST fprintf(stderr, "nxagentDispatchEvents: Going to handle new KeyRelease event.\n"); @@ -803,7 +1161,12 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) nxagentLastEventTime = GetTimeInMillis(); - if (!(nxagentCheckSpecialKeystroke(&X.xkey, &result))) + if (x.u.keyButtonPointer.time > nxagentLastEventTime) + { + x.u.keyButtonPointer.time = nxagentLastEventTime; + } + + if (!(nxagentCheckSpecialKeystroke(&X.xkey, &result)) && sendKey == 1) { mieqEnqueue(&x); @@ -811,6 +1174,8 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) if (nxagentOption(ViewOnly) == 0 && nxagentOption(Shadow)) { + X.xkey.keycode = nxagentConvertKeycode(X.xkey.keycode); + NXShadowEvent(nxagentDisplay, X); } } @@ -828,6 +1193,23 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) nxagentInputEvent = 1; + if (nxagentOption(ClientOs) == ClientOsMac && (X.xbutton.state & ControlMask) == ControlMask) + { + x.u.u.type = ButtonPress; + x.u.u.detail = inputInfo.pointer -> button -> map[3]; + x.u.keyButtonPointer.time = nxagentLastEventTime = GetTimeInMillis(); + + mieqEnqueue(&x); + + x.u.u.type = ButtonRelease; + x.u.u.detail = inputInfo.pointer -> button -> map[3]; + x.u.keyButtonPointer.time = nxagentLastEventTime = GetTimeInMillis(); + + mieqEnqueue(&x); + + break; + } + if (nxagentOption(Fullscreen)) { if (nxagentMagicPixelZone(X.xbutton.x, X.xbutton.y)) @@ -874,7 +1256,7 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) X.xbutton.subwindow == None)) { x.u.u.type = ButtonPress; - x.u.u.detail = X.xbutton.button; + x.u.u.detail = inputInfo.pointer -> button -> map[nxagentReversePointerMap[X.xbutton.button - 1]]; x.u.keyButtonPointer.time = nxagentLastEventTime = GetTimeInMillis(); if (nxagentOption(Rootless)) @@ -931,6 +1313,11 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) nxagentInputEvent = 1; + if (nxagentOption(ClientOs) == ClientOsMac && (X.xbutton.state & ControlMask) == ControlMask) + { + break; + } + if (viewportCursor) { /* @@ -947,7 +1334,7 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) if (minimize != True) { x.u.u.type = ButtonRelease; - x.u.u.detail = X.xbutton.button; + x.u.u.detail = inputInfo.pointer -> button -> map[nxagentReversePointerMap[X.xbutton.button - 1]]; x.u.keyButtonPointer.time = nxagentLastEventTime = GetTimeInMillis(); if (nxagentOption(Rootless)) @@ -1301,10 +1688,11 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) nxagentScreenTrap = 0; } - if (nxagentOption(Fullscreen)) + if (nxagentOption(Fullscreen) == 1) { - if (X.xcrossing.window == nxagentFullscreenWindow && - X.xcrossing.detail != NotifyInferior) + if (X.xcrossing.window == nxagentDefaultWindows[0] && + X.xcrossing.detail != NotifyInferior && + X.xcrossing.mode == NotifyNormal) { nxagentGrabPointerAndKeyboard(&X); } @@ -1356,14 +1744,11 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) nxagentLastEnteredWindow = NULL; } - if (nxagentOption(Fullscreen)) + if (X.xcrossing.window == nxagentDefaultWindows[0] && + X.xcrossing.detail != NotifyInferior && + X.xcrossing.mode == NotifyNormal) { - if (X.xcrossing.window == nxagentFullscreenWindow && - X.xcrossing.detail != NotifyInferior && - X.xcrossing.mode == NotifyNormal) - { - nxagentUngrabPointerAndKeyboard(&X); - } + nxagentUngrabPointerAndKeyboard(&X); } if (X.xcrossing.detail != NotifyInferior) @@ -1617,7 +2002,7 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) } if (nxagentUseNXTrans == 1 && nxagentOption(Rootless) == 0 && - nxagentOption(Nested) == 0 && X.xmap.window != nxagentIconWindow) + nxagentOption(Nested) == 0) { nxagentVisibility = VisibilityFullyObscured; } @@ -1658,12 +2043,6 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) if (nxagentOption(Fullscreen) == 1) { - if (X.xmap.window == nxagentIconWindow) - { - pScreen = nxagentScreen(X.xmap.window); - nxagentMaximizeToFullScreen(pScreen); - } - nxagentVisibility = VisibilityUnobscured; nxagentVisibilityStop = False; nxagentVisibilityTimeout = GetTimeInMillis() + 2000; @@ -1673,10 +2052,17 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) } case MappingNotify: { + XMappingEvent *mappingEvent = (XMappingEvent *) &X; + #ifdef DEBUG fprintf(stderr, "nxagentDispatchEvents: WARNING! Going to handle new MappingNotify event.\n"); #endif + if (mappingEvent -> request == MappingPointer) + { + nxagentInitPointerMap(); + } + break; } default: @@ -1750,14 +2136,8 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) if (nxagentWMIsRunning) { - if (nxagentOption(Fullscreen)) - { - nxagentMinimizeFromFullScreen(pScreen); - } - else - { - XIconifyWindow(nxagentDisplay, nxagentDefaultWindows[0], DefaultScreen(nxagentDisplay)); - } + XIconifyWindow(nxagentDisplay, nxagentDefaultWindows[0], + DefaultScreen(nxagentDisplay)); } } @@ -1916,8 +2296,16 @@ int nxagentHandleKeyPress(XEvent *X, enum HandleEventResult *result) return 1; } - nxagentLastEventTime = nxagentLastKeyPressTime = GetTimeInMillis(); + if (X -> xkey.keycode == 66) + { + nxagentXkbState.Caps = (~nxagentXkbState.Caps & 1); + } + else if (X -> xkey.keycode == 77) + { + nxagentXkbState.Num = (~nxagentXkbState.Num & 1); + } + nxagentLastEventTime = nxagentLastKeyPressTime = GetTimeInMillis(); x.u.u.type = KeyPress; x.u.u.detail = nxagentConvertKeycode(X -> xkey.keycode); @@ -2227,7 +2615,6 @@ int nxagentHandleGraphicsExposeEvent(XEvent *X) int nxagentHandleClientMessageEvent(XEvent *X, enum HandleEventResult *result) { - ScreenPtr pScreen; WindowPtr pWin; xEvent x; @@ -2343,19 +2730,8 @@ int nxagentHandleClientMessageEvent(XEvent *X, enum HandleEventResult *result) fprintf(stderr, "Events: WM_DELETE_WINDOW arrived Atom = %ld.\n", wmAtom); #endif - if (X -> xclient.window == nxagentIconWindow) - { - pScreen = nxagentScreen(X -> xmap.window); - - XMapRaised(nxagentDisplay, nxagentFullscreenWindow); - - XIconifyWindow(nxagentDisplay, nxagentIconWindow, - DefaultScreen(nxagentDisplay)); - - } - - if (X -> xclient.window == (nxagentOption(Fullscreen) ? - nxagentIconWindow : nxagentDefaultWindows[0])) + if (X -> xclient.window == nxagentDefaultWindows[0] || + nxagentWMIsRunning == 0) { *result = doCloseSession; } @@ -2952,85 +3328,110 @@ int nxagentHandleConfigureNotify(XEvent* X) if (X -> xconfigure.window == nxagentDefaultWindows[pScreen -> myNum]) { - if (nxagentOption(Fullscreen) == 0) + if (nxagentOption(DesktopResize) == 1) { - if (nxagentOption(DesktopResize) == 1) + if (nxagentOption(Width) != X -> xconfigure.width || + nxagentOption(Height) != X -> xconfigure.height) { - if (nxagentOption(Width) != X -> xconfigure.width || - nxagentOption(Height) != X -> xconfigure.height) - { - Bool newEvents = False; + Bool newEvents = False; - doRandR = True; + doRandR = True; - NXFlushDisplay(nxagentDisplay, NXFlushLink); + NXFlushDisplay(nxagentDisplay, NXFlushLink); - do - { - newEvents = False; + do + { + newEvents = False; - timeout.tv_sec = 0; - timeout.tv_usec = 500 * 1000; + timeout.tv_sec = 0; + timeout.tv_usec = 500 * 1000; - nxagentWaitEvents(nxagentDisplay, &timeout); + nxagentWaitEvents(nxagentDisplay, &timeout); - /* - * This should also flush - * the NX link for us. - */ + /* + * This should also flush + * the NX link for us. + */ - XSync(nxagentDisplay, 0); + XSync(nxagentDisplay, 0); - while (XCheckTypedWindowEvent(nxagentDisplay, nxagentDefaultWindows[pScreen -> myNum], - ConfigureNotify, X)) - { - newEvents = True; - } + while (XCheckTypedWindowEvent(nxagentDisplay, nxagentDefaultWindows[pScreen -> myNum], + ConfigureNotify, X)) + { + newEvents = True; + } - } while (newEvents); - } + } while (newEvents); } + } - if (nxagentWMIsRunning == 0 || X -> xconfigure.send_event) - { - nxagentChangeOption(X, X -> xconfigure.x); - nxagentChangeOption(Y, X -> xconfigure.y); - } + if (nxagentWMIsRunning == 0 || X -> xconfigure.send_event) + { + nxagentChangeOption(X, X -> xconfigure.x); + nxagentChangeOption(Y, X -> xconfigure.y); + } - if (nxagentOption(Shadow) == 1 && nxagentOption(DesktopResize) == 1 && - (nxagentOption(Width) != X -> xconfigure.width || - nxagentOption(Height) != X -> xconfigure.height)) - { - nxagentShadowResize = 1; - } + if (nxagentOption(Shadow) == 1 && nxagentOption(DesktopResize) == 1 && + (nxagentOption(Width) != X -> xconfigure.width || + nxagentOption(Height) != X -> xconfigure.height)) + { + nxagentShadowResize = 1; + } - nxagentChangeOption(Width, X -> xconfigure.width); - nxagentChangeOption(Height, X -> xconfigure.height); + nxagentChangeOption(Width, X -> xconfigure.width); + nxagentChangeOption(Height, X -> xconfigure.height); - nxagentChangeOption(ViewportXSpan, (int) X -> xconfigure.width - - (int) nxagentOption(RootWidth)); - nxagentChangeOption(ViewportYSpan, (int) X -> xconfigure.height - - (int) nxagentOption(RootHeight)); + nxagentChangeOption(ViewportXSpan, (int) X -> xconfigure.width - + (int) nxagentOption(RootWidth)); + nxagentChangeOption(ViewportYSpan, (int) X -> xconfigure.height - + (int) nxagentOption(RootHeight)); - nxagentMoveViewport(pScreen, 0, 0); + nxagentMoveViewport(pScreen, 0, 0); - if (nxagentOption(Shadow) == 1 || - (nxagentOption(Width) == nxagentOption(RootWidth) && - nxagentOption(Height) == nxagentOption(RootHeight))) - { - doRandR = 0; - } + if (nxagentOption(Shadow) == 1 || + (nxagentOption(Width) == nxagentOption(RootWidth) && + nxagentOption(Height) == nxagentOption(RootHeight))) + { + doRandR = 0; + } - if (doRandR) - { - #ifdef TEST - fprintf(stderr,"nxagentHandleConfigureNotify: Width %d Height %d.\n", - nxagentOption(Width), nxagentOption(Height)); - #endif + nxagentChangeOption(Width, X -> xconfigure.width); + nxagentChangeOption(Height, X -> xconfigure.height); - nxagentRRSetScreenConfig(screenInfo.screens[DefaultScreen(nxagentDisplay)], - nxagentOption(Width), nxagentOption(Height)); - } + XMoveResizeWindow(nxagentDisplay, nxagentInputWindows[0], 0, 0, + X -> xconfigure.width, X -> xconfigure.height); + + if (nxagentOption(Fullscreen) == 0) + { + nxagentMoveViewport(pScreen, 0, 0); + } + else + { + nxagentChangeOption(RootX, (nxagentOption(Width) - + nxagentOption(RootWidth)) / 2); + nxagentChangeOption(RootY, (nxagentOption(Height) - + nxagentOption(RootHeight)) / 2); + nxagentChangeOption(ViewportXSpan, nxagentOption(Width) - + nxagentOption(RootWidth)); + nxagentChangeOption(ViewportYSpan, nxagentOption(Height) - + nxagentOption(RootHeight)); + + nxagentUpdateViewportFrame(0, 0, nxagentOption(RootWidth), + nxagentOption(RootHeight)); + + XMoveWindow(nxagentDisplay, nxagentWindow(WindowTable[pScreen -> myNum]), + nxagentOption(RootX), nxagentOption(RootY)); + } + + if (doRandR) + { + #ifdef TEST + fprintf(stderr,"nxagentHandleConfigureNotify: Width %d Height %d.\n", + nxagentOption(Width), nxagentOption(Height)); + #endif + + nxagentRRSetScreenConfig(screenInfo.screens[DefaultScreen(nxagentDisplay)], + nxagentOption(Width), nxagentOption(Height)); } return 1; @@ -3042,8 +3443,6 @@ int nxagentHandleConfigureNotify(XEvent* X) int nxagentHandleReparentNotify(XEvent* X) { - ScreenPtr pScreen = nxagentScreen(X -> xreparent.window); - #ifdef TEST fprintf(stderr, "nxagentHandleReparentNotify: Going to handle a new reparent event.\n"); #endif @@ -3096,6 +3495,8 @@ int nxagentHandleReparentNotify(XEvent* X) #ifdef WARNING fprintf(stderr, "nxagentHandleReparentNotify: WARNING! Failed QueryTree request.\n"); #endif + + break; } if (result && children_return) @@ -3148,6 +3549,95 @@ int nxagentHandleReparentNotify(XEvent* X) return 1; } + else if (nxagentWMIsRunning == 1 && nxagentOption(Fullscreen) == 0 && + nxagentOption(WMBorderWidth) == -1) + { + XlibWindow w; + XlibWindow rootReturn = 0; + XlibWindow parentReturn = 0; + XlibWindow junk; + XlibWindow *childrenReturn = NULL; + unsigned int nchildrenReturn = 0; + Status result; + XWindowAttributes attributes; + int x, y; + int xParent, yParent; + + /* + * Calculate the absolute upper-left X e Y + */ + + if ((XGetWindowAttributes(nxagentDisplay, X -> xreparent.window, + &attributes) == 0)) + { + #ifdef WARNING + fprintf(stderr, "nxagentHandleReparentNotify: WARNING! " + "XGetWindowAttributes failed.\n"); + #endif + + return 1; + } + + x = attributes.x; + y = attributes.y; + + XTranslateCoordinates(nxagentDisplay, X -> xreparent.window, + attributes.root, -attributes.border_width, + -attributes.border_width, &x, &y, &junk); + + /* + * Calculate the parent X and parent Y. + */ + + w = X -> xreparent.parent; + + if (w != DefaultRootWindow(nxagentDisplay)) + { + do + { + result = XQueryTree(nxagentDisplay, w, &rootReturn, &parentReturn, + &childrenReturn, &nchildrenReturn); + + if (parentReturn == rootReturn || parentReturn == 0 || result == 0) + { + break; + } + + if (result == 1 && childrenReturn != NULL) + { + XFree(childrenReturn); + } + + w = parentReturn; + } + while (True); + + /* + * WM reparented. Find edge of the frame. + */ + + if (XGetWindowAttributes(nxagentDisplay, w, &attributes) == 0) + { + #ifdef WARNING + fprintf(stderr, "nxagentHandleReparentNotify: WARNING! " + "XGetWindowAttributes failed for parent window.\n"); + #endif + + return 1; + } + + xParent = attributes.x; + yParent = attributes.y; + + /* + * Difference between Absolute X and Parent X gives thickness of side frame. + * Difference between Absolute Y and Parent Y gives thickness of title bar. + */ + + nxagentChangeOption(WMBorderWidth, (x - xParent)); + nxagentChangeOption(WMTitleHeight, (y - yParent)); + } + } return 1; } @@ -3308,6 +3798,13 @@ void nxagentGrabPointerAndKeyboard(XEvent *X) int resource; + int result; + + if (nxagentPointerAndKeyboardGrabbed == 1) + { + return; + } + #ifdef TEST fprintf(stderr, "nxagentGrabPointerAndKeyboard: Grabbing pointer and keyboard with event at [%p].\n", (void *) X); @@ -3326,8 +3823,22 @@ void nxagentGrabPointerAndKeyboard(XEvent *X) fprintf(stderr, "nxagentGrabPointerAndKeyboard: Going to grab the keyboard in context [B1].\n"); #endif - XGrabKeyboard(nxagentDisplay, nxagentFullscreenWindow, - True, GrabModeAsync, GrabModeAsync, now); + result = XGrabKeyboard(nxagentDisplay, nxagentFullscreenWindow, + True, GrabModeAsync, GrabModeAsync, now); + + if (result != GrabSuccess) + { + return; + } + + /* + * The smart scheduler could be stopped while + * waiting for the reply. In this case we need + * to yield explicitly to avoid to be stuck in + * the dispatch loop forever. + */ + + isItTimeToYield = 1; #ifdef TEST fprintf(stderr, "nxagentGrabPointerAndKeyboard: Going to grab the pointer in context [B2].\n"); @@ -3356,12 +3867,19 @@ void nxagentGrabPointerAndKeyboard(XEvent *X) XSetInputFocus(nxagentDisplay, nxagentFullscreenWindow, RevertToParent, now); } + + nxagentPointerAndKeyboardGrabbed = 1; } void nxagentUngrabPointerAndKeyboard(XEvent *X) { unsigned long now; + if (nxagentPointerAndKeyboardGrabbed == 0) + { + return; + } + #ifdef TEST fprintf(stderr, "nxagentUngrabPointerAndKeyboard: Ungrabbing pointer and keyboard with event at [%p].\n", (void *) X); @@ -3387,6 +3905,8 @@ void nxagentUngrabPointerAndKeyboard(XEvent *X) #endif XUngrabPointer(nxagentDisplay, now); + + nxagentPointerAndKeyboardGrabbed = 0; } void nxagentDeactivatePointerGrab() @@ -4022,4 +4542,180 @@ void nxagentGuessDumpInputInfo(ClientPtr client, Atom property, char *data) } } +void nxagentDeactivateInputDevicesGrabs() +{ + fprintf(stderr, "Info: Deactivating input devices grabs.\n"); + + if (inputInfo.pointer -> grab) + { + (*inputInfo.pointer -> DeactivateGrab)(inputInfo.pointer); + } + + if (inputInfo.keyboard -> grab) + { + (*inputInfo.keyboard -> DeactivateGrab)(inputInfo.keyboard); + } +} + +static const char *nxagentGrabStateToString(int state) +{ + switch (state) + { + case 0: + return "NOT_GRABBED"; + case 1: + return "THAWED"; + case 2: + return "THAWED_BOTH"; + case 3: + return "FREEZE_NEXT_EVENT"; + case 4: + return "FREEZE_BOTH_NEXT_EVENT"; + case 5: + return "FROZEN_NO_EVENT"; + case 6: + return "FROZEN_WITH_EVENT"; + case 7: + return "THAW_OTHERS"; + default: + return "unknown state"; + } +} + +void nxagentDumpInputDevicesState(void) +{ + int i, k; + int mask = 1; + CARD8 val; + DeviceIntPtr dev; + GrabPtr grab; + WindowPtr pWin = NULL; + + fprintf(stderr, "\n*** Dump input devices state: BEGIN ***" + "\nKeys down:"); + + dev = inputInfo.keyboard; + + for (i = 0; i < DOWN_LENGTH; i++) + { + val = dev -> key -> down[i]; + + if (val != 0) + { + for (k = 0; k < 8; k++) + { + if (val & (mask << k)) + { + fprintf(stderr, "\n\t[%d] [%s]", i * 8 + k, + XKeysymToString(XKeycodeToKeysym(nxagentDisplay, i * 8 + k, 0))); + } + } + } + } + + fprintf(stderr, "\nKeyboard device state: \n\tdevice [%p]\n\tlast grab time [%lu]" + "\n\tfrozen [%s]\n\tstate [%s]\n\tother [%p]\n\tevent count [%d]" + "\n\tfrom passive grab [%s]\n\tactivating key [%d]", dev, + dev -> grabTime.milliseconds, dev -> sync.frozen ? "Yes": "No", + nxagentGrabStateToString(dev -> sync.state), + dev -> sync.other, dev -> sync.evcount, + dev -> fromPassiveGrab ? "Yes" : "No", + dev -> activatingKey); + + grab = dev -> grab; + + if (grab) + { + fprintf(stderr, "\nKeyboard grab state: \n\twindow pointer [%p]" + "\n\towner events flag [%s]\n\tgrab mode [%s]", + grab -> window, grab -> ownerEvents ? "True" : "False", + grab -> keyboardMode ? "asynchronous" : "synchronous"); + + /* + * Passive grabs. + */ + + pWin = grab -> window; + grab = wPassiveGrabs(pWin); + + while (grab) + { + fprintf(stderr, "\nPassive grab state: \n\tdevice [%p]\n\towner events flag [%s]" + "\n\tpointer grab mode [%s]\n\tkeyboard grab mode [%s]\n\tevent type [%d]" + "\n\tmodifiers [%x]\n\tbutton/key [%u]\n\tevent mask [%lx]", + grab -> device, grab -> ownerEvents ? "True" : "False", + grab -> pointerMode ? "asynchronous" : "synchronous", + grab -> keyboardMode ? "asynchronous" : "synchronous", + grab -> type, grab -> modifiersDetail.exact, + grab -> detail.exact, grab -> eventMask); + + grab = grab -> next; + } + } + + fprintf(stderr, "\nButtons down:"); + + dev = inputInfo.pointer; + + for (i = 0; i < DOWN_LENGTH; i++) + { + val = dev -> button -> down[i]; + + if (val != 0) + { + for (k = 0; k < 8; k++) + { + if (val & (mask << k)) + { + fprintf(stderr, "\n\t[%d]", i * 8 + k); + } + } + } + } + + fprintf(stderr, "\nPointer device state: \n\tdevice [%p]\n\tlast grab time [%lu]" + "\n\tfrozen [%s]\n\tstate [%s]\n\tother [%p]\n\tevent count [%d]" + "\n\tfrom passive grab [%s]\n\tactivating button [%d]", dev, + dev -> grabTime.milliseconds, dev -> sync.frozen ? "Yes" : "No", + nxagentGrabStateToString(dev -> sync.state), + dev -> sync.other, dev -> sync.evcount, + dev -> fromPassiveGrab ? "Yes" : "No", + dev -> activatingKey); + + grab = dev -> grab; + + if (grab) + { + fprintf(stderr, "\nPointer grab state: \n\twindow pointer [%p]" + "\n\towner events flag [%s]\n\tgrab mode [%s]", + grab -> window, grab -> ownerEvents ? "True" : "False", + grab -> pointerMode ? "asynchronous" : "synchronous"); + + if (grab -> window != pWin) + { + /* + * Passive grabs. + */ + + grab = wPassiveGrabs(grab -> window); + + while (grab) + { + fprintf(stderr, "\nPassive grab state: \n\tdevice [%p]\n\towner events flag [%s]" + "\n\tpointer grab mode [%s]\n\tkeyboard grab mode [%s]\n\tevent type [%d]" + "\n\tmodifiers [%x]\n\tbutton/key [%u]\n\tevent mask [%lx]", + grab -> device, grab -> ownerEvents ? "True" : "False", + grab -> pointerMode ? "asynchronous" : "synchronous", + grab -> keyboardMode ? "asynchronous" : "synchronous", + grab -> type, grab -> modifiersDetail.exact, + grab -> detail.exact, grab -> eventMask); + + grab = grab -> next; + } + } + } + + fprintf(stderr, "\n*** Dump input devices state: FINISH ***\n"); +} + #endif diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.h b/nx-X11/programs/Xserver/hw/nxagent/Events.h index ab0d25764..109475c16 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ @@ -29,9 +29,14 @@ enum HandleEventResult { doNothing = 0, doMinimize, + doDebugTree, doCloseSession, doStartKbd, doSwitchFullscreen, + doViewportMoveUp, + doViewportMoveLeft, + doViewportMoveRight, + doViewportMoveDown, doViewportLeft, doViewportUp, doViewportRight, diff --git a/nx-X11/programs/Xserver/hw/nxagent/Extensions.c b/nx-X11/programs/Xserver/hw/nxagent/Extensions.c index f2954a3e9..e76cbb4ad 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Extensions.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Extensions.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Extensions.h b/nx-X11/programs/Xserver/hw/nxagent/Extensions.h index f76229867..620645d00 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Extensions.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Extensions.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Font.c b/nx-X11/programs/Xserver/hw/nxagent/Font.c index 87f9f0201..13b819322 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Font.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Font.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ @@ -827,7 +827,10 @@ static XFontStruct *nxagentLoadBestQueryFont(Display* dpy, char *fontName, FontP for (j = 0; j < numSearchFields; j++) { - free (searchFields[j]); + if (searchFields[j] != NULL) + { + free(searchFields[j]); + } } } } @@ -846,7 +849,10 @@ static XFontStruct *nxagentLoadBestQueryFont(Display* dpy, char *fontName, FontP for (j = 0; j < numFontFields; j++) { - free (fontNameFields[j]); + if (fontNameFields[j] != NULL) + { + free(fontNameFields[j]); + } } return fontStruct; @@ -1765,6 +1771,10 @@ int nxagentSplitString(char *string, char *fields[], int nfields, char *sep) strncpy(fields[i], current, fieldlen); *(fields[i] + fieldlen) = 0; } + else + { + fields[i] = NULL; + } current = next + seplen; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Font.h b/nx-X11/programs/Xserver/hw/nxagent/Font.h index 3ae086b44..75ae3f6f5 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Font.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Font.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/GC.c b/nx-X11/programs/Xserver/hw/nxagent/GC.c index 4ca069790..c53e3b9f7 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/GC.c +++ b/nx-X11/programs/Xserver/hw/nxagent/GC.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c index 83aa04f11..85730797e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c +++ b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ @@ -594,6 +594,8 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, unsigned int format; unsigned long planeMask = 0xffffffff; + int oldDstxyValue; + RegionPtr pDstRegion; int skip = 0; @@ -605,6 +607,91 @@ RegionPtr nxagentCopyArea(DrawablePtr pSrcDrawable, DrawablePtr pDstDrawable, (void *) pDstDrawable, srcx, srcy, dstx, dsty, width, height); #endif + /* + * Here, before using fbDoCopy() called by fbCopyArea(), + * it should be provided that the cast in fbDoCopy() from + * int to short int would not cut off significative bits. + */ + + if (dstx + pDstDrawable->x + width > 32767) + { + #ifdef WARNING + fprintf(stderr, "nxagentCopyArea: x2 exceeding short int.\n"); + #endif + + width = 32767 - dstx - pDstDrawable->x; + + if (width <= 0) + { + #ifdef TEST + fprintf(stderr, "nxagentCopyArea: Returning null on x2 check.\n"); + #endif + + return NullRegion; + } + } + + if (dstx + pDstDrawable->x < -32768) + { + #ifdef WARNING + fprintf(stderr, "nxagentCopyArea: x1 exceeding short int.\n"); + #endif + + width += pDstDrawable->x + dstx + 32768; + srcx -= pDstDrawable->x + dstx + 32768; + dstx = -32768 - pDstDrawable->x; + + if (width <= 0) + { + #ifdef TEST + fprintf(stderr, "nxagentCopyArea: Returning null on x1 check.\n"); + #endif + + return NullRegion; + } + } + + oldDstxyValue = dsty; + + if (dsty + pDstDrawable->y + height > 32767) + { + #ifdef WARNING + fprintf(stderr, "nxagentCopyArea: y2 exceeding short int.\n"); + #endif + + height = 32767 - dsty - pDstDrawable->y; + + if (height <= 0) + { + #ifdef TEST + fprintf(stderr, "nxagentCopyArea: Returning null on y2 check.\n"); + #endif + + return NullRegion; + } + } + + if (dsty + pDstDrawable->y < -32768) + { + #ifdef WARNING + fprintf(stderr, "nxagentCopyArea: y1 exceeding short int.\n"); + #endif + + height += 32768 + pDstDrawable->y + dsty; + srcy -= 32768 + pDstDrawable->y + dsty; + dsty = -32768 - pDstDrawable->y; + + if (height <= 0) + { + #ifdef TEST + fprintf(stderr, "nxagentCopyArea: Returning null on y1 check.\n"); + #endif + + return NullRegion; + } + } + + if (nxagentGCTrap == 1 || nxagentShmTrap == 1) { if (pSrcDrawable -> type == DRAWABLE_PIXMAP && diff --git a/nx-X11/programs/Xserver/hw/nxagent/GCOps.h b/nx-X11/programs/Xserver/hw/nxagent/GCOps.h index 14d30e392..7ae6d9923 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/GCOps.h +++ b/nx-X11/programs/Xserver/hw/nxagent/GCOps.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/GCs.h b/nx-X11/programs/Xserver/hw/nxagent/GCs.h index 207d563ed..bec290088 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/GCs.h +++ b/nx-X11/programs/Xserver/hw/nxagent/GCs.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c index 3abc3575f..be407f160 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ @@ -105,6 +105,13 @@ #define MINIMUM_DISPLAY_BUFFER 512 +#ifdef NX_DEBUG_INPUT +extern int nxagentDebugInputDevices; +extern unsigned long nxagentLastInputDevicesDumpTime; + +extern void nxagentDumpInputDevicesState(void); +#endif + /* * Used in the handling of the X desktop * manager protocol. @@ -186,6 +193,18 @@ void nxagentBlockHandler(pointer data, struct timeval **timeout, pointer mask) now = GetTimeInMillis(); + #ifdef NX_DEBUG_INPUT + + if (nxagentDebugInputDevices == 1 && + now - nxagentLastInputDevicesDumpTime > 5000) + { + nxagentLastInputDevicesDumpTime = now; + + nxagentDumpInputDevicesState(); + } + + #endif + if (nxagentNeedConnectionChange() == 1) { #ifdef TEST @@ -508,7 +527,8 @@ void nxagentBlockHandler(pointer data, struct timeval **timeout, pointer mask) synchronize, nxagentReady); #endif - if (nxagentQueuedEvents(nxagentDisplay) > 0) + if (NXDisplayError(nxagentDisplay) == 0 && + nxagentQueuedEvents(nxagentDisplay) > 0) { #ifdef WARNING fprintf(stderr, "nxagentBlockHandler: WARNING! Forcing a null timeout with events queued.\n"); @@ -540,6 +560,8 @@ void nxagentBlockHandler(pointer data, struct timeval **timeout, pointer mask) #endif + nxagentPrintGeometry(); + #ifdef BLOCKS fprintf(stderr, "[End block]\n"); #endif @@ -820,6 +842,8 @@ FIXME: Must queue multiple writes and handle #endif + nxagentPrintGeometry(); + #ifdef BLOCKS fprintf(stderr, "[End block]\n"); #endif diff --git a/nx-X11/programs/Xserver/hw/nxagent/Handlers.h b/nx-X11/programs/Xserver/hw/nxagent/Handlers.h index fc72c7060..fe8aeef36 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Handlers.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Handlers.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Holder.c b/nx-X11/programs/Xserver/hw/nxagent/Holder.c index 087d66017..a9ac77c09 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Holder.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Holder.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Holder.h b/nx-X11/programs/Xserver/hw/nxagent/Holder.h index 6dc2b8ed2..9896aeead 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Holder.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Holder.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Icons.h b/nx-X11/programs/Xserver/hw/nxagent/Icons.h index cb2e08521..4d0e216cd 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Icons.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Icons.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Image.c b/nx-X11/programs/Xserver/hw/nxagent/Image.c index 4e08f6bf1..e8405ed3a 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Image.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Image.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Image.h b/nx-X11/programs/Xserver/hw/nxagent/Image.h index fb77f3c80..7805b0312 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Image.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Image.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Imakefile b/nx-X11/programs/Xserver/hw/nxagent/Imakefile index 633e17a22..51173e410 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Imakefile +++ b/nx-X11/programs/Xserver/hw/nxagent/Imakefile @@ -206,7 +206,8 @@ DEFINES = -g $(OS_DEFINES) $(EXT_DEFINES) $(UPG_DEFINES) \ -DNXAGENT_SPLASH \ -DNXAGENT_ARTSD \ -UNX_DEBUG_INPUT \ - -UPANORAMIX + -UPANORAMIX \ + -UDEBUG_TREE all:: $(OBJS) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Init.c b/nx-X11/programs/Xserver/hw/nxagent/Init.c index 81ed0c43e..64b6583bf 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Init.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Init.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ @@ -74,7 +74,7 @@ is" without express or implied warranty. #undef DEBUG #undef DUMP -#define NXAGENT_VERSION "3.3.0" +#define NXAGENT_VERSION "3.4.0" /* * ProcVector array defined in tables.c. @@ -193,7 +193,7 @@ void InitOutput(ScreenInfo *screenInfo, int argc, char *argv[]) if (serverGeneration <= 1) { fprintf(stderr, "\nNXAGENT - Version " NXAGENT_VERSION "\n\n"); - fprintf(stderr, "Copyright (C) 2001, 2007 NoMachine.\n"); + fprintf(stderr, "Copyright (C) 2001, 2010 NoMachine.\n"); fprintf(stderr, "See http://www.nomachine.com/ for more information.\n\n"); fprintf(stderr, "Info: Agent running with pid '%d'.\n", getpid()); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Init.h b/nx-X11/programs/Xserver/hw/nxagent/Init.h index 63e27bada..576c1a74d 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Init.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Init.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c index 73b4c706a..b0aeabeea 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ @@ -1791,7 +1791,6 @@ void nxagentResetKeycodeConversion(void) { int result; XkbAgentInfoRec info; - XkbDescPtr xkb; result = XkbQueryExtension(nxagentDisplay, &info.Opcode, &info.EventBase, &info.ErrorBase, &info.MajorVersion, diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.h b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.h index 50dd2be78..1a953358a 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c b/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c index ea06913f8..de1da8654 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ @@ -31,6 +31,12 @@ extern Bool nxagentWMIsRunning; extern Bool nxagentIpaq; +#ifdef NX_DEBUG_INPUT +int nxagentDebugInputDevices = 0; +unsigned long nxagentLastInputDevicesDumpTime = 0; +extern void nxagentDeactivateInputDevicesGrabs(); +#endif + /* * Set here the required log level. */ @@ -86,6 +92,18 @@ int nxagentCheckSpecialKeystroke(XKeyEvent *X, enum HandleEventResult *result) { switch (sym) { + #ifdef DEBUG_TREE + + case XK_q: + case XK_Q: + { + *result = doDebugTree; + + break; + } + + #endif /* DEBUG_TREE */ + case XK_t: case XK_T: { @@ -209,6 +227,105 @@ int nxagentCheckSpecialKeystroke(XKeyEvent *X, enum HandleEventResult *result) } #endif + + #ifdef NX_DEBUG_INPUT + + case XK_X: + case XK_x: + { + /* + * Used to test the input devices state. + */ + + if (X -> type == KeyPress) + { + if (nxagentDebugInputDevices == 0) + { + fprintf(stderr, "Info: Turning input devices debug ON.\n"); + + nxagentDebugInputDevices = 1; + } + else + { + fprintf(stderr, "Info: Turning input devices debug OFF.\n"); + + nxagentDebugInputDevices = 0; + + nxagentLastInputDevicesDumpTime = 0; + } + } + + return 1; + } + + case XK_Y: + case XK_y: + { + /* + * Used to deactivate input devices grab. + */ + + if (X -> type == KeyPress) + { + nxagentDeactivateInputDevicesGrabs(); + } + + return 1; + } + + #endif + } + } + else if ((X -> state & nxagentAltMetaMask) && + ((X -> state & (ControlMask | ShiftMask)) == (ControlMask | + ShiftMask))) + { + switch (sym) + { + case XK_Left: + case XK_KP_Left: + { + if (nxagentOption(Rootless) == 0 && + nxagentOption(DesktopResize) == 0) + { + *result = doViewportMoveLeft; + } + + break; + } + case XK_Up: + case XK_KP_Up: + { + if (nxagentOption(Rootless) == 0 && + nxagentOption(DesktopResize) == 0) + { + *result = doViewportMoveUp; + } + + break; + } + case XK_Right: + case XK_KP_Right: + { + if (nxagentOption(Rootless) == 0 && + nxagentOption(DesktopResize) == 0) + { + *result = doViewportMoveRight; + } + + break; + } + case XK_Down: + case XK_KP_Down: + { + if (nxagentOption(Rootless) == 0 && + nxagentOption(DesktopResize) == 0) + { + *result = doViewportMoveDown; + } + + break; + } } } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keystroke.h b/nx-X11/programs/Xserver/hw/nxagent/Keystroke.h index 49a35db1d..e9ca59ff2 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Keystroke.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Keystroke.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/LICENSE b/nx-X11/programs/Xserver/hw/nxagent/LICENSE index f3e15ee70..141ca13ea 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/LICENSE +++ b/nx-X11/programs/Xserver/hw/nxagent/LICENSE @@ -1,4 +1,4 @@ -Copyright (C) 2001, 2007 NoMachine - http://www.nomachine.com/. +Copyright (c) 2001, 2010 NoMachine - http://www.nomachine.com/. NXAGENT and NX extensions to X are copyright of NoMachine. diff --git a/nx-X11/programs/Xserver/hw/nxagent/Literals.h b/nx-X11/programs/Xserver/hw/nxagent/Literals.h index f6aab84e4..377dd7e25 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Literals.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Literals.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Millis.c b/nx-X11/programs/Xserver/hw/nxagent/Millis.c index 38435d9a8..bde85f090 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Millis.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Millis.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Millis.h b/nx-X11/programs/Xserver/hw/nxagent/Millis.h index 8ee380ae1..2125eca3e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Millis.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Millis.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c index 90da743a2..5106ffa8c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c @@ -6,7 +6,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -15,7 +15,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c.NX.original index 90da743a2..5106ffa8c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c.NX.original @@ -6,7 +6,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -15,7 +15,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c b/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c index 83103ffd6..0d8584218 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c @@ -6,7 +6,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -15,7 +15,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c.NX.original index 83103ffd6..0d8584218 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c.NX.original @@ -6,7 +6,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -15,7 +15,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXevents.c b/nx-X11/programs/Xserver/hw/nxagent/NXevents.c index dd607e0ca..cd8ced7a6 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXevents.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXevents.c @@ -6,7 +6,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -15,7 +15,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXevents.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/NXevents.c.NX.original index dd607e0ca..cd8ced7a6 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXevents.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/NXevents.c.NX.original @@ -6,7 +6,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -15,7 +15,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXextension.c b/nx-X11/programs/Xserver/hw/nxagent/NXextension.c index 295b885c2..852ad1503 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXextension.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXextension.c @@ -6,7 +6,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -15,7 +15,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXextension.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/NXextension.c.NX.original index 295b885c2..852ad1503 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXextension.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/NXextension.c.NX.original @@ -6,7 +6,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -15,7 +15,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXglyph.c b/nx-X11/programs/Xserver/hw/nxagent/NXglyph.c index dfd82b76b..55248195f 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXglyph.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXglyph.c @@ -6,7 +6,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -15,7 +15,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXglyph.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/NXglyph.c.NX.original index dfd82b76b..55248195f 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXglyph.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/NXglyph.c.NX.original @@ -6,7 +6,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -15,7 +15,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c b/nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c index 599e4c616..614d2db39 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c @@ -6,7 +6,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -15,7 +15,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c.NX.original index 599e4c616..614d2db39 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c.NX.original @@ -6,7 +6,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -15,7 +15,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXglyphstr.h b/nx-X11/programs/Xserver/hw/nxagent/NXglyphstr.h index 970d0bb4d..08ffb35b0 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXglyphstr.h +++ b/nx-X11/programs/Xserver/hw/nxagent/NXglyphstr.h @@ -6,7 +6,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -15,7 +15,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXglyphstr.h.NX.original b/nx-X11/programs/Xserver/hw/nxagent/NXglyphstr.h.NX.original index 970d0bb4d..08ffb35b0 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXglyphstr.h.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/NXglyphstr.h.NX.original @@ -6,7 +6,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -15,7 +15,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXmiglyph.c b/nx-X11/programs/Xserver/hw/nxagent/NXmiglyph.c index 2521ae5c7..806cf2900 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXmiglyph.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXmiglyph.c @@ -6,7 +6,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -15,7 +15,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXmiglyph.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/NXmiglyph.c.NX.original index 2521ae5c7..806cf2900 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXmiglyph.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/NXmiglyph.c.NX.original @@ -6,7 +6,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -15,7 +15,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c b/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c index 64ba970c9..a9c501b34 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c @@ -6,7 +6,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -15,7 +15,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c.NX.original index 64ba970c9..a9c501b34 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c.NX.original @@ -6,7 +6,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -15,7 +15,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXpicturestr.h b/nx-X11/programs/Xserver/hw/nxagent/NXpicturestr.h index a1790c3f0..26a95fe9f 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXpicturestr.h +++ b/nx-X11/programs/Xserver/hw/nxagent/NXpicturestr.h @@ -6,7 +6,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -15,7 +15,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXpicturestr.h.NX.original b/nx-X11/programs/Xserver/hw/nxagent/NXpicturestr.h.NX.original index a1790c3f0..26a95fe9f 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXpicturestr.h.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/NXpicturestr.h.NX.original @@ -6,7 +6,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -15,7 +15,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c index f5cf91607..14b6136d4 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c @@ -6,7 +6,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -15,7 +15,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c.NX.original index f5cf91607..14b6136d4 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c.NX.original @@ -6,7 +6,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -15,7 +15,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXrandr.c b/nx-X11/programs/Xserver/hw/nxagent/NXrandr.c index 6f53dcdad..b7039e1e0 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXrandr.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXrandr.c @@ -6,7 +6,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -15,7 +15,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXrandr.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/NXrandr.c.NX.original index 6f53dcdad..b7039e1e0 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXrandr.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/NXrandr.c.NX.original @@ -6,7 +6,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -15,7 +15,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c b/nx-X11/programs/Xserver/hw/nxagent/NXrender.c index 20aca4619..0940a3602 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXrender.c @@ -31,7 +31,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -40,7 +40,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/NXrender.c.NX.original index 20aca4619..0940a3602 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/NXrender.c.NX.original @@ -31,7 +31,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -40,7 +40,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c b/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c index 16328f9ab..0954cf8ae 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c @@ -6,7 +6,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -15,7 +15,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c.NX.original index 16328f9ab..0954cf8ae 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c.NX.original @@ -6,7 +6,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -15,7 +15,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXxrandr.c b/nx-X11/programs/Xserver/hw/nxagent/NXxrandr.c index 91dafb6c6..8d05175ff 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXxrandr.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXxrandr.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXxrandr.h b/nx-X11/programs/Xserver/hw/nxagent/NXxrandr.h index 3fb504ea9..4e800e96d 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXxrandr.h +++ b/nx-X11/programs/Xserver/hw/nxagent/NXxrandr.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXxrandrint.h b/nx-X11/programs/Xserver/hw/nxagent/NXxrandrint.h index 33b05b1f0..ae3a03d86 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXxrandrint.h +++ b/nx-X11/programs/Xserver/hw/nxagent/NXxrandrint.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Options.c b/nx-X11/programs/Xserver/hw/nxagent/Options.c index 64dbe3b42..1f04b0daf 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Options.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Options.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ @@ -38,6 +38,11 @@ AgentOptionsRec nxagentOptionsBackup; AgentOptionsPtr nxagentOptionsPtr = &nxagentOptions; +/* + * If this is set, print the geometry in the block handler. + */ + +unsigned int nxagentPrintGeometryFlags = 0; /* * This must be called at startup to initialize * the options repository to the default values. @@ -58,6 +63,9 @@ void nxagentInitOptions() nxagentOptions.Height = 0; nxagentOptions.BorderWidth = 0; + nxagentOptions.WMBorderWidth = -1; + nxagentOptions.WMTitleHeight = -1; + nxagentOptions.SavedX = 0; nxagentOptions.SavedY = 0; nxagentOptions.SavedWidth = 0; @@ -163,6 +171,9 @@ void nxagentResetOptions() nxagentOptions.TileWidth = UNDEFINED; nxagentOptions.TileHeight = UNDEFINED; + + nxagentOptions.WMBorderWidth = -1; + nxagentOptions.WMTitleHeight = -1; } void nxagentSaveOptions() diff --git a/nx-X11/programs/Xserver/hw/nxagent/Options.h b/nx-X11/programs/Xserver/hw/nxagent/Options.h index aa78489b1..1bc7eaa4c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Options.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Options.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ @@ -29,6 +29,8 @@ #define UNDEFINED -1 #define COPY_UNLIMITED -1 +extern unsigned int nxagentPrintGeometryFlags; + typedef enum _BackingStoreMode { BackingStoreUndefined = -1, @@ -124,6 +126,9 @@ typedef struct _AgentOptions * screen. */ + int WMBorderWidth; + int WMTitleHeight; + int SavedX; int SavedY; int SavedWidth; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Pixels.c b/nx-X11/programs/Xserver/hw/nxagent/Pixels.c index 03970a14f..10c705dfc 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Pixels.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Pixels.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Pixels.h b/nx-X11/programs/Xserver/hw/nxagent/Pixels.h index f9f88233e..ea7c375ee 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Pixels.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Pixels.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ @@ -108,6 +108,12 @@ FIXME: The condition checking for the render avoid problems with the render composi- te on XFree86 remote server. */ +/* +FIXME: Changed macro: NXAGENT_SHOULD_DEFER_COMPOSITE + to handle situation, when pSrc -> pDrawable + is NULL. This case happens with gradients + and solid fill. + #define NXAGENT_SHOULD_DEFER_COMPOSITE(pSrc, pMask, pDst) \ ((nxagentRenderVersionMajor == 0 && \ nxagentRenderVersionMinor == 8 && \ @@ -118,6 +124,18 @@ FIXME: The condition checking for the render nxagentOption(DeferLevel) == 1) || \ (nxagentOption(DeferLevel) >= 2 && \ nxagentOption(LinkType) < LINK_TYPE_ADSL)) +*/ +#define NXAGENT_SHOULD_DEFER_COMPOSITE(pSrc, pMask, pDst) \ + ((nxagentRenderVersionMajor == 0 && \ + nxagentRenderVersionMinor == 8 && \ + (pDst) -> pDrawable -> type == DRAWABLE_PIXMAP) || \ + (nxagentOption(DeferLevel) >= 2 && \ + nxagentOption(LinkType) < LINK_TYPE_ADSL) || \ + (nxagentOption(DeferLevel) == 1 && \ + (pDst) -> pDrawable -> type == DRAWABLE_PIXMAP && \ + (((pSrc) -> pDrawable && nxagentDrawableStatus((pSrc) -> pDrawable) == NotSynchronized) || \ + ((pMask) && nxagentDrawableStatus((pMask) -> pDrawable) == NotSynchronized)))) + #define NXAGENT_SHOULD_DEFER_PUTIMAGE(pDrawable) \ (nxagentSplitTrap == 0 && \ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c b/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c index 4aea92e2d..1718c7363 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Pixmaps.h b/nx-X11/programs/Xserver/hw/nxagent/Pixmaps.h index 5cf340d36..234650dd4 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Pixmaps.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Pixmaps.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Pointer.c b/nx-X11/programs/Xserver/hw/nxagent/Pointer.c index f53dfbe52..9c1bfaace 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Pointer.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Pointer.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ @@ -57,6 +57,13 @@ is" without express or implied warranty. #undef TEST #undef DEBUG +/* + * The nxagentReversePointerMap array is used to + * memorize remote display pointer map. + */ + +unsigned char nxagentReversePointerMap[MAXBUTTONS]; + void nxagentChangePointerControl(DeviceIntPtr pDev, PtrCtrl *ctrl) { /* @@ -125,6 +132,8 @@ int nxagentPointerProc(DeviceIntPtr pDev, int onoff) return Success; } + nxagentInitPointerMap(); + nxagentEnablePointerEvents(); break; @@ -155,3 +164,28 @@ int nxagentPointerProc(DeviceIntPtr pDev, int onoff) return Success; } + +void nxagentInitPointerMap(void) +{ + int numButtons; + + int i; + + unsigned char pointerMap[MAXBUTTONS]; + + #ifdef DEBUG + fprintf(stderr, "nxagentInitPointerMap: Going to retrieve the " + "pointer map from remote display.\n"); + #endif + + numButtons = XGetPointerMapping(nxagentDisplay, pointerMap, MAXBUTTONS); + + /* + * Computing revers pointer map. + */ + + for (i = 1; i <= numButtons; i++) + { + nxagentReversePointerMap[pointerMap[i - 1] - 1] = i; + } +} diff --git a/nx-X11/programs/Xserver/hw/nxagent/Pointer.h b/nx-X11/programs/Xserver/hw/nxagent/Pointer.h index 2adee6cb3..b0bb3f99c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Pointer.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Pointer.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ @@ -38,8 +38,17 @@ is" without express or implied warranty. (ButtonPressMask | ButtonReleaseMask | PointerMotionMask | \ EnterWindowMask | LeaveWindowMask) +/* + * The nxagentReversePointerMap array is used to + * memorize remote display pointer map. + */ + +extern unsigned char nxagentReversePointerMap[MAXBUTTONS]; + void nxagentChangePointerControl(DeviceIntPtr pDev, PtrCtrl *ctrl); int nxagentPointerProc(DeviceIntPtr pDev, int onoff); +void nxagentInitPointerMap(void); + #endif /* __Pointer_H__ */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c index 69b73a942..e63b481b2 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ @@ -81,6 +81,8 @@ extern Bool nxagentUninstallFontServerPath(void); extern void nxagentRemoveXConnection(void); +extern void nxagentInitPointerMap(void); + static char *nxagentGetReconnectError(void); void nxagentInitializeRecLossyLevel(void); @@ -257,7 +259,11 @@ TODO: This should be reset only when if ((dispatchException & DE_TERMINATE) == 0) { + #ifdef NX_DEBUG_INPUT + fprintf(stderr, "Session: Session suspended at '%s' timestamp [%lu].\n", GetTimeAsString(), GetTimeInMillis()); + #else fprintf(stderr, "Session: Session suspended at '%s'.\n", GetTimeAsString()); + #endif } nxagentResetDisplayHandlers(); @@ -580,6 +586,8 @@ Bool nxagentReconnectSession(void) nxagentOldKeyboard = NULL; } + nxagentInitPointerMap(); + nxagentDeactivatePointerGrab(); nxagentWakeupByReconnect(); @@ -609,7 +617,11 @@ Bool nxagentReconnectSession(void) goto nxagentReconnectError; } + #ifdef NX_DEBUG_INPUT + fprintf(stderr, "Session: Session resumed at '%s' timestamp [%lu].\n", GetTimeAsString(), GetTimeInMillis()); + #else fprintf(stderr, "Session: Session resumed at '%s'.\n", GetTimeAsString()); + #endif nxagentRemoveSplashWindow(NULL); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.h b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.h index 0a2a8a6a7..12d0742df 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Render.c b/nx-X11/programs/Xserver/hw/nxagent/Render.c index f2d7b15f9..4f0f76474 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Render.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Render.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ @@ -147,8 +147,6 @@ void nxagentCursorPostSaveRenderInfo(CursorPtr pCursor, ScreenPtr pScreen, int nxagentCreatePicture(PicturePtr pPicture, Mask mask); -void nxagentDestroyPicture(PicturePtr pPicture); - int nxagentChangePictureClip(PicturePtr pPicture, int clipType, int nRects, xRectangle *rects, int xOrigin, int yOrigin); @@ -1010,12 +1008,15 @@ void nxagentComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pD #ifdef DEBUG - fprintf(stderr, "nxagentComposite: Source Picture [%lu][%p] with drawable [%s%s][%p].\n", - nxagentPicturePriv(pSrc) -> picture, (void *) pSrc, - (pSrc -> pDrawable -> type == DRAWABLE_PIXMAP && - nxagentIsShmPixmap((PixmapPtr) pSrc -> pDrawable)) ? "Shared " : "", - pSrc -> pDrawable -> type == DRAWABLE_PIXMAP ? "Pixmap" : "Window", - (void *) pSrc -> pDrawable); + if (pSrc -> pDrawable != NULL) + { + fprintf(stderr, "nxagentComposite: Source Picture [%lu][%p] with drawable [%s%s][%p].\n", + nxagentPicturePriv(pSrc) -> picture, (void *) pSrc, + (pSrc -> pDrawable -> type == DRAWABLE_PIXMAP && + nxagentIsShmPixmap((PixmapPtr) pSrc -> pDrawable)) ? "Shared " : "", + pSrc -> pDrawable -> type == DRAWABLE_PIXMAP ? "Pixmap" : "Window", + (void *) pSrc -> pDrawable); + } fprintf(stderr, "nxagentComposite: Destination Picture [%lu][%p] with drawable [%s%s][%p].\n", nxagentPicturePriv(pDst) -> picture, (void *) pDst, @@ -1064,16 +1065,19 @@ void nxagentComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pD * the wrong data. */ - nxagentSynchronizeShmPixmap(pSrc -> pDrawable, xSrc, ySrc, width, height); - - if (nxagentDrawableStatus(pSrc -> pDrawable) == NotSynchronized) + if (pSrc -> pDrawable != NULL) { - #ifdef TEST - fprintf(stderr, "nxagentComposite: Synchronizing the source drawable [%p].\n", - (void *) pSrc -> pDrawable); - #endif + nxagentSynchronizeShmPixmap(pSrc -> pDrawable, xSrc, ySrc, width, height); - nxagentSynchronizeDrawable(pSrc -> pDrawable, DO_WAIT, NEVER_BREAK, NULL); + if (nxagentDrawableStatus(pSrc -> pDrawable) == NotSynchronized) + { + #ifdef TEST + fprintf(stderr, "nxagentComposite: Synchronizing the source drawable [%p].\n", + (void *) pSrc -> pDrawable); + #endif + + nxagentSynchronizeDrawable(pSrc -> pDrawable, DO_WAIT, NEVER_BREAK, NULL); + } } if (pDst -> pDrawable != pSrc -> pDrawable) @@ -2811,3 +2815,248 @@ Bool nxagentDisconnectAllPicture() return True; } +void nxagentRenderCreateSolidFill(PicturePtr pPicture, xRenderColor *color) +{ + Picture id; + + if (nxagentRenderEnable == False) + { + return; + } + + #ifdef DEBUG + + fprintf(stderr, "nxagentRenderCreateSolidFill: Got called.\n"); + + if (pPicture == NULL) + { + fprintf(stderr, "nxagentRenderCreateSolidFill: WARNING! pPicture pointer is NULL.\n"); + } + + if (color == NULL) + { + fprintf(stderr, "nxagentRenderCreateSolidFill: WARNING! color pointer is NULL.\n"); + } + + #endif /* #ifdef DEBUG */ + + memset(&(nxagentPicturePriv(pPicture) -> lastServerValues), 0, + sizeof(XRenderPictureAttributes_)); + + id = XRenderCreateSolidFill(nxagentDisplay, (XRenderColor *) color); + + #ifdef DEBUG + XSync(nxagentDisplay, 0); + #endif + + #ifdef TEST + fprintf(stderr, "nxagentRenderCreateSolidFill: Created solid fill xid [%lu].\n", id); + #endif + + nxagentPicturePriv(pPicture) -> picture = id; +} + +void nxagentRenderCreateLinearGradient(PicturePtr pPicture, xPointFixed *p1, + xPointFixed *p2, int nStops, + xFixed *stops, + xRenderColor *colors) +{ + Picture id; + + XLinearGradient linearGradient; + + if (nxagentRenderEnable == False) + { + return; + } + + #ifdef DEBUG + + fprintf(stderr, "nxagentRenderCreateLinearGradient: Got called.\n"); + + if (pPicture == NULL) + { + fprintf(stderr, "nxagentRenderCreateLinearGradient: WARNING! pPicture pointer is NULL.\n"); + } + + if (p1 == NULL) + { + fprintf(stderr, "nxagentRenderCreateLinearGradient: WARNING! p1 pointer is NULL.\n"); + } + + if (p2 == NULL) + { + fprintf(stderr, "nxagentRenderCreateLinearGradient: WARNING! p2 pointer is NULL.\n"); + } + + if (stops == NULL) + { + fprintf(stderr, "nxagentRenderCreateLinearGradient: WARNING! stops pointer is NULL.\n"); + } + + if (colors == NULL) + { + fprintf(stderr, "nxagentRenderCreateLinearGradient: WARNING! colors pointer is NULL.\n"); + } + + #endif /* #ifdef DEBUG */ + + memset(&(nxagentPicturePriv(pPicture) -> lastServerValues), 0, + sizeof(XRenderPictureAttributes_)); + + linearGradient.p1.x = (XFixed) p1 -> x; + linearGradient.p1.y = (XFixed) p1 -> y; + linearGradient.p2.x = (XFixed) p2 -> x; + linearGradient.p2.y = (XFixed) p2 -> y; + + id = XRenderCreateLinearGradient(nxagentDisplay, &linearGradient, + (XFixed *) stops, + (XRenderColor *) colors, nStops); + + #ifdef DEBUG + XSync(nxagentDisplay, 0); + #endif + + #ifdef TEST + fprintf(stderr, "nxagentRenderCreateLinearGradient: Created linear gradient xid [%lu].\n", id); + #endif + + nxagentPicturePriv(pPicture) -> picture = id; +} + +void nxagentRenderCreateRadialGradient(PicturePtr pPicture, xPointFixed *inner, + xPointFixed *outer, + xFixed innerRadius, + xFixed outerRadius, + int nStops, + xFixed *stops, + xRenderColor *colors) +{ + Picture id; + + XRadialGradient radialGradient; + + if (nxagentRenderEnable == False) + { + return; + } + + #ifdef DEBUG + + fprintf(stderr, "nxagentRenderCreateRadialGradient: Got called.\n"); + + if (pPicture == NULL) + { + fprintf(stderr, "nxagentRenderCreateRadialGradient: WARNING! pPicture pointer is NULL.\n"); + } + + if (inner == NULL) + { + fprintf(stderr, "nxagentRenderCreateRadialGradient: WARNING! inner pointer is NULL.\n"); + } + + if (outer == NULL) + { + fprintf(stderr, "nxagentRenderCreateRadialGradient: WARNING! outer pointer is NULL.\n"); + } + + if (stops == NULL) + { + fprintf(stderr, "nxagentRenderCreateRadialGradient: WARNING! stops pointer is NULL.\n"); + } + + if (colors == NULL) + { + fprintf(stderr, "nxagentRenderCreateRadialGradient: WARNING! colors pointer is NULL.\n"); + } + + #endif /* #ifdef DEBUG */ + + memset(&(nxagentPicturePriv(pPicture) -> lastServerValues), 0, + sizeof(XRenderPictureAttributes_)); + + radialGradient.inner.x = (XFixed) inner -> x; + radialGradient.inner.y = (XFixed) inner -> y; + radialGradient.inner.radius = (XFixed) innerRadius; + radialGradient.outer.x = (XFixed) outer -> x; + radialGradient.outer.y = (XFixed) outer -> y; + radialGradient.outer.radius = (XFixed) outerRadius; + + id = XRenderCreateRadialGradient(nxagentDisplay, &radialGradient, + (XFixed *) stops, + (XRenderColor *) colors, nStops); + + #ifdef DEBUG + XSync(nxagentDisplay, 0); + #endif + + #ifdef TEST + fprintf(stderr, "nxagentRenderCreateRadialGradient: Created radial gradient xid [%lu].\n", id); + #endif + + nxagentPicturePriv(pPicture) -> picture = id; +} + +void nxagentRenderCreateConicalGradient(PicturePtr pPicture, + xPointFixed *center, + xFixed angle, int nStops, + xFixed *stops, + xRenderColor *colors) +{ + Picture id; + + XConicalGradient conicalGradient; + + if (nxagentRenderEnable == False) + { + return; + } + + #ifdef DEBUG + + fprintf(stderr, "nxagentRenderCreateConicalGradient: Got called.\n"); + + if (pPicture == NULL) + { + fprintf(stderr, "nxagentRenderCreateConicalGradient: WARNING! pPicture pointer is NULL.\n"); + } + + if (center == NULL) + { + fprintf(stderr, "nxagentRenderCreateConicalGradient: WARNING! center pointer is NULL.\n"); + } + + if (stops == NULL) + { + fprintf(stderr, "nxagentRenderCreateConicalGradient: WARNING! stops pointer is NULL.\n"); + } + + if (colors == NULL) + { + fprintf(stderr, "nxagentRenderCreateConicalGradient: WARNING! colors pointer is NULL.\n"); + } + + #endif /* #ifdef DEBUG */ + + memset(&(nxagentPicturePriv(pPicture) -> lastServerValues), 0, + sizeof(XRenderPictureAttributes_)); + + conicalGradient.center.x = (XFixed) center -> x; + conicalGradient.center.y = (XFixed) center -> y; + conicalGradient.angle = (XFixed) angle; + + id = XRenderCreateConicalGradient(nxagentDisplay, &conicalGradient, + (XFixed *) stops, + (XRenderColor *) colors, nStops); + + #ifdef DEBUG + XSync(nxagentDisplay, 0); + #endif + + #ifdef TEST + fprintf(stderr, "nxagentRenderCreateConicalGradient: Created conical gradient xid [%lu].\n", id); + #endif + + nxagentPicturePriv(pPicture) -> picture = id; +} + diff --git a/nx-X11/programs/Xserver/hw/nxagent/Render.h b/nx-X11/programs/Xserver/hw/nxagent/Render.h index 240dc3901..4346a4e1e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Render.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Render.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ @@ -105,4 +105,6 @@ void nxagentDisconnectPicture(pointer p0, XID x1, void* p2); void nxagentReconnectGlyphSet(void* p0, XID x1, void *p2); +void nxagentDestroyPicture(PicturePtr pPicture); + #endif /* __Render_H__ */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Rootless.c b/nx-X11/programs/Xserver/hw/nxagent/Rootless.c index 79cb74efa..612e71cf7 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Rootless.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Rootless.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ @@ -60,6 +60,27 @@ typedef struct } nxagentWMHints; +/* + * This structure is compatible with 32 + * and 64 bit library interface. It has + * been copied from Xatomtype.h and it's + * a parameter of XChangeProperty(). + */ + +typedef struct +{ + unsigned long flags; + long input; + long initialState; + unsigned long iconPixmap; + unsigned long iconWindow; + long iconX; + long iconY; + unsigned long iconMask; + unsigned long windowGroup; +} +nxagentPropWMHints; + WindowPtr nxagentRootlessWindow = NULL; #define TOP_LEVEL_TABLE_UNIT 100 @@ -429,6 +450,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) Atom propertyX, typeX; char *output = NULL; nxagentWMHints wmHints; + nxagentPropWMHints propHints; Bool export = False; Bool freeMem = False; @@ -489,8 +511,22 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) wmHints.flags |= InputHint; wmHints.input = True; - output = (char*) &wmHints; - export = True; + /* + * Initialize the structure used in XChangeProperty(). + */ + + propHints.flags = wmHints.flags; + propHints.input = (wmHints.input == True ? 1 : 0); + propHints.initialState = wmHints.initial_state; + propHints.iconPixmap = wmHints.icon_pixmap; + propHints.iconWindow = wmHints.icon_window; + propHints.iconX = wmHints.icon_x; + propHints.iconY = wmHints.icon_y; + propHints.iconMask = wmHints.icon_mask; + propHints.windowGroup = wmHints.window_group; + + output = (char*) &propHints; + export = True; if ((wmHints.flags & IconPixmapHint) && (wmHints.icon_pixmap != None)) { @@ -504,17 +540,17 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) nxagentSynchronizeRegion((DrawablePtr) icon, NullRegion, NEVER_BREAK, NULL); } - wmHints.icon_pixmap = nxagentPixmap(icon); + propHints.iconPixmap = nxagentPixmap(icon); } else { - wmHints.flags &= ~IconPixmapHint; + propHints.flags &= ~IconPixmapHint; #ifdef WARNING fprintf(stderr, "nxagentExportProperty: WARNING! Failed to look up icon pixmap %x from hint " "exporting property %s type %s on window %p.\n", (unsigned int) wmHints.icon_pixmap, propertyS, typeS, - (void*)pWin); + (void *) pWin); #endif } } @@ -526,17 +562,17 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) if (icon) { - wmHints.icon_window = nxagentWindow(icon); + propHints.iconWindow = nxagentWindow(icon); } else { - wmHints.flags &= ~IconWindowHint; + propHints.flags &= ~IconWindowHint; #ifdef WARNING fprintf(stderr, "nxagentExportProperty: WARNING! Failed to look up icon window %x from hint " "exporting property %s type %s on window %p.\n", (unsigned int) wmHints.icon_window, propertyS, typeS, - (void*)pWin); + (void *) pWin); #endif } } @@ -548,17 +584,17 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) if (icon) { - wmHints.icon_mask = nxagentPixmap(icon); + propHints.iconMask = nxagentPixmap(icon); } else { - wmHints.flags &= ~IconMaskHint; + propHints.flags &= ~IconMaskHint; #ifdef WARNING fprintf(stderr, "nxagentExportProperty: WARNING! Failed to look up icon mask %x from hint " "exporting property %s type %s on window %p.\n", (unsigned int) wmHints.icon_mask, propertyS, typeS, - (void*)pWin); + (void *) pWin); #endif } } @@ -570,17 +606,17 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) if (window) { - wmHints.window_group = nxagentWindow(window); + propHints.windowGroup = nxagentWindow(window); } else { - wmHints.flags &= ~WindowGroupHint; + propHints.flags &= ~WindowGroupHint; #ifdef WARNING fprintf(stderr, "nxagentExportProperty: WARNING! Failed to look up window group %x from hint " "exporting property %s type %s on window %p.\n", (unsigned int) wmHints.window_group, propertyS, typeS, - (void*)pWin); + (void *) pWin); #endif } } @@ -590,6 +626,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) XlibAtom *atoms = malloc(nUnits * sizeof(*atoms)); Atom *input = value; int i; + int j = 0; freeMem = True; export = True; @@ -597,16 +634,40 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) for (i = 0; i < nUnits; i++) { - atoms[i] = nxagentLocalToRemoteAtom(input[i]); - - if (atoms[i] == None) - { - #ifdef WARNING - fprintf(stderr, "nxagentExportProperty: WARNING! Failed to convert local atom %ld [%s].\n", - (long int) input[i], validateString(NameForAtom(input[i]))); - #endif - } + /* + * Exporting the _NET_WM_PING property could + * result in rootless windows being grayed out + * when the compiz window manager is running. + * + * Better solution would probably be to handle + * the communication with the window manager + * instead of just getting rid of the property. + */ + + if (strcmp(NameForAtom(input[i]), "_NET_WM_PING") != 0) + { + atoms[j] = nxagentLocalToRemoteAtom(input[i]); + + if (atoms[j] == None) + { + #ifdef WARNING + fprintf(stderr, "nxagentExportProperty: WARNING! Failed to convert local atom %ld [%s].\n", + (long int) input[i], validateString(NameForAtom(input[i]))); + #endif + } + + j++; + } + #ifdef TEST + else + { + fprintf(stderr, "nxagentExportProperty: WARNING! " + "Not exporting the _NET_WM_PING property.\n"); + } + #endif } + + nUnits = j; } else if (strcmp(typeS, "WINDOW") == 0) { diff --git a/nx-X11/programs/Xserver/hw/nxagent/Rootless.h b/nx-X11/programs/Xserver/hw/nxagent/Rootless.h index 90d25d0c1..ece4c9d31 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Rootless.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Rootless.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index 524bafd10..2db7df8fe 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ @@ -160,7 +160,6 @@ void nxagentPropagateArtsdProperties(ScreenPtr pScreen, char *port); #endif -Window nxagentIconWindow = None; Window nxagentFullscreenWindow = None; #ifdef VIEWPORT_FRAME @@ -288,166 +287,6 @@ void nxagentSetPixmapFormats(ScreenInfo *screenInfo) } } -void nxagentMinimizeFromFullScreen(ScreenPtr pScreen) -{ - XUnmapWindow(nxagentDisplay, nxagentFullscreenWindow); - - if(nxagentIpaq) - { - XMapWindow(nxagentDisplay, nxagentIconWindow); - XIconifyWindow(nxagentDisplay, nxagentIconWindow, - DefaultScreen(nxagentDisplay)); - } - else - { - XIconifyWindow(nxagentDisplay, nxagentIconWindow, - DefaultScreen(nxagentDisplay)); - } -} - -void nxagentMaximizeToFullScreen(ScreenPtr pScreen) -{ - if(nxagentIpaq) - { - XUnmapWindow(nxagentDisplay, nxagentIconWindow); - - XMapWindow(nxagentDisplay, nxagentFullscreenWindow); - } - else - { -/* - XUnmapWindow(nxagentDisplay, nxagentIconWindow); -*/ -/* -FIXME: We'll chech for ReparentNotify and LeaveNotify events after XReparentWindow() - in order to avoid the session window is iconified. - We could avoid the sesssion window is iconified when a LeaveNotify event is received, - so this check would be unnecessary. -*/ - struct timeval timeout; - int i; - XEvent e; - - XReparentWindow(nxagentDisplay, nxagentFullscreenWindow, - RootWindow(nxagentDisplay, DefaultScreen(nxagentDisplay)), 0, 0); - - for (i = 0; i < 100 && nxagentWMIsRunning; i++) - { - #ifdef TEST - fprintf(stderr, "nxagentSwitchFullscreen: WARNING! Going to wait for the ReparentNotify event.\n"); - #endif - - if (XCheckTypedWindowEvent(nxagentDisplay, nxagentFullscreenWindow, ReparentNotify, &e)) - { - break; - } - - XSync(nxagentDisplay, 0); - - timeout.tv_sec = 0; - timeout.tv_usec = 50 * 1000; - - nxagentWaitEvents(nxagentDisplay, &timeout); - } - - XMapRaised(nxagentDisplay, nxagentFullscreenWindow); - - XIconifyWindow(nxagentDisplay, nxagentIconWindow, - DefaultScreen(nxagentDisplay)); - - while (XCheckTypedWindowEvent(nxagentDisplay, nxagentFullscreenWindow, LeaveNotify, &e)); -/* - XMapWindow(nxagentDisplay, nxagentIconWindow); -*/ - } -} - -Window nxagentCreateIconWindow() -{ - XSetWindowAttributes attributes; - unsigned long valuemask; - char* window_name; - XTextProperty windowName; - XSizeHints sizeHints; - XWMHints wmHints; - Window w; - Mask mask; - - /* - * Create icon window. - */ - - attributes.override_redirect = False; - attributes.colormap = DefaultColormap(nxagentDisplay, DefaultScreen(nxagentDisplay)); - attributes.background_pixmap = nxagentScreenSaverPixmap; - valuemask = CWOverrideRedirect | CWBackPixmap | CWColormap; - - #ifdef TEST - fprintf(stderr, "nxagentCreateIconWindow: Going to create new icon window.\n"); - #endif - - w = XCreateWindow(nxagentDisplay, DefaultRootWindow(nxagentDisplay), - 0, 0, 1, 1, 0, - DefaultDepth(nxagentDisplay, DefaultScreen(nxagentDisplay)), - InputOutput, - DefaultVisual(nxagentDisplay, DefaultScreen(nxagentDisplay)), - valuemask, &attributes); - - #ifdef TEST - fprintf(stderr, "nxagentCreateIconWindow: Created new icon window with id [%ld].\n", - nxagentIconWindow); - #endif - - /* - * Set hints to the window manager for the icon window. - */ - - window_name = nxagentWindowName; - XStringListToTextProperty(&window_name, 1, &windowName); - sizeHints.flags = PMinSize | PMaxSize; - sizeHints.min_width = sizeHints.max_width = 1; - sizeHints.min_height = sizeHints.max_height = 1; - wmHints.flags = IconPixmapHint | IconMaskHint; - wmHints.initial_state = IconicState; - wmHints.icon_pixmap = nxagentIconPixmap; - - if (useXpmIcon) - { - wmHints.icon_mask = nxagentIconShape; - wmHints.flags = IconPixmapHint | IconMaskHint; - } - else - { - wmHints.flags = StateHint | IconPixmapHint; - } - - XSetWMProperties(nxagentDisplay, w, - &windowName, &windowName, - NULL , 0 , &sizeHints, &wmHints, NULL); - - /* - * Enable events from the icon window. - */ - - nxagentGetDefaultEventMask(&mask); - - XSelectInput(nxagentDisplay, w, (mask & ~(KeyPressMask | - KeyReleaseMask)) | StructureNotifyMask); - - /* - * Notify to client if user closes icon window. - */ - - if (nxagentWMIsRunning && !nxagentOption(Rootless)) - { - XlibAtom deleteWMAtom = nxagentAtoms[2]; /* WM_DELETE_WINDOW */ - - XSetWMProtocols(nxagentDisplay, w, &deleteWMAtom, 1); - } - - return w; -} - Bool nxagentMagicPixelZone(int x, int y) { return (x >= nxagentOption(Width) - 1 && y < 1); @@ -977,6 +816,8 @@ Bool nxagentOpenScreen(int index, ScreenPtr pScreen, nxagentChangeOption(Fullscreen, False); + nxagentFullscreenWindow = 0; + resetAgentPosition = True; } @@ -1382,8 +1223,6 @@ N/A if (nxagentOption(Fullscreen)) { - attributes.override_redirect = True; - /* * We need to disable the host's screensaver or * it will otherwise grab the screen even if it @@ -1609,8 +1448,7 @@ N/A if (nxagentDoFullGeneration == 1 || nxagentReconnectTrap == 1) { - valuemask = CWBackPixel | CWEventMask | CWColormap | - (nxagentOption(Fullscreen) == 1 ? CWOverrideRedirect : 0); + valuemask = CWBackPixel | CWEventMask | CWColormap; attributes.background_pixel = nxagentBlackPixel; @@ -1620,8 +1458,6 @@ N/A if (nxagentOption(Fullscreen) == 1) { - attributes.override_redirect = True; - if (nxagentReconnectTrap) { /* @@ -1754,7 +1590,7 @@ N/A sizeHints.width = nxagentOption(RootWidth); sizeHints.height = nxagentOption(RootHeight); - if (nxagentOption(DesktopResize) == 1) + if (nxagentOption(DesktopResize) == 1 || nxagentOption(Fullscreen) == 1) { sizeHints.max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); sizeHints.max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); @@ -1799,37 +1635,6 @@ N/A XClearWindow(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum]); - if (nxagentOption(Fullscreen)) - { - valuemask = CWBackPixmap | CWColormap | CWOverrideRedirect; - } - else - { - valuemask = CWBackPixmap | CWColormap; - } - - attributes.background_pixmap = nxagentScreenSaverPixmap; - attributes.colormap = DefaultColormap(nxagentDisplay, DefaultScreen(nxagentDisplay)); - - if (nxagentOption(Fullscreen)) - { - attributes.override_redirect = False; - if (nxagentReconnectTrap) - { - XGrabKeyboard(nxagentDisplay, nxagentFullscreenWindow, True, GrabModeAsync, - GrabModeAsync, CurrentTime); - } - } - - if (nxagentOption(Fullscreen)) - { - nxagentIconWindow = nxagentCreateIconWindow(); - } - else - { - nxagentIconWindow = 0; - } - /* * When we don't have window manager we grab keyboard * to let nxagent get keyboard events. @@ -1880,13 +1685,6 @@ N/A */ XSetWMProtocols(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum], &deleteWMatom, 1); - - /* - if (nxagentOption(Fullscreen)) - { - XSetWMProtocols(nxagentDisplay, nxagentIconWindow, &deleteWMatom, 1); - } - */ } else { @@ -2266,13 +2064,10 @@ FIXME: We should try to restore the previously if (nxagentOption(Fullscreen)) { - nxagentChangeOption(Width, WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay))); - nxagentChangeOption(Height, HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay))); - - nxagentChangeOption(RootX, (WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)) - - nxagentOption(RootWidth)) / 2); - nxagentChangeOption(RootY, (HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)) - - nxagentOption(RootHeight)) / 2); + nxagentChangeOption(RootX, (nxagentOption(Width) - + nxagentOption(RootWidth)) / 2); + nxagentChangeOption(RootY, (nxagentOption(Height) - + nxagentOption(RootHeight)) / 2); } else { @@ -2283,62 +2078,6 @@ FIXME: We should try to restore the previously nxagentChangeOption(ViewportXSpan, nxagentOption(Width) - nxagentOption(RootWidth)); nxagentChangeOption(ViewportYSpan, nxagentOption(Height) - nxagentOption(RootHeight)); - /* - * Change agent window size and size hints. - */ - - sizeHints.flags = PPosition | PMinSize | PMaxSize; - sizeHints.x = nxagentOption(X); - sizeHints.y = nxagentOption(Y); - - sizeHints.min_width = MIN_NXAGENT_WIDTH; - sizeHints.min_height = MIN_NXAGENT_HEIGHT; - sizeHints.width = width; - sizeHints.height = height; - - if (nxagentOption(DesktopResize) == 1) - { - sizeHints.max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); - sizeHints.max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); - } - else - { - sizeHints.max_width = nxagentOption(RootWidth); - sizeHints.max_height = nxagentOption(RootHeight); - } - - if (nxagentUserGeometry.flag & XValue || nxagentUserGeometry.flag & YValue) - { - sizeHints.flags |= USPosition; - } - - if (nxagentUserGeometry.flag & WidthValue || nxagentUserGeometry.flag & HeightValue) - { - sizeHints.flags |= USSize; - } - - XSetWMNormalHints(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum], &sizeHints); - - if (nxagentOption(Fullscreen)) - { - XResizeWindow(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum], - WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)), - HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay))); - - XResizeWindow(nxagentDisplay, nxagentInputWindows[pScreen -> myNum], - WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)), - HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay))); - } - else - { - XResizeWindow(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum], width, height); - - if (nxagentOption(Rootless) == 0) - { - XResizeWindow(nxagentDisplay, nxagentInputWindows[pScreen -> myNum], width, height); - } - } - /* * Set properties for the agent root window. */ @@ -2360,8 +2099,6 @@ FIXME: We should try to restore the previously (*pScreen -> PositionWindow)(WindowTable[pScreen -> myNum], 0, 0); - pRootWinSize = &WindowTable[pScreen -> myNum] -> winSize; - nxagentSetRootClip(pScreen, 1); XMoveWindow(nxagentDisplay, nxagentWindow(WindowTable[0]), @@ -2369,12 +2106,17 @@ FIXME: We should try to restore the previously nxagentMoveViewport(pScreen, 0, 0); + /* + * Update pointer bounds. + */ + + ScreenRestructured(pScreen); + #ifdef TEST nxagentPrintAgentGeometry("After Resize Screen", "nxagentResizeScreen:"); #endif - fprintf(stderr, "Info: Screen [%d] resized to geometry [%dx%d].\n", - pScreen -> myNum, width, height); + nxagentSetPrintGeometry(pScreen -> myNum); return 1; @@ -2451,9 +2193,10 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin) #endif #ifdef TEST - fprintf(stderr, "Info: Init shadow session. nxagentDisplayName [%s] nxagentDisplay " - "[%p] nxagentShadowDisplayName [%s].\n", nxagentDisplayName, - (void *) nxagentDisplay, nxagentShadowDisplayName); + fprintf(stderr, "Info: Init shadow session. nxagentDisplayName [%s] " + "nxagentDisplay [%p] nxagentShadowDisplayName [%s].\n", + nxagentDisplayName, (void *) nxagentDisplay, + nxagentShadowDisplayName); #endif if (nxagentKeyboard != NULL) @@ -2463,7 +2206,7 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin) if(nxagentKeyboard[i] == 0 || nxagentKeyboard[i + 1] == 0 || i == 0) { #ifdef WARNING - fprintf(stderr,"Warning: Wrong keyboard type: %s.\n", nxagentKeyboard); + fprintf(stderr,"WARNING! Wrong keyboard type: %s.\n", nxagentKeyboard); #endif } else @@ -2475,7 +2218,8 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin) } #ifdef DEBUG - fprintf(stderr, "nxagentShadowInit: Setting the master uid [%d].\n", nxagentShadowUid); + fprintf(stderr, "nxagentShadowInit: Setting the master uid [%d].\n", + nxagentShadowUid); #endif #if !defined (__CYGWIN32__) && !defined (WIN32) @@ -2495,8 +2239,9 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin) if (NXShadowCreate(nxagentDisplay, layout, nxagentShadowDisplayName, (void *) &nxagentShadowDisplay) != 1) { - #ifdef TEST - fprintf(stderr, "nxagentShadowInit: Failed to initialize shadow display [%s].\n", nxagentShadowDisplayName); + #ifdef PANIIC + fprintf(stderr, "nxagentShadowInit: PANIC! Failed to initialize shadow " + "display [%s].\n", nxagentShadowDisplayName); #endif return -1; @@ -2519,8 +2264,8 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin) if (NXShadowAddUpdaterDisplay(nxagentDisplay, &nxagentShadowWidth, &nxagentShadowHeight, &nxagentMasterDepth) == 0) { - #ifdef TEST - fprintf(stderr, "nxagentShadowInit: Failed to add display [%s].\n", + #ifdef PANIC + fprintf(stderr, "nxagentShadowInit: PANIC! Failed to add display [%s].\n", nxagentDisplayName); #endif @@ -2540,16 +2285,73 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin) nxagentOption(RootHeight) * 1.0 / nxagentShadowHeight); } - if (DefaultVisualOfScreen(DefaultScreenOfDisplay(nxagentDisplay)) -> class != TrueColor || - DefaultVisualOfScreen(DefaultScreenOfDisplay(nxagentShadowDisplay)) -> class != TrueColor) + if (DefaultVisualOfScreen(DefaultScreenOfDisplay(nxagentDisplay)) -> + class != TrueColor) { - #ifdef TEST - fprintf(stderr, "nxagentShadowInit: PANIC! The visual class is not TrueColor.\n"); + #ifdef PANIC + fprintf(stderr, "nxagentShadowInit: PANIC! The visual class of the remote " + "X server is not TrueColor.\n"); #endif return -1; } + if (DefaultVisualOfScreen(DefaultScreenOfDisplay(nxagentShadowDisplay)) -> + class != TrueColor) + { + #ifdef PANIC + + const char *className; + + switch (DefaultVisualOfScreen(DefaultScreenOfDisplay(nxagentShadowDisplay)) -> class) + { + case StaticGray: + { + className = "StaticGray"; + + break; + } + case StaticColor: + { + className = "StaticColor"; + + break; + } + case PseudoColor: + { + className = "PseudoColor"; + + break; + } + case DirectColor: + { + className = "DirectColor"; + + break; + } + case GrayScale: + { + className = "GrayScale"; + + break; + } + default: + { + className = ""; + + break; + } + } + + fprintf(stderr, "nxagentShadowInit: PANIC! Cannot shadow the display. " + "%s visual class is not supported. Only TrueColor visuals " + "are supported.\n", className); + + #endif /* #endif PANIC */ + + return -1; + } + #endif nxagentShadowDepth = pScreen -> rootDepth; @@ -2566,7 +2368,8 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin) else if (nxagentShadowDepth == 8) { #ifdef PANIC - fprintf(stderr, "nxagentShadowInit: PANIC! The target depth is 8 bit.\n"); + fprintf(stderr, "nxagentShadowInit: PANIC! Unable to shadow a %d bit " + "display with a 8 bit screen depth.\n", nxagentMasterDepth); #endif return -1; @@ -2585,7 +2388,8 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin) else if (nxagentShadowDepth == 8) { #ifdef PANIC - fprintf(stderr, "nxagentShadowInit: PANIC! The target depth is 8 bit.\n"); + fprintf(stderr, "nxagentShadowInit: PANIC! Unable to shadow a 16 bit " + "display with a 8 bit screen depth.\n"); #endif return -1; @@ -2600,7 +2404,8 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin) if (nxagentShadowDepth != 8) { #ifdef PANIC - fprintf(stderr, "nxagentShadowInit: PANIC! The target depth is 8 bit.\n"); + fprintf(stderr, "nxagentShadowInit: PANIC! Unable to shadow a 8 bit " + "display with a %d bit screen depth.\n", nxagentShadowDepth); #endif return -1; @@ -3046,7 +2851,7 @@ void nxagentShadowAdaptDepth(unsigned int width, unsigned int height, #ifdef WARNING fprintf(stderr, "nxagentCorrectDepthShadow: WARNING! Visual not found. Using default visual.\n"); #endif - + pVisual = nxagentVisuals[nxagentDefaultVisualIndex].visual; } @@ -3473,10 +3278,10 @@ int nxagentRRSetScreenConfig(ScreenPtr pScreen, int width, int height) RRScreenSizePtr oldSizes; pScrPriv = rrGetScrPriv(pScreen); - + oldWidth = pScreen->width; oldHeight = pScreen->height; - + if (!pScrPriv) { return 1; @@ -3556,7 +3361,7 @@ int nxagentRRSetScreenConfig(ScreenPtr pScreen, int width, int height) } RREditConnectionInfo (pScreen); - + /* * Fix pointer bounds and location */ @@ -3694,7 +3499,8 @@ void nxagentSaveAreas(PixmapPtr pPixmap, RegionPtr prgnSave, int xorg, int yorg, return; } -void nxagentRestoreAreas(PixmapPtr pPixmap, RegionPtr prgnRestore, int xorg, int yorg, WindowPtr pWin) +void nxagentRestoreAreas(PixmapPtr pPixmap, RegionPtr prgnRestore, int xorg, + int yorg, WindowPtr pWin) { PixmapPtr pVirtualPixmap; RegionPtr clipRegion; @@ -3710,6 +3516,14 @@ void nxagentRestoreAreas(PixmapPtr pPixmap, RegionPtr prgnRestore, int xorg, int BoxRec extents; miBSWindowPtr pBackingStore; + /* + * Limit the area to restore to the + * root window size. + */ + + REGION_INTERSECT(pWin -> pScreen, prgnRestore, prgnRestore, + &WindowTable[pWin -> drawable.pScreen -> myNum] -> winSize); + pBackingStore = (miBSWindowPtr) pWin -> backStorage; pVirtualPixmap = nxagentVirtualPixmap(pPixmap); @@ -3903,6 +3717,24 @@ void nxagentShadowAdaptToRatio(void) REGION_UNINIT(pScreen, ®ion); } +void nxagentPrintGeometry() +{ + int i; + + for (i = 0; i < screenInfo.numScreens; i++) + { + if (nxagentPrintGeometryFlags && (1 << i)) + { + fprintf(stderr, "Info: Screen [%d] resized to geometry [%dx%d] " + "fullscreen [%d].\n", i, screenInfo.screens[i] -> width, + screenInfo.screens[i] -> height, + nxagentOption(Fullscreen)); + } + } + + nxagentPrintGeometryFlags = 0; +} + #ifdef DUMP void nxagentShowPixmap(PixmapPtr pPixmap, int x, int y, int width, int height) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.h b/nx-X11/programs/Xserver/hw/nxagent/Screen.h index 3550dd553..1ab6caad2 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ @@ -36,6 +36,9 @@ is" without express or implied warranty. #define MIN_NXAGENT_HEIGHT 60 #define NXAGENT_FRAME_WIDTH 2000 +#define nxagentSetPrintGeometry(screen) \ + nxagentPrintGeometryFlags = (1 << (screen)); + extern int nxagentClients; extern int nxagentAutoDisconnectTimeout; @@ -44,7 +47,6 @@ extern ScreenPtr nxagentDefaultScreen; extern Pixmap nxagentPixmapLogo; -extern Window nxagentIconWindow; extern Window nxagentFullscreenWindow; extern RegionRec nxagentShadowUpdateRegion; @@ -58,6 +60,8 @@ extern short nxagentShadowUid; void nxagentSetScreenInfo(ScreenInfo *screenInfo); void nxagentSetPixmapFormats(ScreenInfo *screenInfo); +void nxagentPrintGeometry(); + extern Window nxagentDefaultWindows[MAXSCREENS]; extern Window nxagentInputWindows[MAXSCREENS]; extern Window nxagentScreenSaverWindows[MAXSCREENS]; @@ -83,11 +87,6 @@ extern int nxagentBitsPerPixel(int depth); void nxagentSetScreenSaverTime(void); -void nxagentMinimizeFromFullScreen(ScreenPtr pScreen); -void nxagentMaximizeToFullScreen(ScreenPtr pScreen); - -Window nxagentCreateIconWindow(void); - Bool nxagentMagicPixelZone(int x, int y); Bool nxagentResizeScreen(ScreenPtr pScreen, int width, int height, diff --git a/nx-X11/programs/Xserver/hw/nxagent/Splash.c b/nx-X11/programs/Xserver/hw/nxagent/Splash.c index 8de74b85b..24dbf1413 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Splash.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Splash.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Splash.h b/nx-X11/programs/Xserver/hw/nxagent/Splash.h index bcc3a90b1..86920ad8b 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Splash.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Splash.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Split.c b/nx-X11/programs/Xserver/hw/nxagent/Split.c index 8f1c65eba..bf7f705b9 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Split.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Split.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Split.h b/nx-X11/programs/Xserver/hw/nxagent/Split.h index 397feef16..60be29b39 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Split.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Split.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/TestExt.c b/nx-X11/programs/Xserver/hw/nxagent/TestExt.c index 704c63e51..1d5fdee20 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/TestExt.c +++ b/nx-X11/programs/Xserver/hw/nxagent/TestExt.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Trap.c b/nx-X11/programs/Xserver/hw/nxagent/Trap.c index 2796b2f14..22de3bc1b 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Trap.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Trap.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Trap.h b/nx-X11/programs/Xserver/hw/nxagent/Trap.h index 493a18a1b..aa6937e70 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Trap.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Trap.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Utils.h b/nx-X11/programs/Xserver/hw/nxagent/Utils.h index 9334a7868..830b2753f 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Utils.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Utils.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Visual.c b/nx-X11/programs/Xserver/hw/nxagent/Visual.c index 2a8283a30..f38931677 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Visual.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Visual.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Visual.h b/nx-X11/programs/Xserver/hw/nxagent/Visual.h index 6d8a8742d..c682f92dd 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Visual.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Visual.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index 8da5d8bd1..2da21b91c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ @@ -692,222 +692,91 @@ void nxagentRestackWindow(WindowPtr pWin, WindowPtr pOldNextSib) void nxagentSwitchFullscreen(ScreenPtr pScreen, Bool switchOn) { - Window w; - XSetWindowAttributes attributes; - unsigned long valuemask; + XEvent e; + XSizeHints sizeHints; - if (nxagentOption(Rootless)) + if (nxagentOption(Rootless) == 1) { return; } - if (!switchOn) + if (switchOn == 0) { nxagentWMDetect(); - if (!nxagentWMIsRunning) - { - #ifdef WARNING - fprintf(stderr, "Warning: Can't switch to window mode, no window manager has been detected.\n"); - #endif - - return; - } - } - - w = nxagentDefaultWindows[pScreen -> myNum]; - attributes.override_redirect = switchOn; - valuemask = CWOverrideRedirect; - XUnmapWindow(nxagentDisplay, w); - XChangeWindowAttributes(nxagentDisplay, w, valuemask, &attributes); - - if (switchOn) - { /* - * Change to fullscreen mode. + * The smart scheduler could be stopped while + * waiting for the reply. In this case we need + * to yield explicitly to avoid to be stuck in + * the dispatch loop forever. */ - struct timeval timeout; - int i; - XEvent e; - - /* - * Wait for window manager reparenting the default window. - */ + isItTimeToYield = 1; - for (i = 0; i < 100 && nxagentWMIsRunning; i++) + if (nxagentWMIsRunning == 0) { - #ifdef TEST - fprintf(stderr, "nxagentSwitchFullscreen: WARNING! Going to wait for the ReparentNotify event.\n"); + #ifdef WARNING + fprintf(stderr, "Warning: Can't switch to window mode, no window manager " + "has been detected.\n"); #endif - if (XCheckTypedWindowEvent(nxagentDisplay, w, ReparentNotify, &e)) - { - break; - } - - /* - * This should also flush - * the NX link for us. - */ - - XSync(nxagentDisplay, 0); - - timeout.tv_sec = 0; - timeout.tv_usec = 50 * 1000; - - nxagentWaitEvents(nxagentDisplay, &timeout); + return; } + } - if (i < 100) - { - /* - * The window manager has done with the reparent - * operation. We can resize and map the window. - */ - - nxagentChangeOption(Fullscreen, True); - - /* - * Save the window-mode configuration. - */ - - nxagentChangeOption(SavedX, nxagentOption(X)); - nxagentChangeOption(SavedY, nxagentOption(Y)); - nxagentChangeOption(SavedWidth, nxagentOption(Width)); - nxagentChangeOption(SavedHeight, nxagentOption(Height)); - nxagentChangeOption(SavedRootWidth, nxagentOption(RootWidth)); - nxagentChangeOption(SavedRootHeight, nxagentOption(RootHeight)); - - /* - * Reconf the Default window. - */ - - nxagentChangeOption(X, 0); - nxagentChangeOption(Y, 0); - nxagentChangeOption(Width, WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay))); - nxagentChangeOption(Height, HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay))); - - /* - * Move the root window. - */ - - nxagentChangeOption(RootX, (nxagentOption(Width) - nxagentOption(RootWidth)) / 2); - nxagentChangeOption(RootY, (nxagentOption(Height) - nxagentOption(RootHeight)) / 2); - nxagentChangeOption(ViewportXSpan, nxagentOption(Width) - nxagentOption(RootWidth)); - nxagentChangeOption(ViewportYSpan, nxagentOption(Height) - nxagentOption(RootHeight)); - - XMoveResizeWindow(nxagentDisplay, w, nxagentOption(X), nxagentOption(Y), - nxagentOption(Width), nxagentOption(Height)); - - nxagentUpdateViewportFrame(0, 0, nxagentOption(RootWidth), nxagentOption(RootHeight)); - - XMoveWindow(nxagentDisplay, nxagentWindow(WindowTable[pScreen -> myNum]), - nxagentOption(RootX), nxagentOption(RootY)); - - /* - * We disable the screensaver when changing - * mode to fullscreen. Is it really needed? - */ - - XSetScreenSaver(nxagentDisplay, 0, 0, DefaultExposures, DefaultBlanking); - - if (nxagentIconWindow == None) - { - nxagentIconWindow = nxagentCreateIconWindow(); + #ifdef TEST + fprintf(stderr, "nxagentSwitchFullscreen: Switching to %s mode.\n", + switchOn ? "fullscreen" : "windowed"); + #endif - XMapWindow(nxagentDisplay, nxagentIconWindow); - } + nxagentChangeOption(Fullscreen, switchOn); - XMapRaised(nxagentDisplay, w); - XSetInputFocus(nxagentDisplay, w, RevertToParent, CurrentTime); - XCheckTypedWindowEvent(nxagentDisplay, w, LeaveNotify, &e); - nxagentFullscreenWindow = w; + if (nxagentOption(DesktopResize) == 1) + { + sizeHints.flags = PSize; - if (nxagentOption(DesktopResize) == 1) - { - if (nxagentOption(Shadow) == 0) - { - nxagentRRSetScreenConfig(pScreen, WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)), - HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay))); - } - else - { - nxagentShadowAdaptToRatio(); - } - } - } - else + if (switchOn == 1) { - /* - * We have waited for a reparent event unsuccessfully. - * Something happened to the window manager. - */ - - #ifdef WARNING - fprintf(stderr, "nxagentSwitchFullscreen: WARNING! Expected ReparentNotify event missing.\n"); - #endif - - nxagentWMIsRunning = False; - attributes.override_redirect = False; - XChangeWindowAttributes(nxagentDisplay, w, valuemask, &attributes); - XMapWindow(nxagentDisplay, w); + sizeHints.width = + WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); + sizeHints.height = + HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); } - } - else - { - /* - * FIXME: - * It could be necessary: - * - To restore screensaver. - * - To set or reset nxagentForceBackingStore flag. - * - To grab keyboard. - * - To propagate device settings to the X server if no WM is running. - */ - - /* - * Change to windowed mode. - */ - - nxagentChangeOption(Fullscreen, False); - XDestroyWindow(nxagentDisplay, nxagentIconWindow); - nxagentIconWindow = nxagentFullscreenWindow = None; - - if (nxagentOption(DesktopResize) == 1) + else { - nxagentChangeOption(RootWidth, nxagentOption(SavedRootWidth)); - nxagentChangeOption(RootHeight, nxagentOption(SavedRootHeight)); - - if (nxagentOption(Shadow) == 0) - { - nxagentRRSetScreenConfig(pScreen, nxagentOption(RootWidth), nxagentOption(RootHeight)); - } + sizeHints.width = nxagentOption(RootWidth); + sizeHints.height = nxagentOption(RootHeight); } - nxagentChangeOption(X, nxagentOption(SavedX)); - nxagentChangeOption(Y, nxagentOption(SavedY)); - nxagentChangeOption(Width, nxagentOption(SavedWidth)); - nxagentChangeOption(Height, nxagentOption(SavedHeight)); + XSetWMNormalHints(nxagentDisplay, nxagentDefaultWindows[pScreen -> myNum], + &sizeHints); + } - if (nxagentOption(Shadow) == 1 && nxagentOption(DesktopResize) == 1) - { - nxagentShadowAdaptToRatio(); - } + memset(&e, 0, sizeof(e)); - XMoveResizeWindow(nxagentDisplay, w, nxagentOption(X), nxagentOption(Y), - nxagentOption(Width), nxagentOption(Height)); + e.xclient.type = ClientMessage; + e.xclient.message_type = nxagentAtoms[13]; /* _NET_WM_STATE */ + e.xclient.display = nxagentDisplay; + e.xclient.window = nxagentDefaultWindows[pScreen -> myNum]; + e.xclient.format = 32; + e.xclient.data.l[0] = nxagentOption(Fullscreen) ? 1 : 0; + e.xclient.data.l[1] = nxagentAtoms[14]; /* _NET_WM_STATE_FULLSCREEN */ - nxagentUpdateViewportFrame(0, 0, nxagentOption(Width), nxagentOption(Height)); + XSendEvent(nxagentDisplay, DefaultRootWindow(nxagentDisplay), False, + SubstructureRedirectMask, &e); - XMoveWindow(nxagentDisplay, nxagentWindow(WindowTable[pScreen -> myNum]), 0, 0); - XMapWindow(nxagentDisplay, w); + if (switchOn == 1) + { + nxagentFullscreenWindow = nxagentDefaultWindows[pScreen -> myNum]; - nxagentChangeOption(RootX, 0); - nxagentChangeOption(RootY, 0); + nxagentGrabPointerAndKeyboard(NULL); } + else + { + nxagentFullscreenWindow = None; - XMoveResizeWindow(nxagentDisplay, nxagentInputWindows[0], 0, 0, - nxagentOption(Width), nxagentOption(Height)); + nxagentUngrabPointerAndKeyboard(NULL); + } } #ifdef VIEWPORT_FRAME @@ -2409,6 +2278,11 @@ void nxagentMapDefaultWindows() #endif XMapWindow(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum]); + + if (nxagentOption(Fullscreen) == 1 && nxagentWMIsRunning == 1) + { + nxagentSwitchFullscreen(pScreen, 1); + } } /* @@ -2438,26 +2312,6 @@ void nxagentMapDefaultWindows() nxagentDefaultWindows[i], CurrentTime); } - /* - * Map the icon window. - */ - - if (nxagentIconWindow != 0) - { - #ifdef TEST - fprintf(stderr, "nxagentMapDefaultWindows: Mapping icon window id [%ld].\n", - nxagentIconWindow); - #endif - - XMapWindow(nxagentDisplay, nxagentIconWindow); - - if (nxagentIpaq != 0) - { - XIconifyWindow(nxagentDisplay, nxagentIconWindow, - DefaultScreen(nxagentDisplay)); - } - } - /* * Ensure that the fullscreen window gets the focus. */ @@ -2895,6 +2749,13 @@ FIXME: Do we need to set save unders attribute here? XSizeHints *props, hints; unsigned char *data = NULL; + #ifdef _XSERVER64 + + unsigned char *data64 = NULL; + unsigned int i; + + #endif + hints.flags = 0; ret = GetWindowProperty(pWin, @@ -2903,10 +2764,13 @@ FIXME: Do we need to set save unders attribute here? False, XA_WM_SIZE_HINTS, &type, &format, &nItems, &bytesLeft, &data); - props = (XSizeHints*) data; + /* + * 72 is the number of bytes returned by + * sizeof(XSizeHints) on 32 bit platforms. + */ if (ret == Success && - ((format >> 3) * nItems) == sizeof(XSizeHints) && + ((format >> 3) * nItems) == 72 && bytesLeft == 0 && type == XA_WM_SIZE_HINTS) { @@ -2915,6 +2779,30 @@ FIXME: Do we need to set save unders attribute here? (void*)pWin, pWin -> drawable.id, nxagentWindow(pWin)); #endif + #ifdef _XSERVER64 + + data64 = (unsigned char *) malloc(sizeof(XSizeHints) + 4); + + for (i = 0; i < 4; i++) + { + *(data64 + i) = *(data + i); + } + + *(((int *) data64) + 1) = 0; + + for (i = 8; i < sizeof(XSizeHints) + 4; i++) + { + *(data64 + i) = *(data + i - 4); + } + + props = (XSizeHints *) data64; + + #else + + props = (XSizeHints *) data; + + #endif /* _XSERVER64 */ + hints = *props; } else @@ -2933,6 +2821,15 @@ FIXME: Do we need to set save unders attribute here? XSetWMNormalHints(nxagentDisplay, nxagentWindow(pWin), &hints); + + #ifdef _XSERVER64 + + if (data64 != NULL) + { + free(data64); + } + + #endif } } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Windows.h b/nx-X11/programs/Xserver/hw/nxagent/Windows.h index ca33f1448..6fc97b341 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Windows.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Windows.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXdamage.c b/nx-X11/programs/Xserver/hw/nxagent/X/NXdamage.c index c49f1587f..7bc1c74cb 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXdamage.c +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXdamage.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXdamage.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXdamage.c.NX.original index c49f1587f..7bc1c74cb 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXdamage.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXdamage.c.NX.original @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXdispatch.c b/nx-X11/programs/Xserver/hw/nxagent/X/NXdispatch.c index f84ca0e03..ba4e1e662 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXdispatch.c +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXdispatch.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ @@ -513,13 +513,6 @@ Dispatch(void) * completed. We can now handle our clients. */ - if (serverGeneration > nxagentMaxAllowedResets) - { - fprintf(stderr, "Session: Session started at '%s'.\n", GetTimeAsString()); - - nxagentSessionState = SESSION_UP; - } - #ifdef XKB nxagentInitXkbWrapper(); @@ -603,6 +596,21 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio clientReady[1] = NXAGENT_WAKEUP; } + if (serverGeneration > nxagentMaxAllowedResets && + nxagentSessionState == SESSION_STARTING && + (nxagentOption(Xdmcp) == 0 || nxagentXdmcpUp == 1)) + { + #ifdef NX_DEBUG_INPUT + fprintf(stderr, "Session: Session started at '%s' timestamp [%lu].\n", + GetTimeAsString(), GetTimeInMillis()); + #else + fprintf(stderr, "Session: Session started at '%s'.\n", + GetTimeAsString()); + #endif + + nxagentSessionState = SESSION_UP; + } + #ifdef BLOCKS fprintf(stderr, "[End dispatch]\n"); #endif diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXdispatch.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXdispatch.c.NX.original index f84ca0e03..ba4e1e662 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXdispatch.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXdispatch.c.NX.original @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ @@ -513,13 +513,6 @@ Dispatch(void) * completed. We can now handle our clients. */ - if (serverGeneration > nxagentMaxAllowedResets) - { - fprintf(stderr, "Session: Session started at '%s'.\n", GetTimeAsString()); - - nxagentSessionState = SESSION_UP; - } - #ifdef XKB nxagentInitXkbWrapper(); @@ -603,6 +596,21 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio clientReady[1] = NXAGENT_WAKEUP; } + if (serverGeneration > nxagentMaxAllowedResets && + nxagentSessionState == SESSION_STARTING && + (nxagentOption(Xdmcp) == 0 || nxagentXdmcpUp == 1)) + { + #ifdef NX_DEBUG_INPUT + fprintf(stderr, "Session: Session started at '%s' timestamp [%lu].\n", + GetTimeAsString(), GetTimeInMillis()); + #else + fprintf(stderr, "Session: Session started at '%s'.\n", + GetTimeAsString()); + #endif + + nxagentSessionState = SESSION_UP; + } + #ifdef BLOCKS fprintf(stderr, "[End dispatch]\n"); #endif diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXdixfonts.c b/nx-X11/programs/Xserver/hw/nxagent/X/NXdixfonts.c index b431796be..225ecdaf8 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXdixfonts.c +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXdixfonts.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXdixfonts.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXdixfonts.c.NX.original index b431796be..225ecdaf8 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXdixfonts.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXdixfonts.c.NX.original @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXevents.c b/nx-X11/programs/Xserver/hw/nxagent/X/NXevents.c index a8a2a68bd..8e87d58c4 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXevents.c +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXevents.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ @@ -191,6 +191,7 @@ xEvent *xeviexE; #ifdef NX_DEBUG_INPUT extern int nxagentDebugInput; +extern int nxagentDebugInputDevices; #endif extern Display *nxagentDisplay; @@ -1865,6 +1866,12 @@ DeliverEventsToWindow(register WindowPtr pWin, xEvent *pEvents, int count, tempGrab.pointerMode = GrabModeAsync; tempGrab.confineTo = NullWindow; tempGrab.cursor = NullCursor; + #ifdef NX_DEBUG_INPUT + if (nxagentDebugInputDevices == 1) + { + fprintf(stderr, "DeliverEventsToWindow: Activating passive grab on pointer.\n"); + } + #endif (*inputInfo.pointer->ActivateGrab)(inputInfo.pointer, &tempGrab, currentTime, TRUE); } @@ -2735,6 +2742,13 @@ CheckPassiveGrabsOnWindow( tempGrab.modifiersDetail.exact&(~0x1f00); } #endif + #ifdef NX_DEBUG_INPUT + if (nxagentDebugInputDevices == 1) + { + fprintf(stderr, "CheckPassiveGrabsOnWindow: Activating passive grab on %s.\n", + device == inputInfo.keyboard ? "keyboard" : "pointer"); + } + #endif (*device->ActivateGrab)(device, grab, currentTime, TRUE); FixUpEventFromWindow(xE, grab->window, None, TRUE); @@ -3093,7 +3107,17 @@ drawable.id:0; else DeliverFocusedEvent(keybd, xE, sprite.win, count); if (deactivateGrab) + #ifdef NX_DEBUG_INPUT + { + if (nxagentDebugInputDevices == 1) + { + fprintf(stderr, "ProcessKeyboardEvent: Deactivating grab on keyboard.\n"); + } + #endif (*keybd->DeactivateGrab)(keybd); + #ifdef NX_DEBUG_INPUT + } + #endif } #ifdef XKB @@ -3320,7 +3344,17 @@ ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count mouse, count); #endif if (deactivateGrab) + #ifdef NX_DEBUG_INPUT + { + if (nxagentDebugInputDevices == 1) + { + fprintf(stderr, "ProcessPointerEvent: Deactivating grab on pointer.\n"); + } + #endif (*mouse->DeactivateGrab)(mouse); + #ifdef NX_DEBUG_INPUT + } + #endif } #define AtMostOneClient \ @@ -4041,6 +4075,12 @@ ProcGrabPointer(ClientPtr client) pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess); if (!pWin) return BadWindow; + #ifdef NX_DEBUG_INPUT + if (nxagentDebugInputDevices == 1) + { + fprintf(stderr, "ProcGrabPointer: pWin [%p] client [%d].\n", pWin, client -> index); + } + #endif if (stuff->confineTo == None) confineTo = NullWindow; else @@ -4100,6 +4140,12 @@ ProcGrabPointer(ClientPtr client) tempGrab.keyboardMode = stuff->keyboardMode; tempGrab.pointerMode = stuff->pointerMode; tempGrab.device = device; + #ifdef NX_DEBUG_INPUT + if (nxagentDebugInputDevices == 1) + { + fprintf(stderr, "ProcGrabPointer: Activating active grab on pointer.\n"); + } + #endif (*device->ActivateGrab)(device, &tempGrab, time, FALSE); if (oldCursor) FreeCursor (oldCursor, (Cursor)0); @@ -4163,6 +4209,12 @@ ProcUngrabPointer(ClientPtr client) TimeStamp time; REQUEST(xResourceReq); + #ifdef NX_DEBUG_INPUT + if (nxagentDebugInputDevices == 1) + { + fprintf(stderr, "ProcUngrabPointer: client [%d].\n", client -> index); + } + #endif REQUEST_SIZE_MATCH(xResourceReq); UpdateCurrentTime(); grab = device->grab; @@ -4170,7 +4222,25 @@ ProcUngrabPointer(ClientPtr client) if ((CompareTimeStamps(time, currentTime) != LATER) && (CompareTimeStamps(time, device->grabTime) != EARLIER) && (grab) && SameClient(grab, client)) + #ifdef NX_DEBUG_INPUT + { + if (nxagentDebugInputDevices == 1) + { + fprintf(stderr, "ProcUngrabPointer: Deactivating grab on pointer.\n"); + } + #endif (*device->DeactivateGrab)(device); + #ifdef NX_DEBUG_INPUT + } + else + { + if (nxagentDebugInputDevices == 1) + { + fprintf(stderr, "ProcUngrabPointer: current time [%lu] request time [%lu] grab time [%lu].\n", + currentTime.milliseconds, time.milliseconds, device->grabTime.milliseconds); + } + } + #endif return Success; } @@ -4225,6 +4295,12 @@ GrabDevice(register ClientPtr client, register DeviceIntPtr dev, tempGrab.pointerMode = other_mode; tempGrab.eventMask = mask; tempGrab.device = dev; + #ifdef NX_DEBUG_INPUT + if (nxagentDebugInputDevices == 1) + { + fprintf(stderr, "GrabDevice: Activating active grab on keyboard.\n"); + } + #endif (*dev->ActivateGrab)(dev, &tempGrab, time, FALSE); *status = GrabSuccess; } @@ -4238,6 +4314,12 @@ ProcGrabKeyboard(ClientPtr client) REQUEST(xGrabKeyboardReq); int result; + #ifdef NX_DEBUG_INPUT + if (nxagentDebugInputDevices == 1) + { + fprintf(stderr, "ProcGrabKeyboard: client [%d].\n", client -> index); + } + #endif REQUEST_SIZE_MATCH(xGrabKeyboardReq); #ifdef XCSECURITY if (!SecurityCheckDeviceAccess(client, inputInfo.keyboard, TRUE)) @@ -4268,6 +4350,12 @@ ProcUngrabKeyboard(ClientPtr client) TimeStamp time; REQUEST(xResourceReq); + #ifdef NX_DEBUG_INPUT + if (nxagentDebugInputDevices == 1) + { + fprintf(stderr, "ProcUngrabKeyboard: client [%d].\n", client -> index); + } + #endif REQUEST_SIZE_MATCH(xResourceReq); UpdateCurrentTime(); grab = device->grab; @@ -4275,7 +4363,25 @@ ProcUngrabKeyboard(ClientPtr client) if ((CompareTimeStamps(time, currentTime) != LATER) && (CompareTimeStamps(time, device->grabTime) != EARLIER) && (grab) && SameClient(grab, client)) + #ifdef NX_DEBUG_INPUT + { + if (nxagentDebugInputDevices == 1) + { + fprintf(stderr, "ProcUngrabKeyboard: Deactivating grab on keyboard.\n"); + } + #endif (*device->DeactivateGrab)(device); + #ifdef NX_DEBUG_INPUT + } + else + { + if (nxagentDebugInputDevices == 1) + { + fprintf(stderr, "ProcUngrabKeyboard: current time [%lu] request time [%lu] grab time [%lu].\n", + currentTime.milliseconds, time.milliseconds, device->grabTime.milliseconds); + } + } + #endif return Success; } diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXevents.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXevents.c.NX.original index a8a2a68bd..8e87d58c4 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXevents.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXevents.c.NX.original @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ @@ -191,6 +191,7 @@ xEvent *xeviexE; #ifdef NX_DEBUG_INPUT extern int nxagentDebugInput; +extern int nxagentDebugInputDevices; #endif extern Display *nxagentDisplay; @@ -1865,6 +1866,12 @@ DeliverEventsToWindow(register WindowPtr pWin, xEvent *pEvents, int count, tempGrab.pointerMode = GrabModeAsync; tempGrab.confineTo = NullWindow; tempGrab.cursor = NullCursor; + #ifdef NX_DEBUG_INPUT + if (nxagentDebugInputDevices == 1) + { + fprintf(stderr, "DeliverEventsToWindow: Activating passive grab on pointer.\n"); + } + #endif (*inputInfo.pointer->ActivateGrab)(inputInfo.pointer, &tempGrab, currentTime, TRUE); } @@ -2735,6 +2742,13 @@ CheckPassiveGrabsOnWindow( tempGrab.modifiersDetail.exact&(~0x1f00); } #endif + #ifdef NX_DEBUG_INPUT + if (nxagentDebugInputDevices == 1) + { + fprintf(stderr, "CheckPassiveGrabsOnWindow: Activating passive grab on %s.\n", + device == inputInfo.keyboard ? "keyboard" : "pointer"); + } + #endif (*device->ActivateGrab)(device, grab, currentTime, TRUE); FixUpEventFromWindow(xE, grab->window, None, TRUE); @@ -3093,7 +3107,17 @@ drawable.id:0; else DeliverFocusedEvent(keybd, xE, sprite.win, count); if (deactivateGrab) + #ifdef NX_DEBUG_INPUT + { + if (nxagentDebugInputDevices == 1) + { + fprintf(stderr, "ProcessKeyboardEvent: Deactivating grab on keyboard.\n"); + } + #endif (*keybd->DeactivateGrab)(keybd); + #ifdef NX_DEBUG_INPUT + } + #endif } #ifdef XKB @@ -3320,7 +3344,17 @@ ProcessPointerEvent (register xEvent *xE, register DeviceIntPtr mouse, int count mouse, count); #endif if (deactivateGrab) + #ifdef NX_DEBUG_INPUT + { + if (nxagentDebugInputDevices == 1) + { + fprintf(stderr, "ProcessPointerEvent: Deactivating grab on pointer.\n"); + } + #endif (*mouse->DeactivateGrab)(mouse); + #ifdef NX_DEBUG_INPUT + } + #endif } #define AtMostOneClient \ @@ -4041,6 +4075,12 @@ ProcGrabPointer(ClientPtr client) pWin = SecurityLookupWindow(stuff->grabWindow, client, SecurityReadAccess); if (!pWin) return BadWindow; + #ifdef NX_DEBUG_INPUT + if (nxagentDebugInputDevices == 1) + { + fprintf(stderr, "ProcGrabPointer: pWin [%p] client [%d].\n", pWin, client -> index); + } + #endif if (stuff->confineTo == None) confineTo = NullWindow; else @@ -4100,6 +4140,12 @@ ProcGrabPointer(ClientPtr client) tempGrab.keyboardMode = stuff->keyboardMode; tempGrab.pointerMode = stuff->pointerMode; tempGrab.device = device; + #ifdef NX_DEBUG_INPUT + if (nxagentDebugInputDevices == 1) + { + fprintf(stderr, "ProcGrabPointer: Activating active grab on pointer.\n"); + } + #endif (*device->ActivateGrab)(device, &tempGrab, time, FALSE); if (oldCursor) FreeCursor (oldCursor, (Cursor)0); @@ -4163,6 +4209,12 @@ ProcUngrabPointer(ClientPtr client) TimeStamp time; REQUEST(xResourceReq); + #ifdef NX_DEBUG_INPUT + if (nxagentDebugInputDevices == 1) + { + fprintf(stderr, "ProcUngrabPointer: client [%d].\n", client -> index); + } + #endif REQUEST_SIZE_MATCH(xResourceReq); UpdateCurrentTime(); grab = device->grab; @@ -4170,7 +4222,25 @@ ProcUngrabPointer(ClientPtr client) if ((CompareTimeStamps(time, currentTime) != LATER) && (CompareTimeStamps(time, device->grabTime) != EARLIER) && (grab) && SameClient(grab, client)) + #ifdef NX_DEBUG_INPUT + { + if (nxagentDebugInputDevices == 1) + { + fprintf(stderr, "ProcUngrabPointer: Deactivating grab on pointer.\n"); + } + #endif (*device->DeactivateGrab)(device); + #ifdef NX_DEBUG_INPUT + } + else + { + if (nxagentDebugInputDevices == 1) + { + fprintf(stderr, "ProcUngrabPointer: current time [%lu] request time [%lu] grab time [%lu].\n", + currentTime.milliseconds, time.milliseconds, device->grabTime.milliseconds); + } + } + #endif return Success; } @@ -4225,6 +4295,12 @@ GrabDevice(register ClientPtr client, register DeviceIntPtr dev, tempGrab.pointerMode = other_mode; tempGrab.eventMask = mask; tempGrab.device = dev; + #ifdef NX_DEBUG_INPUT + if (nxagentDebugInputDevices == 1) + { + fprintf(stderr, "GrabDevice: Activating active grab on keyboard.\n"); + } + #endif (*dev->ActivateGrab)(dev, &tempGrab, time, FALSE); *status = GrabSuccess; } @@ -4238,6 +4314,12 @@ ProcGrabKeyboard(ClientPtr client) REQUEST(xGrabKeyboardReq); int result; + #ifdef NX_DEBUG_INPUT + if (nxagentDebugInputDevices == 1) + { + fprintf(stderr, "ProcGrabKeyboard: client [%d].\n", client -> index); + } + #endif REQUEST_SIZE_MATCH(xGrabKeyboardReq); #ifdef XCSECURITY if (!SecurityCheckDeviceAccess(client, inputInfo.keyboard, TRUE)) @@ -4268,6 +4350,12 @@ ProcUngrabKeyboard(ClientPtr client) TimeStamp time; REQUEST(xResourceReq); + #ifdef NX_DEBUG_INPUT + if (nxagentDebugInputDevices == 1) + { + fprintf(stderr, "ProcUngrabKeyboard: client [%d].\n", client -> index); + } + #endif REQUEST_SIZE_MATCH(xResourceReq); UpdateCurrentTime(); grab = device->grab; @@ -4275,7 +4363,25 @@ ProcUngrabKeyboard(ClientPtr client) if ((CompareTimeStamps(time, currentTime) != LATER) && (CompareTimeStamps(time, device->grabTime) != EARLIER) && (grab) && SameClient(grab, client)) + #ifdef NX_DEBUG_INPUT + { + if (nxagentDebugInputDevices == 1) + { + fprintf(stderr, "ProcUngrabKeyboard: Deactivating grab on keyboard.\n"); + } + #endif (*device->DeactivateGrab)(device); + #ifdef NX_DEBUG_INPUT + } + else + { + if (nxagentDebugInputDevices == 1) + { + fprintf(stderr, "ProcUngrabKeyboard: current time [%lu] request time [%lu] grab time [%lu].\n", + currentTime.milliseconds, time.milliseconds, device->grabTime.milliseconds); + } + } + #endif return Success; } diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXextension.c b/nx-X11/programs/Xserver/hw/nxagent/X/NXextension.c index a510c9356..6e67b7ffe 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXextension.c +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXextension.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXextension.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXextension.c.NX.original index a510c9356..6e67b7ffe 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXextension.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXextension.c.NX.original @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXglxext.c b/nx-X11/programs/Xserver/hw/nxagent/X/NXglxext.c index aee27e820..172252b32 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXglxext.c +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXglxext.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXglxext.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXglxext.c.NX.original index aee27e820..172252b32 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXglxext.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXglxext.c.NX.original @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXglyph.c b/nx-X11/programs/Xserver/hw/nxagent/X/NXglyph.c index f51a8bce9..6340de537 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXglyph.c +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXglyph.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXglyph.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXglyph.c.NX.original index f51a8bce9..6340de537 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXglyph.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXglyph.c.NX.original @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXglyphcurs.c b/nx-X11/programs/Xserver/hw/nxagent/X/NXglyphcurs.c index 3e105ac64..d6cd96631 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXglyphcurs.c +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXglyphcurs.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXglyphcurs.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXglyphcurs.c.NX.original index 3e105ac64..d6cd96631 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXglyphcurs.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXglyphcurs.c.NX.original @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXglyphstr.h b/nx-X11/programs/Xserver/hw/nxagent/X/NXglyphstr.h index 0f30843d6..e78a1bf14 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXglyphstr.h +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXglyphstr.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXglyphstr.h.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXglyphstr.h.NX.original index 0f30843d6..e78a1bf14 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXglyphstr.h.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXglyphstr.h.NX.original @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXmiexpose.c b/nx-X11/programs/Xserver/hw/nxagent/X/NXmiexpose.c index af07fdcc2..c71ea8142 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXmiexpose.c +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXmiexpose.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXmiexpose.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXmiexpose.c.NX.original index af07fdcc2..c71ea8142 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXmiexpose.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXmiexpose.c.NX.original @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXmiglyph.c b/nx-X11/programs/Xserver/hw/nxagent/X/NXmiglyph.c index 6ad60223f..efb295861 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXmiglyph.c +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXmiglyph.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXmiglyph.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXmiglyph.c.NX.original index 6ad60223f..efb295861 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXmiglyph.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXmiglyph.c.NX.original @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXmitrap.c b/nx-X11/programs/Xserver/hw/nxagent/X/NXmitrap.c index e08f5e45f..d2bead0bc 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXmitrap.c +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXmitrap.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXmitrap.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXmitrap.c.NX.original index e08f5e45f..d2bead0bc 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXmitrap.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXmitrap.c.NX.original @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXmiwindow.c b/nx-X11/programs/Xserver/hw/nxagent/X/NXmiwindow.c index 1731e0753..be1096c6c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXmiwindow.c +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXmiwindow.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXmiwindow.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXmiwindow.c.NX.original index 1731e0753..be1096c6c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXmiwindow.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXmiwindow.c.NX.original @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXpicture.c b/nx-X11/programs/Xserver/hw/nxagent/X/NXpicture.c index 5d6f71475..be961c400 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXpicture.c +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXpicture.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ @@ -62,6 +62,7 @@ #include "Screen.h" #include "Pixmaps.h" #include "Drawable.h" +#include "Render.h" #define PANIC #define WARNING @@ -1063,7 +1064,47 @@ static void initGradient(SourcePictPtr pGradient, int stopCount, static PicturePtr createSourcePicture(void) { PicturePtr pPicture; - pPicture = (PicturePtr) xalloc(sizeof(PictureRec)); + + extern int nxagentPicturePrivateIndex; + + unsigned int totalPictureSize; + + DevUnion *ppriv; + + char *privPictureRecAddr; + + int i; + + /* + * Compute size of entire PictureRect, plus privates. + */ + + totalPictureSize = sizeof(PictureRec) + + picturePrivateCount * sizeof(DevUnion) + + sizeof(nxagentPrivPictureRec); + + pPicture = (PicturePtr) xalloc(totalPictureSize); + + if (pPicture != NULL) + { + ppriv = (DevUnion *) (pPicture + 1); + + for (i = 0; i < picturePrivateCount; ++i) + { + /* + * Other privates are inaccessible. + */ + + ppriv[i].ptr = NULL; + } + + privPictureRecAddr = (char *) &ppriv[picturePrivateCount]; + + ppriv[nxagentPicturePrivateIndex].ptr = (pointer) privPictureRecAddr; + + pPicture -> devPrivates = ppriv; + } + pPicture->pDrawable = 0; pPicture->pFormat = 0; pPicture->pNext = 0; @@ -1697,6 +1738,10 @@ FreePicture (pointer value, if (--pPicture->refcnt == 0) { +#ifdef NXAGENT_SERVER + nxagentDestroyPicture(pPicture); +#endif + if (pPicture->transform) xfree (pPicture->transform); if (!pPicture->pDrawable) { diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXpicture.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXpicture.c.NX.original index 5d6f71475..be961c400 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXpicture.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXpicture.c.NX.original @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ @@ -62,6 +62,7 @@ #include "Screen.h" #include "Pixmaps.h" #include "Drawable.h" +#include "Render.h" #define PANIC #define WARNING @@ -1063,7 +1064,47 @@ static void initGradient(SourcePictPtr pGradient, int stopCount, static PicturePtr createSourcePicture(void) { PicturePtr pPicture; - pPicture = (PicturePtr) xalloc(sizeof(PictureRec)); + + extern int nxagentPicturePrivateIndex; + + unsigned int totalPictureSize; + + DevUnion *ppriv; + + char *privPictureRecAddr; + + int i; + + /* + * Compute size of entire PictureRect, plus privates. + */ + + totalPictureSize = sizeof(PictureRec) + + picturePrivateCount * sizeof(DevUnion) + + sizeof(nxagentPrivPictureRec); + + pPicture = (PicturePtr) xalloc(totalPictureSize); + + if (pPicture != NULL) + { + ppriv = (DevUnion *) (pPicture + 1); + + for (i = 0; i < picturePrivateCount; ++i) + { + /* + * Other privates are inaccessible. + */ + + ppriv[i].ptr = NULL; + } + + privPictureRecAddr = (char *) &ppriv[picturePrivateCount]; + + ppriv[nxagentPicturePrivateIndex].ptr = (pointer) privPictureRecAddr; + + pPicture -> devPrivates = ppriv; + } + pPicture->pDrawable = 0; pPicture->pFormat = 0; pPicture->pNext = 0; @@ -1697,6 +1738,10 @@ FreePicture (pointer value, if (--pPicture->refcnt == 0) { +#ifdef NXAGENT_SERVER + nxagentDestroyPicture(pPicture); +#endif + if (pPicture->transform) xfree (pPicture->transform); if (!pPicture->pDrawable) { diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXpicturestr.h b/nx-X11/programs/Xserver/hw/nxagent/X/NXpicturestr.h index 255411a9b..b6cee91f1 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXpicturestr.h +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXpicturestr.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXpicturestr.h.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXpicturestr.h.NX.original index 255411a9b..b6cee91f1 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXpicturestr.h.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXpicturestr.h.NX.original @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXproperty.c b/nx-X11/programs/Xserver/hw/nxagent/X/NXproperty.c index 772a1fbe5..d02f3f015 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXproperty.c +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXproperty.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXproperty.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXproperty.c.NX.original index 772a1fbe5..d02f3f015 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXproperty.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXproperty.c.NX.original @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXrandr.c b/nx-X11/programs/Xserver/hw/nxagent/X/NXrandr.c index 426d15b1b..e1bb44148 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXrandr.c +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXrandr.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXrandr.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXrandr.c.NX.original index 426d15b1b..e1bb44148 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXrandr.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXrandr.c.NX.original @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXrender.c b/nx-X11/programs/Xserver/hw/nxagent/X/NXrender.c index de2df855f..562cd2c66 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXrender.c +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXrender.c @@ -26,7 +26,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -35,7 +35,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ @@ -116,7 +116,6 @@ int nxagentCursorSaveRenderInfo(ScreenPtr, CursorPtr); void nxagentCursorPostSaveRenderInfo(CursorPtr, ScreenPtr, PicturePtr, int, int); int nxagentRenderRealizeCursor(ScreenPtr, CursorPtr); int nxagentCreatePicture(PicturePtr, Mask); -void nxagentDestroyPicture(PicturePtr pPicture); void nxagentChangePicture(PicturePtr, Mask); int nxagentChangePictureClip(PicturePtr, int, int, xRectangle *, int, int); void nxagentComposite(CARD8, PicturePtr, PicturePtr, PicturePtr, INT16, INT16, @@ -132,6 +131,28 @@ void nxagentSetPictureFilter(PicturePtr pPicture, char *filter, int name_size, void nxagentTrapezoids(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int ntrap, xTrapezoid *traps); +void nxagentRenderCreateSolidFill(PicturePtr pPicture, xRenderColor *color); + +void nxagentRenderCreateLinearGradient(PicturePtr pPicture, xPointFixed *p1, + xPointFixed *p2, int nStops, + xFixed *stops, + xRenderColor *colors); + +void nxagentRenderCreateRadialGradient(PicturePtr pPicture, xPointFixed *inner, + xPointFixed *outer, + xFixed innerRadius, + xFixed outerRadius, + int nStops, + xFixed *stops, + xRenderColor *colors); + +void nxagentRenderCreateConicalGradient(PicturePtr pPicture, + xPointFixed *center, + xFixed angle, int nStops, + xFixed *stops, + xRenderColor *colors); + + /* * The void pointer is actually a XGlyphElt8. */ @@ -823,8 +844,6 @@ ProcRenderFreePicture (ClientPtr client) VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityDestroyAccess, RenderErrBase + BadPicture); - nxagentDestroyPicture(pPicture); - FreeResource (stuff->picture, RT_NONE); return(client->noClientException); } @@ -926,9 +945,16 @@ ProcRenderComposite (ClientPtr client) RenderErrBase + BadPicture); VERIFY_ALPHA (pMask, stuff->mask, client, SecurityReadAccess, RenderErrBase + BadPicture); +/* +FIXME: Imported change from newest version of Xorg. Changed pSrc to pDst. + if ((pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) || (pMask && pMask->pDrawable && pSrc->pDrawable->pScreen != pMask->pDrawable->pScreen)) return BadMatch; +*/ + if ((pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) || + (pMask && pMask->pDrawable && pDst->pDrawable->pScreen != pMask->pDrawable->pScreen)) + return BadMatch; ValidatePicture (pSrc); if (pMask) @@ -2336,6 +2362,11 @@ static int ProcRenderCreateSolidFill(ClientPtr client) pPicture = CreateSolidPicture(stuff->pid, &stuff->color, &error); if (!pPicture) return error; + /* AGENT SERVER */ + + nxagentRenderCreateSolidFill(pPicture, &stuff -> color); + + /* AGENT SERVER */ if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) return BadAlloc; return Success; @@ -2367,6 +2398,12 @@ static int ProcRenderCreateLinearGradient (ClientPtr client) stuff->nStops, stops, colors, &error); if (!pPicture) return error; + /* AGENT SERVER */ + + nxagentRenderCreateLinearGradient(pPicture, &stuff->p1, &stuff->p2, + stuff->nStops, stops, colors); + + /* AGENT SERVER */ if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) return BadAlloc; return Success; @@ -2397,6 +2434,14 @@ static int ProcRenderCreateRadialGradient (ClientPtr client) stuff->nStops, stops, colors, &error); if (!pPicture) return error; + /* AGENT SERVER */ + + nxagentRenderCreateRadialGradient(pPicture, &stuff->inner, &stuff->outer, + stuff->inner_radius, + stuff->outer_radius, + stuff->nStops, stops, colors); + + /* AGENT SERVER */ if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) return BadAlloc; return Success; @@ -2426,6 +2471,13 @@ static int ProcRenderCreateConicalGradient (ClientPtr client) stuff->nStops, stops, colors, &error); if (!pPicture) return error; + /* AGENT SERVER */ + + nxagentRenderCreateConicalGradient(pPicture, &stuff->center, + stuff->angle, stuff->nStops, stops, + colors); + + /* AGENT SERVER */ if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) return BadAlloc; return Success; diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXrender.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXrender.c.NX.original index de2df855f..562cd2c66 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXrender.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXrender.c.NX.original @@ -26,7 +26,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -35,7 +35,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ @@ -116,7 +116,6 @@ int nxagentCursorSaveRenderInfo(ScreenPtr, CursorPtr); void nxagentCursorPostSaveRenderInfo(CursorPtr, ScreenPtr, PicturePtr, int, int); int nxagentRenderRealizeCursor(ScreenPtr, CursorPtr); int nxagentCreatePicture(PicturePtr, Mask); -void nxagentDestroyPicture(PicturePtr pPicture); void nxagentChangePicture(PicturePtr, Mask); int nxagentChangePictureClip(PicturePtr, int, int, xRectangle *, int, int); void nxagentComposite(CARD8, PicturePtr, PicturePtr, PicturePtr, INT16, INT16, @@ -132,6 +131,28 @@ void nxagentSetPictureFilter(PicturePtr pPicture, char *filter, int name_size, void nxagentTrapezoids(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int ntrap, xTrapezoid *traps); +void nxagentRenderCreateSolidFill(PicturePtr pPicture, xRenderColor *color); + +void nxagentRenderCreateLinearGradient(PicturePtr pPicture, xPointFixed *p1, + xPointFixed *p2, int nStops, + xFixed *stops, + xRenderColor *colors); + +void nxagentRenderCreateRadialGradient(PicturePtr pPicture, xPointFixed *inner, + xPointFixed *outer, + xFixed innerRadius, + xFixed outerRadius, + int nStops, + xFixed *stops, + xRenderColor *colors); + +void nxagentRenderCreateConicalGradient(PicturePtr pPicture, + xPointFixed *center, + xFixed angle, int nStops, + xFixed *stops, + xRenderColor *colors); + + /* * The void pointer is actually a XGlyphElt8. */ @@ -823,8 +844,6 @@ ProcRenderFreePicture (ClientPtr client) VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityDestroyAccess, RenderErrBase + BadPicture); - nxagentDestroyPicture(pPicture); - FreeResource (stuff->picture, RT_NONE); return(client->noClientException); } @@ -926,9 +945,16 @@ ProcRenderComposite (ClientPtr client) RenderErrBase + BadPicture); VERIFY_ALPHA (pMask, stuff->mask, client, SecurityReadAccess, RenderErrBase + BadPicture); +/* +FIXME: Imported change from newest version of Xorg. Changed pSrc to pDst. + if ((pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) || (pMask && pMask->pDrawable && pSrc->pDrawable->pScreen != pMask->pDrawable->pScreen)) return BadMatch; +*/ + if ((pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) || + (pMask && pMask->pDrawable && pDst->pDrawable->pScreen != pMask->pDrawable->pScreen)) + return BadMatch; ValidatePicture (pSrc); if (pMask) @@ -2336,6 +2362,11 @@ static int ProcRenderCreateSolidFill(ClientPtr client) pPicture = CreateSolidPicture(stuff->pid, &stuff->color, &error); if (!pPicture) return error; + /* AGENT SERVER */ + + nxagentRenderCreateSolidFill(pPicture, &stuff -> color); + + /* AGENT SERVER */ if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) return BadAlloc; return Success; @@ -2367,6 +2398,12 @@ static int ProcRenderCreateLinearGradient (ClientPtr client) stuff->nStops, stops, colors, &error); if (!pPicture) return error; + /* AGENT SERVER */ + + nxagentRenderCreateLinearGradient(pPicture, &stuff->p1, &stuff->p2, + stuff->nStops, stops, colors); + + /* AGENT SERVER */ if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) return BadAlloc; return Success; @@ -2397,6 +2434,14 @@ static int ProcRenderCreateRadialGradient (ClientPtr client) stuff->nStops, stops, colors, &error); if (!pPicture) return error; + /* AGENT SERVER */ + + nxagentRenderCreateRadialGradient(pPicture, &stuff->inner, &stuff->outer, + stuff->inner_radius, + stuff->outer_radius, + stuff->nStops, stops, colors); + + /* AGENT SERVER */ if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) return BadAlloc; return Success; @@ -2426,6 +2471,13 @@ static int ProcRenderCreateConicalGradient (ClientPtr client) stuff->nStops, stops, colors, &error); if (!pPicture) return error; + /* AGENT SERVER */ + + nxagentRenderCreateConicalGradient(pPicture, &stuff->center, + stuff->angle, stuff->nStops, stops, + colors); + + /* AGENT SERVER */ if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) return BadAlloc; return Success; diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXresource.c b/nx-X11/programs/Xserver/hw/nxagent/X/NXresource.c index 91e03cb0e..8c69217e7 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXresource.c +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXresource.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXresource.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXresource.c.NX.original index 91e03cb0e..8c69217e7 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXresource.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXresource.c.NX.original @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXshm.c b/nx-X11/programs/Xserver/hw/nxagent/X/NXshm.c index a6d638ea7..b99cbe3e3 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXshm.c +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXshm.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXshm.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXshm.c.NX.original index a6d638ea7..b99cbe3e3 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXshm.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXshm.c.NX.original @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXwindow.c b/nx-X11/programs/Xserver/hw/nxagent/X/NXwindow.c index 24dad322f..4022bc397 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXwindow.c +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXwindow.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXwindow.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXwindow.c.NX.original index 24dad322f..4022bc397 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXwindow.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXwindow.c.NX.original @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXxvdisp.c b/nx-X11/programs/Xserver/hw/nxagent/X/NXxvdisp.c index 15fdd9ff3..aa902226e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXxvdisp.c +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXxvdisp.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXxvdisp.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXxvdisp.c.NX.original index 15fdd9ff3..aa902226e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXxvdisp.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXxvdisp.c.NX.original @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/nxagent.xpm b/nx-X11/programs/Xserver/hw/nxagent/nxagent.xpm index d35ac4ec1..5955f1705 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/nxagent.xpm +++ b/nx-X11/programs/Xserver/hw/nxagent/nxagent.xpm @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/nxmissing.xpm b/nx-X11/programs/Xserver/hw/nxagent/nxmissing.xpm index 497fa2511..e7dee27b1 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/nxmissing.xpm +++ b/nx-X11/programs/Xserver/hw/nxagent/nxmissing.xpm @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/os2Stub.c b/nx-X11/programs/Xserver/hw/nxagent/os2Stub.c index 81c479233..80419d871 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/os2Stub.c +++ b/nx-X11/programs/Xserver/hw/nxagent/os2Stub.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2007 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/screensaver b/nx-X11/programs/Xserver/hw/nxagent/screensaver index b9408a2b7..4c5c10620 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/screensaver +++ b/nx-X11/programs/Xserver/hw/nxagent/screensaver @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2003 NoMachine, http://www.nomachine.com. */ +/* Copyright (c) 2001, 2010 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -9,7 +9,7 @@ /* */ /* Check http://www.nomachine.com/licensing.html for applicability. */ /* */ -/* NX and NoMachine are trademarks of NoMachine S.r.l. */ +/* NX and NoMachine are trademarks of Medialogic S.p.A. */ /* */ /* All rights reserved. */ /* */ -- cgit v1.2.3 From d30ef0340e759378964b75e8143625ecaea245b0 Mon Sep 17 00:00:00 2001 From: Reinhard Tartler Date: Mon, 10 Oct 2011 17:58:58 +0200 Subject: Imported nxagent-3.4.0-3.tar.gz Summary: Imported nxagent-3.4.0-3.tar.gz Keywords: Imported nxagent-3.4.0-3.tar.gz into Git repository --- nx-X11/programs/Xserver/hw/nxagent/Agent.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Args.c | 19 +- nx-X11/programs/Xserver/hw/nxagent/Args.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Atoms.c | 30 +- nx-X11/programs/Xserver/hw/nxagent/Atoms.h | 4 +- nx-X11/programs/Xserver/hw/nxagent/Binder.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Binder.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/CHANGELOG | 165 ------ nx-X11/programs/Xserver/hw/nxagent/Client.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Client.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Clipboard.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Colormap.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Colormap.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Composite.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Composite.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Cursor.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Cursor.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Dialog.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Dialog.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Display.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Display.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Drawable.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Drawable.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Error.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Error.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Events.c | 603 ++------------------- nx-X11/programs/Xserver/hw/nxagent/Events.h | 8 +- nx-X11/programs/Xserver/hw/nxagent/Extensions.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Extensions.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Font.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Font.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/GC.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/GCOps.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/GCOps.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/GCs.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Handlers.c | 5 +- nx-X11/programs/Xserver/hw/nxagent/Handlers.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Holder.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Holder.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Icons.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Image.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Image.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Imakefile | 3 +- nx-X11/programs/Xserver/hw/nxagent/Init.c | 4 +- nx-X11/programs/Xserver/hw/nxagent/Init.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Keyboard.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Keyboard.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Keystroke.c | 78 +-- nx-X11/programs/Xserver/hw/nxagent/Keystroke.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/LICENSE | 2 +- nx-X11/programs/Xserver/hw/nxagent/Literals.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Millis.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Millis.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c | 2 +- .../Xserver/hw/nxagent/NXdispatch.c.NX.original | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c | 2 +- .../Xserver/hw/nxagent/NXdixfonts.c.NX.original | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXevents.c | 2 +- .../Xserver/hw/nxagent/NXevents.c.NX.original | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXextension.c | 2 +- .../Xserver/hw/nxagent/NXextension.c.NX.original | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXglyph.c | 2 +- .../Xserver/hw/nxagent/NXglyph.c.NX.original | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c | 2 +- .../Xserver/hw/nxagent/NXglyphcurs.c.NX.original | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXglyphstr.h | 2 +- .../Xserver/hw/nxagent/NXglyphstr.h.NX.original | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXmiglyph.c | 2 +- .../Xserver/hw/nxagent/NXmiglyph.c.NX.original | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXpicture.c | 2 +- .../Xserver/hw/nxagent/NXpicture.c.NX.original | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXpicturestr.h | 2 +- .../Xserver/hw/nxagent/NXpicturestr.h.NX.original | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXproperty.c | 2 +- .../Xserver/hw/nxagent/NXproperty.c.NX.original | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXrandr.c | 2 +- .../Xserver/hw/nxagent/NXrandr.c.NX.original | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXrender.c | 2 +- .../Xserver/hw/nxagent/NXrender.c.NX.original | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXwindow.c | 2 +- .../Xserver/hw/nxagent/NXwindow.c.NX.original | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXxrandr.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXxrandr.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/NXxrandrint.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Options.c | 8 +- nx-X11/programs/Xserver/hw/nxagent/Options.h | 12 +- nx-X11/programs/Xserver/hw/nxagent/Pixels.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Pixels.h | 20 +- nx-X11/programs/Xserver/hw/nxagent/Pixmap.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Pixmaps.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Pointer.c | 36 +- nx-X11/programs/Xserver/hw/nxagent/Pointer.h | 11 +- nx-X11/programs/Xserver/hw/nxagent/Reconnect.c | 6 +- nx-X11/programs/Xserver/hw/nxagent/Reconnect.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Render.c | 293 +--------- nx-X11/programs/Xserver/hw/nxagent/Render.h | 4 +- nx-X11/programs/Xserver/hw/nxagent/Rootless.c | 99 +--- nx-X11/programs/Xserver/hw/nxagent/Rootless.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 130 ++++- nx-X11/programs/Xserver/hw/nxagent/Screen.h | 6 +- nx-X11/programs/Xserver/hw/nxagent/Splash.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Splash.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Split.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Split.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/TestExt.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Trap.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Trap.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Utils.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Visual.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/Visual.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Window.c | 152 +----- nx-X11/programs/Xserver/hw/nxagent/Windows.h | 4 +- nx-X11/programs/Xserver/hw/nxagent/X/NXdamage.c | 2 +- .../Xserver/hw/nxagent/X/NXdamage.c.NX.original | 2 +- nx-X11/programs/Xserver/hw/nxagent/X/NXdispatch.c | 28 +- .../Xserver/hw/nxagent/X/NXdispatch.c.NX.original | 28 +- nx-X11/programs/Xserver/hw/nxagent/X/NXdixfonts.c | 2 +- .../Xserver/hw/nxagent/X/NXdixfonts.c.NX.original | 2 +- nx-X11/programs/Xserver/hw/nxagent/X/NXevents.c | 2 +- .../Xserver/hw/nxagent/X/NXevents.c.NX.original | 2 +- nx-X11/programs/Xserver/hw/nxagent/X/NXextension.c | 2 +- .../Xserver/hw/nxagent/X/NXextension.c.NX.original | 2 +- nx-X11/programs/Xserver/hw/nxagent/X/NXglxext.c | 2 +- .../Xserver/hw/nxagent/X/NXglxext.c.NX.original | 2 +- nx-X11/programs/Xserver/hw/nxagent/X/NXglyph.c | 2 +- .../Xserver/hw/nxagent/X/NXglyph.c.NX.original | 2 +- nx-X11/programs/Xserver/hw/nxagent/X/NXglyphcurs.c | 2 +- .../Xserver/hw/nxagent/X/NXglyphcurs.c.NX.original | 2 +- nx-X11/programs/Xserver/hw/nxagent/X/NXglyphstr.h | 2 +- .../Xserver/hw/nxagent/X/NXglyphstr.h.NX.original | 2 +- nx-X11/programs/Xserver/hw/nxagent/X/NXmiexpose.c | 2 +- .../Xserver/hw/nxagent/X/NXmiexpose.c.NX.original | 2 +- nx-X11/programs/Xserver/hw/nxagent/X/NXmiglyph.c | 2 +- .../Xserver/hw/nxagent/X/NXmiglyph.c.NX.original | 2 +- nx-X11/programs/Xserver/hw/nxagent/X/NXmitrap.c | 2 +- .../Xserver/hw/nxagent/X/NXmitrap.c.NX.original | 2 +- nx-X11/programs/Xserver/hw/nxagent/X/NXmiwindow.c | 2 +- .../Xserver/hw/nxagent/X/NXmiwindow.c.NX.original | 2 +- nx-X11/programs/Xserver/hw/nxagent/X/NXpicture.c | 54 +- .../Xserver/hw/nxagent/X/NXpicture.c.NX.original | 54 +- .../programs/Xserver/hw/nxagent/X/NXpicturestr.h | 2 +- .../hw/nxagent/X/NXpicturestr.h.NX.original | 2 +- nx-X11/programs/Xserver/hw/nxagent/X/NXproperty.c | 2 +- .../Xserver/hw/nxagent/X/NXproperty.c.NX.original | 2 +- nx-X11/programs/Xserver/hw/nxagent/X/NXrandr.c | 2 +- .../Xserver/hw/nxagent/X/NXrandr.c.NX.original | 2 +- nx-X11/programs/Xserver/hw/nxagent/X/NXrender.c | 60 +- .../Xserver/hw/nxagent/X/NXrender.c.NX.original | 60 +- nx-X11/programs/Xserver/hw/nxagent/X/NXresource.c | 2 +- .../Xserver/hw/nxagent/X/NXresource.c.NX.original | 2 +- nx-X11/programs/Xserver/hw/nxagent/X/NXshm.c | 2 +- .../Xserver/hw/nxagent/X/NXshm.c.NX.original | 2 +- nx-X11/programs/Xserver/hw/nxagent/X/NXwindow.c | 2 +- .../Xserver/hw/nxagent/X/NXwindow.c.NX.original | 2 +- nx-X11/programs/Xserver/hw/nxagent/X/NXxvdisp.c | 2 +- .../Xserver/hw/nxagent/X/NXxvdisp.c.NX.original | 2 +- nx-X11/programs/Xserver/hw/nxagent/nxagent.xpm | 2 +- nx-X11/programs/Xserver/hw/nxagent/nxmissing.xpm | 2 +- nx-X11/programs/Xserver/hw/nxagent/os2Stub.c | 2 +- nx-X11/programs/Xserver/hw/nxagent/screensaver | 2 +- 161 files changed, 382 insertions(+), 1866 deletions(-) (limited to 'nx-X11/programs/Xserver/hw/nxagent/Imakefile') diff --git a/nx-X11/programs/Xserver/hw/nxagent/Agent.h b/nx-X11/programs/Xserver/hw/nxagent/Agent.h index dbed1e0d8..13f87c96e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Agent.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Agent.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.c b/nx-X11/programs/Xserver/hw/nxagent/Args.c index 8fbb275a6..0588f43d6 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Args.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -562,15 +562,11 @@ int ddxProcessArgument(int argc, char *argv[], int i) if (!strcmp(argv[i],"fullscreen")) { nxagentChangeOption(Fullscreen, True); - - nxagentChangeOption(AllScreens, True); } else if (!strcmp(argv[i],"ipaq")) { nxagentChangeOption(Fullscreen, True); - nxagentChangeOption(AllScreens, True); - nxagentIpaq = True; } else @@ -1075,14 +1071,10 @@ static void nxagentParseOptions(char *name, char *value) else if (!strcmp(value, "1")) { nxagentChangeOption(Fullscreen, True); - - nxagentChangeOption(AllScreens, True); } else if (!strcmp(value, "0")) { nxagentChangeOption(Fullscreen, False); - - nxagentChangeOption(AllScreens, False); } else { @@ -1216,7 +1208,7 @@ static void nxagentParseOptions(char *name, char *value) { nxagentChangeOption(ClientOs, ClientOsSolaris); } - else if (strcmp(value, "macosx") == 0) + else if (strcmp(value, "mac") == 0) { nxagentChangeOption(ClientOs, ClientOsMac); } @@ -1520,7 +1512,7 @@ N/A int splitMode = 0; int splitSize = 0; - unsigned int packMethod = PACK_NONE; + unsigned int packMethod = PACK_NONE; unsigned int packQuality = 9; int dataLevel = 0; @@ -1688,11 +1680,6 @@ N/A nxagentChangeOption(Fullscreen, False); } - if (nxagentOption(AllScreens) == UNDEFINED) - { - nxagentChangeOption(AllScreens, False); - } - if (nxagentOption(Binder) == UNDEFINED) { nxagentChangeOption(Binder, False); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.h b/nx-X11/programs/Xserver/hw/nxagent/Args.h index 9cb97ca03..2aac8e387 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Args.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Args.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Atoms.c b/nx-X11/programs/Xserver/hw/nxagent/Atoms.c index 578731f07..13f9b8082 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Atoms.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Atoms.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -66,21 +66,19 @@ Atom nxagentAtoms[NXAGENT_NUMBER_OF_ATOMS]; static char *nxagentAtomNames[NXAGENT_NUMBER_OF_ATOMS + 1] = { - "NX_IDENTITY", /* 0 */ - "WM_PROTOCOLS", /* 1 */ - "WM_DELETE_WINDOW", /* 2 */ - "WM_NX_READY", /* 3 */ - "MCOPGLOBALS", /* 4 */ - "NX_CUT_BUFFER_SERVER", /* 5 */ - "TARGETS", /* 6 */ - "TEXT", /* 7 */ - "NX_AGENT_SIGNATURE", /* 8 */ - "NXDARWIN", /* 9 */ - "CLIPBOARD", /* 10 */ - "TIMESTAMP", /* 11 */ - "UTF8_STRING", /* 12 */ - "_NET_WM_STATE", /* 13 */ - "_NET_WM_STATE_FULLSCREEN", /* 14 */ + "NX_IDENTITY", /* 0 */ + "WM_PROTOCOLS", /* 1 */ + "WM_DELETE_WINDOW", /* 2 */ + "WM_NX_READY", /* 3 */ + "MCOPGLOBALS", /* 4 */ + "NX_CUT_BUFFER_SERVER", /* 5 */ + "TARGETS", /* 6 */ + "TEXT", /* 7 */ + "NX_AGENT_SIGNATURE", /* 8 */ + "NXDARWIN", /* 9 */ + "CLIPBOARD", /* 10 */ + "TIMESTAMP", /* 11 */ + "UTF8_STRING", /* 12 */ NULL, NULL }; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Atoms.h b/nx-X11/programs/Xserver/hw/nxagent/Atoms.h index d5b7fe5aa..842b820db 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Atoms.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Atoms.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -22,7 +22,7 @@ #include "../../include/window.h" #include "screenint.h" -#define NXAGENT_NUMBER_OF_ATOMS 16 +#define NXAGENT_NUMBER_OF_ATOMS 14 extern Atom nxagentAtoms[NXAGENT_NUMBER_OF_ATOMS]; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Binder.c b/nx-X11/programs/Xserver/hw/nxagent/Binder.c index d40aaebe6..4fb5224fb 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Binder.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Binder.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Binder.h b/nx-X11/programs/Xserver/hw/nxagent/Binder.h index f28a82b9f..c4daeea8c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Binder.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Binder.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/CHANGELOG b/nx-X11/programs/Xserver/hw/nxagent/CHANGELOG index 64e41b8cc..4e964d0ad 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/CHANGELOG +++ b/nx-X11/programs/Xserver/hw/nxagent/CHANGELOG @@ -1,170 +1,5 @@ ChangeLog: -nxagent-3.4.0-16 - -- Updated copyright to year 2011. - -nxagent-3.4.0-15 - -- Added reference to fixed TR11H02405. - -nxagent-3.4.0-14 - -- Reverted fix for TR03H02335 implemented in nxagent-3.4.0-6. The - emulation of right click by Control key + left click introduces - issues for some applications changing the reaction to the left click - depending on the state of Control key. Issue reported in TR03H02335 - affects Apple laptop touchpads having a single button acting as - left button: on those devices the right button can be emulated by - a double-fingered tap (using two fingertips simultaneously). - -nxagent-3.4.0-13 - -- Fixed TR12H02414. Exported property must be split if ChangeProperty - request exceeds 262140 bytes. - -- Reset AllScreens option at reconnection time if full screen mode - have to be automatically turned off. - -nxagent-3.4.0-12 - -- If one of the two full screen modes is active ('one screen' or 'all - screens') both keystrokes Ctrl-Alt-F and Ctrl-Alt-Shift-F change the - mode back to 'windowed'. - -- Fixed TR11H02405. XRenderFreePicture is called only for pictures - that were actually created on the X server side. - -- Ctrl+Alt+f switch fullscreen to all monitors, while Ctrl+Alt+Shift+f - does it to one monitor only. - -- If the fullscreen option is enabled at the startup, session starts - in the fullscreen mode on all monitors. - -- Added a call to XReparentWindow in the nxagentSwitchAllScreens(). - -- Corrected focus and grab when switching to fullscreen on - all monitors. - -- Removed a compile warning e deleted some unused variables. - -- Removed nxagentPointerAndKeyboardGrabbed variable. - -- Use the override redirect attribute to switch to fullscreen to all - monitors instead of send _NET_WM_FULLSCREEN_MONITORS hint to the WM. - -- Added nxagentMinimizeFromFullScreen(), nxagentMaximizeToFullScreen() - and nxagentCreateIconWindow(). - -- Removed check on EnterNotify to grab the keyboard in fullscreen - mode not only if mode is 'NotifyNormal'. - -nxagent-3.4.0-11 - -- Corrected switching between viewport mode and resize mode. - -- Fixed TR04H02340. Keycode is correctly translated in shadow sessions - also if the remote X display is using evdev. - -nxagent-3.4.0-10 - -- Handled XGrabKeyboard() return value. - -- Fixed TR10D01512. NumLock and CapsLock keys are now synchronized - between local and remote. - -nxagent-3.4.0-9 - -- Fixed TR06H02362. No icon was swown in the task bar. - -- Fixed keyboard grab in fullscreen mode. - -- Fixed compiler warnings. - -nxagent-3.4.0-8 - -- Grab the keyboard in fullscreen mode on EnterNotify only if mode is - 'NotifyNormal'. - -- Yield control in the dispatch loop in case we stop the smart sche- - duler timer while waiting for a reply from the remote display. - -nxagent-3.4.0-7 - -- Fixed TR08D01478. The communication with the compiz window manager - by means of the _NET_WM_PING property was not handled properly. - -- Fixed a type mismatch in XKB events on 64 bit platforms. - -- Moved grab/ungrab keyboard from focus in/out event to enter/leave - notify event. - -- Removed nxagentIconWindow because it's not longer used. - -nxagent-3.4.0-6 - -- Fixed TR09F02102. Problem was with pointer buttons map. - -- Fixed TR02H02327. Some KeyRelease events was discarded. - -- Fixed up Num and Caps locks. - -- Fixed TR03H02335. Emulated right mouse button for Mac clients. - -- Added utilities to print info about internal and remote windows. - -- Fixed TR01F01995. Solved a picture resource leak by destroying remo- - te pictures only when their reference counter returns to zero. - -- Fixed TR04H02337. Errors occurred because pictures with no drawable - were handled badly. - -- Implemented handling nxagent's private for gradient pictures and so- - lid fill picture. - -- Fixed BadMatch condition check in function ProcRenderComposite. - -- Fixed nxagentComposite() to handle situations with source picture - drawable pointing to NULL. - -- Implemented render acceleration for requests: CreateSolidFill, - CreateLinearGradient, CreateRadialGradient, CreateConicalGradient. - -- Fixed TR03G02196. Dialogs are shown to the fore when the NX session - is in fullscreen mode. - -- Changed mechanism to switch to fullscreen mode. Now the override - redirect attribute is no longer used and _NET_WM_STATE_FULLSCREEN - hint is sent to the WM. - -nxagent-3.4.0-5 - -- Updated copyright to year 2010. - -nxagent-3.4.0-4 - -- Fixed TR07F02090. Now XDMCP sessions start without problems. - -- Fixed TR08G02259. Corrected window border granularity of rootless - session at reconnection on 64 bit platforms. - -- Fixed TR11G02290. Forcing null timeout with queued events only if - display connection is up. This prevents the flood of session log. - -- Fixed TR10G02287. Now QueryTree's loop is aborted in case of failure - and session log isn't filled anymore with repeated warning messages. - -- Fixed TR01G02154. Corrected window placement when switching between - fullscreen and windowed mode. - -- Fixed TR09G02276. Now the agent does not receive unwanted characters - while interacting with the local window manager. - -- Implemented FR02G02174. Added ability to do large screen pans in - viewport mode through key combination Ctrl+Alt+Shift+Arrow. - -- Corrected parsing of the 'client' option when the client OS is Mac. - nxagent-3.4.0-3 - Fixed TR09G02271. The array containing the font name fields was not diff --git a/nx-X11/programs/Xserver/hw/nxagent/Client.c b/nx-X11/programs/Xserver/hw/nxagent/Client.c index 63ed0e134..b0db1df0f 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Client.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Client.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Client.h b/nx-X11/programs/Xserver/hw/nxagent/Client.h index a9b06c845..4b12ed127 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Client.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Client.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 2742e147f..442b1c871 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.h b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.h index 43189df81..5a592a4da 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Colormap.c b/nx-X11/programs/Xserver/hw/nxagent/Colormap.c index b0f0507b5..d9a979a42 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Colormap.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Colormap.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Colormap.h b/nx-X11/programs/Xserver/hw/nxagent/Colormap.h index b2960590c..a8e225460 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Colormap.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Colormap.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Composite.c b/nx-X11/programs/Xserver/hw/nxagent/Composite.c index c79104fc1..44bab3cf9 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Composite.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Composite.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Composite.h b/nx-X11/programs/Xserver/hw/nxagent/Composite.h index e875d0051..c5dede9eb 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Composite.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Composite.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Cursor.c b/nx-X11/programs/Xserver/hw/nxagent/Cursor.c index 9ed7c233f..7e4385712 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Cursor.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Cursor.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Cursor.h b/nx-X11/programs/Xserver/hw/nxagent/Cursor.h index df7dc44f7..7b4e6beac 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Cursor.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Cursor.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Dialog.c b/nx-X11/programs/Xserver/hw/nxagent/Dialog.c index 0fb9491a4..c6f8a9104 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Dialog.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Dialog.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Dialog.h b/nx-X11/programs/Xserver/hw/nxagent/Dialog.h index bd12f3097..5c71fad87 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Dialog.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Dialog.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Display.c b/nx-X11/programs/Xserver/hw/nxagent/Display.c index 87be98116..c1a80b391 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Display.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Display.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Display.h b/nx-X11/programs/Xserver/hw/nxagent/Display.h index 454150d6e..4c04c5ba8 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Display.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Display.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c index 9c167743f..ddd7f13ca 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Drawable.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Drawable.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Drawable.h b/nx-X11/programs/Xserver/hw/nxagent/Drawable.h index c987fa119..6ce0e3156 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Drawable.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Drawable.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Error.c b/nx-X11/programs/Xserver/hw/nxagent/Error.c index 43bf85900..2a8173019 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Error.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Error.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Error.h b/nx-X11/programs/Xserver/hw/nxagent/Error.h index e55fd71a5..f7a53cbd1 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Error.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Error.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index b9da934d6..83665ff90 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -76,9 +76,7 @@ #include "input.h" #endif -#define Time XlibXID #include "XKBlib.h" -#undef Time #define GC XlibGC #define Font XlibFont @@ -220,16 +218,6 @@ static void nxagentForwardRemoteExpose(void); static int nxagentClipAndSendExpose(WindowPtr pWin, pointer ptr); -/* - * This is from NXproperty.c. - */ - -int GetWindowProperty(WindowPtr pWin, Atom property, long longOffset, - long longLength, Bool delete, Atom type, - Atom *actualType, int *format, unsigned - long *nItems, unsigned long *bytesAfter, - unsigned char **propData); - /* * Associate a resource to a drawable and * store the region affected by the split @@ -286,280 +274,6 @@ void ProcessInputEvents() mieqProcessInputEvents(); } -#ifdef DEBUG_TREE - -/* - * Print ID and name of window. - */ - -void nxagentRemoteWindowID(Window window, Bool newline) -{ -#ifdef NO_I18N - char *winName; -#else - XTextProperty tp; -#endif - - fprintf(stderr, "0x%lx", window); - - if (!window) - { - fprintf(stderr, " (none) "); - } - else - { - if (window == DefaultRootWindow(nxagentDisplay)) - { - fprintf(stderr, " (the root window) "); - } - -#ifdef NO_I18N - - if (!XFetchName(nxagentDisplay, window, &winName)) - { - fprintf(stderr, " (has no name) "); - } - else if (winName) - { - fprintf(stderr, " \"%s\" ", winName); - XFree(winName); - } - -#else - - if (XGetWMName(nxagentDisplay, window, &tp) != 0) - { - fprintf(stderr, " (has no name) "); - } - else if (tp.nitems > 0) - { - int count = 0; - int i, ret; - char **list = NULL; - - fprintf(stderr, " \""); - - ret = XmbTextPropertyToTextList(nxagentDisplay, &tp, &list, &count); - - if ((ret == Success || ret > 0) && list != NULL) - { - for (i = 0; i < count; i++) - { - fprintf(stderr, "%s", list[i]); - } - - XFreeStringList(list); - } - else - { - fprintf(stderr, "%s", tp.value); - } - - fprintf(stderr, "\" "); - } - -#endif - - else - { - fprintf(stderr, " (has no name) "); - } - } - - if (newline == TRUE) - { - fprintf(stderr, "\n"); - } - - return; -} - -/* - * Print info about remote window. - */ - -void nxagentRemoteWindowInfo(Window win, int indent, Bool newLine) -{ - XWindowAttributes attributes; - int i; - - if (XGetWindowAttributes(nxagentDisplay, win, &attributes) == 0) - { - return; - } - - for (i = 0; i < indent; i++) - { - fprintf(stderr, " "); - } - - fprintf(stderr, "x=%d y=%d width=%d height=%d class=%s map_state=%s " - "override_redirect=%s\n", attributes.x, attributes.y, - attributes.width, attributes.height, (attributes.class == 0) ? - "InputOutput" : "InputOnly", (attributes.map_state == 0) ? - "IsUnmapped" : (attributes.map_state == 1 ? - "IsUnviewable" : "IsViewable"), - (attributes.override_redirect == 0) ? - "No" : "Yes" ); - - if (newLine == TRUE) - { - fprintf(stderr, "\n"); - } -} - -/* - * Walk remote windows tree. - */ - -void nxagentRemoteWindowsTree(Window window, int level) -{ - int i, j; - Window rootWin, parentWin; - unsigned int numChildren; - Window *childList; - - if (!XQueryTree(nxagentDisplay, window, &rootWin, &parentWin, &childList, - &numChildren)) - { - fprintf(stderr, "nxagentRemoteWindowsTree - XQueryTree failed.\n"); - - return; - } - - if (level == 0) - { - fprintf(stderr, "\n"); - - fprintf(stderr, " Root Window ID: "); - nxagentRemoteWindowID(rootWin, TRUE); - - fprintf(stderr, " Parent window ID: "); - nxagentRemoteWindowID(parentWin, TRUE); - } - - if (level == 0 || numChildren > 0) - { - fprintf(stderr, " "); - - for (j = 0; j < level; j++) - { - fprintf(stderr, " "); - } - - fprintf(stderr, "%d child%s%s\n", numChildren, (numChildren == 1) ? "" : - "ren", (numChildren == 1) ? ":" : "."); - } - - for (i = (int) numChildren - 1; i >= 0; i--) - { - fprintf(stderr, " "); - - for (j = 0; j < level; j++) - { - fprintf(stderr, " "); - } - - nxagentRemoteWindowID(childList[i], TRUE); - - nxagentRemoteWindowInfo(childList[i], (level * 5) + 6, TRUE); - - nxagentRemoteWindowsTree(childList[i], level + 1); - } - - if (childList) - { - XFree((char *) childList); - } -} - -/* - * Print info about internal window. - */ - -void nxagentInternalWindowInfo(WindowPtr pWin, int indent, Bool newLine) -{ - int i; - int result; - unsigned long ulReturnItems; - unsigned long ulReturnBytesLeft; - Atom atomReturnType; - int iReturnFormat; - unsigned char *pszReturnData = NULL; - - fprintf(stderr, "Window ID=[0x%lx] Remote ID=[0x%lx] ", pWin -> drawable.id, - nxagentWindow(pWin)); - - result = GetWindowProperty(pWin, MakeAtom("WM_NAME", 7, False) , 0, - sizeof(CARD32), False, AnyPropertyType, - &atomReturnType, &iReturnFormat, - &ulReturnItems, &ulReturnBytesLeft, - &pszReturnData); - - fprintf(stderr, "Name: "); - - if (result == Success && pszReturnData != NULL) - { - pszReturnData[ulReturnItems] = '\0'; - - fprintf(stderr, "\"%s\"\n", (char *) pszReturnData); - } - else - { - fprintf(stderr, "%s\n", "( has no name )"); - } - - for (i = 0; i < indent; i++) - { - fprintf(stderr, " "); - } - - fprintf(stderr, "x=%d y=%d width=%d height=%d class=%s map_state=%s " - "override_redirect=%s", pWin -> drawable.x, pWin -> drawable.y, - pWin -> drawable.width, pWin -> drawable.height, - (pWin -> drawable.class == 0) ? "InputOutput" : - "InputOnly", (pWin -> mapped == 0) ? - "IsUnmapped" : (pWin -> mapped == 1 ? - "IsUnviewable" : "IsViewable"), - (pWin -> overrideRedirect == 0) ? - "No" : "Yes"); - - if (newLine == TRUE) - { - fprintf(stderr, "\n"); - } -} - -/* - * Walk internal windows tree. - */ - -void nxagentInternalWindowsTree(WindowPtr pWin, int indent) -{ - WindowPtr pChild; - int i; - - while (pWin) - { - pChild = pWin -> firstChild; - - for (i = 0; i < indent; i++) - { - fprintf(stderr, " "); - } - - nxagentInternalWindowInfo(pWin, indent, TRUE); - - fprintf(stderr, "\n"); - - nxagentInternalWindowsTree(pChild, indent + 4); - - pWin = pWin -> nextSib; - } -} - -#endif /* DEBUG_TREE */ - void nxagentSwitchResizeMode(ScreenPtr pScreen) { XSizeHints sizeHints; @@ -576,14 +290,8 @@ void nxagentSwitchResizeMode(ScreenPtr pScreen) nxagentLaunchDialog(DIALOG_DISABLE_DESKTOP_RESIZE_MODE); - if (nxagentOption(Fullscreen) == 0) - { - sizeHints.max_width = nxagentOption(RootWidth); - sizeHints.max_height = nxagentOption(RootHeight); - - XSetWMNormalHints(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum], - &sizeHints); - } + sizeHints.max_width = nxagentOption(RootWidth); + sizeHints.max_height = nxagentOption(RootHeight); } else { @@ -591,8 +299,7 @@ void nxagentSwitchResizeMode(ScreenPtr pScreen) nxagentLaunchDialog(DIALOG_ENABLE_DESKTOP_RESIZE_MODE); - nxagentRRSetScreenConfig(pScreen, nxagentOption(Width), - nxagentOption(Height)); + nxagentRRSetScreenConfig(pScreen, nxagentOption(Width), nxagentOption(Height)); if (nxagentOption(ClientOs) == ClientOsWinnt) { @@ -601,10 +308,10 @@ void nxagentSwitchResizeMode(ScreenPtr pScreen) sizeHints.max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); sizeHints.max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); - - XSetWMNormalHints(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum], - &sizeHints); } + + XSetWMNormalHints(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum], + &sizeHints); } void nxagentShadowSwitchResizeMode(ScreenPtr pScreen) @@ -804,7 +511,6 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) Bool startKbd = False; Bool closeSession = False; Bool switchFullscreen = False; - Bool switchAllScreens = False; /* * Last entered top level window. @@ -949,22 +655,6 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) { break; } - - #ifdef DEBUG_TREE - - case doDebugTree: - { - fprintf(stderr, "\n ========== nxagentRemoteWindowsTree ==========\n"); - nxagentRemoteWindowsTree(nxagentWindow(WindowTable[0]), 0); - - fprintf(stderr, "\n========== nxagentInternalWindowsTree ==========\n"); - nxagentInternalWindowsTree(WindowTable[0], 0); - - break; - } - - #endif /* DEBUG_TREE */ - case doCloseSession: { closeSession = TRUE; @@ -989,36 +679,6 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) break; } - case doSwitchAllScreens: - { - switchAllScreens = TRUE; - - break; - } - case doViewportMoveUp: - { - nxagentMoveViewport(pScreen, 0, -nxagentOption(Height)); - - break; - } - case doViewportMoveDown: - { - nxagentMoveViewport(pScreen, 0, nxagentOption(Height)); - - break; - } - case doViewportMoveLeft: - { - nxagentMoveViewport(pScreen, -nxagentOption(Width), 0); - - break; - } - case doViewportMoveRight: - { - nxagentMoveViewport(pScreen, nxagentOption(Width), 0); - - break; - } case doViewportUp: { nxagentMoveViewport(pScreen, 0, -nextinc(viewportInc)); @@ -1095,8 +755,6 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) if (nxagentOption(ViewOnly) == 0 && nxagentOption(Shadow) == 1 && result == doNothing) { - X.xkey.keycode = nxagentConvertKeycode(X.xkey.keycode); - NXShadowEvent(nxagentDisplay, X); } @@ -1105,27 +763,6 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) case KeyRelease: { enum HandleEventResult result; - int sendKey = 0; - -/* -FIXME: If we don't flush the queue here, it could happen - that the inputInfo structure will not be up to date - when we perform the following check on down keys. -*/ - ProcessInputEvents(); - -/* -FIXME: Don't enqueue the KeyRelease event if the key was - not already pressed. This workaround avoids a fake - KeyPress is enqueued by the XKEYBOARD extension. - Another solution would be to let the events are - enqueued and to remove the KeyPress afterwards. -*/ - if (BitIsOn(inputInfo.keyboard -> key -> down, - nxagentConvertKeycode(X.xkey.keycode))) - { - sendKey = 1; - } #ifdef TEST fprintf(stderr, "nxagentDispatchEvents: Going to handle new KeyRelease event.\n"); @@ -1171,7 +808,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was x.u.keyButtonPointer.time = nxagentLastEventTime; } - if (!(nxagentCheckSpecialKeystroke(&X.xkey, &result)) && sendKey == 1) + if (!(nxagentCheckSpecialKeystroke(&X.xkey, &result))) { mieqEnqueue(&x); @@ -1179,8 +816,6 @@ FIXME: Don't enqueue the KeyRelease event if the key was if (nxagentOption(ViewOnly) == 0 && nxagentOption(Shadow)) { - X.xkey.keycode = nxagentConvertKeycode(X.xkey.keycode); - NXShadowEvent(nxagentDisplay, X); } } @@ -1244,7 +879,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was X.xbutton.subwindow == None)) { x.u.u.type = ButtonPress; - x.u.u.detail = inputInfo.pointer -> button -> map[nxagentReversePointerMap[X.xbutton.button - 1]]; + x.u.u.detail = X.xbutton.button; x.u.keyButtonPointer.time = nxagentLastEventTime = GetTimeInMillis(); if (nxagentOption(Rootless)) @@ -1317,7 +952,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was if (minimize != True) { x.u.u.type = ButtonRelease; - x.u.u.detail = inputInfo.pointer -> button -> map[nxagentReversePointerMap[X.xbutton.button - 1]]; + x.u.u.detail = X.xbutton.button; x.u.keyButtonPointer.time = nxagentLastEventTime = GetTimeInMillis(); if (nxagentOption(Rootless)) @@ -1671,11 +1306,13 @@ FIXME: Don't enqueue the KeyRelease event if the key was nxagentScreenTrap = 0; } - if (nxagentOption(Fullscreen) == 1 && - X.xcrossing.window == nxagentFullscreenWindow && - X.xcrossing.detail != NotifyInferior) + if (nxagentOption(Fullscreen)) { - nxagentGrabPointerAndKeyboard(&X); + if (X.xcrossing.window == nxagentFullscreenWindow && + X.xcrossing.detail != NotifyInferior) + { + nxagentGrabPointerAndKeyboard(&X); + } } if (X.xcrossing.detail != NotifyInferior) @@ -1724,11 +1361,14 @@ FIXME: Don't enqueue the KeyRelease event if the key was nxagentLastEnteredWindow = NULL; } - if (X.xcrossing.window == nxagentDefaultWindows[0] && - X.xcrossing.detail != NotifyInferior && - X.xcrossing.mode == NotifyNormal) + if (nxagentOption(Fullscreen)) { - nxagentUngrabPointerAndKeyboard(&X); + if (X.xcrossing.window == nxagentFullscreenWindow && + X.xcrossing.detail != NotifyInferior && + X.xcrossing.mode == NotifyNormal) + { + nxagentUngrabPointerAndKeyboard(&X); + } } if (X.xcrossing.detail != NotifyInferior) @@ -1982,8 +1622,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was } if (nxagentUseNXTrans == 1 && nxagentOption(Rootless) == 0 && - nxagentOption(Nested) == 0 && - X.xmap.window != nxagentIconWindow) + nxagentOption(Nested) == 0 && X.xmap.window != nxagentIconWindow) { nxagentVisibility = VisibilityFullyObscured; } @@ -2022,17 +1661,14 @@ FIXME: Don't enqueue the KeyRelease event if the key was } } - if (nxagentOption(AllScreens) == 1) + if (nxagentOption(Fullscreen) == 1) { if (X.xmap.window == nxagentIconWindow) { pScreen = nxagentScreen(X.xmap.window); nxagentMaximizeToFullScreen(pScreen); } - } - if (nxagentOption(Fullscreen) == 1) - { nxagentVisibility = VisibilityUnobscured; nxagentVisibilityStop = False; nxagentVisibilityTimeout = GetTimeInMillis() + 2000; @@ -2042,17 +1678,10 @@ FIXME: Don't enqueue the KeyRelease event if the key was } case MappingNotify: { - XMappingEvent *mappingEvent = (XMappingEvent *) &X; - #ifdef DEBUG fprintf(stderr, "nxagentDispatchEvents: WARNING! Going to handle new MappingNotify event.\n"); #endif - if (mappingEvent -> request == MappingPointer) - { - nxagentInitPointerMap(); - } - break; } default: @@ -2126,40 +1755,20 @@ FIXME: Don't enqueue the KeyRelease event if the key was if (nxagentWMIsRunning) { - if (nxagentOption(AllScreens)) + if (nxagentOption(Fullscreen)) { nxagentMinimizeFromFullScreen(pScreen); } else { - XIconifyWindow(nxagentDisplay, nxagentDefaultWindows[0], - DefaultScreen(nxagentDisplay)); + XIconifyWindow(nxagentDisplay, nxagentDefaultWindows[0], DefaultScreen(nxagentDisplay)); } } } if (switchFullscreen) { - if (nxagentOption(AllScreens) == 1 && nxagentOption(Fullscreen) == 1) - { - nxagentSwitchAllScreens(pScreen, 0); - } - else - { - nxagentSwitchFullscreen(pScreen, !nxagentOption(Fullscreen)); - } - } - - if (switchAllScreens) - { - if (nxagentOption(AllScreens) == 0 && nxagentOption(Fullscreen) == 1) - { - nxagentSwitchFullscreen(pScreen, 0); - } - else - { - nxagentSwitchAllScreens(pScreen, !nxagentOption(AllScreens)); - } + nxagentSwitchFullscreen(pScreen, !nxagentOption(Fullscreen)); } if (startKbd) @@ -2312,16 +1921,8 @@ int nxagentHandleKeyPress(XEvent *X, enum HandleEventResult *result) return 1; } - if (X -> xkey.keycode == 66) - { - nxagentXkbState.Caps = (~nxagentXkbState.Caps & 1); - } - else if (X -> xkey.keycode == 77) - { - nxagentXkbState.Num = (~nxagentXkbState.Num & 1); - } - nxagentLastEventTime = nxagentLastKeyPressTime = GetTimeInMillis(); + x.u.u.type = KeyPress; x.u.u.detail = nxagentConvertKeycode(X -> xkey.keycode); @@ -2759,8 +2360,7 @@ int nxagentHandleClientMessageEvent(XEvent *X, enum HandleEventResult *result) } if (X -> xclient.window == (nxagentOption(Fullscreen) ? - nxagentIconWindow : nxagentDefaultWindows[0]) || - nxagentWMIsRunning == 0) + nxagentIconWindow : nxagentDefaultWindows[0])) { *result = doCloseSession; } @@ -3357,7 +2957,7 @@ int nxagentHandleConfigureNotify(XEvent* X) if (X -> xconfigure.window == nxagentDefaultWindows[pScreen -> myNum]) { - if (nxagentOption(AllScreens) == 0) + if (nxagentOption(Fullscreen) == 0) { if (nxagentOption(DesktopResize) == 1) { @@ -3426,34 +3026,6 @@ int nxagentHandleConfigureNotify(XEvent* X) doRandR = 0; } - nxagentChangeOption(Width, X -> xconfigure.width); - nxagentChangeOption(Height, X -> xconfigure.height); - - XMoveResizeWindow(nxagentDisplay, nxagentInputWindows[0], 0, 0, - X -> xconfigure.width, X -> xconfigure.height); - - if (nxagentOption(Fullscreen) == 0) - { - nxagentMoveViewport(pScreen, 0, 0); - } - else - { - nxagentChangeOption(RootX, (nxagentOption(Width) - - nxagentOption(RootWidth)) / 2); - nxagentChangeOption(RootY, (nxagentOption(Height) - - nxagentOption(RootHeight)) / 2); - nxagentChangeOption(ViewportXSpan, nxagentOption(Width) - - nxagentOption(RootWidth)); - nxagentChangeOption(ViewportYSpan, nxagentOption(Height) - - nxagentOption(RootHeight)); - - nxagentUpdateViewportFrame(0, 0, nxagentOption(RootWidth), - nxagentOption(RootHeight)); - - XMoveWindow(nxagentDisplay, nxagentWindow(WindowTable[pScreen -> myNum]), - nxagentOption(RootX), nxagentOption(RootY)); - } - if (doRandR) { #ifdef TEST @@ -3475,6 +3047,8 @@ int nxagentHandleConfigureNotify(XEvent* X) int nxagentHandleReparentNotify(XEvent* X) { + ScreenPtr pScreen = nxagentScreen(X -> xreparent.window); + #ifdef TEST fprintf(stderr, "nxagentHandleReparentNotify: Going to handle a new reparent event.\n"); #endif @@ -3527,8 +3101,6 @@ int nxagentHandleReparentNotify(XEvent* X) #ifdef WARNING fprintf(stderr, "nxagentHandleReparentNotify: WARNING! Failed QueryTree request.\n"); #endif - - break; } if (result && children_return) @@ -3581,95 +3153,6 @@ int nxagentHandleReparentNotify(XEvent* X) return 1; } - else if (nxagentWMIsRunning == 1 && nxagentOption(Fullscreen) == 0 && - nxagentOption(WMBorderWidth) == -1) - { - XlibWindow w; - XlibWindow rootReturn = 0; - XlibWindow parentReturn = 0; - XlibWindow junk; - XlibWindow *childrenReturn = NULL; - unsigned int nchildrenReturn = 0; - Status result; - XWindowAttributes attributes; - int x, y; - int xParent, yParent; - - /* - * Calculate the absolute upper-left X e Y - */ - - if ((XGetWindowAttributes(nxagentDisplay, X -> xreparent.window, - &attributes) == 0)) - { - #ifdef WARNING - fprintf(stderr, "nxagentHandleReparentNotify: WARNING! " - "XGetWindowAttributes failed.\n"); - #endif - - return 1; - } - - x = attributes.x; - y = attributes.y; - - XTranslateCoordinates(nxagentDisplay, X -> xreparent.window, - attributes.root, -attributes.border_width, - -attributes.border_width, &x, &y, &junk); - - /* - * Calculate the parent X and parent Y. - */ - - w = X -> xreparent.parent; - - if (w != DefaultRootWindow(nxagentDisplay)) - { - do - { - result = XQueryTree(nxagentDisplay, w, &rootReturn, &parentReturn, - &childrenReturn, &nchildrenReturn); - - if (parentReturn == rootReturn || parentReturn == 0 || result == 0) - { - break; - } - - if (result == 1 && childrenReturn != NULL) - { - XFree(childrenReturn); - } - - w = parentReturn; - } - while (True); - - /* - * WM reparented. Find edge of the frame. - */ - - if (XGetWindowAttributes(nxagentDisplay, w, &attributes) == 0) - { - #ifdef WARNING - fprintf(stderr, "nxagentHandleReparentNotify: WARNING! " - "XGetWindowAttributes failed for parent window.\n"); - #endif - - return 1; - } - - xParent = attributes.x; - yParent = attributes.y; - - /* - * Difference between Absolute X and Parent X gives thickness of side frame. - * Difference between Absolute Y and Parent Y gives thickness of title bar. - */ - - nxagentChangeOption(WMBorderWidth, (x - xParent)); - nxagentChangeOption(WMTitleHeight, (y - yParent)); - } - } return 1; } @@ -3830,8 +3313,6 @@ void nxagentGrabPointerAndKeyboard(XEvent *X) int resource; - int result; - #ifdef TEST fprintf(stderr, "nxagentGrabPointerAndKeyboard: Grabbing pointer and keyboard with event at [%p].\n", (void *) X); @@ -3850,22 +3331,8 @@ void nxagentGrabPointerAndKeyboard(XEvent *X) fprintf(stderr, "nxagentGrabPointerAndKeyboard: Going to grab the keyboard in context [B1].\n"); #endif - result = XGrabKeyboard(nxagentDisplay, nxagentFullscreenWindow, - True, GrabModeAsync, GrabModeAsync, now); - - if (result != GrabSuccess) - { - return; - } - - /* - * The smart scheduler could be stopped while - * waiting for the reply. In this case we need - * to yield explicitly to avoid to be stuck in - * the dispatch loop forever. - */ - - isItTimeToYield = 1; + XGrabKeyboard(nxagentDisplay, nxagentFullscreenWindow, + True, GrabModeAsync, GrabModeAsync, now); #ifdef TEST fprintf(stderr, "nxagentGrabPointerAndKeyboard: Going to grab the pointer in context [B2].\n"); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.h b/nx-X11/programs/Xserver/hw/nxagent/Events.h index c74fa151f..3e04222a2 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -29,15 +29,9 @@ enum HandleEventResult { doNothing = 0, doMinimize, - doDebugTree, doCloseSession, doStartKbd, doSwitchFullscreen, - doSwitchAllScreens, - doViewportMoveUp, - doViewportMoveLeft, - doViewportMoveRight, - doViewportMoveDown, doViewportLeft, doViewportUp, doViewportRight, diff --git a/nx-X11/programs/Xserver/hw/nxagent/Extensions.c b/nx-X11/programs/Xserver/hw/nxagent/Extensions.c index aced24ff4..748afa53e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Extensions.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Extensions.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Extensions.h b/nx-X11/programs/Xserver/hw/nxagent/Extensions.h index 5335cf87c..06185170e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Extensions.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Extensions.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Font.c b/nx-X11/programs/Xserver/hw/nxagent/Font.c index 5e58b792b..b14dc883b 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Font.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Font.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Font.h b/nx-X11/programs/Xserver/hw/nxagent/Font.h index 63cb6aa24..d95cbdc83 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Font.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Font.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/GC.c b/nx-X11/programs/Xserver/hw/nxagent/GC.c index 71562d999..55a0a0031 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/GC.c +++ b/nx-X11/programs/Xserver/hw/nxagent/GC.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c index e18b034eb..d2cc58400 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/GCOps.c +++ b/nx-X11/programs/Xserver/hw/nxagent/GCOps.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/GCOps.h b/nx-X11/programs/Xserver/hw/nxagent/GCOps.h index fa4967aee..666a098bf 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/GCOps.h +++ b/nx-X11/programs/Xserver/hw/nxagent/GCOps.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/GCs.h b/nx-X11/programs/Xserver/hw/nxagent/GCs.h index f7e13477a..460469696 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/GCs.h +++ b/nx-X11/programs/Xserver/hw/nxagent/GCs.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c index 310b572cc..e43fbb931 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Handlers.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Handlers.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -527,8 +527,7 @@ void nxagentBlockHandler(pointer data, struct timeval **timeout, pointer mask) synchronize, nxagentReady); #endif - if (NXDisplayError(nxagentDisplay) == 0 && - nxagentQueuedEvents(nxagentDisplay) > 0) + if (nxagentQueuedEvents(nxagentDisplay) > 0) { #ifdef WARNING fprintf(stderr, "nxagentBlockHandler: WARNING! Forcing a null timeout with events queued.\n"); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Handlers.h b/nx-X11/programs/Xserver/hw/nxagent/Handlers.h index 3d3b335c0..8cf92b219 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Handlers.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Handlers.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Holder.c b/nx-X11/programs/Xserver/hw/nxagent/Holder.c index bfd907cde..02fde6782 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Holder.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Holder.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Holder.h b/nx-X11/programs/Xserver/hw/nxagent/Holder.h index c39b98780..469da223d 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Holder.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Holder.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Icons.h b/nx-X11/programs/Xserver/hw/nxagent/Icons.h index 0601584d4..350e76487 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Icons.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Icons.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Image.c b/nx-X11/programs/Xserver/hw/nxagent/Image.c index e499b7a11..ec7a60a96 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Image.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Image.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Image.h b/nx-X11/programs/Xserver/hw/nxagent/Image.h index 57272ab18..bd6d4c948 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Image.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Image.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Imakefile b/nx-X11/programs/Xserver/hw/nxagent/Imakefile index 51173e410..633e17a22 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Imakefile +++ b/nx-X11/programs/Xserver/hw/nxagent/Imakefile @@ -206,8 +206,7 @@ DEFINES = -g $(OS_DEFINES) $(EXT_DEFINES) $(UPG_DEFINES) \ -DNXAGENT_SPLASH \ -DNXAGENT_ARTSD \ -UNX_DEBUG_INPUT \ - -UPANORAMIX \ - -UDEBUG_TREE + -UPANORAMIX all:: $(OBJS) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Init.c b/nx-X11/programs/Xserver/hw/nxagent/Init.c index 789ff3446..f60d7c457 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Init.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Init.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -193,7 +193,7 @@ void InitOutput(ScreenInfo *screenInfo, int argc, char *argv[]) if (serverGeneration <= 1) { fprintf(stderr, "\nNXAGENT - Version " NXAGENT_VERSION "\n\n"); - fprintf(stderr, "Copyright (C) 2001, 2010 NoMachine.\n"); + fprintf(stderr, "Copyright (C) 2001, 2007 NoMachine.\n"); fprintf(stderr, "See http://www.nomachine.com/ for more information.\n\n"); fprintf(stderr, "Info: Agent running with pid '%d'.\n", getpid()); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Init.h b/nx-X11/programs/Xserver/hw/nxagent/Init.h index cf154e86d..16c74ea99 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Init.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Init.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c index 8db38892e..a4729e9b7 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.h b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.h index 0e11a8a13..4c7395a43 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c b/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c index 6c6e477ab..eee13db2d 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -92,18 +92,6 @@ int nxagentCheckSpecialKeystroke(XKeyEvent *X, enum HandleEventResult *result) { switch (sym) { - #ifdef DEBUG_TREE - - case XK_q: - case XK_Q: - { - *result = doDebugTree; - - break; - } - - #endif /* DEBUG_TREE */ - case XK_t: case XK_T: { @@ -116,7 +104,7 @@ int nxagentCheckSpecialKeystroke(XKeyEvent *X, enum HandleEventResult *result) { if (nxagentOption(Rootless) == False) { - *result = doSwitchAllScreens; + *result = doSwitchFullscreen; } break; @@ -276,68 +264,6 @@ int nxagentCheckSpecialKeystroke(XKeyEvent *X, enum HandleEventResult *result) #endif } } - else if ((X -> state & nxagentAltMetaMask) && - ((X -> state & (ControlMask | ShiftMask)) == (ControlMask | - ShiftMask))) - { - switch (sym) - { - case XK_f: - case XK_F: - { - if (nxagentOption(Rootless) == 0) - { - *result = doSwitchFullscreen; - } - - break; - } - case XK_Left: - case XK_KP_Left: - { - if (nxagentOption(Rootless) == 0 && - nxagentOption(DesktopResize) == 0) - { - *result = doViewportMoveLeft; - } - - break; - } - case XK_Up: - case XK_KP_Up: - { - if (nxagentOption(Rootless) == 0 && - nxagentOption(DesktopResize) == 0) - { - *result = doViewportMoveUp; - } - - break; - } - case XK_Right: - case XK_KP_Right: - { - if (nxagentOption(Rootless) == 0 && - nxagentOption(DesktopResize) == 0) - { - *result = doViewportMoveRight; - } - - break; - } - case XK_Down: - case XK_KP_Down: - { - if (nxagentOption(Rootless) == 0 && - nxagentOption(DesktopResize) == 0) - { - *result = doViewportMoveDown; - } - - break; - } - } - } return (*result == doNothing) ? 0 : 1; } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keystroke.h b/nx-X11/programs/Xserver/hw/nxagent/Keystroke.h index ef71a8851..fea97975c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Keystroke.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Keystroke.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/LICENSE b/nx-X11/programs/Xserver/hw/nxagent/LICENSE index 8446e6f55..451196c1a 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/LICENSE +++ b/nx-X11/programs/Xserver/hw/nxagent/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2001, 2011 NoMachine - http://www.nomachine.com/. +Copyright (c) 2001, 2009 NoMachine - http://www.nomachine.com/. NXAGENT and NX extensions to X are copyright of NoMachine. diff --git a/nx-X11/programs/Xserver/hw/nxagent/Literals.h b/nx-X11/programs/Xserver/hw/nxagent/Literals.h index aaa3430d6..21c27afa1 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Literals.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Literals.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Millis.c b/nx-X11/programs/Xserver/hw/nxagent/Millis.c index e9c739eeb..e275b985f 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Millis.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Millis.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Millis.h b/nx-X11/programs/Xserver/hw/nxagent/Millis.h index 69d247bbc..9b6d879d7 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Millis.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Millis.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c index 4f59b8098..e189b9539 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c @@ -6,7 +6,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c.NX.original index 4f59b8098..e189b9539 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/NXdispatch.c.NX.original @@ -6,7 +6,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c b/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c index 1cccfd972..b57401ceb 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c @@ -6,7 +6,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c.NX.original index 1cccfd972..b57401ceb 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/NXdixfonts.c.NX.original @@ -6,7 +6,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXevents.c b/nx-X11/programs/Xserver/hw/nxagent/NXevents.c index f697cf3ca..b01e4a452 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXevents.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXevents.c @@ -6,7 +6,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXevents.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/NXevents.c.NX.original index f697cf3ca..b01e4a452 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXevents.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/NXevents.c.NX.original @@ -6,7 +6,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXextension.c b/nx-X11/programs/Xserver/hw/nxagent/NXextension.c index 1d86bf870..9bb868f2b 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXextension.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXextension.c @@ -6,7 +6,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXextension.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/NXextension.c.NX.original index 1d86bf870..9bb868f2b 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXextension.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/NXextension.c.NX.original @@ -6,7 +6,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXglyph.c b/nx-X11/programs/Xserver/hw/nxagent/NXglyph.c index 22483b3fd..6ec64afae 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXglyph.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXglyph.c @@ -6,7 +6,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXglyph.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/NXglyph.c.NX.original index 22483b3fd..6ec64afae 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXglyph.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/NXglyph.c.NX.original @@ -6,7 +6,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c b/nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c index 9212bf438..6352c88d1 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c @@ -6,7 +6,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c.NX.original index 9212bf438..6352c88d1 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/NXglyphcurs.c.NX.original @@ -6,7 +6,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXglyphstr.h b/nx-X11/programs/Xserver/hw/nxagent/NXglyphstr.h index 0f122be4a..0874f0fef 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXglyphstr.h +++ b/nx-X11/programs/Xserver/hw/nxagent/NXglyphstr.h @@ -6,7 +6,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXglyphstr.h.NX.original b/nx-X11/programs/Xserver/hw/nxagent/NXglyphstr.h.NX.original index 0f122be4a..0874f0fef 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXglyphstr.h.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/NXglyphstr.h.NX.original @@ -6,7 +6,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXmiglyph.c b/nx-X11/programs/Xserver/hw/nxagent/NXmiglyph.c index 09901ba9c..e0f6d1cdf 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXmiglyph.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXmiglyph.c @@ -6,7 +6,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXmiglyph.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/NXmiglyph.c.NX.original index 09901ba9c..e0f6d1cdf 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXmiglyph.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/NXmiglyph.c.NX.original @@ -6,7 +6,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c b/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c index d32cdb6c4..95178d362 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c @@ -6,7 +6,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c.NX.original index d32cdb6c4..95178d362 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/NXpicture.c.NX.original @@ -6,7 +6,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXpicturestr.h b/nx-X11/programs/Xserver/hw/nxagent/NXpicturestr.h index 91eab0125..90a31d36f 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXpicturestr.h +++ b/nx-X11/programs/Xserver/hw/nxagent/NXpicturestr.h @@ -6,7 +6,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXpicturestr.h.NX.original b/nx-X11/programs/Xserver/hw/nxagent/NXpicturestr.h.NX.original index 91eab0125..90a31d36f 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXpicturestr.h.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/NXpicturestr.h.NX.original @@ -6,7 +6,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c index 20a6bd6dc..06d6074ad 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c @@ -6,7 +6,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c.NX.original index 20a6bd6dc..06d6074ad 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/NXproperty.c.NX.original @@ -6,7 +6,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXrandr.c b/nx-X11/programs/Xserver/hw/nxagent/NXrandr.c index d593fa6aa..179cc1ab0 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXrandr.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXrandr.c @@ -6,7 +6,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXrandr.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/NXrandr.c.NX.original index d593fa6aa..179cc1ab0 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXrandr.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/NXrandr.c.NX.original @@ -6,7 +6,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c b/nx-X11/programs/Xserver/hw/nxagent/NXrender.c index 43607ac08..a670c3521 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXrender.c @@ -31,7 +31,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/NXrender.c.NX.original index 43607ac08..a670c3521 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/NXrender.c.NX.original @@ -31,7 +31,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c b/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c index 95ecde951..a0d4cd6ee 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c @@ -6,7 +6,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c.NX.original index 95ecde951..a0d4cd6ee 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/NXwindow.c.NX.original @@ -6,7 +6,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXxrandr.c b/nx-X11/programs/Xserver/hw/nxagent/NXxrandr.c index 37b2c74fd..a8aa254ff 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXxrandr.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXxrandr.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXxrandr.h b/nx-X11/programs/Xserver/hw/nxagent/NXxrandr.h index 160dc6517..8ceb49418 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXxrandr.h +++ b/nx-X11/programs/Xserver/hw/nxagent/NXxrandr.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXxrandrint.h b/nx-X11/programs/Xserver/hw/nxagent/NXxrandrint.h index 97ae77e29..727161648 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXxrandrint.h +++ b/nx-X11/programs/Xserver/hw/nxagent/NXxrandrint.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Options.c b/nx-X11/programs/Xserver/hw/nxagent/Options.c index 5d7855667..955be61bc 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Options.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Options.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -63,9 +63,6 @@ void nxagentInitOptions() nxagentOptions.Height = 0; nxagentOptions.BorderWidth = 0; - nxagentOptions.WMBorderWidth = -1; - nxagentOptions.WMTitleHeight = -1; - nxagentOptions.SavedX = 0; nxagentOptions.SavedY = 0; nxagentOptions.SavedWidth = 0; @@ -171,9 +168,6 @@ void nxagentResetOptions() nxagentOptions.TileWidth = UNDEFINED; nxagentOptions.TileHeight = UNDEFINED; - - nxagentOptions.WMBorderWidth = -1; - nxagentOptions.WMTitleHeight = -1; } void nxagentSaveOptions() diff --git a/nx-X11/programs/Xserver/hw/nxagent/Options.h b/nx-X11/programs/Xserver/hw/nxagent/Options.h index 7850a0586..7126338a8 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Options.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Options.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -102,13 +102,6 @@ typedef struct _AgentOptions int Fullscreen; - /* - * True if the fullscreen NX session will - * extend on all available screens. - */ - - int AllScreens; - /* * Set to the auto-disconnect timeout, if * the user activated this feature. @@ -133,9 +126,6 @@ typedef struct _AgentOptions * screen. */ - int WMBorderWidth; - int WMTitleHeight; - int SavedX; int SavedY; int SavedWidth; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Pixels.c b/nx-X11/programs/Xserver/hw/nxagent/Pixels.c index d3ab9dd2f..eb8daf8f3 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Pixels.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Pixels.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Pixels.h b/nx-X11/programs/Xserver/hw/nxagent/Pixels.h index 918d74dc7..cd2df1fa6 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Pixels.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Pixels.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -108,12 +108,6 @@ FIXME: The condition checking for the render avoid problems with the render composi- te on XFree86 remote server. */ -/* -FIXME: Changed macro: NXAGENT_SHOULD_DEFER_COMPOSITE - to handle situation, when pSrc -> pDrawable - is NULL. This case happens with gradients - and solid fill. - #define NXAGENT_SHOULD_DEFER_COMPOSITE(pSrc, pMask, pDst) \ ((nxagentRenderVersionMajor == 0 && \ nxagentRenderVersionMinor == 8 && \ @@ -124,18 +118,6 @@ FIXME: Changed macro: NXAGENT_SHOULD_DEFER_COMPOSITE nxagentOption(DeferLevel) == 1) || \ (nxagentOption(DeferLevel) >= 2 && \ nxagentOption(LinkType) < LINK_TYPE_ADSL)) -*/ -#define NXAGENT_SHOULD_DEFER_COMPOSITE(pSrc, pMask, pDst) \ - ((nxagentRenderVersionMajor == 0 && \ - nxagentRenderVersionMinor == 8 && \ - (pDst) -> pDrawable -> type == DRAWABLE_PIXMAP) || \ - (nxagentOption(DeferLevel) >= 2 && \ - nxagentOption(LinkType) < LINK_TYPE_ADSL) || \ - (nxagentOption(DeferLevel) == 1 && \ - (pDst) -> pDrawable -> type == DRAWABLE_PIXMAP && \ - (((pSrc) -> pDrawable && nxagentDrawableStatus((pSrc) -> pDrawable) == NotSynchronized) || \ - ((pMask) && nxagentDrawableStatus((pMask) -> pDrawable) == NotSynchronized)))) - #define NXAGENT_SHOULD_DEFER_PUTIMAGE(pDrawable) \ (nxagentSplitTrap == 0 && \ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c b/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c index ad7e9c313..9a4776192 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Pixmap.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Pixmaps.h b/nx-X11/programs/Xserver/hw/nxagent/Pixmaps.h index 98d5666d1..93df4d444 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Pixmaps.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Pixmaps.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Pointer.c b/nx-X11/programs/Xserver/hw/nxagent/Pointer.c index a751974af..8a6702d18 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Pointer.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Pointer.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -57,13 +57,6 @@ is" without express or implied warranty. #undef TEST #undef DEBUG -/* - * The nxagentReversePointerMap array is used to - * memorize remote display pointer map. - */ - -unsigned char nxagentReversePointerMap[MAXBUTTONS]; - void nxagentChangePointerControl(DeviceIntPtr pDev, PtrCtrl *ctrl) { /* @@ -132,8 +125,6 @@ int nxagentPointerProc(DeviceIntPtr pDev, int onoff) return Success; } - nxagentInitPointerMap(); - nxagentEnablePointerEvents(); break; @@ -164,28 +155,3 @@ int nxagentPointerProc(DeviceIntPtr pDev, int onoff) return Success; } - -void nxagentInitPointerMap(void) -{ - int numButtons; - - int i; - - unsigned char pointerMap[MAXBUTTONS]; - - #ifdef DEBUG - fprintf(stderr, "nxagentInitPointerMap: Going to retrieve the " - "pointer map from remote display.\n"); - #endif - - numButtons = XGetPointerMapping(nxagentDisplay, pointerMap, MAXBUTTONS); - - /* - * Computing revers pointer map. - */ - - for (i = 1; i <= numButtons; i++) - { - nxagentReversePointerMap[pointerMap[i - 1] - 1] = i; - } -} diff --git a/nx-X11/programs/Xserver/hw/nxagent/Pointer.h b/nx-X11/programs/Xserver/hw/nxagent/Pointer.h index 3b9ccce15..3d8899bbe 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Pointer.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Pointer.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -38,17 +38,8 @@ is" without express or implied warranty. (ButtonPressMask | ButtonReleaseMask | PointerMotionMask | \ EnterWindowMask | LeaveWindowMask) -/* - * The nxagentReversePointerMap array is used to - * memorize remote display pointer map. - */ - -extern unsigned char nxagentReversePointerMap[MAXBUTTONS]; - void nxagentChangePointerControl(DeviceIntPtr pDev, PtrCtrl *ctrl); int nxagentPointerProc(DeviceIntPtr pDev, int onoff); -void nxagentInitPointerMap(void); - #endif /* __Pointer_H__ */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c index b78660240..c656f2912 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -81,8 +81,6 @@ extern Bool nxagentUninstallFontServerPath(void); extern void nxagentRemoveXConnection(void); -extern void nxagentInitPointerMap(void); - static char *nxagentGetReconnectError(void); void nxagentInitializeRecLossyLevel(void); @@ -586,8 +584,6 @@ Bool nxagentReconnectSession(void) nxagentOldKeyboard = NULL; } - nxagentInitPointerMap(); - nxagentDeactivatePointerGrab(); nxagentWakeupByReconnect(); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.h b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.h index c321bfada..6a3b56fc7 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Render.c b/nx-X11/programs/Xserver/hw/nxagent/Render.c index 6c74c147f..5c6503e64 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Render.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Render.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -147,6 +147,8 @@ void nxagentCursorPostSaveRenderInfo(CursorPtr pCursor, ScreenPtr pScreen, int nxagentCreatePicture(PicturePtr pPicture, Mask mask); +void nxagentDestroyPicture(PicturePtr pPicture); + int nxagentChangePictureClip(PicturePtr pPicture, int clipType, int nRects, xRectangle *rects, int xOrigin, int yOrigin); @@ -584,16 +586,16 @@ XRenderPictFormat *nxagentMatchingFormats(PictFormatPtr pFormat) void nxagentDestroyPicture(PicturePtr pPicture) { - if (pPicture == NULL || nxagentPicturePriv(pPicture) -> picture == 0) - { - return; - } - #ifdef TEST fprintf(stderr, "nxagentDestroyPicture: Going to destroy picture at [%p].\n", (void *) pPicture); #endif + if (pPicture == NULL) + { + return; + } + XRenderFreePicture(nxagentDisplay, nxagentPicturePriv(pPicture) -> picture); @@ -1008,15 +1010,12 @@ void nxagentComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pD #ifdef DEBUG - if (pSrc -> pDrawable != NULL) - { - fprintf(stderr, "nxagentComposite: Source Picture [%lu][%p] with drawable [%s%s][%p].\n", - nxagentPicturePriv(pSrc) -> picture, (void *) pSrc, - (pSrc -> pDrawable -> type == DRAWABLE_PIXMAP && - nxagentIsShmPixmap((PixmapPtr) pSrc -> pDrawable)) ? "Shared " : "", - pSrc -> pDrawable -> type == DRAWABLE_PIXMAP ? "Pixmap" : "Window", - (void *) pSrc -> pDrawable); - } + fprintf(stderr, "nxagentComposite: Source Picture [%lu][%p] with drawable [%s%s][%p].\n", + nxagentPicturePriv(pSrc) -> picture, (void *) pSrc, + (pSrc -> pDrawable -> type == DRAWABLE_PIXMAP && + nxagentIsShmPixmap((PixmapPtr) pSrc -> pDrawable)) ? "Shared " : "", + pSrc -> pDrawable -> type == DRAWABLE_PIXMAP ? "Pixmap" : "Window", + (void *) pSrc -> pDrawable); fprintf(stderr, "nxagentComposite: Destination Picture [%lu][%p] with drawable [%s%s][%p].\n", nxagentPicturePriv(pDst) -> picture, (void *) pDst, @@ -1065,19 +1064,16 @@ void nxagentComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pD * the wrong data. */ - if (pSrc -> pDrawable != NULL) - { - nxagentSynchronizeShmPixmap(pSrc -> pDrawable, xSrc, ySrc, width, height); + nxagentSynchronizeShmPixmap(pSrc -> pDrawable, xSrc, ySrc, width, height); - if (nxagentDrawableStatus(pSrc -> pDrawable) == NotSynchronized) - { - #ifdef TEST - fprintf(stderr, "nxagentComposite: Synchronizing the source drawable [%p].\n", - (void *) pSrc -> pDrawable); - #endif + if (nxagentDrawableStatus(pSrc -> pDrawable) == NotSynchronized) + { + #ifdef TEST + fprintf(stderr, "nxagentComposite: Synchronizing the source drawable [%p].\n", + (void *) pSrc -> pDrawable); + #endif - nxagentSynchronizeDrawable(pSrc -> pDrawable, DO_WAIT, NEVER_BREAK, NULL); - } + nxagentSynchronizeDrawable(pSrc -> pDrawable, DO_WAIT, NEVER_BREAK, NULL); } if (pDst -> pDrawable != pSrc -> pDrawable) @@ -2815,248 +2811,3 @@ Bool nxagentDisconnectAllPicture() return True; } -void nxagentRenderCreateSolidFill(PicturePtr pPicture, xRenderColor *color) -{ - Picture id; - - if (nxagentRenderEnable == False) - { - return; - } - - #ifdef DEBUG - - fprintf(stderr, "nxagentRenderCreateSolidFill: Got called.\n"); - - if (pPicture == NULL) - { - fprintf(stderr, "nxagentRenderCreateSolidFill: WARNING! pPicture pointer is NULL.\n"); - } - - if (color == NULL) - { - fprintf(stderr, "nxagentRenderCreateSolidFill: WARNING! color pointer is NULL.\n"); - } - - #endif /* #ifdef DEBUG */ - - memset(&(nxagentPicturePriv(pPicture) -> lastServerValues), 0, - sizeof(XRenderPictureAttributes_)); - - id = XRenderCreateSolidFill(nxagentDisplay, (XRenderColor *) color); - - #ifdef DEBUG - XSync(nxagentDisplay, 0); - #endif - - #ifdef TEST - fprintf(stderr, "nxagentRenderCreateSolidFill: Created solid fill xid [%lu].\n", id); - #endif - - nxagentPicturePriv(pPicture) -> picture = id; -} - -void nxagentRenderCreateLinearGradient(PicturePtr pPicture, xPointFixed *p1, - xPointFixed *p2, int nStops, - xFixed *stops, - xRenderColor *colors) -{ - Picture id; - - XLinearGradient linearGradient; - - if (nxagentRenderEnable == False) - { - return; - } - - #ifdef DEBUG - - fprintf(stderr, "nxagentRenderCreateLinearGradient: Got called.\n"); - - if (pPicture == NULL) - { - fprintf(stderr, "nxagentRenderCreateLinearGradient: WARNING! pPicture pointer is NULL.\n"); - } - - if (p1 == NULL) - { - fprintf(stderr, "nxagentRenderCreateLinearGradient: WARNING! p1 pointer is NULL.\n"); - } - - if (p2 == NULL) - { - fprintf(stderr, "nxagentRenderCreateLinearGradient: WARNING! p2 pointer is NULL.\n"); - } - - if (stops == NULL) - { - fprintf(stderr, "nxagentRenderCreateLinearGradient: WARNING! stops pointer is NULL.\n"); - } - - if (colors == NULL) - { - fprintf(stderr, "nxagentRenderCreateLinearGradient: WARNING! colors pointer is NULL.\n"); - } - - #endif /* #ifdef DEBUG */ - - memset(&(nxagentPicturePriv(pPicture) -> lastServerValues), 0, - sizeof(XRenderPictureAttributes_)); - - linearGradient.p1.x = (XFixed) p1 -> x; - linearGradient.p1.y = (XFixed) p1 -> y; - linearGradient.p2.x = (XFixed) p2 -> x; - linearGradient.p2.y = (XFixed) p2 -> y; - - id = XRenderCreateLinearGradient(nxagentDisplay, &linearGradient, - (XFixed *) stops, - (XRenderColor *) colors, nStops); - - #ifdef DEBUG - XSync(nxagentDisplay, 0); - #endif - - #ifdef TEST - fprintf(stderr, "nxagentRenderCreateLinearGradient: Created linear gradient xid [%lu].\n", id); - #endif - - nxagentPicturePriv(pPicture) -> picture = id; -} - -void nxagentRenderCreateRadialGradient(PicturePtr pPicture, xPointFixed *inner, - xPointFixed *outer, - xFixed innerRadius, - xFixed outerRadius, - int nStops, - xFixed *stops, - xRenderColor *colors) -{ - Picture id; - - XRadialGradient radialGradient; - - if (nxagentRenderEnable == False) - { - return; - } - - #ifdef DEBUG - - fprintf(stderr, "nxagentRenderCreateRadialGradient: Got called.\n"); - - if (pPicture == NULL) - { - fprintf(stderr, "nxagentRenderCreateRadialGradient: WARNING! pPicture pointer is NULL.\n"); - } - - if (inner == NULL) - { - fprintf(stderr, "nxagentRenderCreateRadialGradient: WARNING! inner pointer is NULL.\n"); - } - - if (outer == NULL) - { - fprintf(stderr, "nxagentRenderCreateRadialGradient: WARNING! outer pointer is NULL.\n"); - } - - if (stops == NULL) - { - fprintf(stderr, "nxagentRenderCreateRadialGradient: WARNING! stops pointer is NULL.\n"); - } - - if (colors == NULL) - { - fprintf(stderr, "nxagentRenderCreateRadialGradient: WARNING! colors pointer is NULL.\n"); - } - - #endif /* #ifdef DEBUG */ - - memset(&(nxagentPicturePriv(pPicture) -> lastServerValues), 0, - sizeof(XRenderPictureAttributes_)); - - radialGradient.inner.x = (XFixed) inner -> x; - radialGradient.inner.y = (XFixed) inner -> y; - radialGradient.inner.radius = (XFixed) innerRadius; - radialGradient.outer.x = (XFixed) outer -> x; - radialGradient.outer.y = (XFixed) outer -> y; - radialGradient.outer.radius = (XFixed) outerRadius; - - id = XRenderCreateRadialGradient(nxagentDisplay, &radialGradient, - (XFixed *) stops, - (XRenderColor *) colors, nStops); - - #ifdef DEBUG - XSync(nxagentDisplay, 0); - #endif - - #ifdef TEST - fprintf(stderr, "nxagentRenderCreateRadialGradient: Created radial gradient xid [%lu].\n", id); - #endif - - nxagentPicturePriv(pPicture) -> picture = id; -} - -void nxagentRenderCreateConicalGradient(PicturePtr pPicture, - xPointFixed *center, - xFixed angle, int nStops, - xFixed *stops, - xRenderColor *colors) -{ - Picture id; - - XConicalGradient conicalGradient; - - if (nxagentRenderEnable == False) - { - return; - } - - #ifdef DEBUG - - fprintf(stderr, "nxagentRenderCreateConicalGradient: Got called.\n"); - - if (pPicture == NULL) - { - fprintf(stderr, "nxagentRenderCreateConicalGradient: WARNING! pPicture pointer is NULL.\n"); - } - - if (center == NULL) - { - fprintf(stderr, "nxagentRenderCreateConicalGradient: WARNING! center pointer is NULL.\n"); - } - - if (stops == NULL) - { - fprintf(stderr, "nxagentRenderCreateConicalGradient: WARNING! stops pointer is NULL.\n"); - } - - if (colors == NULL) - { - fprintf(stderr, "nxagentRenderCreateConicalGradient: WARNING! colors pointer is NULL.\n"); - } - - #endif /* #ifdef DEBUG */ - - memset(&(nxagentPicturePriv(pPicture) -> lastServerValues), 0, - sizeof(XRenderPictureAttributes_)); - - conicalGradient.center.x = (XFixed) center -> x; - conicalGradient.center.y = (XFixed) center -> y; - conicalGradient.angle = (XFixed) angle; - - id = XRenderCreateConicalGradient(nxagentDisplay, &conicalGradient, - (XFixed *) stops, - (XRenderColor *) colors, nStops); - - #ifdef DEBUG - XSync(nxagentDisplay, 0); - #endif - - #ifdef TEST - fprintf(stderr, "nxagentRenderCreateConicalGradient: Created conical gradient xid [%lu].\n", id); - #endif - - nxagentPicturePriv(pPicture) -> picture = id; -} - diff --git a/nx-X11/programs/Xserver/hw/nxagent/Render.h b/nx-X11/programs/Xserver/hw/nxagent/Render.h index 6f61ca85f..77e842d16 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Render.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Render.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -105,6 +105,4 @@ void nxagentDisconnectPicture(pointer p0, XID x1, void* p2); void nxagentReconnectGlyphSet(void* p0, XID x1, void *p2); -void nxagentDestroyPicture(PicturePtr pPicture); - #endif /* __Render_H__ */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Rootless.c b/nx-X11/programs/Xserver/hw/nxagent/Rootless.c index 706aa9320..53f4df41e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Rootless.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Rootless.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -626,7 +626,6 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) XlibAtom *atoms = malloc(nUnits * sizeof(*atoms)); Atom *input = value; int i; - int j = 0; freeMem = True; export = True; @@ -634,40 +633,16 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) for (i = 0; i < nUnits; i++) { - /* - * Exporting the _NET_WM_PING property could - * result in rootless windows being grayed out - * when the compiz window manager is running. - * - * Better solution would probably be to handle - * the communication with the window manager - * instead of just getting rid of the property. - */ - - if (strcmp(NameForAtom(input[i]), "_NET_WM_PING") != 0) - { - atoms[j] = nxagentLocalToRemoteAtom(input[i]); - - if (atoms[j] == None) - { - #ifdef WARNING - fprintf(stderr, "nxagentExportProperty: WARNING! Failed to convert local atom %ld [%s].\n", - (long int) input[i], validateString(NameForAtom(input[i]))); - #endif - } - - j++; - } - #ifdef TEST - else - { - fprintf(stderr, "nxagentExportProperty: WARNING! " - "Not exporting the _NET_WM_PING property.\n"); - } - #endif + atoms[i] = nxagentLocalToRemoteAtom(input[i]); + + if (atoms[i] == None) + { + #ifdef WARNING + fprintf(stderr, "nxagentExportProperty: WARNING! Failed to convert local atom %ld [%s].\n", + (long int) input[i], validateString(NameForAtom(input[i]))); + #endif + } } - - nUnits = j; } else if (strcmp(typeS, "WINDOW") == 0) { @@ -725,57 +700,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) } else { - #ifdef TEST - fprintf(stderr, "nxagentExportProperty: Property [%lu] format [%i] " - "units [%lu].\n", propertyX, format, nUnits); - #endif - - if ((format >> 3) * nUnits + sizeof(xChangePropertyReq) < - (MAX_REQUEST_SIZE << 2)) - { - XChangeProperty(nxagentDisplay, nxagentWindow(pWin), propertyX, typeX, - format, mode, (void*)output, nUnits); - } - else if (mode == PropModeReplace) - { - int n; - char *data; - - XDeleteProperty(nxagentDisplay, nxagentWindow(pWin), propertyX); - - data = (char *) output; - - while (nUnits > 0) - { - if ((format >> 3) * nUnits + sizeof(xChangePropertyReq) < - (MAX_REQUEST_SIZE << 2)) - { - n = nUnits; - } - else - { - n = ((MAX_REQUEST_SIZE << 2) - sizeof(xChangePropertyReq)) / - (format >> 3); - } - - XChangeProperty(nxagentDisplay, nxagentWindow(pWin), propertyX, - typeX, format, PropModeAppend, (void*) data, n); - - nUnits -= n; - - data = (char *) data + n * (format >> 3); - } - } - else - { - #ifdef WARNING - fprintf(stderr, "nxagentExportProperty: WARNING! " - "Property [%lu] too long.\n", propertyX); - #endif - - goto nxagentExportPropertyError; - } - + XChangeProperty(nxagentDisplay, nxagentWindow(pWin), propertyX, typeX, format, mode, (void*)output, nUnits); nxagentAddPropertyToList(propertyX, pWin); } } @@ -790,8 +715,6 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) #endif } - nxagentExportPropertyError: - if (freeMem) { xfree(output); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Rootless.h b/nx-X11/programs/Xserver/hw/nxagent/Rootless.h index 1ea258db3..5538b58ea 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Rootless.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Rootless.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index 0a0d409eb..4f4160765 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -292,7 +292,7 @@ void nxagentMinimizeFromFullScreen(ScreenPtr pScreen) { XUnmapWindow(nxagentDisplay, nxagentFullscreenWindow); - if (nxagentIpaq) + if(nxagentIpaq) { XMapWindow(nxagentDisplay, nxagentIconWindow); XIconifyWindow(nxagentDisplay, nxagentIconWindow, @@ -307,7 +307,7 @@ void nxagentMinimizeFromFullScreen(ScreenPtr pScreen) void nxagentMaximizeToFullScreen(ScreenPtr pScreen) { - if (nxagentIpaq) + if(nxagentIpaq) { XUnmapWindow(nxagentDisplay, nxagentIconWindow); @@ -334,7 +334,7 @@ FIXME: We'll chech for ReparentNotify and LeaveNotify events after XReparentWind for (i = 0; i < 100 && nxagentWMIsRunning; i++) { #ifdef TEST - fprintf(stderr, "nxagentMaximizeToFullscreen: WARNING! Going to wait for the ReparentNotify event.\n"); + fprintf(stderr, "nxagentSwitchFullscreen: WARNING! Going to wait for the ReparentNotify event.\n"); #endif if (XCheckTypedWindowEvent(nxagentDisplay, nxagentFullscreenWindow, ReparentNotify, &e)) @@ -977,10 +977,6 @@ Bool nxagentOpenScreen(int index, ScreenPtr pScreen, nxagentChangeOption(Fullscreen, False); - nxagentChangeOption(AllScreens, False); - - nxagentFullscreenWindow = 0; - resetAgentPosition = True; } @@ -1384,13 +1380,10 @@ N/A nxagentChangeOption(Height, gattributes.height); } - if (nxagentOption(AllScreens)) - { - attributes.override_redirect = True; - } - if (nxagentOption(Fullscreen)) { + attributes.override_redirect = True; + /* * We need to disable the host's screensaver or * it will otherwise grab the screen even if it @@ -1617,7 +1610,7 @@ N/A nxagentReconnectTrap == 1) { valuemask = CWBackPixel | CWEventMask | CWColormap | - (nxagentOption(AllScreens) == 1 ? CWOverrideRedirect : 0); + (nxagentOption(Fullscreen) == 1 ? CWOverrideRedirect : 0); attributes.background_pixel = nxagentBlackPixel; @@ -1625,13 +1618,10 @@ N/A attributes.colormap = nxagentDefaultVisualColormap(nxagentDefaultVisual(pScreen)); - if (nxagentOption(AllScreens) == 1) + if (nxagentOption(Fullscreen) == 1) { attributes.override_redirect = True; - } - if (nxagentOption(Fullscreen) == 1) - { if (nxagentReconnectTrap) { /* @@ -1764,7 +1754,7 @@ N/A sizeHints.width = nxagentOption(RootWidth); sizeHints.height = nxagentOption(RootHeight); - if (nxagentOption(DesktopResize) == 1 || nxagentOption(Fullscreen) == 1) + if (nxagentOption(DesktopResize) == 1) { sizeHints.max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); sizeHints.max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); @@ -1809,14 +1799,30 @@ N/A XClearWindow(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum]); - if (nxagentOption(AllScreens)) + if (nxagentOption(Fullscreen)) + { + valuemask = CWBackPixmap | CWColormap | CWOverrideRedirect; + } + else + { + valuemask = CWBackPixmap | CWColormap; + } + + attributes.background_pixmap = nxagentScreenSaverPixmap; + attributes.colormap = DefaultColormap(nxagentDisplay, DefaultScreen(nxagentDisplay)); + + if (nxagentOption(Fullscreen)) { + attributes.override_redirect = False; if (nxagentReconnectTrap) { XGrabKeyboard(nxagentDisplay, nxagentFullscreenWindow, True, GrabModeAsync, GrabModeAsync, CurrentTime); } + } + if (nxagentOption(Fullscreen)) + { nxagentIconWindow = nxagentCreateIconWindow(); } else @@ -1874,6 +1880,13 @@ N/A */ XSetWMProtocols(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum], &deleteWMatom, 1); + + /* + if (nxagentOption(Fullscreen)) + { + XSetWMProtocols(nxagentDisplay, nxagentIconWindow, &deleteWMatom, 1); + } + */ } else { @@ -2172,6 +2185,8 @@ Bool nxagentResizeScreen(ScreenPtr pScreen, int width, int height, int oldMmWidth; int oldMmHeight; + RegionPtr pRootWinSize; + #ifdef TEST nxagentPrintAgentGeometry("Before Resize Screen", "nxagentResizeScreen:"); #endif @@ -2251,10 +2266,13 @@ FIXME: We should try to restore the previously if (nxagentOption(Fullscreen)) { - nxagentChangeOption(RootX, (nxagentOption(Width) - - nxagentOption(RootWidth)) / 2); - nxagentChangeOption(RootY, (nxagentOption(Height) - - nxagentOption(RootHeight)) / 2); + nxagentChangeOption(Width, WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay))); + nxagentChangeOption(Height, HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay))); + + nxagentChangeOption(RootX, (WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)) + - nxagentOption(RootWidth)) / 2); + nxagentChangeOption(RootY, (HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)) + - nxagentOption(RootHeight)) / 2); } else { @@ -2265,6 +2283,62 @@ FIXME: We should try to restore the previously nxagentChangeOption(ViewportXSpan, nxagentOption(Width) - nxagentOption(RootWidth)); nxagentChangeOption(ViewportYSpan, nxagentOption(Height) - nxagentOption(RootHeight)); + /* + * Change agent window size and size hints. + */ + + sizeHints.flags = PPosition | PMinSize | PMaxSize; + sizeHints.x = nxagentOption(X); + sizeHints.y = nxagentOption(Y); + + sizeHints.min_width = MIN_NXAGENT_WIDTH; + sizeHints.min_height = MIN_NXAGENT_HEIGHT; + sizeHints.width = width; + sizeHints.height = height; + + if (nxagentOption(DesktopResize) == 1) + { + sizeHints.max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); + sizeHints.max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); + } + else + { + sizeHints.max_width = nxagentOption(RootWidth); + sizeHints.max_height = nxagentOption(RootHeight); + } + + if (nxagentUserGeometry.flag & XValue || nxagentUserGeometry.flag & YValue) + { + sizeHints.flags |= USPosition; + } + + if (nxagentUserGeometry.flag & WidthValue || nxagentUserGeometry.flag & HeightValue) + { + sizeHints.flags |= USSize; + } + + XSetWMNormalHints(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum], &sizeHints); + + if (nxagentOption(Fullscreen)) + { + XResizeWindow(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum], + WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)), + HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay))); + + XResizeWindow(nxagentDisplay, nxagentInputWindows[pScreen -> myNum], + WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)), + HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay))); + } + else + { + XResizeWindow(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum], width, height); + + if (nxagentOption(Rootless) == 0) + { + XResizeWindow(nxagentDisplay, nxagentInputWindows[pScreen -> myNum], width, height); + } + } + /* * Set properties for the agent root window. */ @@ -2286,6 +2360,8 @@ FIXME: We should try to restore the previously (*pScreen -> PositionWindow)(WindowTable[pScreen -> myNum], 0, 0); + pRootWinSize = &WindowTable[pScreen -> myNum] -> winSize; + nxagentSetRootClip(pScreen, 1); XMoveWindow(nxagentDisplay, nxagentWindow(WindowTable[0]), @@ -2293,12 +2369,6 @@ FIXME: We should try to restore the previously nxagentMoveViewport(pScreen, 0, 0); - /* - * Update pointer bounds. - */ - - ScreenRestructured(pScreen); - #ifdef TEST nxagentPrintAgentGeometry("After Resize Screen", "nxagentResizeScreen:"); #endif diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.h b/nx-X11/programs/Xserver/hw/nxagent/Screen.h index 5b1957755..ab8c01a73 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -48,7 +48,6 @@ extern ScreenPtr nxagentDefaultScreen; extern Pixmap nxagentPixmapLogo; extern Window nxagentIconWindow; - extern Window nxagentFullscreenWindow; extern RegionRec nxagentShadowUpdateRegion; @@ -62,8 +61,6 @@ extern short nxagentShadowUid; void nxagentSetScreenInfo(ScreenInfo *screenInfo); void nxagentSetPixmapFormats(ScreenInfo *screenInfo); -void nxagentPrintGeometry(); - extern Window nxagentDefaultWindows[MAXSCREENS]; extern Window nxagentInputWindows[MAXSCREENS]; extern Window nxagentScreenSaverWindows[MAXSCREENS]; @@ -90,7 +87,6 @@ extern int nxagentBitsPerPixel(int depth); void nxagentSetScreenSaverTime(void); void nxagentMinimizeFromFullScreen(ScreenPtr pScreen); - void nxagentMaximizeToFullScreen(ScreenPtr pScreen); Window nxagentCreateIconWindow(void); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Splash.c b/nx-X11/programs/Xserver/hw/nxagent/Splash.c index 235c48c23..54b355762 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Splash.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Splash.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Splash.h b/nx-X11/programs/Xserver/hw/nxagent/Splash.h index f7ba6c2e2..a677f209b 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Splash.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Splash.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Split.c b/nx-X11/programs/Xserver/hw/nxagent/Split.c index 4cc2ea607..061ab8c45 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Split.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Split.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Split.h b/nx-X11/programs/Xserver/hw/nxagent/Split.h index 2be449a18..88e55485c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Split.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Split.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/TestExt.c b/nx-X11/programs/Xserver/hw/nxagent/TestExt.c index 6bce2eaeb..17e6a89e1 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/TestExt.c +++ b/nx-X11/programs/Xserver/hw/nxagent/TestExt.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Trap.c b/nx-X11/programs/Xserver/hw/nxagent/Trap.c index f5e6bde0e..c6f62c43f 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Trap.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Trap.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Trap.h b/nx-X11/programs/Xserver/hw/nxagent/Trap.h index 9258e3b67..13bbf65c7 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Trap.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Trap.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Utils.h b/nx-X11/programs/Xserver/hw/nxagent/Utils.h index f5bd55d8b..bf2aa1c26 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Utils.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Utils.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Visual.c b/nx-X11/programs/Xserver/hw/nxagent/Visual.c index b086c0e9a..46fe90f39 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Visual.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Visual.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Visual.h b/nx-X11/programs/Xserver/hw/nxagent/Visual.h index 8436f79ad..d60f0d824 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Visual.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Visual.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index 3e6d41d04..2abfd5ea0 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -691,73 +691,6 @@ void nxagentRestackWindow(WindowPtr pWin, WindowPtr pOldNextSib) } void nxagentSwitchFullscreen(ScreenPtr pScreen, Bool switchOn) -{ - XEvent e; - - if (nxagentOption(Rootless) == 1) - { - return; - } - - if (switchOn == 0) - { - nxagentWMDetect(); - - /* - * The smart scheduler could be stopped while - * waiting for the reply. In this case we need - * to yield explicitly to avoid to be stuck in - * the dispatch loop forever. - */ - - isItTimeToYield = 1; - - if (nxagentWMIsRunning == 0) - { - #ifdef WARNING - fprintf(stderr, "Warning: Can't switch to window mode, no window manager " - "has been detected.\n"); - #endif - - return; - } - } - - #ifdef TEST - fprintf(stderr, "nxagentSwitchFullscreen: Switching to %s mode.\n", - switchOn ? "fullscreen" : "windowed"); - #endif - - nxagentChangeOption(Fullscreen, switchOn); - - memset(&e, 0, sizeof(e)); - - e.xclient.type = ClientMessage; - e.xclient.message_type = nxagentAtoms[13]; /* _NET_WM_STATE */ - e.xclient.display = nxagentDisplay; - e.xclient.window = nxagentDefaultWindows[pScreen -> myNum]; - e.xclient.format = 32; - e.xclient.data.l[0] = nxagentOption(Fullscreen) ? 1 : 0; - e.xclient.data.l[1] = nxagentAtoms[14]; /* _NET_WM_STATE_FULLSCREEN */ - - XSendEvent(nxagentDisplay, DefaultRootWindow(nxagentDisplay), False, - SubstructureRedirectMask, &e); - - if (switchOn == 1) - { - nxagentFullscreenWindow = nxagentDefaultWindows[pScreen -> myNum]; - - nxagentGrabPointerAndKeyboard(NULL); - } - else - { - nxagentFullscreenWindow = None; - - nxagentUngrabPointerAndKeyboard(NULL); - } -} - -void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn) { Window w; XSetWindowAttributes attributes; @@ -788,8 +721,6 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn) XUnmapWindow(nxagentDisplay, w); XChangeWindowAttributes(nxagentDisplay, w, valuemask, &attributes); - XReparentWindow(nxagentDisplay, w, DefaultRootWindow(nxagentDisplay), 0, 0); - if (switchOn) { /* @@ -807,7 +738,7 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn) for (i = 0; i < 100 && nxagentWMIsRunning; i++) { #ifdef TEST - fprintf(stderr, "nxagentSwitchAllScreens: WARNING! Going to wait for the ReparentNotify event.\n"); + fprintf(stderr, "nxagentSwitchFullscreen: WARNING! Going to wait for the ReparentNotify event.\n"); #endif if (XCheckTypedWindowEvent(nxagentDisplay, w, ReparentNotify, &e)) @@ -836,8 +767,6 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn) */ nxagentChangeOption(Fullscreen, True); - nxagentChangeOption(AllScreens, True); - /* * Save the window-mode configuration. @@ -916,9 +845,9 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn) */ #ifdef WARNING - fprintf(stderr, "nxagentSwitchAllScreens: WARNING! Expected ReparentNotify event missing.\n"); + fprintf(stderr, "nxagentSwitchFullscreen: WARNING! Expected ReparentNotify event missing.\n"); #endif - + nxagentWMIsRunning = False; attributes.override_redirect = False; XChangeWindowAttributes(nxagentDisplay, w, valuemask, &attributes); @@ -932,6 +861,7 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn) * It could be necessary: * - To restore screensaver. * - To set or reset nxagentForceBackingStore flag. + * - To grab keyboard. * - To propagate device settings to the X server if no WM is running. */ @@ -940,10 +870,7 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn) */ nxagentChangeOption(Fullscreen, False); - nxagentChangeOption(AllScreens, False); - XDestroyWindow(nxagentDisplay, nxagentIconWindow); - nxagentIconWindow = nxagentFullscreenWindow = None; if (nxagentOption(DesktopResize) == 1) @@ -957,19 +884,8 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn) } } - if (nxagentOption(WMBorderWidth) > 0 && nxagentOption(WMTitleHeight) > 0) - { - nxagentChangeOption(X, nxagentOption(SavedX) - - nxagentOption(WMBorderWidth)); - nxagentChangeOption(Y, nxagentOption(SavedY) - - nxagentOption(WMTitleHeight)); - } - else - { - nxagentChangeOption(X, nxagentOption(SavedX)); - nxagentChangeOption(Y, nxagentOption(SavedY)); - } - + nxagentChangeOption(X, nxagentOption(SavedX)); + nxagentChangeOption(Y, nxagentOption(SavedY)); nxagentChangeOption(Width, nxagentOption(SavedWidth)); nxagentChangeOption(Height, nxagentOption(SavedHeight)); @@ -993,7 +909,7 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn) XMoveResizeWindow(nxagentDisplay, nxagentInputWindows[0], 0, 0, nxagentOption(Width), nxagentOption(Height)); - nxagentSetPrintGeometry(pScreen -> myNum); + nxagentSetPrintGeometry(pScreen -> myNum); } #ifdef VIEWPORT_FRAME @@ -2495,11 +2411,6 @@ void nxagentMapDefaultWindows() #endif XMapWindow(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum]); - - if (nxagentOption(Fullscreen) == 1 && nxagentWMIsRunning == 1) - { - nxagentMaximizeToFullScreen(pScreen); - } } /* @@ -2986,13 +2897,6 @@ FIXME: Do we need to set save unders attribute here? XSizeHints *props, hints; unsigned char *data = NULL; - #ifdef _XSERVER64 - - unsigned char *data64 = NULL; - unsigned int i; - - #endif - hints.flags = 0; ret = GetWindowProperty(pWin, @@ -3001,13 +2905,10 @@ FIXME: Do we need to set save unders attribute here? False, XA_WM_SIZE_HINTS, &type, &format, &nItems, &bytesLeft, &data); - /* - * 72 is the number of bytes returned by - * sizeof(XSizeHints) on 32 bit platforms. - */ + props = (XSizeHints*) data; if (ret == Success && - ((format >> 3) * nItems) == 72 && + ((format >> 3) * nItems) == sizeof(XSizeHints) && bytesLeft == 0 && type == XA_WM_SIZE_HINTS) { @@ -3016,30 +2917,6 @@ FIXME: Do we need to set save unders attribute here? (void*)pWin, pWin -> drawable.id, nxagentWindow(pWin)); #endif - #ifdef _XSERVER64 - - data64 = (unsigned char *) malloc(sizeof(XSizeHints) + 4); - - for (i = 0; i < 4; i++) - { - *(data64 + i) = *(data + i); - } - - *(((int *) data64) + 1) = 0; - - for (i = 8; i < sizeof(XSizeHints) + 4; i++) - { - *(data64 + i) = *(data + i - 4); - } - - props = (XSizeHints *) data64; - - #else - - props = (XSizeHints *) data; - - #endif /* _XSERVER64 */ - hints = *props; } else @@ -3058,15 +2935,6 @@ FIXME: Do we need to set save unders attribute here? XSetWMNormalHints(nxagentDisplay, nxagentWindow(pWin), &hints); - - #ifdef _XSERVER64 - - if (data64 != NULL) - { - free(data64); - } - - #endif } } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Windows.h b/nx-X11/programs/Xserver/hw/nxagent/Windows.h index 3ca74ba8e..f77db372d 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Windows.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Windows.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -222,8 +222,6 @@ void nxagentSetTopLevelEventMask(WindowPtr pWin); void nxagentSwitchFullscreen(ScreenPtr pScreen, Bool switchOn); -void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn); - void nxagentMoveViewport(ScreenPtr pScreen, int hShift, int vShift); #ifdef VIEWPORT_FRAME diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXdamage.c b/nx-X11/programs/Xserver/hw/nxagent/X/NXdamage.c index cf5d48ba2..967c5656e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXdamage.c +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXdamage.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXdamage.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXdamage.c.NX.original index cf5d48ba2..967c5656e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXdamage.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXdamage.c.NX.original @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXdispatch.c b/nx-X11/programs/Xserver/hw/nxagent/X/NXdispatch.c index 69ad30d2d..d9da23738 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXdispatch.c +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXdispatch.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -513,6 +513,17 @@ Dispatch(void) * completed. We can now handle our clients. */ + if (serverGeneration > nxagentMaxAllowedResets) + { + #ifdef NX_DEBUG_INPUT + fprintf(stderr, "Session: Session started at '%s' timestamp [%lu].\n", GetTimeAsString(), GetTimeInMillis()); + #else + fprintf(stderr, "Session: Session started at '%s'.\n", GetTimeAsString()); + #endif + + nxagentSessionState = SESSION_UP; + } + #ifdef XKB nxagentInitXkbWrapper(); @@ -596,21 +607,6 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio clientReady[1] = NXAGENT_WAKEUP; } - if (serverGeneration > nxagentMaxAllowedResets && - nxagentSessionState == SESSION_STARTING && - (nxagentOption(Xdmcp) == 0 || nxagentXdmcpUp == 1)) - { - #ifdef NX_DEBUG_INPUT - fprintf(stderr, "Session: Session started at '%s' timestamp [%lu].\n", - GetTimeAsString(), GetTimeInMillis()); - #else - fprintf(stderr, "Session: Session started at '%s'.\n", - GetTimeAsString()); - #endif - - nxagentSessionState = SESSION_UP; - } - #ifdef BLOCKS fprintf(stderr, "[End dispatch]\n"); #endif diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXdispatch.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXdispatch.c.NX.original index 69ad30d2d..d9da23738 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXdispatch.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXdispatch.c.NX.original @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -513,6 +513,17 @@ Dispatch(void) * completed. We can now handle our clients. */ + if (serverGeneration > nxagentMaxAllowedResets) + { + #ifdef NX_DEBUG_INPUT + fprintf(stderr, "Session: Session started at '%s' timestamp [%lu].\n", GetTimeAsString(), GetTimeInMillis()); + #else + fprintf(stderr, "Session: Session started at '%s'.\n", GetTimeAsString()); + #endif + + nxagentSessionState = SESSION_UP; + } + #ifdef XKB nxagentInitXkbWrapper(); @@ -596,21 +607,6 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio clientReady[1] = NXAGENT_WAKEUP; } - if (serverGeneration > nxagentMaxAllowedResets && - nxagentSessionState == SESSION_STARTING && - (nxagentOption(Xdmcp) == 0 || nxagentXdmcpUp == 1)) - { - #ifdef NX_DEBUG_INPUT - fprintf(stderr, "Session: Session started at '%s' timestamp [%lu].\n", - GetTimeAsString(), GetTimeInMillis()); - #else - fprintf(stderr, "Session: Session started at '%s'.\n", - GetTimeAsString()); - #endif - - nxagentSessionState = SESSION_UP; - } - #ifdef BLOCKS fprintf(stderr, "[End dispatch]\n"); #endif diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXdixfonts.c b/nx-X11/programs/Xserver/hw/nxagent/X/NXdixfonts.c index 04fc047fc..4361985fd 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXdixfonts.c +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXdixfonts.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXdixfonts.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXdixfonts.c.NX.original index 04fc047fc..4361985fd 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXdixfonts.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXdixfonts.c.NX.original @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXevents.c b/nx-X11/programs/Xserver/hw/nxagent/X/NXevents.c index c5593adbb..467381054 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXevents.c +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXevents.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXevents.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXevents.c.NX.original index c5593adbb..467381054 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXevents.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXevents.c.NX.original @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXextension.c b/nx-X11/programs/Xserver/hw/nxagent/X/NXextension.c index ead9b9d28..9bfb28426 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXextension.c +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXextension.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXextension.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXextension.c.NX.original index ead9b9d28..9bfb28426 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXextension.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXextension.c.NX.original @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXglxext.c b/nx-X11/programs/Xserver/hw/nxagent/X/NXglxext.c index 51c547984..3d021a0c4 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXglxext.c +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXglxext.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXglxext.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXglxext.c.NX.original index 51c547984..3d021a0c4 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXglxext.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXglxext.c.NX.original @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXglyph.c b/nx-X11/programs/Xserver/hw/nxagent/X/NXglyph.c index cd65fdc0e..577659a82 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXglyph.c +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXglyph.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXglyph.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXglyph.c.NX.original index cd65fdc0e..577659a82 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXglyph.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXglyph.c.NX.original @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXglyphcurs.c b/nx-X11/programs/Xserver/hw/nxagent/X/NXglyphcurs.c index 7a1d813b3..b11b10fb9 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXglyphcurs.c +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXglyphcurs.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXglyphcurs.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXglyphcurs.c.NX.original index 7a1d813b3..b11b10fb9 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXglyphcurs.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXglyphcurs.c.NX.original @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXglyphstr.h b/nx-X11/programs/Xserver/hw/nxagent/X/NXglyphstr.h index fa6b5fb02..b6d563c6b 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXglyphstr.h +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXglyphstr.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXglyphstr.h.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXglyphstr.h.NX.original index fa6b5fb02..b6d563c6b 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXglyphstr.h.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXglyphstr.h.NX.original @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXmiexpose.c b/nx-X11/programs/Xserver/hw/nxagent/X/NXmiexpose.c index 3fc73cf3b..652b85dd7 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXmiexpose.c +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXmiexpose.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXmiexpose.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXmiexpose.c.NX.original index 3fc73cf3b..652b85dd7 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXmiexpose.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXmiexpose.c.NX.original @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXmiglyph.c b/nx-X11/programs/Xserver/hw/nxagent/X/NXmiglyph.c index 5f32334ae..4eabd17f9 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXmiglyph.c +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXmiglyph.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXmiglyph.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXmiglyph.c.NX.original index 5f32334ae..4eabd17f9 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXmiglyph.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXmiglyph.c.NX.original @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXmitrap.c b/nx-X11/programs/Xserver/hw/nxagent/X/NXmitrap.c index f418654b4..124356427 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXmitrap.c +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXmitrap.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXmitrap.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXmitrap.c.NX.original index f418654b4..124356427 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXmitrap.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXmitrap.c.NX.original @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXmiwindow.c b/nx-X11/programs/Xserver/hw/nxagent/X/NXmiwindow.c index 190294979..d486d19c5 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXmiwindow.c +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXmiwindow.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXmiwindow.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXmiwindow.c.NX.original index 190294979..d486d19c5 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXmiwindow.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXmiwindow.c.NX.original @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXpicture.c b/nx-X11/programs/Xserver/hw/nxagent/X/NXpicture.c index d9054b4b6..5cd3e5073 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXpicture.c +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXpicture.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -62,7 +62,6 @@ #include "Screen.h" #include "Pixmaps.h" #include "Drawable.h" -#include "Render.h" #define PANIC #define WARNING @@ -873,9 +872,6 @@ AllocatePicture (ScreenPtr pScreen) else ppriv->ptr = (pointer)NULL; } - - nxagentPicturePriv(pPicture) -> picture = 0; - return pPicture; } @@ -1067,49 +1063,7 @@ static void initGradient(SourcePictPtr pGradient, int stopCount, static PicturePtr createSourcePicture(void) { PicturePtr pPicture; - - extern int nxagentPicturePrivateIndex; - - unsigned int totalPictureSize; - - DevUnion *ppriv; - - char *privPictureRecAddr; - - int i; - - /* - * Compute size of entire PictureRect, plus privates. - */ - - totalPictureSize = sizeof(PictureRec) + - picturePrivateCount * sizeof(DevUnion) + - sizeof(nxagentPrivPictureRec); - - pPicture = (PicturePtr) xalloc(totalPictureSize); - - if (pPicture != NULL) - { - ppriv = (DevUnion *) (pPicture + 1); - - for (i = 0; i < picturePrivateCount; ++i) - { - /* - * Other privates are inaccessible. - */ - - ppriv[i].ptr = NULL; - } - - privPictureRecAddr = (char *) &ppriv[picturePrivateCount]; - - ppriv[nxagentPicturePrivateIndex].ptr = (pointer) privPictureRecAddr; - - pPicture -> devPrivates = ppriv; - - nxagentPicturePriv(pPicture) -> picture = 0; - } - + pPicture = (PicturePtr) xalloc(sizeof(PictureRec)); pPicture->pDrawable = 0; pPicture->pFormat = 0; pPicture->pNext = 0; @@ -1743,10 +1697,6 @@ FreePicture (pointer value, if (--pPicture->refcnt == 0) { -#ifdef NXAGENT_SERVER - nxagentDestroyPicture(pPicture); -#endif - if (pPicture->transform) xfree (pPicture->transform); if (!pPicture->pDrawable) { diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXpicture.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXpicture.c.NX.original index d9054b4b6..5cd3e5073 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXpicture.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXpicture.c.NX.original @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -62,7 +62,6 @@ #include "Screen.h" #include "Pixmaps.h" #include "Drawable.h" -#include "Render.h" #define PANIC #define WARNING @@ -873,9 +872,6 @@ AllocatePicture (ScreenPtr pScreen) else ppriv->ptr = (pointer)NULL; } - - nxagentPicturePriv(pPicture) -> picture = 0; - return pPicture; } @@ -1067,49 +1063,7 @@ static void initGradient(SourcePictPtr pGradient, int stopCount, static PicturePtr createSourcePicture(void) { PicturePtr pPicture; - - extern int nxagentPicturePrivateIndex; - - unsigned int totalPictureSize; - - DevUnion *ppriv; - - char *privPictureRecAddr; - - int i; - - /* - * Compute size of entire PictureRect, plus privates. - */ - - totalPictureSize = sizeof(PictureRec) + - picturePrivateCount * sizeof(DevUnion) + - sizeof(nxagentPrivPictureRec); - - pPicture = (PicturePtr) xalloc(totalPictureSize); - - if (pPicture != NULL) - { - ppriv = (DevUnion *) (pPicture + 1); - - for (i = 0; i < picturePrivateCount; ++i) - { - /* - * Other privates are inaccessible. - */ - - ppriv[i].ptr = NULL; - } - - privPictureRecAddr = (char *) &ppriv[picturePrivateCount]; - - ppriv[nxagentPicturePrivateIndex].ptr = (pointer) privPictureRecAddr; - - pPicture -> devPrivates = ppriv; - - nxagentPicturePriv(pPicture) -> picture = 0; - } - + pPicture = (PicturePtr) xalloc(sizeof(PictureRec)); pPicture->pDrawable = 0; pPicture->pFormat = 0; pPicture->pNext = 0; @@ -1743,10 +1697,6 @@ FreePicture (pointer value, if (--pPicture->refcnt == 0) { -#ifdef NXAGENT_SERVER - nxagentDestroyPicture(pPicture); -#endif - if (pPicture->transform) xfree (pPicture->transform); if (!pPicture->pDrawable) { diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXpicturestr.h b/nx-X11/programs/Xserver/hw/nxagent/X/NXpicturestr.h index 0d1a8e1d8..d11e1fe21 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXpicturestr.h +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXpicturestr.h @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXpicturestr.h.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXpicturestr.h.NX.original index 0d1a8e1d8..d11e1fe21 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXpicturestr.h.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXpicturestr.h.NX.original @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXproperty.c b/nx-X11/programs/Xserver/hw/nxagent/X/NXproperty.c index cd1ec6ddd..ac61552f0 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXproperty.c +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXproperty.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXproperty.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXproperty.c.NX.original index cd1ec6ddd..ac61552f0 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXproperty.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXproperty.c.NX.original @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXrandr.c b/nx-X11/programs/Xserver/hw/nxagent/X/NXrandr.c index 5f460f23e..fa40a4921 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXrandr.c +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXrandr.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXrandr.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXrandr.c.NX.original index 5f460f23e..fa40a4921 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXrandr.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXrandr.c.NX.original @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXrender.c b/nx-X11/programs/Xserver/hw/nxagent/X/NXrender.c index 89e790135..7c60d856c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXrender.c +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXrender.c @@ -26,7 +26,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -116,6 +116,7 @@ int nxagentCursorSaveRenderInfo(ScreenPtr, CursorPtr); void nxagentCursorPostSaveRenderInfo(CursorPtr, ScreenPtr, PicturePtr, int, int); int nxagentRenderRealizeCursor(ScreenPtr, CursorPtr); int nxagentCreatePicture(PicturePtr, Mask); +void nxagentDestroyPicture(PicturePtr pPicture); void nxagentChangePicture(PicturePtr, Mask); int nxagentChangePictureClip(PicturePtr, int, int, xRectangle *, int, int); void nxagentComposite(CARD8, PicturePtr, PicturePtr, PicturePtr, INT16, INT16, @@ -131,28 +132,6 @@ void nxagentSetPictureFilter(PicturePtr pPicture, char *filter, int name_size, void nxagentTrapezoids(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int ntrap, xTrapezoid *traps); -void nxagentRenderCreateSolidFill(PicturePtr pPicture, xRenderColor *color); - -void nxagentRenderCreateLinearGradient(PicturePtr pPicture, xPointFixed *p1, - xPointFixed *p2, int nStops, - xFixed *stops, - xRenderColor *colors); - -void nxagentRenderCreateRadialGradient(PicturePtr pPicture, xPointFixed *inner, - xPointFixed *outer, - xFixed innerRadius, - xFixed outerRadius, - int nStops, - xFixed *stops, - xRenderColor *colors); - -void nxagentRenderCreateConicalGradient(PicturePtr pPicture, - xPointFixed *center, - xFixed angle, int nStops, - xFixed *stops, - xRenderColor *colors); - - /* * The void pointer is actually a XGlyphElt8. */ @@ -844,6 +823,8 @@ ProcRenderFreePicture (ClientPtr client) VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityDestroyAccess, RenderErrBase + BadPicture); + nxagentDestroyPicture(pPicture); + FreeResource (stuff->picture, RT_NONE); return(client->noClientException); } @@ -945,16 +926,9 @@ ProcRenderComposite (ClientPtr client) RenderErrBase + BadPicture); VERIFY_ALPHA (pMask, stuff->mask, client, SecurityReadAccess, RenderErrBase + BadPicture); -/* -FIXME: Imported change from newest version of Xorg. Changed pSrc to pDst. - if ((pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) || (pMask && pMask->pDrawable && pSrc->pDrawable->pScreen != pMask->pDrawable->pScreen)) return BadMatch; -*/ - if ((pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) || - (pMask && pMask->pDrawable && pDst->pDrawable->pScreen != pMask->pDrawable->pScreen)) - return BadMatch; ValidatePicture (pSrc); if (pMask) @@ -2362,11 +2336,6 @@ static int ProcRenderCreateSolidFill(ClientPtr client) pPicture = CreateSolidPicture(stuff->pid, &stuff->color, &error); if (!pPicture) return error; - /* AGENT SERVER */ - - nxagentRenderCreateSolidFill(pPicture, &stuff -> color); - - /* AGENT SERVER */ if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) return BadAlloc; return Success; @@ -2398,12 +2367,6 @@ static int ProcRenderCreateLinearGradient (ClientPtr client) stuff->nStops, stops, colors, &error); if (!pPicture) return error; - /* AGENT SERVER */ - - nxagentRenderCreateLinearGradient(pPicture, &stuff->p1, &stuff->p2, - stuff->nStops, stops, colors); - - /* AGENT SERVER */ if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) return BadAlloc; return Success; @@ -2434,14 +2397,6 @@ static int ProcRenderCreateRadialGradient (ClientPtr client) stuff->nStops, stops, colors, &error); if (!pPicture) return error; - /* AGENT SERVER */ - - nxagentRenderCreateRadialGradient(pPicture, &stuff->inner, &stuff->outer, - stuff->inner_radius, - stuff->outer_radius, - stuff->nStops, stops, colors); - - /* AGENT SERVER */ if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) return BadAlloc; return Success; @@ -2471,13 +2426,6 @@ static int ProcRenderCreateConicalGradient (ClientPtr client) stuff->nStops, stops, colors, &error); if (!pPicture) return error; - /* AGENT SERVER */ - - nxagentRenderCreateConicalGradient(pPicture, &stuff->center, - stuff->angle, stuff->nStops, stops, - colors); - - /* AGENT SERVER */ if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) return BadAlloc; return Success; diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXrender.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXrender.c.NX.original index 89e790135..7c60d856c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXrender.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXrender.c.NX.original @@ -26,7 +26,7 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ @@ -116,6 +116,7 @@ int nxagentCursorSaveRenderInfo(ScreenPtr, CursorPtr); void nxagentCursorPostSaveRenderInfo(CursorPtr, ScreenPtr, PicturePtr, int, int); int nxagentRenderRealizeCursor(ScreenPtr, CursorPtr); int nxagentCreatePicture(PicturePtr, Mask); +void nxagentDestroyPicture(PicturePtr pPicture); void nxagentChangePicture(PicturePtr, Mask); int nxagentChangePictureClip(PicturePtr, int, int, xRectangle *, int, int); void nxagentComposite(CARD8, PicturePtr, PicturePtr, PicturePtr, INT16, INT16, @@ -131,28 +132,6 @@ void nxagentSetPictureFilter(PicturePtr pPicture, char *filter, int name_size, void nxagentTrapezoids(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int ntrap, xTrapezoid *traps); -void nxagentRenderCreateSolidFill(PicturePtr pPicture, xRenderColor *color); - -void nxagentRenderCreateLinearGradient(PicturePtr pPicture, xPointFixed *p1, - xPointFixed *p2, int nStops, - xFixed *stops, - xRenderColor *colors); - -void nxagentRenderCreateRadialGradient(PicturePtr pPicture, xPointFixed *inner, - xPointFixed *outer, - xFixed innerRadius, - xFixed outerRadius, - int nStops, - xFixed *stops, - xRenderColor *colors); - -void nxagentRenderCreateConicalGradient(PicturePtr pPicture, - xPointFixed *center, - xFixed angle, int nStops, - xFixed *stops, - xRenderColor *colors); - - /* * The void pointer is actually a XGlyphElt8. */ @@ -844,6 +823,8 @@ ProcRenderFreePicture (ClientPtr client) VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityDestroyAccess, RenderErrBase + BadPicture); + nxagentDestroyPicture(pPicture); + FreeResource (stuff->picture, RT_NONE); return(client->noClientException); } @@ -945,16 +926,9 @@ ProcRenderComposite (ClientPtr client) RenderErrBase + BadPicture); VERIFY_ALPHA (pMask, stuff->mask, client, SecurityReadAccess, RenderErrBase + BadPicture); -/* -FIXME: Imported change from newest version of Xorg. Changed pSrc to pDst. - if ((pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) || (pMask && pMask->pDrawable && pSrc->pDrawable->pScreen != pMask->pDrawable->pScreen)) return BadMatch; -*/ - if ((pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) || - (pMask && pMask->pDrawable && pDst->pDrawable->pScreen != pMask->pDrawable->pScreen)) - return BadMatch; ValidatePicture (pSrc); if (pMask) @@ -2362,11 +2336,6 @@ static int ProcRenderCreateSolidFill(ClientPtr client) pPicture = CreateSolidPicture(stuff->pid, &stuff->color, &error); if (!pPicture) return error; - /* AGENT SERVER */ - - nxagentRenderCreateSolidFill(pPicture, &stuff -> color); - - /* AGENT SERVER */ if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) return BadAlloc; return Success; @@ -2398,12 +2367,6 @@ static int ProcRenderCreateLinearGradient (ClientPtr client) stuff->nStops, stops, colors, &error); if (!pPicture) return error; - /* AGENT SERVER */ - - nxagentRenderCreateLinearGradient(pPicture, &stuff->p1, &stuff->p2, - stuff->nStops, stops, colors); - - /* AGENT SERVER */ if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) return BadAlloc; return Success; @@ -2434,14 +2397,6 @@ static int ProcRenderCreateRadialGradient (ClientPtr client) stuff->nStops, stops, colors, &error); if (!pPicture) return error; - /* AGENT SERVER */ - - nxagentRenderCreateRadialGradient(pPicture, &stuff->inner, &stuff->outer, - stuff->inner_radius, - stuff->outer_radius, - stuff->nStops, stops, colors); - - /* AGENT SERVER */ if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) return BadAlloc; return Success; @@ -2471,13 +2426,6 @@ static int ProcRenderCreateConicalGradient (ClientPtr client) stuff->nStops, stops, colors, &error); if (!pPicture) return error; - /* AGENT SERVER */ - - nxagentRenderCreateConicalGradient(pPicture, &stuff->center, - stuff->angle, stuff->nStops, stops, - colors); - - /* AGENT SERVER */ if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) return BadAlloc; return Success; diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXresource.c b/nx-X11/programs/Xserver/hw/nxagent/X/NXresource.c index d1c8325f2..cffe8008b 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXresource.c +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXresource.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXresource.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXresource.c.NX.original index d1c8325f2..cffe8008b 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXresource.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXresource.c.NX.original @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXshm.c b/nx-X11/programs/Xserver/hw/nxagent/X/NXshm.c index eaaa92041..ef830b73f 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXshm.c +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXshm.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXshm.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXshm.c.NX.original index eaaa92041..ef830b73f 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXshm.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXshm.c.NX.original @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXwindow.c b/nx-X11/programs/Xserver/hw/nxagent/X/NXwindow.c index 76e86fd2a..ea133eaae 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXwindow.c +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXwindow.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXwindow.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXwindow.c.NX.original index 76e86fd2a..ea133eaae 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXwindow.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXwindow.c.NX.original @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXxvdisp.c b/nx-X11/programs/Xserver/hw/nxagent/X/NXxvdisp.c index f6dad312a..497a62fe0 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXxvdisp.c +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXxvdisp.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXxvdisp.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXxvdisp.c.NX.original index f6dad312a..497a62fe0 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXxvdisp.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXxvdisp.c.NX.original @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/nxagent.xpm b/nx-X11/programs/Xserver/hw/nxagent/nxagent.xpm index dd8be6cb3..5023265e9 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/nxagent.xpm +++ b/nx-X11/programs/Xserver/hw/nxagent/nxagent.xpm @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/nxmissing.xpm b/nx-X11/programs/Xserver/hw/nxagent/nxmissing.xpm index 854e0a611..3fce57ff7 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/nxmissing.xpm +++ b/nx-X11/programs/Xserver/hw/nxagent/nxmissing.xpm @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/os2Stub.c b/nx-X11/programs/Xserver/hw/nxagent/os2Stub.c index 9ec7e6bc8..f4d0a2d55 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/os2Stub.c +++ b/nx-X11/programs/Xserver/hw/nxagent/os2Stub.c @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2009 NoMachine, http://www.nomachine.com/. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/screensaver b/nx-X11/programs/Xserver/hw/nxagent/screensaver index ef7cd661a..2fcf5dc87 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/screensaver +++ b/nx-X11/programs/Xserver/hw/nxagent/screensaver @@ -1,6 +1,6 @@ /**************************************************************************/ /* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ +/* Copyright (c) 2001, 2003 NoMachine, http://www.nomachine.com. */ /* */ /* NXAGENT, NX protocol compression and NX extensions to this software */ /* are copyright of NoMachine. Redistribution and use of the present */ -- cgit v1.2.3 From b7494f082ad56049c24927afdf89abc852fe06bb Mon Sep 17 00:00:00 2001 From: Reinhard Tartler Date: Mon, 10 Oct 2011 17:58:59 +0200 Subject: Imported nxagent-3.4.0-8.tar.gz Summary: Imported nxagent-3.4.0-8.tar.gz Keywords: Imported nxagent-3.4.0-8.tar.gz into Git repository --- nx-X11/programs/Xserver/hw/nxagent/Atoms.c | 28 +- nx-X11/programs/Xserver/hw/nxagent/Atoms.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/CHANGELOG | 56 +++ nx-X11/programs/Xserver/hw/nxagent/Events.c | 553 +++++++++++++++++---- nx-X11/programs/Xserver/hw/nxagent/Events.h | 1 + nx-X11/programs/Xserver/hw/nxagent/Imakefile | 3 +- nx-X11/programs/Xserver/hw/nxagent/Keystroke.c | 12 + nx-X11/programs/Xserver/hw/nxagent/Pixels.h | 18 + nx-X11/programs/Xserver/hw/nxagent/Pointer.c | 34 ++ nx-X11/programs/Xserver/hw/nxagent/Pointer.h | 9 + nx-X11/programs/Xserver/hw/nxagent/Reconnect.c | 4 + nx-X11/programs/Xserver/hw/nxagent/Render.c | 281 ++++++++++- nx-X11/programs/Xserver/hw/nxagent/Render.h | 2 + nx-X11/programs/Xserver/hw/nxagent/Rootless.c | 43 +- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 234 +-------- nx-X11/programs/Xserver/hw/nxagent/Screen.h | 3 - nx-X11/programs/Xserver/hw/nxagent/Window.c | 269 ++-------- nx-X11/programs/Xserver/hw/nxagent/X/NXpicture.c | 47 +- .../Xserver/hw/nxagent/X/NXpicture.c.NX.original | 47 +- nx-X11/programs/Xserver/hw/nxagent/X/NXrender.c | 58 ++- .../Xserver/hw/nxagent/X/NXrender.c.NX.original | 58 ++- 21 files changed, 1179 insertions(+), 583 deletions(-) (limited to 'nx-X11/programs/Xserver/hw/nxagent/Imakefile') diff --git a/nx-X11/programs/Xserver/hw/nxagent/Atoms.c b/nx-X11/programs/Xserver/hw/nxagent/Atoms.c index 7f12406f5..171df95a9 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Atoms.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Atoms.c @@ -66,19 +66,21 @@ Atom nxagentAtoms[NXAGENT_NUMBER_OF_ATOMS]; static char *nxagentAtomNames[NXAGENT_NUMBER_OF_ATOMS + 1] = { - "NX_IDENTITY", /* 0 */ - "WM_PROTOCOLS", /* 1 */ - "WM_DELETE_WINDOW", /* 2 */ - "WM_NX_READY", /* 3 */ - "MCOPGLOBALS", /* 4 */ - "NX_CUT_BUFFER_SERVER", /* 5 */ - "TARGETS", /* 6 */ - "TEXT", /* 7 */ - "NX_AGENT_SIGNATURE", /* 8 */ - "NXDARWIN", /* 9 */ - "CLIPBOARD", /* 10 */ - "TIMESTAMP", /* 11 */ - "UTF8_STRING", /* 12 */ + "NX_IDENTITY", /* 0 */ + "WM_PROTOCOLS", /* 1 */ + "WM_DELETE_WINDOW", /* 2 */ + "WM_NX_READY", /* 3 */ + "MCOPGLOBALS", /* 4 */ + "NX_CUT_BUFFER_SERVER", /* 5 */ + "TARGETS", /* 6 */ + "TEXT", /* 7 */ + "NX_AGENT_SIGNATURE", /* 8 */ + "NXDARWIN", /* 9 */ + "CLIPBOARD", /* 10 */ + "TIMESTAMP", /* 11 */ + "UTF8_STRING", /* 12 */ + "_NET_WM_STATE", /* 13 */ + "_NET_WM_STATE_FULLSCREEN", /* 14 */ NULL, NULL }; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Atoms.h b/nx-X11/programs/Xserver/hw/nxagent/Atoms.h index d8acb9442..f49f2751e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Atoms.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Atoms.h @@ -22,7 +22,7 @@ #include "../../include/window.h" #include "screenint.h" -#define NXAGENT_NUMBER_OF_ATOMS 14 +#define NXAGENT_NUMBER_OF_ATOMS 16 extern Atom nxagentAtoms[NXAGENT_NUMBER_OF_ATOMS]; diff --git a/nx-X11/programs/Xserver/hw/nxagent/CHANGELOG b/nx-X11/programs/Xserver/hw/nxagent/CHANGELOG index 1a82e9abf..9e067d407 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/CHANGELOG +++ b/nx-X11/programs/Xserver/hw/nxagent/CHANGELOG @@ -1,5 +1,61 @@ ChangeLog: +nxagent-3.4.0-8 + +- Grab the keyboard in fullscreen mode on EnterNotify only if mode is + 'NotifyNormal'. + +- Yield control in the dispatch loop in case we stop the smart sche- + duler timer while waiting for a reply from the remote display. + +nxagent-3.4.0-7 + +- Fixed TR08D01478. The communication with the compiz window manager + by means of the _NET_WM_PING property was not handled properly. + +- Fixed a type mismatch in XKB events on 64 bit platforms. + +- Moved grab/ungrab keyboard from focus in/out event to enter/leave + notify event. + +- Removed nxagentIconWindow because it's not longer used. + +nxagent-3.4.0-6 + +- Fixed TR09F02102. Problem was with pointer buttons map. + +- Fixed TR02H02327. Some KeyRelease events was discarded. + +- Fixed up Num and Caps locks. + +- Fixed TR03H02335. Emulated right mouse button for Mac clients. + +- Added utilities to print info about internal and remote windows. + +- Fixed TR01F01995. Solved a picture resource leak by destroying remo- + te pictures only when their reference counter returns to zero. + +- Fixed TR04H02337. Errors occurred because pictures with no drawable + were handled badly. + +- Implemented handling nxagent's private for gradient pictures and so- + lid fill picture. + +- Fixed BadMatch condition check in function ProcRenderComposite. + +- Fixed nxagentComposite() to handle situations with source picture + drawable pointing to NULL. + +- Implemented render acceleration for requests: CreateSolidFill, + CreateLinearGradient, CreateRadialGradient, CreateConicalGradient. + +- Fixed TR03G02196. Dialogs are shown to the fore when the NX session + is in fullscreen mode. + +- Changed mechanism to switch to fullscreen mode. Now the override + redirect attribute is no longer used and _NET_WM_STATE_FULLSCREEN + hint is sent to the WM. + nxagent-3.4.0-5 - Updated copyright to year 2010. diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index ca21423aa..33eafa55b 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -76,7 +76,9 @@ #include "input.h" #endif +#define Time XlibXID #include "XKBlib.h" +#undef Time #define GC XlibGC #define Font XlibFont @@ -203,6 +205,8 @@ CARD32 nxagentLastEventTime = 0; CARD32 nxagentLastKeyPressTime = 0; Time nxagentLastServerTime = 0; +int nxagentPointerAndKeyboardGrabbed = 0; + /* * Used for storing windows that need to * receive expose events from the agent. @@ -218,6 +222,16 @@ static void nxagentForwardRemoteExpose(void); static int nxagentClipAndSendExpose(WindowPtr pWin, pointer ptr); +/* + * This is from NXproperty.c. + */ + +int GetWindowProperty(WindowPtr pWin, Atom property, long longOffset, + long longLength, Bool delete, Atom type, + Atom *actualType, int *format, unsigned + long *nItems, unsigned long *bytesAfter, + unsigned char **propData); + /* * Associate a resource to a drawable and * store the region affected by the split @@ -274,6 +288,280 @@ void ProcessInputEvents() mieqProcessInputEvents(); } +#ifdef DEBUG_TREE + +/* + * Print ID and name of window. + */ + +void nxagentRemoteWindowID(Window window, Bool newline) +{ +#ifdef NO_I18N + char *winName; +#else + XTextProperty tp; +#endif + + fprintf(stderr, "0x%lx", window); + + if (!window) + { + fprintf(stderr, " (none) "); + } + else + { + if (window == DefaultRootWindow(nxagentDisplay)) + { + fprintf(stderr, " (the root window) "); + } + +#ifdef NO_I18N + + if (!XFetchName(nxagentDisplay, window, &winName)) + { + fprintf(stderr, " (has no name) "); + } + else if (winName) + { + fprintf(stderr, " \"%s\" ", winName); + XFree(winName); + } + +#else + + if (XGetWMName(nxagentDisplay, window, &tp) != 0) + { + fprintf(stderr, " (has no name) "); + } + else if (tp.nitems > 0) + { + int count = 0; + int i, ret; + char **list = NULL; + + fprintf(stderr, " \""); + + ret = XmbTextPropertyToTextList(nxagentDisplay, &tp, &list, &count); + + if ((ret == Success || ret > 0) && list != NULL) + { + for (i = 0; i < count; i++) + { + fprintf(stderr, "%s", list[i]); + } + + XFreeStringList(list); + } + else + { + fprintf(stderr, "%s", tp.value); + } + + fprintf(stderr, "\" "); + } + +#endif + + else + { + fprintf(stderr, " (has no name) "); + } + } + + if (newline == TRUE) + { + fprintf(stderr, "\n"); + } + + return; +} + +/* + * Print info about remote window. + */ + +void nxagentRemoteWindowInfo(Window win, int indent, Bool newLine) +{ + XWindowAttributes attributes; + int i; + + if (XGetWindowAttributes(nxagentDisplay, win, &attributes) == 0) + { + return; + } + + for (i = 0; i < indent; i++) + { + fprintf(stderr, " "); + } + + fprintf(stderr, "x=%d y=%d width=%d height=%d class=%s map_state=%s " + "override_redirect=%s\n", attributes.x, attributes.y, + attributes.width, attributes.height, (attributes.class == 0) ? + "InputOutput" : "InputOnly", (attributes.map_state == 0) ? + "IsUnmapped" : (attributes.map_state == 1 ? + "IsUnviewable" : "IsViewable"), + (attributes.override_redirect == 0) ? + "No" : "Yes" ); + + if (newLine == TRUE) + { + fprintf(stderr, "\n"); + } +} + +/* + * Walk remote windows tree. + */ + +void nxagentRemoteWindowsTree(Window window, int level) +{ + int i, j; + Window rootWin, parentWin; + unsigned int numChildren; + Window *childList; + + if (!XQueryTree(nxagentDisplay, window, &rootWin, &parentWin, &childList, + &numChildren)) + { + fprintf(stderr, "nxagentRemoteWindowsTree - XQueryTree failed.\n"); + + return; + } + + if (level == 0) + { + fprintf(stderr, "\n"); + + fprintf(stderr, " Root Window ID: "); + nxagentRemoteWindowID(rootWin, TRUE); + + fprintf(stderr, " Parent window ID: "); + nxagentRemoteWindowID(parentWin, TRUE); + } + + if (level == 0 || numChildren > 0) + { + fprintf(stderr, " "); + + for (j = 0; j < level; j++) + { + fprintf(stderr, " "); + } + + fprintf(stderr, "%d child%s%s\n", numChildren, (numChildren == 1) ? "" : + "ren", (numChildren == 1) ? ":" : "."); + } + + for (i = (int) numChildren - 1; i >= 0; i--) + { + fprintf(stderr, " "); + + for (j = 0; j < level; j++) + { + fprintf(stderr, " "); + } + + nxagentRemoteWindowID(childList[i], TRUE); + + nxagentRemoteWindowInfo(childList[i], (level * 5) + 6, TRUE); + + nxagentRemoteWindowsTree(childList[i], level + 1); + } + + if (childList) + { + XFree((char *) childList); + } +} + +/* + * Print info about internal window. + */ + +void nxagentInternalWindowInfo(WindowPtr pWin, int indent, Bool newLine) +{ + int i; + int result; + unsigned long ulReturnItems; + unsigned long ulReturnBytesLeft; + Atom atomReturnType; + int iReturnFormat; + unsigned char *pszReturnData = NULL; + + fprintf(stderr, "Window ID=[0x%lx] Remote ID=[0x%lx] ", pWin -> drawable.id, + nxagentWindow(pWin)); + + result = GetWindowProperty(pWin, MakeAtom("WM_NAME", 7, False) , 0, + sizeof(CARD32), False, AnyPropertyType, + &atomReturnType, &iReturnFormat, + &ulReturnItems, &ulReturnBytesLeft, + &pszReturnData); + + fprintf(stderr, "Name: "); + + if (result == Success && pszReturnData != NULL) + { + pszReturnData[ulReturnItems] = '\0'; + + fprintf(stderr, "\"%s\"\n", (char *) pszReturnData); + } + else + { + fprintf(stderr, "%s\n", "( has no name )"); + } + + for (i = 0; i < indent; i++) + { + fprintf(stderr, " "); + } + + fprintf(stderr, "x=%d y=%d width=%d height=%d class=%s map_state=%s " + "override_redirect=%s", pWin -> drawable.x, pWin -> drawable.y, + pWin -> drawable.width, pWin -> drawable.height, + (pWin -> drawable.class == 0) ? "InputOutput" : + "InputOnly", (pWin -> mapped == 0) ? + "IsUnmapped" : (pWin -> mapped == 1 ? + "IsUnviewable" : "IsViewable"), + (pWin -> overrideRedirect == 0) ? + "No" : "Yes"); + + if (newLine == TRUE) + { + fprintf(stderr, "\n"); + } +} + +/* + * Walk internal windows tree. + */ + +void nxagentInternalWindowsTree(WindowPtr pWin, int indent) +{ + WindowPtr pChild; + int i; + + while (pWin) + { + pChild = pWin -> firstChild; + + for (i = 0; i < indent; i++) + { + fprintf(stderr, " "); + } + + nxagentInternalWindowInfo(pWin, indent, TRUE); + + fprintf(stderr, "\n"); + + nxagentInternalWindowsTree(pChild, indent + 4); + + pWin = pWin -> nextSib; + } +} + +#endif /* DEBUG_TREE */ + void nxagentSwitchResizeMode(ScreenPtr pScreen) { XSizeHints sizeHints; @@ -290,8 +578,11 @@ void nxagentSwitchResizeMode(ScreenPtr pScreen) nxagentLaunchDialog(DIALOG_DISABLE_DESKTOP_RESIZE_MODE); - sizeHints.max_width = nxagentOption(RootWidth); - sizeHints.max_height = nxagentOption(RootHeight); + if (nxagentOption(Fullscreen) == 0) + { + sizeHints.max_width = nxagentOption(RootWidth); + sizeHints.max_height = nxagentOption(RootHeight); + } } else { @@ -299,8 +590,6 @@ void nxagentSwitchResizeMode(ScreenPtr pScreen) nxagentLaunchDialog(DIALOG_ENABLE_DESKTOP_RESIZE_MODE); - nxagentRRSetScreenConfig(pScreen, nxagentOption(Width), nxagentOption(Height)); - if (nxagentOption(ClientOs) == ClientOsWinnt) { NXSetExposeParameters(nxagentDisplay, 0, 0, 0); @@ -655,6 +944,22 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate) { break; } + + #ifdef DEBUG_TREE + + case doDebugTree: + { + fprintf(stderr, "\n ========== nxagentRemoteWindowsTree ==========\n"); + nxagentRemoteWindowsTree(nxagentWindow(WindowTable[0]), 0); + + fprintf(stderr, "\n========== nxagentInternalWindowsTree ==========\n"); + nxagentInternalWindowsTree(WindowTable[0], 0); + + break; + } + + #endif /* DEBUG_TREE */ + case doCloseSession: { closeSession = TRUE; @@ -797,7 +1102,8 @@ FIXME: Don't enqueue the KeyRelease event if the key was enqueued and to remove the KeyPress afterwards. */ - if (inputInfo.keyboard -> key -> down[X.xkey.keycode >> 3] & (1 << (X.xkey.keycode & 7))) + if (BitIsOn(inputInfo.keyboard -> key -> down, + nxagentConvertKeycode(X.xkey.keycode))) { sendKey = 1; } @@ -871,6 +1177,23 @@ FIXME: Don't enqueue the KeyRelease event if the key was nxagentInputEvent = 1; + if (nxagentOption(ClientOs) == ClientOsMac && (X.xbutton.state & ControlMask) == ControlMask) + { + x.u.u.type = ButtonPress; + x.u.u.detail = inputInfo.pointer -> button -> map[3]; + x.u.keyButtonPointer.time = nxagentLastEventTime = GetTimeInMillis(); + + mieqEnqueue(&x); + + x.u.u.type = ButtonRelease; + x.u.u.detail = inputInfo.pointer -> button -> map[3]; + x.u.keyButtonPointer.time = nxagentLastEventTime = GetTimeInMillis(); + + mieqEnqueue(&x); + + break; + } + if (nxagentOption(Fullscreen)) { if (nxagentMagicPixelZone(X.xbutton.x, X.xbutton.y)) @@ -917,7 +1240,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was X.xbutton.subwindow == None)) { x.u.u.type = ButtonPress; - x.u.u.detail = X.xbutton.button; + x.u.u.detail = inputInfo.pointer -> button -> map[nxagentReversePointerMap[X.xbutton.button - 1]]; x.u.keyButtonPointer.time = nxagentLastEventTime = GetTimeInMillis(); if (nxagentOption(Rootless)) @@ -974,6 +1297,11 @@ FIXME: Don't enqueue the KeyRelease event if the key was nxagentInputEvent = 1; + if (nxagentOption(ClientOs) == ClientOsMac && (X.xbutton.state & ControlMask) == ControlMask) + { + break; + } + if (viewportCursor) { /* @@ -990,7 +1318,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was if (minimize != True) { x.u.u.type = ButtonRelease; - x.u.u.detail = X.xbutton.button; + x.u.u.detail = inputInfo.pointer -> button -> map[nxagentReversePointerMap[X.xbutton.button - 1]]; x.u.keyButtonPointer.time = nxagentLastEventTime = GetTimeInMillis(); if (nxagentOption(Rootless)) @@ -1344,10 +1672,11 @@ FIXME: Don't enqueue the KeyRelease event if the key was nxagentScreenTrap = 0; } - if (nxagentOption(Fullscreen)) + if (nxagentOption(Fullscreen) == 1) { - if (X.xcrossing.window == nxagentFullscreenWindow && - X.xcrossing.detail != NotifyInferior) + if (X.xcrossing.window == nxagentDefaultWindows[0] && + X.xcrossing.detail != NotifyInferior && + X.xcrossing.mode == NotifyNormal) { nxagentGrabPointerAndKeyboard(&X); } @@ -1399,9 +1728,9 @@ FIXME: Don't enqueue the KeyRelease event if the key was nxagentLastEnteredWindow = NULL; } - if (nxagentOption(Fullscreen)) + if (nxagentPointerAndKeyboardGrabbed == 1) { - if (X.xcrossing.window == nxagentFullscreenWindow && + if (X.xcrossing.window == nxagentDefaultWindows[0] && X.xcrossing.detail != NotifyInferior && X.xcrossing.mode == NotifyNormal) { @@ -1660,7 +1989,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was } if (nxagentUseNXTrans == 1 && nxagentOption(Rootless) == 0 && - nxagentOption(Nested) == 0 && X.xmap.window != nxagentIconWindow) + nxagentOption(Nested) == 0) { nxagentVisibility = VisibilityFullyObscured; } @@ -1701,12 +2030,6 @@ FIXME: Don't enqueue the KeyRelease event if the key was if (nxagentOption(Fullscreen) == 1) { - if (X.xmap.window == nxagentIconWindow) - { - pScreen = nxagentScreen(X.xmap.window); - nxagentMaximizeToFullScreen(pScreen); - } - nxagentVisibility = VisibilityUnobscured; nxagentVisibilityStop = False; nxagentVisibilityTimeout = GetTimeInMillis() + 2000; @@ -1716,10 +2039,17 @@ FIXME: Don't enqueue the KeyRelease event if the key was } case MappingNotify: { + XMappingEvent *mappingEvent = (XMappingEvent *) &X; + #ifdef DEBUG fprintf(stderr, "nxagentDispatchEvents: WARNING! Going to handle new MappingNotify event.\n"); #endif + if (mappingEvent -> request == MappingPointer) + { + nxagentInitPointerMap(); + } + break; } default: @@ -1959,8 +2289,16 @@ int nxagentHandleKeyPress(XEvent *X, enum HandleEventResult *result) return 1; } - nxagentLastEventTime = nxagentLastKeyPressTime = GetTimeInMillis(); + if (X -> xkey.keycode == 66) + { + nxagentXkbState.Caps = (~nxagentXkbState.Caps & 1); + } + else if (X -> xkey.keycode == 77) + { + nxagentXkbState.Num = (~nxagentXkbState.Num & 1); + } + nxagentLastEventTime = nxagentLastKeyPressTime = GetTimeInMillis(); x.u.u.type = KeyPress; x.u.u.detail = nxagentConvertKeycode(X -> xkey.keycode); @@ -2270,7 +2608,6 @@ int nxagentHandleGraphicsExposeEvent(XEvent *X) int nxagentHandleClientMessageEvent(XEvent *X, enum HandleEventResult *result) { - ScreenPtr pScreen; WindowPtr pWin; xEvent x; @@ -2386,19 +2723,8 @@ int nxagentHandleClientMessageEvent(XEvent *X, enum HandleEventResult *result) fprintf(stderr, "Events: WM_DELETE_WINDOW arrived Atom = %ld.\n", wmAtom); #endif - if (X -> xclient.window == nxagentIconWindow) - { - pScreen = nxagentScreen(X -> xmap.window); - - XMapRaised(nxagentDisplay, nxagentFullscreenWindow); - - XIconifyWindow(nxagentDisplay, nxagentIconWindow, - DefaultScreen(nxagentDisplay)); - - } - - if (X -> xclient.window == (nxagentOption(Fullscreen) ? - nxagentIconWindow : nxagentDefaultWindows[0])) + if (X -> xclient.window == nxagentDefaultWindows[0] || + nxagentWMIsRunning == 0) { *result = doCloseSession; } @@ -2995,85 +3321,110 @@ int nxagentHandleConfigureNotify(XEvent* X) if (X -> xconfigure.window == nxagentDefaultWindows[pScreen -> myNum]) { - if (nxagentOption(Fullscreen) == 0) + if (nxagentOption(DesktopResize) == 1) { - if (nxagentOption(DesktopResize) == 1) + if (nxagentOption(Width) != X -> xconfigure.width || + nxagentOption(Height) != X -> xconfigure.height) { - if (nxagentOption(Width) != X -> xconfigure.width || - nxagentOption(Height) != X -> xconfigure.height) - { - Bool newEvents = False; + Bool newEvents = False; - doRandR = True; + doRandR = True; - NXFlushDisplay(nxagentDisplay, NXFlushLink); + NXFlushDisplay(nxagentDisplay, NXFlushLink); - do - { - newEvents = False; + do + { + newEvents = False; - timeout.tv_sec = 0; - timeout.tv_usec = 500 * 1000; + timeout.tv_sec = 0; + timeout.tv_usec = 500 * 1000; - nxagentWaitEvents(nxagentDisplay, &timeout); + nxagentWaitEvents(nxagentDisplay, &timeout); - /* - * This should also flush - * the NX link for us. - */ + /* + * This should also flush + * the NX link for us. + */ - XSync(nxagentDisplay, 0); + XSync(nxagentDisplay, 0); - while (XCheckTypedWindowEvent(nxagentDisplay, nxagentDefaultWindows[pScreen -> myNum], - ConfigureNotify, X)) - { - newEvents = True; - } + while (XCheckTypedWindowEvent(nxagentDisplay, nxagentDefaultWindows[pScreen -> myNum], + ConfigureNotify, X)) + { + newEvents = True; + } - } while (newEvents); - } + } while (newEvents); } + } - if (nxagentWMIsRunning == 0 || X -> xconfigure.send_event) - { - nxagentChangeOption(X, X -> xconfigure.x); - nxagentChangeOption(Y, X -> xconfigure.y); - } + if (nxagentWMIsRunning == 0 || X -> xconfigure.send_event) + { + nxagentChangeOption(X, X -> xconfigure.x); + nxagentChangeOption(Y, X -> xconfigure.y); + } - if (nxagentOption(Shadow) == 1 && nxagentOption(DesktopResize) == 1 && - (nxagentOption(Width) != X -> xconfigure.width || - nxagentOption(Height) != X -> xconfigure.height)) - { - nxagentShadowResize = 1; - } + if (nxagentOption(Shadow) == 1 && nxagentOption(DesktopResize) == 1 && + (nxagentOption(Width) != X -> xconfigure.width || + nxagentOption(Height) != X -> xconfigure.height)) + { + nxagentShadowResize = 1; + } - nxagentChangeOption(Width, X -> xconfigure.width); - nxagentChangeOption(Height, X -> xconfigure.height); + nxagentChangeOption(Width, X -> xconfigure.width); + nxagentChangeOption(Height, X -> xconfigure.height); - nxagentChangeOption(ViewportXSpan, (int) X -> xconfigure.width - - (int) nxagentOption(RootWidth)); - nxagentChangeOption(ViewportYSpan, (int) X -> xconfigure.height - - (int) nxagentOption(RootHeight)); + nxagentChangeOption(ViewportXSpan, (int) X -> xconfigure.width - + (int) nxagentOption(RootWidth)); + nxagentChangeOption(ViewportYSpan, (int) X -> xconfigure.height - + (int) nxagentOption(RootHeight)); - nxagentMoveViewport(pScreen, 0, 0); + nxagentMoveViewport(pScreen, 0, 0); - if (nxagentOption(Shadow) == 1 || - (nxagentOption(Width) == nxagentOption(RootWidth) && - nxagentOption(Height) == nxagentOption(RootHeight))) - { - doRandR = 0; - } + if (nxagentOption(Shadow) == 1 || + (nxagentOption(Width) == nxagentOption(RootWidth) && + nxagentOption(Height) == nxagentOption(RootHeight))) + { + doRandR = 0; + } - if (doRandR) - { - #ifdef TEST - fprintf(stderr,"nxagentHandleConfigureNotify: Width %d Height %d.\n", - nxagentOption(Width), nxagentOption(Height)); - #endif + nxagentChangeOption(Width, X -> xconfigure.width); + nxagentChangeOption(Height, X -> xconfigure.height); - nxagentRRSetScreenConfig(screenInfo.screens[DefaultScreen(nxagentDisplay)], - nxagentOption(Width), nxagentOption(Height)); - } + XMoveResizeWindow(nxagentDisplay, nxagentInputWindows[0], 0, 0, + X -> xconfigure.width, X -> xconfigure.height); + + if (nxagentOption(Fullscreen) == 0) + { + nxagentMoveViewport(pScreen, 0, 0); + } + else + { + nxagentChangeOption(RootX, (nxagentOption(Width) - + nxagentOption(RootWidth)) / 2); + nxagentChangeOption(RootY, (nxagentOption(Height) - + nxagentOption(RootHeight)) / 2); + nxagentChangeOption(ViewportXSpan, nxagentOption(Width) - + nxagentOption(RootWidth)); + nxagentChangeOption(ViewportYSpan, nxagentOption(Height) - + nxagentOption(RootHeight)); + + nxagentUpdateViewportFrame(0, 0, nxagentOption(RootWidth), + nxagentOption(RootHeight)); + + XMoveWindow(nxagentDisplay, nxagentWindow(WindowTable[pScreen -> myNum]), + nxagentOption(RootX), nxagentOption(RootY)); + } + + if (doRandR) + { + #ifdef TEST + fprintf(stderr,"nxagentHandleConfigureNotify: Width %d Height %d.\n", + nxagentOption(Width), nxagentOption(Height)); + #endif + + nxagentRRSetScreenConfig(screenInfo.screens[DefaultScreen(nxagentDisplay)], + nxagentOption(Width), nxagentOption(Height)); } return 1; @@ -3085,8 +3436,6 @@ int nxagentHandleConfigureNotify(XEvent* X) int nxagentHandleReparentNotify(XEvent* X) { - ScreenPtr pScreen = nxagentScreen(X -> xreparent.window); - #ifdef TEST fprintf(stderr, "nxagentHandleReparentNotify: Going to handle a new reparent event.\n"); #endif @@ -3203,7 +3552,6 @@ int nxagentHandleReparentNotify(XEvent* X) XlibWindow *childrenReturn = NULL; unsigned int nchildrenReturn = 0; Status result; - XSizeHints hints; XWindowAttributes attributes; int x, y; int xParent, yParent; @@ -3464,6 +3812,15 @@ void nxagentGrabPointerAndKeyboard(XEvent *X) XGrabKeyboard(nxagentDisplay, nxagentFullscreenWindow, True, GrabModeAsync, GrabModeAsync, now); + /* + * The smart scheduler could be stopped while + * waiting for the reply. In this case we need + * to yield explicitly to avoid to be stuck in + * the dispatch loop forever. + */ + + isItTimeToYield = 1; + #ifdef TEST fprintf(stderr, "nxagentGrabPointerAndKeyboard: Going to grab the pointer in context [B2].\n"); #endif @@ -3491,6 +3848,8 @@ void nxagentGrabPointerAndKeyboard(XEvent *X) XSetInputFocus(nxagentDisplay, nxagentFullscreenWindow, RevertToParent, now); } + + nxagentPointerAndKeyboardGrabbed = 1; } void nxagentUngrabPointerAndKeyboard(XEvent *X) @@ -3522,6 +3881,8 @@ void nxagentUngrabPointerAndKeyboard(XEvent *X) #endif XUngrabPointer(nxagentDisplay, now); + + nxagentPointerAndKeyboardGrabbed = 0; } void nxagentDeactivatePointerGrab() diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.h b/nx-X11/programs/Xserver/hw/nxagent/Events.h index 238a229f9..109475c16 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.h @@ -29,6 +29,7 @@ enum HandleEventResult { doNothing = 0, doMinimize, + doDebugTree, doCloseSession, doStartKbd, doSwitchFullscreen, diff --git a/nx-X11/programs/Xserver/hw/nxagent/Imakefile b/nx-X11/programs/Xserver/hw/nxagent/Imakefile index 633e17a22..51173e410 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Imakefile +++ b/nx-X11/programs/Xserver/hw/nxagent/Imakefile @@ -206,7 +206,8 @@ DEFINES = -g $(OS_DEFINES) $(EXT_DEFINES) $(UPG_DEFINES) \ -DNXAGENT_SPLASH \ -DNXAGENT_ARTSD \ -UNX_DEBUG_INPUT \ - -UPANORAMIX + -UPANORAMIX \ + -UDEBUG_TREE all:: $(OBJS) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c b/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c index a2e4fb06f..de1da8654 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Keystroke.c @@ -92,6 +92,18 @@ int nxagentCheckSpecialKeystroke(XKeyEvent *X, enum HandleEventResult *result) { switch (sym) { + #ifdef DEBUG_TREE + + case XK_q: + case XK_Q: + { + *result = doDebugTree; + + break; + } + + #endif /* DEBUG_TREE */ + case XK_t: case XK_T: { diff --git a/nx-X11/programs/Xserver/hw/nxagent/Pixels.h b/nx-X11/programs/Xserver/hw/nxagent/Pixels.h index e046771cc..ea7c375ee 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Pixels.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Pixels.h @@ -108,6 +108,12 @@ FIXME: The condition checking for the render avoid problems with the render composi- te on XFree86 remote server. */ +/* +FIXME: Changed macro: NXAGENT_SHOULD_DEFER_COMPOSITE + to handle situation, when pSrc -> pDrawable + is NULL. This case happens with gradients + and solid fill. + #define NXAGENT_SHOULD_DEFER_COMPOSITE(pSrc, pMask, pDst) \ ((nxagentRenderVersionMajor == 0 && \ nxagentRenderVersionMinor == 8 && \ @@ -118,6 +124,18 @@ FIXME: The condition checking for the render nxagentOption(DeferLevel) == 1) || \ (nxagentOption(DeferLevel) >= 2 && \ nxagentOption(LinkType) < LINK_TYPE_ADSL)) +*/ +#define NXAGENT_SHOULD_DEFER_COMPOSITE(pSrc, pMask, pDst) \ + ((nxagentRenderVersionMajor == 0 && \ + nxagentRenderVersionMinor == 8 && \ + (pDst) -> pDrawable -> type == DRAWABLE_PIXMAP) || \ + (nxagentOption(DeferLevel) >= 2 && \ + nxagentOption(LinkType) < LINK_TYPE_ADSL) || \ + (nxagentOption(DeferLevel) == 1 && \ + (pDst) -> pDrawable -> type == DRAWABLE_PIXMAP && \ + (((pSrc) -> pDrawable && nxagentDrawableStatus((pSrc) -> pDrawable) == NotSynchronized) || \ + ((pMask) && nxagentDrawableStatus((pMask) -> pDrawable) == NotSynchronized)))) + #define NXAGENT_SHOULD_DEFER_PUTIMAGE(pDrawable) \ (nxagentSplitTrap == 0 && \ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Pointer.c b/nx-X11/programs/Xserver/hw/nxagent/Pointer.c index 34012d3d5..9c1bfaace 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Pointer.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Pointer.c @@ -57,6 +57,13 @@ is" without express or implied warranty. #undef TEST #undef DEBUG +/* + * The nxagentReversePointerMap array is used to + * memorize remote display pointer map. + */ + +unsigned char nxagentReversePointerMap[MAXBUTTONS]; + void nxagentChangePointerControl(DeviceIntPtr pDev, PtrCtrl *ctrl) { /* @@ -125,6 +132,8 @@ int nxagentPointerProc(DeviceIntPtr pDev, int onoff) return Success; } + nxagentInitPointerMap(); + nxagentEnablePointerEvents(); break; @@ -155,3 +164,28 @@ int nxagentPointerProc(DeviceIntPtr pDev, int onoff) return Success; } + +void nxagentInitPointerMap(void) +{ + int numButtons; + + int i; + + unsigned char pointerMap[MAXBUTTONS]; + + #ifdef DEBUG + fprintf(stderr, "nxagentInitPointerMap: Going to retrieve the " + "pointer map from remote display.\n"); + #endif + + numButtons = XGetPointerMapping(nxagentDisplay, pointerMap, MAXBUTTONS); + + /* + * Computing revers pointer map. + */ + + for (i = 1; i <= numButtons; i++) + { + nxagentReversePointerMap[pointerMap[i - 1] - 1] = i; + } +} diff --git a/nx-X11/programs/Xserver/hw/nxagent/Pointer.h b/nx-X11/programs/Xserver/hw/nxagent/Pointer.h index 0807b08ae..b0bb3f99c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Pointer.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Pointer.h @@ -38,8 +38,17 @@ is" without express or implied warranty. (ButtonPressMask | ButtonReleaseMask | PointerMotionMask | \ EnterWindowMask | LeaveWindowMask) +/* + * The nxagentReversePointerMap array is used to + * memorize remote display pointer map. + */ + +extern unsigned char nxagentReversePointerMap[MAXBUTTONS]; + void nxagentChangePointerControl(DeviceIntPtr pDev, PtrCtrl *ctrl); int nxagentPointerProc(DeviceIntPtr pDev, int onoff); +void nxagentInitPointerMap(void); + #endif /* __Pointer_H__ */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c index 598ffc188..e63b481b2 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c @@ -81,6 +81,8 @@ extern Bool nxagentUninstallFontServerPath(void); extern void nxagentRemoveXConnection(void); +extern void nxagentInitPointerMap(void); + static char *nxagentGetReconnectError(void); void nxagentInitializeRecLossyLevel(void); @@ -584,6 +586,8 @@ Bool nxagentReconnectSession(void) nxagentOldKeyboard = NULL; } + nxagentInitPointerMap(); + nxagentDeactivatePointerGrab(); nxagentWakeupByReconnect(); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Render.c b/nx-X11/programs/Xserver/hw/nxagent/Render.c index 6bc54c86e..4f0f76474 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Render.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Render.c @@ -147,8 +147,6 @@ void nxagentCursorPostSaveRenderInfo(CursorPtr pCursor, ScreenPtr pScreen, int nxagentCreatePicture(PicturePtr pPicture, Mask mask); -void nxagentDestroyPicture(PicturePtr pPicture); - int nxagentChangePictureClip(PicturePtr pPicture, int clipType, int nRects, xRectangle *rects, int xOrigin, int yOrigin); @@ -1010,12 +1008,15 @@ void nxagentComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pD #ifdef DEBUG - fprintf(stderr, "nxagentComposite: Source Picture [%lu][%p] with drawable [%s%s][%p].\n", - nxagentPicturePriv(pSrc) -> picture, (void *) pSrc, - (pSrc -> pDrawable -> type == DRAWABLE_PIXMAP && - nxagentIsShmPixmap((PixmapPtr) pSrc -> pDrawable)) ? "Shared " : "", - pSrc -> pDrawable -> type == DRAWABLE_PIXMAP ? "Pixmap" : "Window", - (void *) pSrc -> pDrawable); + if (pSrc -> pDrawable != NULL) + { + fprintf(stderr, "nxagentComposite: Source Picture [%lu][%p] with drawable [%s%s][%p].\n", + nxagentPicturePriv(pSrc) -> picture, (void *) pSrc, + (pSrc -> pDrawable -> type == DRAWABLE_PIXMAP && + nxagentIsShmPixmap((PixmapPtr) pSrc -> pDrawable)) ? "Shared " : "", + pSrc -> pDrawable -> type == DRAWABLE_PIXMAP ? "Pixmap" : "Window", + (void *) pSrc -> pDrawable); + } fprintf(stderr, "nxagentComposite: Destination Picture [%lu][%p] with drawable [%s%s][%p].\n", nxagentPicturePriv(pDst) -> picture, (void *) pDst, @@ -1064,16 +1065,19 @@ void nxagentComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pD * the wrong data. */ - nxagentSynchronizeShmPixmap(pSrc -> pDrawable, xSrc, ySrc, width, height); - - if (nxagentDrawableStatus(pSrc -> pDrawable) == NotSynchronized) + if (pSrc -> pDrawable != NULL) { - #ifdef TEST - fprintf(stderr, "nxagentComposite: Synchronizing the source drawable [%p].\n", - (void *) pSrc -> pDrawable); - #endif + nxagentSynchronizeShmPixmap(pSrc -> pDrawable, xSrc, ySrc, width, height); - nxagentSynchronizeDrawable(pSrc -> pDrawable, DO_WAIT, NEVER_BREAK, NULL); + if (nxagentDrawableStatus(pSrc -> pDrawable) == NotSynchronized) + { + #ifdef TEST + fprintf(stderr, "nxagentComposite: Synchronizing the source drawable [%p].\n", + (void *) pSrc -> pDrawable); + #endif + + nxagentSynchronizeDrawable(pSrc -> pDrawable, DO_WAIT, NEVER_BREAK, NULL); + } } if (pDst -> pDrawable != pSrc -> pDrawable) @@ -2811,3 +2815,248 @@ Bool nxagentDisconnectAllPicture() return True; } +void nxagentRenderCreateSolidFill(PicturePtr pPicture, xRenderColor *color) +{ + Picture id; + + if (nxagentRenderEnable == False) + { + return; + } + + #ifdef DEBUG + + fprintf(stderr, "nxagentRenderCreateSolidFill: Got called.\n"); + + if (pPicture == NULL) + { + fprintf(stderr, "nxagentRenderCreateSolidFill: WARNING! pPicture pointer is NULL.\n"); + } + + if (color == NULL) + { + fprintf(stderr, "nxagentRenderCreateSolidFill: WARNING! color pointer is NULL.\n"); + } + + #endif /* #ifdef DEBUG */ + + memset(&(nxagentPicturePriv(pPicture) -> lastServerValues), 0, + sizeof(XRenderPictureAttributes_)); + + id = XRenderCreateSolidFill(nxagentDisplay, (XRenderColor *) color); + + #ifdef DEBUG + XSync(nxagentDisplay, 0); + #endif + + #ifdef TEST + fprintf(stderr, "nxagentRenderCreateSolidFill: Created solid fill xid [%lu].\n", id); + #endif + + nxagentPicturePriv(pPicture) -> picture = id; +} + +void nxagentRenderCreateLinearGradient(PicturePtr pPicture, xPointFixed *p1, + xPointFixed *p2, int nStops, + xFixed *stops, + xRenderColor *colors) +{ + Picture id; + + XLinearGradient linearGradient; + + if (nxagentRenderEnable == False) + { + return; + } + + #ifdef DEBUG + + fprintf(stderr, "nxagentRenderCreateLinearGradient: Got called.\n"); + + if (pPicture == NULL) + { + fprintf(stderr, "nxagentRenderCreateLinearGradient: WARNING! pPicture pointer is NULL.\n"); + } + + if (p1 == NULL) + { + fprintf(stderr, "nxagentRenderCreateLinearGradient: WARNING! p1 pointer is NULL.\n"); + } + + if (p2 == NULL) + { + fprintf(stderr, "nxagentRenderCreateLinearGradient: WARNING! p2 pointer is NULL.\n"); + } + + if (stops == NULL) + { + fprintf(stderr, "nxagentRenderCreateLinearGradient: WARNING! stops pointer is NULL.\n"); + } + + if (colors == NULL) + { + fprintf(stderr, "nxagentRenderCreateLinearGradient: WARNING! colors pointer is NULL.\n"); + } + + #endif /* #ifdef DEBUG */ + + memset(&(nxagentPicturePriv(pPicture) -> lastServerValues), 0, + sizeof(XRenderPictureAttributes_)); + + linearGradient.p1.x = (XFixed) p1 -> x; + linearGradient.p1.y = (XFixed) p1 -> y; + linearGradient.p2.x = (XFixed) p2 -> x; + linearGradient.p2.y = (XFixed) p2 -> y; + + id = XRenderCreateLinearGradient(nxagentDisplay, &linearGradient, + (XFixed *) stops, + (XRenderColor *) colors, nStops); + + #ifdef DEBUG + XSync(nxagentDisplay, 0); + #endif + + #ifdef TEST + fprintf(stderr, "nxagentRenderCreateLinearGradient: Created linear gradient xid [%lu].\n", id); + #endif + + nxagentPicturePriv(pPicture) -> picture = id; +} + +void nxagentRenderCreateRadialGradient(PicturePtr pPicture, xPointFixed *inner, + xPointFixed *outer, + xFixed innerRadius, + xFixed outerRadius, + int nStops, + xFixed *stops, + xRenderColor *colors) +{ + Picture id; + + XRadialGradient radialGradient; + + if (nxagentRenderEnable == False) + { + return; + } + + #ifdef DEBUG + + fprintf(stderr, "nxagentRenderCreateRadialGradient: Got called.\n"); + + if (pPicture == NULL) + { + fprintf(stderr, "nxagentRenderCreateRadialGradient: WARNING! pPicture pointer is NULL.\n"); + } + + if (inner == NULL) + { + fprintf(stderr, "nxagentRenderCreateRadialGradient: WARNING! inner pointer is NULL.\n"); + } + + if (outer == NULL) + { + fprintf(stderr, "nxagentRenderCreateRadialGradient: WARNING! outer pointer is NULL.\n"); + } + + if (stops == NULL) + { + fprintf(stderr, "nxagentRenderCreateRadialGradient: WARNING! stops pointer is NULL.\n"); + } + + if (colors == NULL) + { + fprintf(stderr, "nxagentRenderCreateRadialGradient: WARNING! colors pointer is NULL.\n"); + } + + #endif /* #ifdef DEBUG */ + + memset(&(nxagentPicturePriv(pPicture) -> lastServerValues), 0, + sizeof(XRenderPictureAttributes_)); + + radialGradient.inner.x = (XFixed) inner -> x; + radialGradient.inner.y = (XFixed) inner -> y; + radialGradient.inner.radius = (XFixed) innerRadius; + radialGradient.outer.x = (XFixed) outer -> x; + radialGradient.outer.y = (XFixed) outer -> y; + radialGradient.outer.radius = (XFixed) outerRadius; + + id = XRenderCreateRadialGradient(nxagentDisplay, &radialGradient, + (XFixed *) stops, + (XRenderColor *) colors, nStops); + + #ifdef DEBUG + XSync(nxagentDisplay, 0); + #endif + + #ifdef TEST + fprintf(stderr, "nxagentRenderCreateRadialGradient: Created radial gradient xid [%lu].\n", id); + #endif + + nxagentPicturePriv(pPicture) -> picture = id; +} + +void nxagentRenderCreateConicalGradient(PicturePtr pPicture, + xPointFixed *center, + xFixed angle, int nStops, + xFixed *stops, + xRenderColor *colors) +{ + Picture id; + + XConicalGradient conicalGradient; + + if (nxagentRenderEnable == False) + { + return; + } + + #ifdef DEBUG + + fprintf(stderr, "nxagentRenderCreateConicalGradient: Got called.\n"); + + if (pPicture == NULL) + { + fprintf(stderr, "nxagentRenderCreateConicalGradient: WARNING! pPicture pointer is NULL.\n"); + } + + if (center == NULL) + { + fprintf(stderr, "nxagentRenderCreateConicalGradient: WARNING! center pointer is NULL.\n"); + } + + if (stops == NULL) + { + fprintf(stderr, "nxagentRenderCreateConicalGradient: WARNING! stops pointer is NULL.\n"); + } + + if (colors == NULL) + { + fprintf(stderr, "nxagentRenderCreateConicalGradient: WARNING! colors pointer is NULL.\n"); + } + + #endif /* #ifdef DEBUG */ + + memset(&(nxagentPicturePriv(pPicture) -> lastServerValues), 0, + sizeof(XRenderPictureAttributes_)); + + conicalGradient.center.x = (XFixed) center -> x; + conicalGradient.center.y = (XFixed) center -> y; + conicalGradient.angle = (XFixed) angle; + + id = XRenderCreateConicalGradient(nxagentDisplay, &conicalGradient, + (XFixed *) stops, + (XRenderColor *) colors, nStops); + + #ifdef DEBUG + XSync(nxagentDisplay, 0); + #endif + + #ifdef TEST + fprintf(stderr, "nxagentRenderCreateConicalGradient: Created conical gradient xid [%lu].\n", id); + #endif + + nxagentPicturePriv(pPicture) -> picture = id; +} + diff --git a/nx-X11/programs/Xserver/hw/nxagent/Render.h b/nx-X11/programs/Xserver/hw/nxagent/Render.h index 81ba3369d..4346a4e1e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Render.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Render.h @@ -105,4 +105,6 @@ void nxagentDisconnectPicture(pointer p0, XID x1, void* p2); void nxagentReconnectGlyphSet(void* p0, XID x1, void *p2); +void nxagentDestroyPicture(PicturePtr pPicture); + #endif /* __Render_H__ */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/Rootless.c b/nx-X11/programs/Xserver/hw/nxagent/Rootless.c index a8ce4c7cd..612e71cf7 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Rootless.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Rootless.c @@ -626,6 +626,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) XlibAtom *atoms = malloc(nUnits * sizeof(*atoms)); Atom *input = value; int i; + int j = 0; freeMem = True; export = True; @@ -633,16 +634,40 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value) for (i = 0; i < nUnits; i++) { - atoms[i] = nxagentLocalToRemoteAtom(input[i]); - - if (atoms[i] == None) - { - #ifdef WARNING - fprintf(stderr, "nxagentExportProperty: WARNING! Failed to convert local atom %ld [%s].\n", - (long int) input[i], validateString(NameForAtom(input[i]))); - #endif - } + /* + * Exporting the _NET_WM_PING property could + * result in rootless windows being grayed out + * when the compiz window manager is running. + * + * Better solution would probably be to handle + * the communication with the window manager + * instead of just getting rid of the property. + */ + + if (strcmp(NameForAtom(input[i]), "_NET_WM_PING") != 0) + { + atoms[j] = nxagentLocalToRemoteAtom(input[i]); + + if (atoms[j] == None) + { + #ifdef WARNING + fprintf(stderr, "nxagentExportProperty: WARNING! Failed to convert local atom %ld [%s].\n", + (long int) input[i], validateString(NameForAtom(input[i]))); + #endif + } + + j++; + } + #ifdef TEST + else + { + fprintf(stderr, "nxagentExportProperty: WARNING! " + "Not exporting the _NET_WM_PING property.\n"); + } + #endif } + + nUnits = j; } else if (strcmp(typeS, "WINDOW") == 0) { diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index bdd30afee..3522d7e2e 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -160,7 +160,6 @@ void nxagentPropagateArtsdProperties(ScreenPtr pScreen, char *port); #endif -Window nxagentIconWindow = None; Window nxagentFullscreenWindow = None; #ifdef VIEWPORT_FRAME @@ -291,33 +290,16 @@ void nxagentSetPixmapFormats(ScreenInfo *screenInfo) void nxagentMinimizeFromFullScreen(ScreenPtr pScreen) { XUnmapWindow(nxagentDisplay, nxagentFullscreenWindow); - - if(nxagentIpaq) - { - XMapWindow(nxagentDisplay, nxagentIconWindow); - XIconifyWindow(nxagentDisplay, nxagentIconWindow, - DefaultScreen(nxagentDisplay)); - } - else - { - XIconifyWindow(nxagentDisplay, nxagentIconWindow, - DefaultScreen(nxagentDisplay)); - } } void nxagentMaximizeToFullScreen(ScreenPtr pScreen) { if(nxagentIpaq) { - XUnmapWindow(nxagentDisplay, nxagentIconWindow); - XMapWindow(nxagentDisplay, nxagentFullscreenWindow); } else { -/* - XUnmapWindow(nxagentDisplay, nxagentIconWindow); -*/ /* FIXME: We'll chech for ReparentNotify and LeaveNotify events after XReparentWindow() in order to avoid the session window is iconified. @@ -352,100 +334,8 @@ FIXME: We'll chech for ReparentNotify and LeaveNotify events after XReparentWind XMapRaised(nxagentDisplay, nxagentFullscreenWindow); - XIconifyWindow(nxagentDisplay, nxagentIconWindow, - DefaultScreen(nxagentDisplay)); - while (XCheckTypedWindowEvent(nxagentDisplay, nxagentFullscreenWindow, LeaveNotify, &e)); -/* - XMapWindow(nxagentDisplay, nxagentIconWindow); -*/ - } -} - -Window nxagentCreateIconWindow() -{ - XSetWindowAttributes attributes; - unsigned long valuemask; - char* window_name; - XTextProperty windowName; - XSizeHints sizeHints; - XWMHints wmHints; - Window w; - Mask mask; - - /* - * Create icon window. - */ - - attributes.override_redirect = False; - attributes.colormap = DefaultColormap(nxagentDisplay, DefaultScreen(nxagentDisplay)); - attributes.background_pixmap = nxagentScreenSaverPixmap; - valuemask = CWOverrideRedirect | CWBackPixmap | CWColormap; - - #ifdef TEST - fprintf(stderr, "nxagentCreateIconWindow: Going to create new icon window.\n"); - #endif - - w = XCreateWindow(nxagentDisplay, DefaultRootWindow(nxagentDisplay), - 0, 0, 1, 1, 0, - DefaultDepth(nxagentDisplay, DefaultScreen(nxagentDisplay)), - InputOutput, - DefaultVisual(nxagentDisplay, DefaultScreen(nxagentDisplay)), - valuemask, &attributes); - - #ifdef TEST - fprintf(stderr, "nxagentCreateIconWindow: Created new icon window with id [%ld].\n", - nxagentIconWindow); - #endif - - /* - * Set hints to the window manager for the icon window. - */ - - window_name = nxagentWindowName; - XStringListToTextProperty(&window_name, 1, &windowName); - sizeHints.flags = PMinSize | PMaxSize; - sizeHints.min_width = sizeHints.max_width = 1; - sizeHints.min_height = sizeHints.max_height = 1; - wmHints.flags = IconPixmapHint | IconMaskHint; - wmHints.initial_state = IconicState; - wmHints.icon_pixmap = nxagentIconPixmap; - - if (useXpmIcon) - { - wmHints.icon_mask = nxagentIconShape; - wmHints.flags = IconPixmapHint | IconMaskHint; } - else - { - wmHints.flags = StateHint | IconPixmapHint; - } - - XSetWMProperties(nxagentDisplay, w, - &windowName, &windowName, - NULL , 0 , &sizeHints, &wmHints, NULL); - - /* - * Enable events from the icon window. - */ - - nxagentGetDefaultEventMask(&mask); - - XSelectInput(nxagentDisplay, w, (mask & ~(KeyPressMask | - KeyReleaseMask)) | StructureNotifyMask); - - /* - * Notify to client if user closes icon window. - */ - - if (nxagentWMIsRunning && !nxagentOption(Rootless)) - { - XlibAtom deleteWMAtom = nxagentAtoms[2]; /* WM_DELETE_WINDOW */ - - XSetWMProtocols(nxagentDisplay, w, &deleteWMAtom, 1); - } - - return w; } Bool nxagentMagicPixelZone(int x, int y) @@ -977,6 +867,8 @@ Bool nxagentOpenScreen(int index, ScreenPtr pScreen, nxagentChangeOption(Fullscreen, False); + nxagentFullscreenWindow = 0; + resetAgentPosition = True; } @@ -1382,8 +1274,6 @@ N/A if (nxagentOption(Fullscreen)) { - attributes.override_redirect = True; - /* * We need to disable the host's screensaver or * it will otherwise grab the screen even if it @@ -1609,8 +1499,7 @@ N/A if (nxagentDoFullGeneration == 1 || nxagentReconnectTrap == 1) { - valuemask = CWBackPixel | CWEventMask | CWColormap | - (nxagentOption(Fullscreen) == 1 ? CWOverrideRedirect : 0); + valuemask = CWBackPixel | CWEventMask | CWColormap; attributes.background_pixel = nxagentBlackPixel; @@ -1620,8 +1509,6 @@ N/A if (nxagentOption(Fullscreen) == 1) { - attributes.override_redirect = True; - if (nxagentReconnectTrap) { /* @@ -1754,7 +1641,7 @@ N/A sizeHints.width = nxagentOption(RootWidth); sizeHints.height = nxagentOption(RootHeight); - if (nxagentOption(DesktopResize) == 1) + if (nxagentOption(DesktopResize) == 1 || nxagentOption(Fullscreen) == 1) { sizeHints.max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); sizeHints.max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); @@ -1799,37 +1686,6 @@ N/A XClearWindow(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum]); - if (nxagentOption(Fullscreen)) - { - valuemask = CWBackPixmap | CWColormap | CWOverrideRedirect; - } - else - { - valuemask = CWBackPixmap | CWColormap; - } - - attributes.background_pixmap = nxagentScreenSaverPixmap; - attributes.colormap = DefaultColormap(nxagentDisplay, DefaultScreen(nxagentDisplay)); - - if (nxagentOption(Fullscreen)) - { - attributes.override_redirect = False; - if (nxagentReconnectTrap) - { - XGrabKeyboard(nxagentDisplay, nxagentFullscreenWindow, True, GrabModeAsync, - GrabModeAsync, CurrentTime); - } - } - - if (nxagentOption(Fullscreen)) - { - nxagentIconWindow = nxagentCreateIconWindow(); - } - else - { - nxagentIconWindow = 0; - } - /* * When we don't have window manager we grab keyboard * to let nxagent get keyboard events. @@ -1880,13 +1736,6 @@ N/A */ XSetWMProtocols(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum], &deleteWMatom, 1); - - /* - if (nxagentOption(Fullscreen)) - { - XSetWMProtocols(nxagentDisplay, nxagentIconWindow, &deleteWMatom, 1); - } - */ } else { @@ -2266,13 +2115,10 @@ FIXME: We should try to restore the previously if (nxagentOption(Fullscreen)) { - nxagentChangeOption(Width, WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay))); - nxagentChangeOption(Height, HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay))); - - nxagentChangeOption(RootX, (WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)) - - nxagentOption(RootWidth)) / 2); - nxagentChangeOption(RootY, (HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)) - - nxagentOption(RootHeight)) / 2); + nxagentChangeOption(RootX, (nxagentOption(Width) - + nxagentOption(RootWidth)) / 2); + nxagentChangeOption(RootY, (nxagentOption(Height) - + nxagentOption(RootHeight)) / 2); } else { @@ -2283,62 +2129,6 @@ FIXME: We should try to restore the previously nxagentChangeOption(ViewportXSpan, nxagentOption(Width) - nxagentOption(RootWidth)); nxagentChangeOption(ViewportYSpan, nxagentOption(Height) - nxagentOption(RootHeight)); - /* - * Change agent window size and size hints. - */ - - sizeHints.flags = PPosition | PMinSize | PMaxSize; - sizeHints.x = nxagentOption(X); - sizeHints.y = nxagentOption(Y); - - sizeHints.min_width = MIN_NXAGENT_WIDTH; - sizeHints.min_height = MIN_NXAGENT_HEIGHT; - sizeHints.width = width; - sizeHints.height = height; - - if (nxagentOption(DesktopResize) == 1) - { - sizeHints.max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); - sizeHints.max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); - } - else - { - sizeHints.max_width = nxagentOption(RootWidth); - sizeHints.max_height = nxagentOption(RootHeight); - } - - if (nxagentUserGeometry.flag & XValue || nxagentUserGeometry.flag & YValue) - { - sizeHints.flags |= USPosition; - } - - if (nxagentUserGeometry.flag & WidthValue || nxagentUserGeometry.flag & HeightValue) - { - sizeHints.flags |= USSize; - } - - XSetWMNormalHints(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum], &sizeHints); - - if (nxagentOption(Fullscreen)) - { - XResizeWindow(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum], - WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)), - HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay))); - - XResizeWindow(nxagentDisplay, nxagentInputWindows[pScreen -> myNum], - WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)), - HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay))); - } - else - { - XResizeWindow(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum], width, height); - - if (nxagentOption(Rootless) == 0) - { - XResizeWindow(nxagentDisplay, nxagentInputWindows[pScreen -> myNum], width, height); - } - } - /* * Set properties for the agent root window. */ @@ -2360,8 +2150,6 @@ FIXME: We should try to restore the previously (*pScreen -> PositionWindow)(WindowTable[pScreen -> myNum], 0, 0); - pRootWinSize = &WindowTable[pScreen -> myNum] -> winSize; - nxagentSetRootClip(pScreen, 1); XMoveWindow(nxagentDisplay, nxagentWindow(WindowTable[0]), @@ -2369,6 +2157,12 @@ FIXME: We should try to restore the previously nxagentMoveViewport(pScreen, 0, 0); + /* + * Update pointer bounds. + */ + + ScreenRestructured(pScreen); + #ifdef TEST nxagentPrintAgentGeometry("After Resize Screen", "nxagentResizeScreen:"); #endif diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.h b/nx-X11/programs/Xserver/hw/nxagent/Screen.h index 6ffebe0ea..3bf66b2f5 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.h @@ -47,7 +47,6 @@ extern ScreenPtr nxagentDefaultScreen; extern Pixmap nxagentPixmapLogo; -extern Window nxagentIconWindow; extern Window nxagentFullscreenWindow; extern RegionRec nxagentShadowUpdateRegion; @@ -89,8 +88,6 @@ void nxagentSetScreenSaverTime(void); void nxagentMinimizeFromFullScreen(ScreenPtr pScreen); void nxagentMaximizeToFullScreen(ScreenPtr pScreen); -Window nxagentCreateIconWindow(void); - Bool nxagentMagicPixelZone(int x, int y); Bool nxagentResizeScreen(ScreenPtr pScreen, int width, int height, diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index 449458ade..2403390b8 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -692,235 +692,87 @@ void nxagentRestackWindow(WindowPtr pWin, WindowPtr pOldNextSib) void nxagentSwitchFullscreen(ScreenPtr pScreen, Bool switchOn) { - Window w; - XSetWindowAttributes attributes; - unsigned long valuemask; + XEvent e; + XSizeHints sizeHints; - if (nxagentOption(Rootless)) + if (nxagentOption(Rootless) == 1) { return; } - if (!switchOn) + if (switchOn == 0) { nxagentWMDetect(); - if (!nxagentWMIsRunning) - { - #ifdef WARNING - fprintf(stderr, "Warning: Can't switch to window mode, no window manager has been detected.\n"); - #endif - - return; - } - } - - w = nxagentDefaultWindows[pScreen -> myNum]; - attributes.override_redirect = switchOn; - valuemask = CWOverrideRedirect; - XUnmapWindow(nxagentDisplay, w); - XChangeWindowAttributes(nxagentDisplay, w, valuemask, &attributes); - - if (switchOn) - { - /* - * Change to fullscreen mode. - */ - - struct timeval timeout; - int i; - XEvent e; - /* - * Wait for window manager reparenting the default window. + * The smart scheduler could be stopped while + * waiting for the reply. In this case we need + * to yield explicitly to avoid to be stuck in + * the dispatch loop forever. */ - for (i = 0; i < 100 && nxagentWMIsRunning; i++) - { - #ifdef TEST - fprintf(stderr, "nxagentSwitchFullscreen: WARNING! Going to wait for the ReparentNotify event.\n"); - #endif - - if (XCheckTypedWindowEvent(nxagentDisplay, w, ReparentNotify, &e)) - { - break; - } - - /* - * This should also flush - * the NX link for us. - */ - - XSync(nxagentDisplay, 0); - - timeout.tv_sec = 0; - timeout.tv_usec = 50 * 1000; - - nxagentWaitEvents(nxagentDisplay, &timeout); - } - - if (i < 100) - { - /* - * The window manager has done with the reparent - * operation. We can resize and map the window. - */ - - nxagentChangeOption(Fullscreen, True); - - /* - * Save the window-mode configuration. - */ - - nxagentChangeOption(SavedX, nxagentOption(X)); - nxagentChangeOption(SavedY, nxagentOption(Y)); - nxagentChangeOption(SavedWidth, nxagentOption(Width)); - nxagentChangeOption(SavedHeight, nxagentOption(Height)); - nxagentChangeOption(SavedRootWidth, nxagentOption(RootWidth)); - nxagentChangeOption(SavedRootHeight, nxagentOption(RootHeight)); - - /* - * Reconf the Default window. - */ - - nxagentChangeOption(X, 0); - nxagentChangeOption(Y, 0); - nxagentChangeOption(Width, WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay))); - nxagentChangeOption(Height, HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay))); - - /* - * Move the root window. - */ - - nxagentChangeOption(RootX, (nxagentOption(Width) - nxagentOption(RootWidth)) / 2); - nxagentChangeOption(RootY, (nxagentOption(Height) - nxagentOption(RootHeight)) / 2); - nxagentChangeOption(ViewportXSpan, nxagentOption(Width) - nxagentOption(RootWidth)); - nxagentChangeOption(ViewportYSpan, nxagentOption(Height) - nxagentOption(RootHeight)); - - XMoveResizeWindow(nxagentDisplay, w, nxagentOption(X), nxagentOption(Y), - nxagentOption(Width), nxagentOption(Height)); - - nxagentUpdateViewportFrame(0, 0, nxagentOption(RootWidth), nxagentOption(RootHeight)); - - XMoveWindow(nxagentDisplay, nxagentWindow(WindowTable[pScreen -> myNum]), - nxagentOption(RootX), nxagentOption(RootY)); - - /* - * We disable the screensaver when changing - * mode to fullscreen. Is it really needed? - */ - - XSetScreenSaver(nxagentDisplay, 0, 0, DefaultExposures, DefaultBlanking); + isItTimeToYield = 1; - if (nxagentIconWindow == None) - { - nxagentIconWindow = nxagentCreateIconWindow(); - - XMapWindow(nxagentDisplay, nxagentIconWindow); - } - - XMapRaised(nxagentDisplay, w); - XSetInputFocus(nxagentDisplay, w, RevertToParent, CurrentTime); - XCheckTypedWindowEvent(nxagentDisplay, w, LeaveNotify, &e); - nxagentFullscreenWindow = w; - - if (nxagentOption(DesktopResize) == 1) - { - if (nxagentOption(Shadow) == 0) - { - nxagentRRSetScreenConfig(pScreen, WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)), - HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay))); - } - else - { - nxagentShadowAdaptToRatio(); - } - } - } - else + if (nxagentWMIsRunning == 0) { - /* - * We have waited for a reparent event unsuccessfully. - * Something happened to the window manager. - */ - #ifdef WARNING - fprintf(stderr, "nxagentSwitchFullscreen: WARNING! Expected ReparentNotify event missing.\n"); + fprintf(stderr, "Warning: Can't switch to window mode, no window manager " + "has been detected.\n"); #endif - nxagentWMIsRunning = False; - attributes.override_redirect = False; - XChangeWindowAttributes(nxagentDisplay, w, valuemask, &attributes); - XMapWindow(nxagentDisplay, w); + return; } } - else - { - /* - * FIXME: - * It could be necessary: - * - To restore screensaver. - * - To set or reset nxagentForceBackingStore flag. - * - To grab keyboard. - * - To propagate device settings to the X server if no WM is running. - */ - - /* - * Change to windowed mode. - */ - nxagentChangeOption(Fullscreen, False); - XDestroyWindow(nxagentDisplay, nxagentIconWindow); - nxagentIconWindow = nxagentFullscreenWindow = None; + #ifdef TEST + fprintf(stderr, "nxagentSwitchFullscreen: Switching to %s mode.\n", + switchOn ? "fullscreen" : "windowed"); + #endif - if (nxagentOption(DesktopResize) == 1) - { - nxagentChangeOption(RootWidth, nxagentOption(SavedRootWidth)); - nxagentChangeOption(RootHeight, nxagentOption(SavedRootHeight)); + nxagentChangeOption(Fullscreen, switchOn); - if (nxagentOption(Shadow) == 0) - { - nxagentRRSetScreenConfig(pScreen, nxagentOption(RootWidth), nxagentOption(RootHeight)); - } - } + if (nxagentOption(DesktopResize) == 1) + { + sizeHints.flags = PSize; - if (nxagentOption(WMBorderWidth) > 0 && nxagentOption(WMTitleHeight) > 0) + if (switchOn == 1) { - nxagentChangeOption(X, nxagentOption(SavedX) - - nxagentOption(WMBorderWidth)); - nxagentChangeOption(Y, nxagentOption(SavedY) - - nxagentOption(WMTitleHeight)); + sizeHints.width = + WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); + sizeHints.height = + HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); } else { - nxagentChangeOption(X, nxagentOption(SavedX)); - nxagentChangeOption(Y, nxagentOption(SavedY)); + sizeHints.width = nxagentOption(RootWidth); + sizeHints.height = nxagentOption(RootHeight); } - nxagentChangeOption(Width, nxagentOption(SavedWidth)); - nxagentChangeOption(Height, nxagentOption(SavedHeight)); - - if (nxagentOption(Shadow) == 1 && nxagentOption(DesktopResize) == 1) - { - nxagentShadowAdaptToRatio(); - } + XSetWMNormalHints(nxagentDisplay, nxagentDefaultWindows[pScreen -> myNum], + &sizeHints); + } - XMoveResizeWindow(nxagentDisplay, w, nxagentOption(X), nxagentOption(Y), - nxagentOption(Width), nxagentOption(Height)); + memset(&e, 0, sizeof(e)); - nxagentUpdateViewportFrame(0, 0, nxagentOption(Width), nxagentOption(Height)); + e.xclient.type = ClientMessage; + e.xclient.message_type = nxagentAtoms[13]; /* _NET_WM_STATE */ + e.xclient.display = nxagentDisplay; + e.xclient.window = nxagentDefaultWindows[pScreen -> myNum]; + e.xclient.format = 32; + e.xclient.data.l[0] = nxagentOption(Fullscreen) ? 1 : 0; + e.xclient.data.l[1] = nxagentAtoms[14]; /* _NET_WM_STATE_FULLSCREEN */ - XMoveWindow(nxagentDisplay, nxagentWindow(WindowTable[pScreen -> myNum]), 0, 0); - XMapWindow(nxagentDisplay, w); + XSendEvent(nxagentDisplay, DefaultRootWindow(nxagentDisplay), False, + SubstructureRedirectMask, &e); - nxagentChangeOption(RootX, 0); - nxagentChangeOption(RootY, 0); + if (switchOn == 1) + { + nxagentFullscreenWindow = nxagentDefaultWindows[pScreen -> myNum]; } - - XMoveResizeWindow(nxagentDisplay, nxagentInputWindows[0], 0, 0, - nxagentOption(Width), nxagentOption(Height)); - - nxagentSetPrintGeometry(pScreen -> myNum); + else + { + nxagentFullscreenWindow = None; + } } #ifdef VIEWPORT_FRAME @@ -2422,6 +2274,11 @@ void nxagentMapDefaultWindows() #endif XMapWindow(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum]); + + if (nxagentOption(Fullscreen) == 1 && nxagentWMIsRunning == 1) + { + nxagentSwitchFullscreen(pScreen, 1); + } } /* @@ -2451,26 +2308,6 @@ void nxagentMapDefaultWindows() nxagentDefaultWindows[i], CurrentTime); } - /* - * Map the icon window. - */ - - if (nxagentIconWindow != 0) - { - #ifdef TEST - fprintf(stderr, "nxagentMapDefaultWindows: Mapping icon window id [%ld].\n", - nxagentIconWindow); - #endif - - XMapWindow(nxagentDisplay, nxagentIconWindow); - - if (nxagentIpaq != 0) - { - XIconifyWindow(nxagentDisplay, nxagentIconWindow, - DefaultScreen(nxagentDisplay)); - } - } - /* * Ensure that the fullscreen window gets the focus. */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXpicture.c b/nx-X11/programs/Xserver/hw/nxagent/X/NXpicture.c index 18697a576..be961c400 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXpicture.c +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXpicture.c @@ -62,6 +62,7 @@ #include "Screen.h" #include "Pixmaps.h" #include "Drawable.h" +#include "Render.h" #define PANIC #define WARNING @@ -1063,7 +1064,47 @@ static void initGradient(SourcePictPtr pGradient, int stopCount, static PicturePtr createSourcePicture(void) { PicturePtr pPicture; - pPicture = (PicturePtr) xalloc(sizeof(PictureRec)); + + extern int nxagentPicturePrivateIndex; + + unsigned int totalPictureSize; + + DevUnion *ppriv; + + char *privPictureRecAddr; + + int i; + + /* + * Compute size of entire PictureRect, plus privates. + */ + + totalPictureSize = sizeof(PictureRec) + + picturePrivateCount * sizeof(DevUnion) + + sizeof(nxagentPrivPictureRec); + + pPicture = (PicturePtr) xalloc(totalPictureSize); + + if (pPicture != NULL) + { + ppriv = (DevUnion *) (pPicture + 1); + + for (i = 0; i < picturePrivateCount; ++i) + { + /* + * Other privates are inaccessible. + */ + + ppriv[i].ptr = NULL; + } + + privPictureRecAddr = (char *) &ppriv[picturePrivateCount]; + + ppriv[nxagentPicturePrivateIndex].ptr = (pointer) privPictureRecAddr; + + pPicture -> devPrivates = ppriv; + } + pPicture->pDrawable = 0; pPicture->pFormat = 0; pPicture->pNext = 0; @@ -1697,6 +1738,10 @@ FreePicture (pointer value, if (--pPicture->refcnt == 0) { +#ifdef NXAGENT_SERVER + nxagentDestroyPicture(pPicture); +#endif + if (pPicture->transform) xfree (pPicture->transform); if (!pPicture->pDrawable) { diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXpicture.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXpicture.c.NX.original index 18697a576..be961c400 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXpicture.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXpicture.c.NX.original @@ -62,6 +62,7 @@ #include "Screen.h" #include "Pixmaps.h" #include "Drawable.h" +#include "Render.h" #define PANIC #define WARNING @@ -1063,7 +1064,47 @@ static void initGradient(SourcePictPtr pGradient, int stopCount, static PicturePtr createSourcePicture(void) { PicturePtr pPicture; - pPicture = (PicturePtr) xalloc(sizeof(PictureRec)); + + extern int nxagentPicturePrivateIndex; + + unsigned int totalPictureSize; + + DevUnion *ppriv; + + char *privPictureRecAddr; + + int i; + + /* + * Compute size of entire PictureRect, plus privates. + */ + + totalPictureSize = sizeof(PictureRec) + + picturePrivateCount * sizeof(DevUnion) + + sizeof(nxagentPrivPictureRec); + + pPicture = (PicturePtr) xalloc(totalPictureSize); + + if (pPicture != NULL) + { + ppriv = (DevUnion *) (pPicture + 1); + + for (i = 0; i < picturePrivateCount; ++i) + { + /* + * Other privates are inaccessible. + */ + + ppriv[i].ptr = NULL; + } + + privPictureRecAddr = (char *) &ppriv[picturePrivateCount]; + + ppriv[nxagentPicturePrivateIndex].ptr = (pointer) privPictureRecAddr; + + pPicture -> devPrivates = ppriv; + } + pPicture->pDrawable = 0; pPicture->pFormat = 0; pPicture->pNext = 0; @@ -1697,6 +1738,10 @@ FreePicture (pointer value, if (--pPicture->refcnt == 0) { +#ifdef NXAGENT_SERVER + nxagentDestroyPicture(pPicture); +#endif + if (pPicture->transform) xfree (pPicture->transform); if (!pPicture->pDrawable) { diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXrender.c b/nx-X11/programs/Xserver/hw/nxagent/X/NXrender.c index ffc199704..562cd2c66 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXrender.c +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXrender.c @@ -116,7 +116,6 @@ int nxagentCursorSaveRenderInfo(ScreenPtr, CursorPtr); void nxagentCursorPostSaveRenderInfo(CursorPtr, ScreenPtr, PicturePtr, int, int); int nxagentRenderRealizeCursor(ScreenPtr, CursorPtr); int nxagentCreatePicture(PicturePtr, Mask); -void nxagentDestroyPicture(PicturePtr pPicture); void nxagentChangePicture(PicturePtr, Mask); int nxagentChangePictureClip(PicturePtr, int, int, xRectangle *, int, int); void nxagentComposite(CARD8, PicturePtr, PicturePtr, PicturePtr, INT16, INT16, @@ -132,6 +131,28 @@ void nxagentSetPictureFilter(PicturePtr pPicture, char *filter, int name_size, void nxagentTrapezoids(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int ntrap, xTrapezoid *traps); +void nxagentRenderCreateSolidFill(PicturePtr pPicture, xRenderColor *color); + +void nxagentRenderCreateLinearGradient(PicturePtr pPicture, xPointFixed *p1, + xPointFixed *p2, int nStops, + xFixed *stops, + xRenderColor *colors); + +void nxagentRenderCreateRadialGradient(PicturePtr pPicture, xPointFixed *inner, + xPointFixed *outer, + xFixed innerRadius, + xFixed outerRadius, + int nStops, + xFixed *stops, + xRenderColor *colors); + +void nxagentRenderCreateConicalGradient(PicturePtr pPicture, + xPointFixed *center, + xFixed angle, int nStops, + xFixed *stops, + xRenderColor *colors); + + /* * The void pointer is actually a XGlyphElt8. */ @@ -823,8 +844,6 @@ ProcRenderFreePicture (ClientPtr client) VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityDestroyAccess, RenderErrBase + BadPicture); - nxagentDestroyPicture(pPicture); - FreeResource (stuff->picture, RT_NONE); return(client->noClientException); } @@ -926,9 +945,16 @@ ProcRenderComposite (ClientPtr client) RenderErrBase + BadPicture); VERIFY_ALPHA (pMask, stuff->mask, client, SecurityReadAccess, RenderErrBase + BadPicture); +/* +FIXME: Imported change from newest version of Xorg. Changed pSrc to pDst. + if ((pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) || (pMask && pMask->pDrawable && pSrc->pDrawable->pScreen != pMask->pDrawable->pScreen)) return BadMatch; +*/ + if ((pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) || + (pMask && pMask->pDrawable && pDst->pDrawable->pScreen != pMask->pDrawable->pScreen)) + return BadMatch; ValidatePicture (pSrc); if (pMask) @@ -2336,6 +2362,11 @@ static int ProcRenderCreateSolidFill(ClientPtr client) pPicture = CreateSolidPicture(stuff->pid, &stuff->color, &error); if (!pPicture) return error; + /* AGENT SERVER */ + + nxagentRenderCreateSolidFill(pPicture, &stuff -> color); + + /* AGENT SERVER */ if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) return BadAlloc; return Success; @@ -2367,6 +2398,12 @@ static int ProcRenderCreateLinearGradient (ClientPtr client) stuff->nStops, stops, colors, &error); if (!pPicture) return error; + /* AGENT SERVER */ + + nxagentRenderCreateLinearGradient(pPicture, &stuff->p1, &stuff->p2, + stuff->nStops, stops, colors); + + /* AGENT SERVER */ if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) return BadAlloc; return Success; @@ -2397,6 +2434,14 @@ static int ProcRenderCreateRadialGradient (ClientPtr client) stuff->nStops, stops, colors, &error); if (!pPicture) return error; + /* AGENT SERVER */ + + nxagentRenderCreateRadialGradient(pPicture, &stuff->inner, &stuff->outer, + stuff->inner_radius, + stuff->outer_radius, + stuff->nStops, stops, colors); + + /* AGENT SERVER */ if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) return BadAlloc; return Success; @@ -2426,6 +2471,13 @@ static int ProcRenderCreateConicalGradient (ClientPtr client) stuff->nStops, stops, colors, &error); if (!pPicture) return error; + /* AGENT SERVER */ + + nxagentRenderCreateConicalGradient(pPicture, &stuff->center, + stuff->angle, stuff->nStops, stops, + colors); + + /* AGENT SERVER */ if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) return BadAlloc; return Success; diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXrender.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXrender.c.NX.original index ffc199704..562cd2c66 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXrender.c.NX.original +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXrender.c.NX.original @@ -116,7 +116,6 @@ int nxagentCursorSaveRenderInfo(ScreenPtr, CursorPtr); void nxagentCursorPostSaveRenderInfo(CursorPtr, ScreenPtr, PicturePtr, int, int); int nxagentRenderRealizeCursor(ScreenPtr, CursorPtr); int nxagentCreatePicture(PicturePtr, Mask); -void nxagentDestroyPicture(PicturePtr pPicture); void nxagentChangePicture(PicturePtr, Mask); int nxagentChangePictureClip(PicturePtr, int, int, xRectangle *, int, int); void nxagentComposite(CARD8, PicturePtr, PicturePtr, PicturePtr, INT16, INT16, @@ -132,6 +131,28 @@ void nxagentSetPictureFilter(PicturePtr pPicture, char *filter, int name_size, void nxagentTrapezoids(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat, INT16 xSrc, INT16 ySrc, int ntrap, xTrapezoid *traps); +void nxagentRenderCreateSolidFill(PicturePtr pPicture, xRenderColor *color); + +void nxagentRenderCreateLinearGradient(PicturePtr pPicture, xPointFixed *p1, + xPointFixed *p2, int nStops, + xFixed *stops, + xRenderColor *colors); + +void nxagentRenderCreateRadialGradient(PicturePtr pPicture, xPointFixed *inner, + xPointFixed *outer, + xFixed innerRadius, + xFixed outerRadius, + int nStops, + xFixed *stops, + xRenderColor *colors); + +void nxagentRenderCreateConicalGradient(PicturePtr pPicture, + xPointFixed *center, + xFixed angle, int nStops, + xFixed *stops, + xRenderColor *colors); + + /* * The void pointer is actually a XGlyphElt8. */ @@ -823,8 +844,6 @@ ProcRenderFreePicture (ClientPtr client) VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityDestroyAccess, RenderErrBase + BadPicture); - nxagentDestroyPicture(pPicture); - FreeResource (stuff->picture, RT_NONE); return(client->noClientException); } @@ -926,9 +945,16 @@ ProcRenderComposite (ClientPtr client) RenderErrBase + BadPicture); VERIFY_ALPHA (pMask, stuff->mask, client, SecurityReadAccess, RenderErrBase + BadPicture); +/* +FIXME: Imported change from newest version of Xorg. Changed pSrc to pDst. + if ((pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) || (pMask && pMask->pDrawable && pSrc->pDrawable->pScreen != pMask->pDrawable->pScreen)) return BadMatch; +*/ + if ((pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) || + (pMask && pMask->pDrawable && pDst->pDrawable->pScreen != pMask->pDrawable->pScreen)) + return BadMatch; ValidatePicture (pSrc); if (pMask) @@ -2336,6 +2362,11 @@ static int ProcRenderCreateSolidFill(ClientPtr client) pPicture = CreateSolidPicture(stuff->pid, &stuff->color, &error); if (!pPicture) return error; + /* AGENT SERVER */ + + nxagentRenderCreateSolidFill(pPicture, &stuff -> color); + + /* AGENT SERVER */ if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) return BadAlloc; return Success; @@ -2367,6 +2398,12 @@ static int ProcRenderCreateLinearGradient (ClientPtr client) stuff->nStops, stops, colors, &error); if (!pPicture) return error; + /* AGENT SERVER */ + + nxagentRenderCreateLinearGradient(pPicture, &stuff->p1, &stuff->p2, + stuff->nStops, stops, colors); + + /* AGENT SERVER */ if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) return BadAlloc; return Success; @@ -2397,6 +2434,14 @@ static int ProcRenderCreateRadialGradient (ClientPtr client) stuff->nStops, stops, colors, &error); if (!pPicture) return error; + /* AGENT SERVER */ + + nxagentRenderCreateRadialGradient(pPicture, &stuff->inner, &stuff->outer, + stuff->inner_radius, + stuff->outer_radius, + stuff->nStops, stops, colors); + + /* AGENT SERVER */ if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) return BadAlloc; return Success; @@ -2426,6 +2471,13 @@ static int ProcRenderCreateConicalGradient (ClientPtr client) stuff->nStops, stops, colors, &error); if (!pPicture) return error; + /* AGENT SERVER */ + + nxagentRenderCreateConicalGradient(pPicture, &stuff->center, + stuff->angle, stuff->nStops, stops, + colors); + + /* AGENT SERVER */ if (!AddResource (stuff->pid, PictureType, (pointer)pPicture)) return BadAlloc; return Success; -- cgit v1.2.3 From e01b9177b41f7d27a934d41fa38d550fa0026b45 Mon Sep 17 00:00:00 2001 From: Reinhard Tartler Date: Mon, 10 Oct 2011 17:59:01 +0200 Subject: Imported nxagent-3.5.0-5.tar.gz Summary: Imported nxagent-3.5.0-5.tar.gz Keywords: Imported nxagent-3.5.0-5.tar.gz into Git repository --- nx-X11/programs/Xserver/hw/nxagent/Args.c | 4 + nx-X11/programs/Xserver/hw/nxagent/Args.h | 2 + nx-X11/programs/Xserver/hw/nxagent/CHANGELOG | 19 + nx-X11/programs/Xserver/hw/nxagent/Cursor.c | 26 +- nx-X11/programs/Xserver/hw/nxagent/Display.c | 2 + nx-X11/programs/Xserver/hw/nxagent/Events.c | 8 +- nx-X11/programs/Xserver/hw/nxagent/Extensions.c | 142 ++- nx-X11/programs/Xserver/hw/nxagent/Imakefile | 8 +- nx-X11/programs/Xserver/hw/nxagent/Init.c | 20 + nx-X11/programs/Xserver/hw/nxagent/Init.h | 2 + nx-X11/programs/Xserver/hw/nxagent/NXrandr.c | 1229 ------------------ .../Xserver/hw/nxagent/NXrandr.c.NX.original | 1229 ------------------ .../Xserver/hw/nxagent/NXrandr.c.XF86.original | 1197 ----------------- nx-X11/programs/Xserver/hw/nxagent/Reconnect.c | 3 +- nx-X11/programs/Xserver/hw/nxagent/Screen.c | 230 ++-- nx-X11/programs/Xserver/hw/nxagent/Screen.h | 2 +- nx-X11/programs/Xserver/hw/nxagent/Window.c | 7 +- nx-X11/programs/Xserver/hw/nxagent/X/NXdixfonts.c | 3 +- nx-X11/programs/Xserver/hw/nxagent/X/NXrandr.c | 1344 -------------------- .../Xserver/hw/nxagent/X/NXrandr.c.NX.original | 1344 -------------------- .../Xserver/hw/nxagent/X/NXrandr.c.X.original | 1319 ------------------- 21 files changed, 342 insertions(+), 7798 deletions(-) delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/NXrandr.c delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/NXrandr.c.NX.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/NXrandr.c.XF86.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/X/NXrandr.c delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/X/NXrandr.c.NX.original delete mode 100644 nx-X11/programs/Xserver/hw/nxagent/X/NXrandr.c.X.original (limited to 'nx-X11/programs/Xserver/hw/nxagent/Imakefile') diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.c b/nx-X11/programs/Xserver/hw/nxagent/Args.c index 8fbb275a6..ecf0a21af 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Args.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Args.c @@ -135,6 +135,8 @@ char *nxagentKeyboard = NULL; Bool nxagentOnce = True; +int nxagentRemoteMajor = -1; + static void nxagentParseOptionString(char*); /* @@ -1578,6 +1580,8 @@ N/A nxagentAlphaCompat = 0; } + nxagentRemoteMajor = remoteMajor; + if (nxagentPackMethod == -1) { nxagentPackMethod = packMethod; diff --git a/nx-X11/programs/Xserver/hw/nxagent/Args.h b/nx-X11/programs/Xserver/hw/nxagent/Args.h index 9cb97ca03..8f4d05d6c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Args.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Args.h @@ -81,4 +81,6 @@ void nxagentSetCoalescence(void); extern int nxagentUserDefinedFontPath; +extern int nxagentRemoteMajor; + #endif /* __Args_H__ */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/CHANGELOG b/nx-X11/programs/Xserver/hw/nxagent/CHANGELOG index 5f4b561ca..0f20b79c3 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/CHANGELOG +++ b/nx-X11/programs/Xserver/hw/nxagent/CHANGELOG @@ -1,5 +1,24 @@ ChangeLog: +nxagent-3.5.0-5 + +- The NX agent failed to resize its own window to fit the desktop size + in shadow sessions. TR07I02561 is now fixed also in shadow mode. + +nxagent-3.5.0-4 + +- Fixed TR07I02530. Solved a buffer overflow occurring when the '-fp' + option value exceeds 1024 characters. + +- Extended list of the available screen geometries. + +nxagent-3.5.0-3 + +- Fixed TR08I02572. Upgraded RandR extension to version 1.2. + +- Fixed TR07I02561. The NX agent failed to resize its own window to + fit the desktop size. + nxagent-3.5.0-2 - Fixed TR0502449. Initialized font server path even if font server diff --git a/nx-X11/programs/Xserver/hw/nxagent/Cursor.c b/nx-X11/programs/Xserver/hw/nxagent/Cursor.c index 9ed7c233f..e27415b91 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Cursor.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Cursor.c @@ -293,31 +293,7 @@ void nxagentRecolorCursor(ScreenPtr pScreen, CursorPtr pCursor, Bool nxagentSetCursorPosition(ScreenPtr pScreen, int x, int y, Bool generateEvent) { - /* - * Don't warp the cursor if the requesting client - * is the server client itself or a shadow agent. - */ - - if (requestingClient != NULL && - requestingClient != serverClient && - nxagentClientHint(requestingClient) != NXAGENT_SHADOW) - { - int i; - - #ifdef TEST - fprintf(stderr, "nxagentSetCursorPosition: Moving the cursor at position [%d,%d].\n", - x, y); - #endif - - for (i = 0; i < nxagentNumScreens; i++) - { - XWarpPointer(nxagentDisplay, nxagentDefaultWindows[i], - nxagentDefaultWindows[pScreen->myNum], - 0, 0, 0, 0, x, y); - } - } - - return True; + return 1; } void nxagentReconnectCursor(pointer p0, XID x1, pointer p2) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Display.c b/nx-X11/programs/Xserver/hw/nxagent/Display.c index 87be98116..db70434e3 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Display.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Display.c @@ -2406,6 +2406,8 @@ Bool nxagentReconnectDisplay(void *p0) nxagentPackQuality = -1; nxagentSplitThreshold = -1; + nxagentRemoteMajor = -1; + nxagentInstallSignalHandlers(); nxagentInstallDisplayHandlers(); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c index b9da934d6..ce84c1b19 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Events.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c @@ -591,8 +591,8 @@ void nxagentSwitchResizeMode(ScreenPtr pScreen) nxagentLaunchDialog(DIALOG_ENABLE_DESKTOP_RESIZE_MODE); - nxagentRRSetScreenConfig(pScreen, nxagentOption(Width), - nxagentOption(Height)); + nxagentChangeScreenConfig(0, nxagentOption(Width), nxagentOption(Height), + 0, 0); if (nxagentOption(ClientOs) == ClientOsWinnt) { @@ -3461,8 +3461,8 @@ int nxagentHandleConfigureNotify(XEvent* X) nxagentOption(Width), nxagentOption(Height)); #endif - nxagentRRSetScreenConfig(screenInfo.screens[DefaultScreen(nxagentDisplay)], - nxagentOption(Width), nxagentOption(Height)); + nxagentChangeScreenConfig(0, nxagentOption(Width), + nxagentOption(Height), 0, 0); } } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Extensions.c b/nx-X11/programs/Xserver/hw/nxagent/Extensions.c index aced24ff4..6dce644ae 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Extensions.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Extensions.c @@ -22,11 +22,19 @@ #include "Agent.h" #include "Display.h" #include "Screen.h" +#include "Options.h" #include "Extensions.h" +#include "Windows.h" void GlxExtensionInit(void); void GlxWrapInitVisuals(void *procPtr); +static int nxagentRandRScreenSetSize(ScreenPtr pScreen, CARD16 width, + CARD16 height, CARD32 mmWidth, + CARD32 mmHeight); + +static int nxagentRandRInitSizes(ScreenPtr pScreen); + #ifdef __DARWIN__ void DarwinHandleGUI(int argc, char *argv[]) @@ -75,6 +83,8 @@ void nxagentInitRandRExtension(ScreenPtr pScreen) fprintf(stderr, "Warning: Failed to initialize the RandR extension.\n"); } + nxagentRandRInitSizes(pScreen); + /* * RRScreenInit sets these pointers to NULL, * so requiring the server to set up its own @@ -84,12 +94,31 @@ void nxagentInitRandRExtension(ScreenPtr pScreen) pRandRScrPriv = rrGetScrPriv(pScreen); pRandRScrPriv -> rrGetInfo = nxagentRandRGetInfo; + + #if RANDR_12_INTERFACE + pRandRScrPriv -> rrScreenSetSize = nxagentRandRScreenSetSize; + #endif + + #if RANDR_10_INTERFACE pRandRScrPriv -> rrSetConfig = nxagentRandRSetConfig; + #endif } int nxagentRandRGetInfo(ScreenPtr pScreen, Rotation *pRotations) +{ + /* + * Rotation is not supported. + */ + + *pRotations = RR_Rotate_0; + + return 1; +} + +static int nxagentRandRInitSizes(ScreenPtr pScreen) { RRScreenSizePtr pSize; + rrScrPrivPtr pRandRScrPriv = rrGetScrPriv(pScreen); int width; int height; @@ -97,8 +126,16 @@ int nxagentRandRGetInfo(ScreenPtr pScreen, Rotation *pRotations) int maxWidth; int maxHeight; - int w[] = {0, 160, 320, 640, 800, 1024, 0, 0}; - int h[] = {0, 120, 240, 480, 600, 768, 0, 0}; +/* + int w[] = {0, 160, 320, 640, 800, 1024, 1152, 1280, 1280, 1280, 1280, 1280, + 1280, 1360, 1440, 1600, 1600, 1680, 1920, 1920, 0, 0}; + int h[] = {0, 120, 240, 480, 600, 768, 864, 600, 720, 800, 854, 960, + 1024, 768, 900, 900, 1200, 1050, 1080, 1200, 0, 0}; +*/ + int w[] = {0, 320, 640, 640, 800, 800, 1024, 1024, 1152, 1280, 1280, 1280, 1360, + 1440, 1600, 1600, 1680, 1920, 1920, 0, 0}; + int h[] = {0, 240, 360, 480, 480, 600, 600, 768, 864, 720, 800, 1024, 768, + 900, 900, 1200, 1050, 1080, 1200, 0, 0}; int i; int nSizes; @@ -106,12 +143,6 @@ int nxagentRandRGetInfo(ScreenPtr pScreen, Rotation *pRotations) int mmWidth; int mmHeight; - /* - * Rotation is not supported. - */ - - *pRotations = RR_Rotate_0; - /* * Register all the supported sizes. The third * parameter is the refresh rate. @@ -185,13 +216,106 @@ int nxagentRandRGetInfo(ScreenPtr pScreen, Rotation *pRotations) return 1; } +#if RANDR_10_INTERFACE + int nxagentRandRSetConfig(ScreenPtr pScreen, Rotation rotation, int rate, RRScreenSizePtr pSize) { + int r; + rrScrPrivPtr pRandRScrPriv; + + UpdateCurrentTime(); + /* * Whatever size is OK for us. */ - return nxagentResizeScreen(pScreen, pSize -> width, pSize -> height, + r = nxagentResizeScreen(pScreen, pSize -> width, pSize -> height, pSize -> mmWidth, pSize -> mmHeight); + + nxagentMoveViewport(pScreen, 0, 0); + + return r; } + +#endif + +#if RANDR_12_INTERFACE + +void nxagentRandRSetWindowsSize(int width, int height) +{ + if (width == 0) + { + if (nxagentOption(Fullscreen) == 1) + { + width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); + } + else + { + width = nxagentOption(Width); + } + } + + if (height == 0) + { + if (nxagentOption(Fullscreen) == 1) + { + height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); + } + else + { + height = nxagentOption(Height); + } + } + + XResizeWindow(nxagentDisplay, nxagentDefaultWindows[0], width, height); + + if (nxagentOption(Rootless) == 0) + { + XMoveResizeWindow(nxagentDisplay, nxagentInputWindows[0], 0, 0, width, + height); + } +} + +int nxagentRandRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height, + CARD32 mmWidth, CARD32 mmHeight) +{ + int result; + rrScrPrivPtr pRandRScrPriv; + + UpdateCurrentTime(); + + if (nxagentOption(DesktopResize) == 1 && + (nxagentOption(Fullscreen) == 1 || + width > WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)) || + height > HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)))) + { + if (nxagentOption(ClientOs) != ClientOsWinnt + /*&& nxagentOption(ClientOs) != ClientNXPlayer*/) + { + nxagentChangeOption(DesktopResize, 0); + } + } + + if (nxagentOption(DesktopResize) == 1 && nxagentOption(Fullscreen) == 0 && + nxagentOption(AllScreens) == 0) + { + nxagentChangeOption(Width, width); + nxagentChangeOption(Height, height); + } + + result = nxagentResizeScreen(pScreen, width, height, mmWidth, mmHeight); + + if (result == 1 && nxagentOption(DesktopResize) == 1 && + nxagentOption(Fullscreen) == 0 && nxagentOption(AllScreens) == 0) + { + nxagentRandRSetWindowsSize(width, height); + nxagentSetWMNormalHints(pScreen -> myNum); + } + + nxagentMoveViewport(pScreen, 0, 0); + + return result; +} + +#endif diff --git a/nx-X11/programs/Xserver/hw/nxagent/Imakefile b/nx-X11/programs/Xserver/hw/nxagent/Imakefile index 51173e410..96579583b 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Imakefile +++ b/nx-X11/programs/Xserver/hw/nxagent/Imakefile @@ -7,8 +7,7 @@ SRCS1 = os2Stub.c OBJS1 = os2Stub.o #endif -SRCS = NXrandr.c \ - NXwindow.c \ +SRCS = NXwindow.c \ NXevents.c \ NXproperty.c \ NXdixfonts.c \ @@ -70,8 +69,7 @@ SRCS = NXrandr.c \ miinitext.c \ $(SRCS1) -OBJS = NXrandr.o \ - NXwindow.o \ +OBJS = NXwindow.o \ NXevents.o \ NXproperty.o \ NXdixfonts.o \ @@ -206,6 +204,8 @@ DEFINES = -g $(OS_DEFINES) $(EXT_DEFINES) $(UPG_DEFINES) \ -DNXAGENT_SPLASH \ -DNXAGENT_ARTSD \ -UNX_DEBUG_INPUT \ + -DRANDR_10_INTERFACE \ + -DRANDR_12_INTERFACE \ -UPANORAMIX \ -UDEBUG_TREE diff --git a/nx-X11/programs/Xserver/hw/nxagent/Init.c b/nx-X11/programs/Xserver/hw/nxagent/Init.c index 4f675a630..f4fc3c7e5 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Init.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Init.c @@ -128,6 +128,10 @@ void OsVendorEndRedirectErrorFFunction(); * new X server tree. */ + +static void nxagentGrabServerCallback(CallbackListPtr *callbacks, pointer data, + pointer args); + #ifdef NXAGENT_UPGRADE void ddxInitGlobals(void) @@ -209,6 +213,11 @@ void InitOutput(ScreenInfo *screenInfo, int argc, char *argv[]) NXUnsetLibraryPath(1); + if (serverGeneration == 1) + { + AddCallback(&ServerGrabCallback, nxagentGrabServerCallback, NULL); + } + if (nxagentUserDefinedFontPath == 0) { #ifdef TEST @@ -479,6 +488,17 @@ void OsVendorEndRedirectErrorFFunction() int SelectWaitTime = 10000; /* usec */ #endif +ServerGrabInfoRec nxagentGrabServerInfo; + +static void nxagentGrabServerCallback(CallbackListPtr *callbacks, pointer data, + pointer args) +{ + ServerGrabInfoRec *grab = (ServerGrabInfoRec*)args; + + nxagentGrabServerInfo.client = grab->client; + nxagentGrabServerInfo.grabstate = grab->grabstate; +} + #ifdef DPMSExtension void DPMSSet(int level) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Init.h b/nx-X11/programs/Xserver/hw/nxagent/Init.h index cf154e86d..2dc0f5c02 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Init.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Init.h @@ -37,4 +37,6 @@ extern int nxagentDoFullGeneration; extern int nxagentBackingStore; extern int nxagentSaveUnder; +extern ServerGrabInfoRec nxagentGrabServerInfo; + #endif /* __Init_H__ */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXrandr.c b/nx-X11/programs/Xserver/hw/nxagent/NXrandr.c deleted file mode 100644 index d593fa6aa..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/NXrandr.c +++ /dev/null @@ -1,1229 +0,0 @@ -#ifdef NXAGENT_UPGRADE - -#include "X/NXrandr.c" - -#else - -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NXAGENT, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -/* - * $XFree86: xc/programs/Xserver/randr/randr.c,v 1.19 2003/02/08 03:52:30 dawes Exp $ - * - * Copyright © 2000, Compaq Computer Corporation, - * Copyright © 2002, Hewlett Packard, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Compaq or HP not be used in advertising - * or publicity pertaining to distribution of the software without specific, - * written prior permission. HP makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * HP DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HP - * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Author: Jim Gettys, HP Labs, Hewlett-Packard, Inc. - */ - - -#define NEED_REPLIES -#define NEED_EVENTS -#include "X.h" -#include "Xproto.h" -#include "misc.h" -#include "os.h" -#include "dixstruct.h" -#include "resource.h" -#include "scrnintstr.h" -#include "windowstr.h" -#include "pixmapstr.h" -#include "extnsionst.h" -#include "servermd.h" -#include "randr.h" -#include "randrproto.h" -#include "../../randr/randrstr.h" -#include "render.h" /* we share subpixel order information */ -#include "picturestr.h" -#include "Xfuncproto.h" -#ifdef EXTMODULE -#include "xf86_ansic.h" -#endif - -#define RR_VALIDATE -int RRGeneration; -int RRNScreens; - -static int ProcRRQueryVersion (ClientPtr pClient); -static int ProcRRDispatch (ClientPtr pClient); -static int SProcRRDispatch (ClientPtr pClient); -static int SProcRRQueryVersion (ClientPtr pClient); - -#define wrap(priv,real,mem,func) {\ - priv->mem = real->mem; \ - real->mem = func; \ -} - -#define unwrap(priv,real,mem) {\ - real->mem = priv->mem; \ -} - -static CARD8 RRReqCode; -static int RRErrBase; -static int RREventBase; -static RESTYPE ClientType, EventType; /* resource types for event masks */ -static int RRClientPrivateIndex; - -typedef struct _RRTimes { - TimeStamp setTime; - TimeStamp configTime; -} RRTimesRec, *RRTimesPtr; - -typedef struct _RRClient { - int major_version; - int minor_version; -/* RRTimesRec times[0]; */ -} RRClientRec, *RRClientPtr; - -/* - * each window has a list of clients requesting - * RRNotify events. Each client has a resource - * for each window it selects RRNotify input for, - * this resource is used to delete the RRNotifyRec - * entry from the per-window queue. - */ - -typedef struct _RREvent *RREventPtr; - -typedef struct _RREvent { - RREventPtr next; - ClientPtr client; - WindowPtr window; - XID clientResource; - int mask; -} RREventRec; - -int rrPrivIndex = -1; - -#define GetRRClient(pClient) ((RRClientPtr) (pClient)->devPrivates[RRClientPrivateIndex].ptr) -#define rrClientPriv(pClient) RRClientPtr pRRClient = GetRRClient(pClient) - -static Bool -RRClientKnowsRates (ClientPtr pClient) -{ - rrClientPriv(pClient); - - return (pRRClient->major_version > 1 || - (pRRClient->major_version == 1 && pRRClient->minor_version >= 1)); -} - -static void -RRClientCallback (CallbackListPtr *list, - pointer closure, - pointer data) -{ - NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; - ClientPtr pClient = clientinfo->client; - rrClientPriv(pClient); - RRTimesPtr pTimes = (RRTimesPtr) (pRRClient + 1); - int i; - - pRRClient->major_version = 0; - pRRClient->minor_version = 0; - for (i = 0; i < screenInfo.numScreens; i++) - { - ScreenPtr pScreen = screenInfo.screens[i]; - rrScrPriv(pScreen); - - if (pScrPriv) - { - pTimes[i].setTime = pScrPriv->lastSetTime; - pTimes[i].configTime = pScrPriv->lastConfigTime; - } - } -} - -static void -RRResetProc (ExtensionEntry *extEntry) -{ -} - -static Bool -RRCloseScreen (int i, ScreenPtr pScreen) -{ - rrScrPriv(pScreen); - - unwrap (pScrPriv, pScreen, CloseScreen); - if (pScrPriv->pSizes) - xfree (pScrPriv->pSizes); - xfree (pScrPriv); - RRNScreens -= 1; /* ok, one fewer screen with RandR running */ - return (*pScreen->CloseScreen) (i, pScreen); -} - -static void -SRRScreenChangeNotifyEvent(xRRScreenChangeNotifyEvent *from, - xRRScreenChangeNotifyEvent *to) -{ - to->type = from->type; - to->rotation = from->rotation; - cpswaps(from->sequenceNumber, to->sequenceNumber); - cpswapl(from->timestamp, to->timestamp); - cpswapl(from->configTimestamp, to->configTimestamp); - cpswapl(from->root, to->root); - cpswapl(from->window, to->window); - cpswaps(from->sizeID, to->sizeID); - cpswaps(from->widthInPixels, to->widthInPixels); - cpswaps(from->heightInPixels, to->heightInPixels); - cpswaps(from->widthInMillimeters, to->widthInMillimeters); - cpswaps(from->heightInMillimeters, to->heightInMillimeters); - cpswaps(from->subpixelOrder, to->subpixelOrder); -} - -Bool RRScreenInit(ScreenPtr pScreen) -{ - rrScrPrivPtr pScrPriv; - - if (RRGeneration != serverGeneration) - { - if ((rrPrivIndex = AllocateScreenPrivateIndex()) < 0) - return FALSE; - RRGeneration = serverGeneration; - } - - pScrPriv = (rrScrPrivPtr) xalloc (sizeof (rrScrPrivRec)); - if (!pScrPriv) - return FALSE; - - SetRRScreen(pScreen, pScrPriv); - - /* - * Calling function best set these function vectors - */ - pScrPriv->rrSetConfig = 0; - pScrPriv->rrGetInfo = 0; - /* - * This value doesn't really matter -- any client must call - * GetScreenInfo before reading it which will automatically update - * the time - */ - pScrPriv->lastSetTime = currentTime; - pScrPriv->lastConfigTime = currentTime; - - wrap (pScrPriv, pScreen, CloseScreen, RRCloseScreen); - - pScrPriv->rotations = RR_Rotate_0; - - pScrPriv->nSizes = 0; - pScrPriv->nSizesInUse = 0; - pScrPriv->pSizes = 0; - - pScrPriv->rotation = RR_Rotate_0; - pScrPriv->size = -1; - - RRNScreens += 1; /* keep count of screens that implement randr */ - return TRUE; -} - -/*ARGSUSED*/ -static int -RRFreeClient (pointer data, XID id) -{ - RREventPtr pRREvent; - WindowPtr pWin; - RREventPtr *pHead, pCur, pPrev; - - pRREvent = (RREventPtr) data; - pWin = pRREvent->window; - pHead = (RREventPtr *) LookupIDByType(pWin->drawable.id, EventType); - if (pHead) { - pPrev = 0; - for (pCur = *pHead; pCur && pCur != pRREvent; pCur=pCur->next) - pPrev = pCur; - if (pCur) - { - if (pPrev) - pPrev->next = pRREvent->next; - else - *pHead = pRREvent->next; - } - } - xfree ((pointer) pRREvent); - return 1; -} - -/*ARGSUSED*/ -static int -RRFreeEvents (pointer data, XID id) -{ - RREventPtr *pHead, pCur, pNext; - - pHead = (RREventPtr *) data; - for (pCur = *pHead; pCur; pCur = pNext) { - pNext = pCur->next; - FreeResource (pCur->clientResource, ClientType); - xfree ((pointer) pCur); - } - xfree ((pointer) pHead); - return 1; -} - -void -RRExtensionInit (void) -{ - ExtensionEntry *extEntry; - - if (RRNScreens == 0) return; - - RRClientPrivateIndex = AllocateClientPrivateIndex (); - if (!AllocateClientPrivate (RRClientPrivateIndex, - sizeof (RRClientRec) + - screenInfo.numScreens * sizeof (RRTimesRec))) - return; - if (!AddCallback (&ClientStateCallback, RRClientCallback, 0)) - return; - - ClientType = CreateNewResourceType(RRFreeClient); - if (!ClientType) - return; - EventType = CreateNewResourceType(RRFreeEvents); - if (!EventType) - return; - extEntry = AddExtension (RANDR_NAME, RRNumberEvents, RRNumberErrors, - ProcRRDispatch, SProcRRDispatch, - RRResetProc, StandardMinorOpcode); - if (!extEntry) - return; - RRReqCode = (CARD8) extEntry->base; - RRErrBase = extEntry->errorBase; - RREventBase = extEntry->eventBase; - EventSwapVector[RREventBase + RRScreenChangeNotify] = (EventSwapPtr) - SRRScreenChangeNotifyEvent; - - return; -} - -int -TellChanged (WindowPtr pWin, pointer value) -{ - RREventPtr *pHead, pRREvent; - ClientPtr client; - xRRScreenChangeNotifyEvent se; - ScreenPtr pScreen = pWin->drawable.pScreen; - rrScrPriv(pScreen); - RRScreenSizePtr pSize; - WindowPtr pRoot = WindowTable[pScreen->myNum]; - - pHead = (RREventPtr *) LookupIDByType (pWin->drawable.id, EventType); - if (!pHead) - return WT_WALKCHILDREN; - - se.type = RRScreenChangeNotify + RREventBase; - se.rotation = (CARD8) pScrPriv->rotation; - se.timestamp = pScrPriv->lastSetTime.milliseconds; - se.configTimestamp = pScrPriv->lastConfigTime.milliseconds; - se.root = pRoot->drawable.id; - se.window = pWin->drawable.id; - se.subpixelOrder = PictureGetSubpixelOrder (pScreen); - if (pScrPriv->size >= 0) - { - pSize = &pScrPriv->pSizes[pScrPriv->size]; - se.sizeID = pSize->id; - se.widthInPixels = pSize->width; - se.heightInPixels = pSize->height; - se.widthInMillimeters = pSize->mmWidth; - se.heightInMillimeters = pSize->mmHeight; - } - else - { - /* - * This "shouldn't happen", but a broken DDX can - * forget to set the current configuration on GetInfo - */ - se.sizeID = 0xffff; - se.widthInPixels = 0; - se.heightInPixels = 0; - se.widthInMillimeters = 0; - se.heightInMillimeters = 0; - } - for (pRREvent = *pHead; pRREvent; pRREvent = pRREvent->next) - { - client = pRREvent->client; - if (client == serverClient || client->clientGone) - continue; - se.sequenceNumber = client->sequence; - if(pRREvent->mask & RRScreenChangeNotifyMask) - WriteEventsToClient (client, 1, (xEvent *) &se); - } - return WT_WALKCHILDREN; -} - -Bool -RRGetInfo (ScreenPtr pScreen) -{ - rrScrPriv (pScreen); - int i, j, k, l; - Bool changed; - Rotation rotations; - RRScreenSizePtr pSize; - RRScreenRatePtr pRate; - - for (i = 0; i < pScrPriv->nSizes; i++) - { - pSize = &pScrPriv->pSizes[i]; - pSize->oldReferenced = pSize->referenced; - pSize->referenced = FALSE; - for (k = 0; k < pSize->nRates; k++) - { - pRate = &pSize->pRates[k]; - pRate->oldReferenced = pRate->referenced; - pRate->referenced = FALSE; - } - } - if (!(*pScrPriv->rrGetInfo) (pScreen, &rotations)) - return FALSE; - - changed = FALSE; - - /* - * Check whether anything changed and simultaneously generate - * the protocol id values for the objects - */ - if (rotations != pScrPriv->rotations) - { - pScrPriv->rotations = rotations; - changed = TRUE; - } - - j = 0; - for (i = 0; i < pScrPriv->nSizes; i++) - { - pSize = &pScrPriv->pSizes[i]; - if (pSize->oldReferenced != pSize->referenced) - changed = TRUE; - if (pSize->referenced) - pSize->id = j++; - l = 0; - for (k = 0; k < pSize->nRates; k++) - { - pRate = &pSize->pRates[k]; - if (pRate->oldReferenced != pRate->referenced) - changed = TRUE; - if (pRate->referenced) - l++; - } - pSize->nRatesInUse = l; - } - pScrPriv->nSizesInUse = j; - if (changed) - { - UpdateCurrentTime (); - pScrPriv->lastConfigTime = currentTime; - WalkTree (pScreen, TellChanged, (pointer) pScreen); - } - return TRUE; -} - -void -RRSendConfigNotify (ScreenPtr pScreen) -{ - WindowPtr pWin = WindowTable[pScreen->myNum]; - xEvent event; - - event.u.u.type = ConfigureNotify; - event.u.configureNotify.window = pWin->drawable.id; - event.u.configureNotify.aboveSibling = None; - event.u.configureNotify.x = 0; - event.u.configureNotify.y = 0; - - /* XXX xinerama stuff ? */ - - event.u.configureNotify.width = pWin->drawable.width; - event.u.configureNotify.height = pWin->drawable.height; - event.u.configureNotify.borderWidth = wBorderWidth (pWin); - event.u.configureNotify.override = pWin->overrideRedirect; - DeliverEvents(pWin, &event, 1, NullWindow); -} - -static int -ProcRRQueryVersion (ClientPtr client) -{ - xRRQueryVersionReply rep; - register int n; - REQUEST(xRRQueryVersionReq); - rrClientPriv(client); - - REQUEST_SIZE_MATCH(xRRQueryVersionReq); - pRRClient->major_version = stuff->majorVersion; - pRRClient->minor_version = stuff->minorVersion; - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.majorVersion = RANDR_MAJOR; - rep.minorVersion = RANDR_MINOR; - if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.majorVersion, n); - swapl(&rep.minorVersion, n); - } - WriteToClient(client, sizeof(xRRQueryVersionReply), (char *)&rep); - return (client->noClientException); -} - - -extern char *ConnectionInfo; - -static int padlength[4] = {0, 3, 2, 1}; - -void -RREditConnectionInfo (ScreenPtr pScreen) -{ - xConnSetup *connSetup; - char *vendor; - xPixmapFormat *formats; - xWindowRoot *root; - xDepth *depth; - xVisualType *visual; - int screen = 0; - int d; - - connSetup = (xConnSetup *) ConnectionInfo; - vendor = (char *) connSetup + sizeof (xConnSetup); - formats = (xPixmapFormat *) ((char *) vendor + - connSetup->nbytesVendor + - padlength[connSetup->nbytesVendor & 3]); - root = (xWindowRoot *) ((char *) formats + - sizeof (xPixmapFormat) * screenInfo.numPixmapFormats); - while (screen != pScreen->myNum) - { - depth = (xDepth *) ((char *) root + - sizeof (xWindowRoot)); - for (d = 0; d < root->nDepths; d++) - { - visual = (xVisualType *) ((char *) depth + - sizeof (xDepth)); - depth = (xDepth *) ((char *) visual + - depth->nVisuals * sizeof (xVisualType)); - } - root = (xWindowRoot *) ((char *) depth); - screen++; - } - root->pixWidth = pScreen->width; - root->pixHeight = pScreen->height; - root->mmWidth = pScreen->mmWidth; - root->mmHeight = pScreen->mmHeight; -} - -static int -ProcRRGetScreenInfo (ClientPtr client) -{ - REQUEST(xRRGetScreenInfoReq); - xRRGetScreenInfoReply rep; - WindowPtr pWin; - int n; - ScreenPtr pScreen; - rrScrPrivPtr pScrPriv; - CARD8 *extra; - int extraLen; - - REQUEST_SIZE_MATCH(xRRGetScreenInfoReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityReadAccess); - - if (!pWin) - return BadWindow; - - pScreen = pWin->drawable.pScreen; - pScrPriv = rrGetScrPriv(pScreen); - rep.pad = 0; - if (!pScrPriv) - { - rep.type = X_Reply; - rep.setOfRotations = RR_Rotate_0;; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.root = WindowTable[pWin->drawable.pScreen->myNum]->drawable.id; - rep.timestamp = currentTime.milliseconds; - rep.configTimestamp = currentTime.milliseconds; - rep.nSizes = 0; - rep.sizeID = 0; - rep.rotation = RR_Rotate_0; - rep.rate = 0; - rep.nrateEnts = 0; - extra = 0; - extraLen = 0; - } - else - { - int i, j; - xScreenSizes *size; - CARD16 *rates; - CARD8 *data8; - Bool has_rate = RRClientKnowsRates (client); - - RRGetInfo (pScreen); - - rep.type = X_Reply; - rep.setOfRotations = pScrPriv->rotations; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.root = WindowTable[pWin->drawable.pScreen->myNum]->drawable.id; - rep.timestamp = pScrPriv->lastSetTime.milliseconds; - rep.configTimestamp = pScrPriv->lastConfigTime.milliseconds; - rep.rotation = pScrPriv->rotation; - rep.nSizes = pScrPriv->nSizesInUse; - rep.rate = pScrPriv->rate; - rep.nrateEnts = 0; - if (has_rate) - { - for (i = 0; i < pScrPriv->nSizes; i++) - { - RRScreenSizePtr pSize = &pScrPriv->pSizes[i]; - if (pSize->referenced) - { - rep.nrateEnts += (1 + pSize->nRatesInUse); - } - } - } - - if (pScrPriv->size >= 0) - rep.sizeID = pScrPriv->pSizes[pScrPriv->size].id; - else - return BadImplementation; - - extraLen = (rep.nSizes * sizeof (xScreenSizes) + - rep.nrateEnts * sizeof (CARD16)); - - extra = (CARD8 *) xalloc (extraLen); - if (!extra) - return BadAlloc; - /* - * First comes the size information - */ - size = (xScreenSizes *) extra; - rates = (CARD16 *) (size + rep.nSizes); - for (i = 0; i < pScrPriv->nSizes; i++) - { - RRScreenSizePtr pSize = &pScrPriv->pSizes[i]; - if (pSize->referenced) - { - size->widthInPixels = pSize->width; - size->heightInPixels = pSize->height; - size->widthInMillimeters = pSize->mmWidth; - size->heightInMillimeters = pSize->mmHeight; - if (client->swapped) - { - swaps (&size->widthInPixels, n); - swaps (&size->heightInPixels, n); - swaps (&size->widthInMillimeters, n); - swaps (&size->heightInMillimeters, n); - } - size++; - if (has_rate) - { - *rates = pSize->nRatesInUse; - if (client->swapped) - { - swaps (rates, n); - } - rates++; - for (j = 0; j < pSize->nRates; j++) - { - RRScreenRatePtr pRate = &pSize->pRates[j]; - if (pRate->referenced) - { - *rates = pRate->rate; - if (client->swapped) - { - swaps (rates, n); - } - rates++; - } - } - } - } - } - data8 = (CARD8 *) rates; - - if (data8 - (CARD8 *) extra != extraLen) - FatalError ("RRGetScreenInfo bad extra len %d != %d\n", - data8 - (CARD8 *) extra, extraLen); - rep.length = (extraLen + 3) >> 2; - } - if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.timestamp, n); - swaps(&rep.rotation, n); - swaps(&rep.nSizes, n); - swaps(&rep.sizeID, n); - swaps(&rep.rate, n); - swaps(&rep.nrateEnts, n); - } - WriteToClient(client, sizeof(xRRGetScreenInfoReply), (char *)&rep); - if (extraLen) - { - WriteToClient (client, extraLen, (char *) extra); - xfree (extra); - } - return (client->noClientException); -} - -static int -ProcRRSetScreenConfig (ClientPtr client) -{ - REQUEST(xRRSetScreenConfigReq); - xRRSetScreenConfigReply rep; - DrawablePtr pDraw; - int n; - ScreenPtr pScreen; - rrScrPrivPtr pScrPriv; - TimeStamp configTime; - TimeStamp time; - RRScreenSizePtr pSize; - int i; - Rotation rotation; - int rate; - short oldWidth, oldHeight; - Bool has_rate; - - UpdateCurrentTime (); - - if (RRClientKnowsRates (client)) - { - REQUEST_SIZE_MATCH (xRRSetScreenConfigReq); - has_rate = TRUE; - } - else - { - REQUEST_SIZE_MATCH (xRR1_0SetScreenConfigReq); - has_rate = FALSE; - } - - SECURITY_VERIFY_DRAWABLE(pDraw, stuff->drawable, client, - SecurityWriteAccess); - - pScreen = pDraw->pScreen; - - pScrPriv= rrGetScrPriv(pScreen); - - time = ClientTimeToServerTime(stuff->timestamp); - configTime = ClientTimeToServerTime(stuff->configTimestamp); - - oldWidth = pScreen->width; - oldHeight = pScreen->height; - - if (!pScrPriv) - { - time = currentTime; - rep.status = RRSetConfigFailed; - goto sendReply; - } - if (!RRGetInfo (pScreen)) - return BadAlloc; - - /* - * if the client's config timestamp is not the same as the last config - * timestamp, then the config information isn't up-to-date and - * can't even be validated - */ - if (CompareTimeStamps (configTime, pScrPriv->lastConfigTime) != 0) - { - rep.status = RRSetConfigInvalidConfigTime; - goto sendReply; - } - - /* - * Search for the requested size - */ - pSize = 0; - for (i = 0; i < pScrPriv->nSizes; i++) - { - pSize = &pScrPriv->pSizes[i]; - if (pSize->referenced && pSize->id == stuff->sizeID) - { - break; - } - } - if (i == pScrPriv->nSizes) - { - /* - * Invalid size ID - */ - client->errorValue = stuff->sizeID; - return BadValue; - } - - /* - * Validate requested rotation - */ - rotation = (Rotation) stuff->rotation; - - /* test the rotation bits only! */ - switch (rotation & 0xf) { - case RR_Rotate_0: - case RR_Rotate_90: - case RR_Rotate_180: - case RR_Rotate_270: - break; - default: - /* - * Invalid rotation - */ - client->errorValue = stuff->rotation; - return BadValue; - } - - if ((~pScrPriv->rotations) & rotation) - { - /* - * requested rotation or reflection not supported by screen - */ - client->errorValue = stuff->rotation; - return BadMatch; - } - - /* - * Validate requested refresh - */ - if (has_rate) - rate = (int) stuff->rate; - else - rate = 0; - - if (rate) - { - for (i = 0; i < pSize->nRates; i++) - { - RRScreenRatePtr pRate = &pSize->pRates[i]; - if (pRate->referenced && pRate->rate == rate) - break; - } - if (i == pSize->nRates) - { - /* - * Invalid rate - */ - client->errorValue = rate; - return BadValue; - } - } - - /* - * Make sure the requested set-time is not older than - * the last set-time - */ - if (CompareTimeStamps (time, pScrPriv->lastSetTime) < 0) - { - rep.status = RRSetConfigInvalidTime; - goto sendReply; - } - - /* - * call out to ddx routine to effect the change - */ - if (!(*pScrPriv->rrSetConfig) (pScreen, rotation, rate, - pSize)) - { - /* - * unknown DDX failure, report to client - */ - rep.status = RRSetConfigFailed; - goto sendReply; - } - - /* - * set current extension configuration pointers - */ - RRSetCurrentConfig (pScreen, rotation, rate, pSize); - - /* - * Deliver ScreenChangeNotify events whenever - * the configuration is updated - */ - WalkTree (pScreen, TellChanged, (pointer) pScreen); - - /* - * Deliver ConfigureNotify events when root changes - * pixel size - */ - if (oldWidth != pScreen->width || oldHeight != pScreen->height) - RRSendConfigNotify (pScreen); - RREditConnectionInfo (pScreen); - - /* - * Fix pointer bounds and location - */ - ScreenRestructured (pScreen); - pScrPriv->lastSetTime = time; - - /* - * Report Success - */ - rep.status = RRSetConfigSuccess; - -sendReply: - - rep.type = X_Reply; - /* rep.status has already been filled in */ - rep.length = 0; - rep.sequenceNumber = client->sequence; - - rep.newTimestamp = pScrPriv->lastSetTime.milliseconds; - rep.newConfigTimestamp = pScrPriv->lastConfigTime.milliseconds; - rep.root = WindowTable[pDraw->pScreen->myNum]->drawable.id; - - if (client->swapped) - { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.newTimestamp, n); - swapl(&rep.newConfigTimestamp, n); - swapl(&rep.root, n); - } - WriteToClient(client, sizeof(xRRSetScreenConfigReply), (char *)&rep); - - return (client->noClientException); -} - -static int -ProcRRSelectInput (ClientPtr client) -{ - REQUEST(xRRSelectInputReq); - rrClientPriv(client); - RRTimesPtr pTimes; - WindowPtr pWin; - RREventPtr pRREvent, pNewRREvent, *pHead; - XID clientResource; - - REQUEST_SIZE_MATCH(xRRSelectInputReq); - pWin = SecurityLookupWindow (stuff->window, client, SecurityWriteAccess); - if (!pWin) - return BadWindow; - pHead = (RREventPtr *)SecurityLookupIDByType(client, - pWin->drawable.id, EventType, - SecurityWriteAccess); - - if (stuff->enable & (RRScreenChangeNotifyMask)) - { - ScreenPtr pScreen = pWin->drawable.pScreen; - rrScrPriv (pScreen); - - if (pHead) - { - /* check for existing entry. */ - for (pRREvent = *pHead; pRREvent; pRREvent = pRREvent->next) - if (pRREvent->client == client) - return Success; - } - - /* build the entry */ - pNewRREvent = (RREventPtr) xalloc (sizeof (RREventRec)); - if (!pNewRREvent) - return BadAlloc; - pNewRREvent->next = 0; - pNewRREvent->client = client; - pNewRREvent->window = pWin; - pNewRREvent->mask = stuff->enable; - /* - * add a resource that will be deleted when - * the client goes away - */ - clientResource = FakeClientID (client->index); - pNewRREvent->clientResource = clientResource; - if (!AddResource (clientResource, ClientType, (pointer)pNewRREvent)) - 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 = (RREventPtr *) xalloc (sizeof (RREventPtr)); - if (!pHead || - !AddResource (pWin->drawable.id, EventType, (pointer)pHead)) - { - FreeResource (clientResource, RT_NONE); - return BadAlloc; - } - *pHead = 0; - } - pNewRREvent->next = *pHead; - *pHead = pNewRREvent; - /* - * Now see if the client needs an event - */ - if (pScrPriv) - { - pTimes = &((RRTimesPtr) (pRRClient + 1))[pScreen->myNum]; - if (CompareTimeStamps (pTimes->setTime, - pScrPriv->lastSetTime) != 0 || - CompareTimeStamps (pTimes->configTime, - pScrPriv->lastConfigTime) != 0) - { - TellChanged (pWin, (pointer) pScreen); - } - } - } - else if (stuff->enable == xFalse) - { - /* delete the interest */ - if (pHead) { - pNewRREvent = 0; - for (pRREvent = *pHead; pRREvent; pRREvent = pRREvent->next) { - if (pRREvent->client == client) - break; - pNewRREvent = pRREvent; - } - if (pRREvent) { - FreeResource (pRREvent->clientResource, ClientType); - if (pNewRREvent) - pNewRREvent->next = pRREvent->next; - else - *pHead = pRREvent->next; - xfree (pRREvent); - } - } - } - else - { - client->errorValue = stuff->enable; - return BadValue; - } - return Success; -} - - -static int -ProcRRDispatch (ClientPtr client) -{ - REQUEST(xReq); - switch (stuff->data) - { - case X_RRQueryVersion: - return ProcRRQueryVersion(client); - case X_RRSetScreenConfig: - return ProcRRSetScreenConfig(client); - case X_RRSelectInput: - return ProcRRSelectInput(client); - case X_RRGetScreenInfo: - return ProcRRGetScreenInfo(client); - default: - return BadRequest; - } -} - -static int -SProcRRQueryVersion (ClientPtr client) -{ - register int n; - REQUEST(xRRQueryVersionReq); - - swaps(&stuff->length, n); - swapl(&stuff->majorVersion, n); - swapl(&stuff->minorVersion, n); - return ProcRRQueryVersion(client); -} - -static int -SProcRRGetScreenInfo (ClientPtr client) -{ - register int n; - REQUEST(xRRGetScreenInfoReq); - - swaps(&stuff->length, n); - swapl(&stuff->window, n); - return ProcRRGetScreenInfo(client); -} - -static int -SProcRRSetScreenConfig (ClientPtr client) -{ - register int n; - REQUEST(xRRSetScreenConfigReq); - - if (RRClientKnowsRates (client)) - { - REQUEST_SIZE_MATCH (xRRSetScreenConfigReq); - swaps (&stuff->rate, n); - } - else - { - REQUEST_SIZE_MATCH (xRR1_0SetScreenConfigReq); - } - - swaps(&stuff->length, n); - swapl(&stuff->drawable, n); - swapl(&stuff->timestamp, n); - swaps(&stuff->sizeID, n); - swaps(&stuff->rotation, n); - return ProcRRSetScreenConfig(client); -} - -static int -SProcRRSelectInput (ClientPtr client) -{ - register int n; - REQUEST(xRRSelectInputReq); - - swaps(&stuff->length, n); - swapl(&stuff->window, n); - return ProcRRSelectInput(client); -} - - -static int -SProcRRDispatch (ClientPtr client) -{ - REQUEST(xReq); - switch (stuff->data) - { - case X_RRQueryVersion: - return SProcRRQueryVersion(client); - case X_RRSetScreenConfig: - return SProcRRSetScreenConfig(client); - case X_RRSelectInput: - return SProcRRSelectInput(client); - case X_RRGetScreenInfo: - return SProcRRGetScreenInfo(client); - default: - return BadRequest; - } -} - - -static Bool -RRScreenSizeMatches (RRScreenSizePtr a, - RRScreenSizePtr b) -{ - if (a->width != b->width) - return FALSE; - if (a->height != b->height) - return FALSE; - if (a->mmWidth != b->mmWidth) - return FALSE; - if (a->mmHeight != b->mmHeight) - return FALSE; - return TRUE; -} - -RRScreenSizePtr -RRRegisterSize (ScreenPtr pScreen, - short width, - short height, - short mmWidth, - short mmHeight) -{ - rrScrPriv (pScreen); - int i; - RRScreenSize tmp; - RRScreenSizePtr pNew; - - if (!pScrPriv) - return 0; - - /* - * FIXME: The compiler reports that field - * id is used uninitialized here. - */ - - tmp.id = 0; - - tmp.width = width; - tmp.height= height; - tmp.mmWidth = mmWidth; - tmp.mmHeight = mmHeight; - tmp.pRates = 0; - tmp.nRates = 0; - tmp.nRatesInUse = 0; - tmp.referenced = TRUE; - tmp.oldReferenced = FALSE; - for (i = 0; i < pScrPriv->nSizes; i++) - if (RRScreenSizeMatches (&tmp, &pScrPriv->pSizes[i])) - { - pScrPriv->pSizes[i].referenced = TRUE; - return &pScrPriv->pSizes[i]; - } - pNew = xrealloc (pScrPriv->pSizes, - (pScrPriv->nSizes + 1) * sizeof (RRScreenSize)); - if (!pNew) - return 0; - pNew[pScrPriv->nSizes++] = tmp; - pScrPriv->pSizes = pNew; - return &pNew[pScrPriv->nSizes-1]; -} - -Bool RRRegisterRate (ScreenPtr pScreen, - RRScreenSizePtr pSize, - int rate) -{ - rrScrPriv(pScreen); - int i; - RRScreenRatePtr pNew, pRate; - - if (!pScrPriv) - return FALSE; - - for (i = 0; i < pSize->nRates; i++) - { - pRate = &pSize->pRates[i]; - if (pRate->rate == rate) - { - pRate->referenced = TRUE; - return TRUE; - } - } - - pNew = xrealloc (pSize->pRates, - (pSize->nRates + 1) * sizeof (RRScreenRate)); - if (!pNew) - return FALSE; - pRate = &pNew[pSize->nRates++]; - pRate->rate = rate; - pRate->referenced = TRUE; - pRate->oldReferenced = FALSE; - pSize->pRates = pNew; - return TRUE; -} - -void -RRSetCurrentConfig (ScreenPtr pScreen, - Rotation rotation, - int rate, - RRScreenSizePtr pSize) -{ - rrScrPriv (pScreen); - - if (!pScrPriv) - return; - - pScrPriv->rotation = rotation; - pScrPriv->size = pSize - pScrPriv->pSizes; - pScrPriv->rate = rate; -} - -#endif /* #ifdef NXAGENT_UPGRADE */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXrandr.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/NXrandr.c.NX.original deleted file mode 100644 index d593fa6aa..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/NXrandr.c.NX.original +++ /dev/null @@ -1,1229 +0,0 @@ -#ifdef NXAGENT_UPGRADE - -#include "X/NXrandr.c" - -#else - -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NXAGENT, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -/* - * $XFree86: xc/programs/Xserver/randr/randr.c,v 1.19 2003/02/08 03:52:30 dawes Exp $ - * - * Copyright © 2000, Compaq Computer Corporation, - * Copyright © 2002, Hewlett Packard, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Compaq or HP not be used in advertising - * or publicity pertaining to distribution of the software without specific, - * written prior permission. HP makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * HP DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HP - * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Author: Jim Gettys, HP Labs, Hewlett-Packard, Inc. - */ - - -#define NEED_REPLIES -#define NEED_EVENTS -#include "X.h" -#include "Xproto.h" -#include "misc.h" -#include "os.h" -#include "dixstruct.h" -#include "resource.h" -#include "scrnintstr.h" -#include "windowstr.h" -#include "pixmapstr.h" -#include "extnsionst.h" -#include "servermd.h" -#include "randr.h" -#include "randrproto.h" -#include "../../randr/randrstr.h" -#include "render.h" /* we share subpixel order information */ -#include "picturestr.h" -#include "Xfuncproto.h" -#ifdef EXTMODULE -#include "xf86_ansic.h" -#endif - -#define RR_VALIDATE -int RRGeneration; -int RRNScreens; - -static int ProcRRQueryVersion (ClientPtr pClient); -static int ProcRRDispatch (ClientPtr pClient); -static int SProcRRDispatch (ClientPtr pClient); -static int SProcRRQueryVersion (ClientPtr pClient); - -#define wrap(priv,real,mem,func) {\ - priv->mem = real->mem; \ - real->mem = func; \ -} - -#define unwrap(priv,real,mem) {\ - real->mem = priv->mem; \ -} - -static CARD8 RRReqCode; -static int RRErrBase; -static int RREventBase; -static RESTYPE ClientType, EventType; /* resource types for event masks */ -static int RRClientPrivateIndex; - -typedef struct _RRTimes { - TimeStamp setTime; - TimeStamp configTime; -} RRTimesRec, *RRTimesPtr; - -typedef struct _RRClient { - int major_version; - int minor_version; -/* RRTimesRec times[0]; */ -} RRClientRec, *RRClientPtr; - -/* - * each window has a list of clients requesting - * RRNotify events. Each client has a resource - * for each window it selects RRNotify input for, - * this resource is used to delete the RRNotifyRec - * entry from the per-window queue. - */ - -typedef struct _RREvent *RREventPtr; - -typedef struct _RREvent { - RREventPtr next; - ClientPtr client; - WindowPtr window; - XID clientResource; - int mask; -} RREventRec; - -int rrPrivIndex = -1; - -#define GetRRClient(pClient) ((RRClientPtr) (pClient)->devPrivates[RRClientPrivateIndex].ptr) -#define rrClientPriv(pClient) RRClientPtr pRRClient = GetRRClient(pClient) - -static Bool -RRClientKnowsRates (ClientPtr pClient) -{ - rrClientPriv(pClient); - - return (pRRClient->major_version > 1 || - (pRRClient->major_version == 1 && pRRClient->minor_version >= 1)); -} - -static void -RRClientCallback (CallbackListPtr *list, - pointer closure, - pointer data) -{ - NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; - ClientPtr pClient = clientinfo->client; - rrClientPriv(pClient); - RRTimesPtr pTimes = (RRTimesPtr) (pRRClient + 1); - int i; - - pRRClient->major_version = 0; - pRRClient->minor_version = 0; - for (i = 0; i < screenInfo.numScreens; i++) - { - ScreenPtr pScreen = screenInfo.screens[i]; - rrScrPriv(pScreen); - - if (pScrPriv) - { - pTimes[i].setTime = pScrPriv->lastSetTime; - pTimes[i].configTime = pScrPriv->lastConfigTime; - } - } -} - -static void -RRResetProc (ExtensionEntry *extEntry) -{ -} - -static Bool -RRCloseScreen (int i, ScreenPtr pScreen) -{ - rrScrPriv(pScreen); - - unwrap (pScrPriv, pScreen, CloseScreen); - if (pScrPriv->pSizes) - xfree (pScrPriv->pSizes); - xfree (pScrPriv); - RRNScreens -= 1; /* ok, one fewer screen with RandR running */ - return (*pScreen->CloseScreen) (i, pScreen); -} - -static void -SRRScreenChangeNotifyEvent(xRRScreenChangeNotifyEvent *from, - xRRScreenChangeNotifyEvent *to) -{ - to->type = from->type; - to->rotation = from->rotation; - cpswaps(from->sequenceNumber, to->sequenceNumber); - cpswapl(from->timestamp, to->timestamp); - cpswapl(from->configTimestamp, to->configTimestamp); - cpswapl(from->root, to->root); - cpswapl(from->window, to->window); - cpswaps(from->sizeID, to->sizeID); - cpswaps(from->widthInPixels, to->widthInPixels); - cpswaps(from->heightInPixels, to->heightInPixels); - cpswaps(from->widthInMillimeters, to->widthInMillimeters); - cpswaps(from->heightInMillimeters, to->heightInMillimeters); - cpswaps(from->subpixelOrder, to->subpixelOrder); -} - -Bool RRScreenInit(ScreenPtr pScreen) -{ - rrScrPrivPtr pScrPriv; - - if (RRGeneration != serverGeneration) - { - if ((rrPrivIndex = AllocateScreenPrivateIndex()) < 0) - return FALSE; - RRGeneration = serverGeneration; - } - - pScrPriv = (rrScrPrivPtr) xalloc (sizeof (rrScrPrivRec)); - if (!pScrPriv) - return FALSE; - - SetRRScreen(pScreen, pScrPriv); - - /* - * Calling function best set these function vectors - */ - pScrPriv->rrSetConfig = 0; - pScrPriv->rrGetInfo = 0; - /* - * This value doesn't really matter -- any client must call - * GetScreenInfo before reading it which will automatically update - * the time - */ - pScrPriv->lastSetTime = currentTime; - pScrPriv->lastConfigTime = currentTime; - - wrap (pScrPriv, pScreen, CloseScreen, RRCloseScreen); - - pScrPriv->rotations = RR_Rotate_0; - - pScrPriv->nSizes = 0; - pScrPriv->nSizesInUse = 0; - pScrPriv->pSizes = 0; - - pScrPriv->rotation = RR_Rotate_0; - pScrPriv->size = -1; - - RRNScreens += 1; /* keep count of screens that implement randr */ - return TRUE; -} - -/*ARGSUSED*/ -static int -RRFreeClient (pointer data, XID id) -{ - RREventPtr pRREvent; - WindowPtr pWin; - RREventPtr *pHead, pCur, pPrev; - - pRREvent = (RREventPtr) data; - pWin = pRREvent->window; - pHead = (RREventPtr *) LookupIDByType(pWin->drawable.id, EventType); - if (pHead) { - pPrev = 0; - for (pCur = *pHead; pCur && pCur != pRREvent; pCur=pCur->next) - pPrev = pCur; - if (pCur) - { - if (pPrev) - pPrev->next = pRREvent->next; - else - *pHead = pRREvent->next; - } - } - xfree ((pointer) pRREvent); - return 1; -} - -/*ARGSUSED*/ -static int -RRFreeEvents (pointer data, XID id) -{ - RREventPtr *pHead, pCur, pNext; - - pHead = (RREventPtr *) data; - for (pCur = *pHead; pCur; pCur = pNext) { - pNext = pCur->next; - FreeResource (pCur->clientResource, ClientType); - xfree ((pointer) pCur); - } - xfree ((pointer) pHead); - return 1; -} - -void -RRExtensionInit (void) -{ - ExtensionEntry *extEntry; - - if (RRNScreens == 0) return; - - RRClientPrivateIndex = AllocateClientPrivateIndex (); - if (!AllocateClientPrivate (RRClientPrivateIndex, - sizeof (RRClientRec) + - screenInfo.numScreens * sizeof (RRTimesRec))) - return; - if (!AddCallback (&ClientStateCallback, RRClientCallback, 0)) - return; - - ClientType = CreateNewResourceType(RRFreeClient); - if (!ClientType) - return; - EventType = CreateNewResourceType(RRFreeEvents); - if (!EventType) - return; - extEntry = AddExtension (RANDR_NAME, RRNumberEvents, RRNumberErrors, - ProcRRDispatch, SProcRRDispatch, - RRResetProc, StandardMinorOpcode); - if (!extEntry) - return; - RRReqCode = (CARD8) extEntry->base; - RRErrBase = extEntry->errorBase; - RREventBase = extEntry->eventBase; - EventSwapVector[RREventBase + RRScreenChangeNotify] = (EventSwapPtr) - SRRScreenChangeNotifyEvent; - - return; -} - -int -TellChanged (WindowPtr pWin, pointer value) -{ - RREventPtr *pHead, pRREvent; - ClientPtr client; - xRRScreenChangeNotifyEvent se; - ScreenPtr pScreen = pWin->drawable.pScreen; - rrScrPriv(pScreen); - RRScreenSizePtr pSize; - WindowPtr pRoot = WindowTable[pScreen->myNum]; - - pHead = (RREventPtr *) LookupIDByType (pWin->drawable.id, EventType); - if (!pHead) - return WT_WALKCHILDREN; - - se.type = RRScreenChangeNotify + RREventBase; - se.rotation = (CARD8) pScrPriv->rotation; - se.timestamp = pScrPriv->lastSetTime.milliseconds; - se.configTimestamp = pScrPriv->lastConfigTime.milliseconds; - se.root = pRoot->drawable.id; - se.window = pWin->drawable.id; - se.subpixelOrder = PictureGetSubpixelOrder (pScreen); - if (pScrPriv->size >= 0) - { - pSize = &pScrPriv->pSizes[pScrPriv->size]; - se.sizeID = pSize->id; - se.widthInPixels = pSize->width; - se.heightInPixels = pSize->height; - se.widthInMillimeters = pSize->mmWidth; - se.heightInMillimeters = pSize->mmHeight; - } - else - { - /* - * This "shouldn't happen", but a broken DDX can - * forget to set the current configuration on GetInfo - */ - se.sizeID = 0xffff; - se.widthInPixels = 0; - se.heightInPixels = 0; - se.widthInMillimeters = 0; - se.heightInMillimeters = 0; - } - for (pRREvent = *pHead; pRREvent; pRREvent = pRREvent->next) - { - client = pRREvent->client; - if (client == serverClient || client->clientGone) - continue; - se.sequenceNumber = client->sequence; - if(pRREvent->mask & RRScreenChangeNotifyMask) - WriteEventsToClient (client, 1, (xEvent *) &se); - } - return WT_WALKCHILDREN; -} - -Bool -RRGetInfo (ScreenPtr pScreen) -{ - rrScrPriv (pScreen); - int i, j, k, l; - Bool changed; - Rotation rotations; - RRScreenSizePtr pSize; - RRScreenRatePtr pRate; - - for (i = 0; i < pScrPriv->nSizes; i++) - { - pSize = &pScrPriv->pSizes[i]; - pSize->oldReferenced = pSize->referenced; - pSize->referenced = FALSE; - for (k = 0; k < pSize->nRates; k++) - { - pRate = &pSize->pRates[k]; - pRate->oldReferenced = pRate->referenced; - pRate->referenced = FALSE; - } - } - if (!(*pScrPriv->rrGetInfo) (pScreen, &rotations)) - return FALSE; - - changed = FALSE; - - /* - * Check whether anything changed and simultaneously generate - * the protocol id values for the objects - */ - if (rotations != pScrPriv->rotations) - { - pScrPriv->rotations = rotations; - changed = TRUE; - } - - j = 0; - for (i = 0; i < pScrPriv->nSizes; i++) - { - pSize = &pScrPriv->pSizes[i]; - if (pSize->oldReferenced != pSize->referenced) - changed = TRUE; - if (pSize->referenced) - pSize->id = j++; - l = 0; - for (k = 0; k < pSize->nRates; k++) - { - pRate = &pSize->pRates[k]; - if (pRate->oldReferenced != pRate->referenced) - changed = TRUE; - if (pRate->referenced) - l++; - } - pSize->nRatesInUse = l; - } - pScrPriv->nSizesInUse = j; - if (changed) - { - UpdateCurrentTime (); - pScrPriv->lastConfigTime = currentTime; - WalkTree (pScreen, TellChanged, (pointer) pScreen); - } - return TRUE; -} - -void -RRSendConfigNotify (ScreenPtr pScreen) -{ - WindowPtr pWin = WindowTable[pScreen->myNum]; - xEvent event; - - event.u.u.type = ConfigureNotify; - event.u.configureNotify.window = pWin->drawable.id; - event.u.configureNotify.aboveSibling = None; - event.u.configureNotify.x = 0; - event.u.configureNotify.y = 0; - - /* XXX xinerama stuff ? */ - - event.u.configureNotify.width = pWin->drawable.width; - event.u.configureNotify.height = pWin->drawable.height; - event.u.configureNotify.borderWidth = wBorderWidth (pWin); - event.u.configureNotify.override = pWin->overrideRedirect; - DeliverEvents(pWin, &event, 1, NullWindow); -} - -static int -ProcRRQueryVersion (ClientPtr client) -{ - xRRQueryVersionReply rep; - register int n; - REQUEST(xRRQueryVersionReq); - rrClientPriv(client); - - REQUEST_SIZE_MATCH(xRRQueryVersionReq); - pRRClient->major_version = stuff->majorVersion; - pRRClient->minor_version = stuff->minorVersion; - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.majorVersion = RANDR_MAJOR; - rep.minorVersion = RANDR_MINOR; - if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.majorVersion, n); - swapl(&rep.minorVersion, n); - } - WriteToClient(client, sizeof(xRRQueryVersionReply), (char *)&rep); - return (client->noClientException); -} - - -extern char *ConnectionInfo; - -static int padlength[4] = {0, 3, 2, 1}; - -void -RREditConnectionInfo (ScreenPtr pScreen) -{ - xConnSetup *connSetup; - char *vendor; - xPixmapFormat *formats; - xWindowRoot *root; - xDepth *depth; - xVisualType *visual; - int screen = 0; - int d; - - connSetup = (xConnSetup *) ConnectionInfo; - vendor = (char *) connSetup + sizeof (xConnSetup); - formats = (xPixmapFormat *) ((char *) vendor + - connSetup->nbytesVendor + - padlength[connSetup->nbytesVendor & 3]); - root = (xWindowRoot *) ((char *) formats + - sizeof (xPixmapFormat) * screenInfo.numPixmapFormats); - while (screen != pScreen->myNum) - { - depth = (xDepth *) ((char *) root + - sizeof (xWindowRoot)); - for (d = 0; d < root->nDepths; d++) - { - visual = (xVisualType *) ((char *) depth + - sizeof (xDepth)); - depth = (xDepth *) ((char *) visual + - depth->nVisuals * sizeof (xVisualType)); - } - root = (xWindowRoot *) ((char *) depth); - screen++; - } - root->pixWidth = pScreen->width; - root->pixHeight = pScreen->height; - root->mmWidth = pScreen->mmWidth; - root->mmHeight = pScreen->mmHeight; -} - -static int -ProcRRGetScreenInfo (ClientPtr client) -{ - REQUEST(xRRGetScreenInfoReq); - xRRGetScreenInfoReply rep; - WindowPtr pWin; - int n; - ScreenPtr pScreen; - rrScrPrivPtr pScrPriv; - CARD8 *extra; - int extraLen; - - REQUEST_SIZE_MATCH(xRRGetScreenInfoReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityReadAccess); - - if (!pWin) - return BadWindow; - - pScreen = pWin->drawable.pScreen; - pScrPriv = rrGetScrPriv(pScreen); - rep.pad = 0; - if (!pScrPriv) - { - rep.type = X_Reply; - rep.setOfRotations = RR_Rotate_0;; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.root = WindowTable[pWin->drawable.pScreen->myNum]->drawable.id; - rep.timestamp = currentTime.milliseconds; - rep.configTimestamp = currentTime.milliseconds; - rep.nSizes = 0; - rep.sizeID = 0; - rep.rotation = RR_Rotate_0; - rep.rate = 0; - rep.nrateEnts = 0; - extra = 0; - extraLen = 0; - } - else - { - int i, j; - xScreenSizes *size; - CARD16 *rates; - CARD8 *data8; - Bool has_rate = RRClientKnowsRates (client); - - RRGetInfo (pScreen); - - rep.type = X_Reply; - rep.setOfRotations = pScrPriv->rotations; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.root = WindowTable[pWin->drawable.pScreen->myNum]->drawable.id; - rep.timestamp = pScrPriv->lastSetTime.milliseconds; - rep.configTimestamp = pScrPriv->lastConfigTime.milliseconds; - rep.rotation = pScrPriv->rotation; - rep.nSizes = pScrPriv->nSizesInUse; - rep.rate = pScrPriv->rate; - rep.nrateEnts = 0; - if (has_rate) - { - for (i = 0; i < pScrPriv->nSizes; i++) - { - RRScreenSizePtr pSize = &pScrPriv->pSizes[i]; - if (pSize->referenced) - { - rep.nrateEnts += (1 + pSize->nRatesInUse); - } - } - } - - if (pScrPriv->size >= 0) - rep.sizeID = pScrPriv->pSizes[pScrPriv->size].id; - else - return BadImplementation; - - extraLen = (rep.nSizes * sizeof (xScreenSizes) + - rep.nrateEnts * sizeof (CARD16)); - - extra = (CARD8 *) xalloc (extraLen); - if (!extra) - return BadAlloc; - /* - * First comes the size information - */ - size = (xScreenSizes *) extra; - rates = (CARD16 *) (size + rep.nSizes); - for (i = 0; i < pScrPriv->nSizes; i++) - { - RRScreenSizePtr pSize = &pScrPriv->pSizes[i]; - if (pSize->referenced) - { - size->widthInPixels = pSize->width; - size->heightInPixels = pSize->height; - size->widthInMillimeters = pSize->mmWidth; - size->heightInMillimeters = pSize->mmHeight; - if (client->swapped) - { - swaps (&size->widthInPixels, n); - swaps (&size->heightInPixels, n); - swaps (&size->widthInMillimeters, n); - swaps (&size->heightInMillimeters, n); - } - size++; - if (has_rate) - { - *rates = pSize->nRatesInUse; - if (client->swapped) - { - swaps (rates, n); - } - rates++; - for (j = 0; j < pSize->nRates; j++) - { - RRScreenRatePtr pRate = &pSize->pRates[j]; - if (pRate->referenced) - { - *rates = pRate->rate; - if (client->swapped) - { - swaps (rates, n); - } - rates++; - } - } - } - } - } - data8 = (CARD8 *) rates; - - if (data8 - (CARD8 *) extra != extraLen) - FatalError ("RRGetScreenInfo bad extra len %d != %d\n", - data8 - (CARD8 *) extra, extraLen); - rep.length = (extraLen + 3) >> 2; - } - if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.timestamp, n); - swaps(&rep.rotation, n); - swaps(&rep.nSizes, n); - swaps(&rep.sizeID, n); - swaps(&rep.rate, n); - swaps(&rep.nrateEnts, n); - } - WriteToClient(client, sizeof(xRRGetScreenInfoReply), (char *)&rep); - if (extraLen) - { - WriteToClient (client, extraLen, (char *) extra); - xfree (extra); - } - return (client->noClientException); -} - -static int -ProcRRSetScreenConfig (ClientPtr client) -{ - REQUEST(xRRSetScreenConfigReq); - xRRSetScreenConfigReply rep; - DrawablePtr pDraw; - int n; - ScreenPtr pScreen; - rrScrPrivPtr pScrPriv; - TimeStamp configTime; - TimeStamp time; - RRScreenSizePtr pSize; - int i; - Rotation rotation; - int rate; - short oldWidth, oldHeight; - Bool has_rate; - - UpdateCurrentTime (); - - if (RRClientKnowsRates (client)) - { - REQUEST_SIZE_MATCH (xRRSetScreenConfigReq); - has_rate = TRUE; - } - else - { - REQUEST_SIZE_MATCH (xRR1_0SetScreenConfigReq); - has_rate = FALSE; - } - - SECURITY_VERIFY_DRAWABLE(pDraw, stuff->drawable, client, - SecurityWriteAccess); - - pScreen = pDraw->pScreen; - - pScrPriv= rrGetScrPriv(pScreen); - - time = ClientTimeToServerTime(stuff->timestamp); - configTime = ClientTimeToServerTime(stuff->configTimestamp); - - oldWidth = pScreen->width; - oldHeight = pScreen->height; - - if (!pScrPriv) - { - time = currentTime; - rep.status = RRSetConfigFailed; - goto sendReply; - } - if (!RRGetInfo (pScreen)) - return BadAlloc; - - /* - * if the client's config timestamp is not the same as the last config - * timestamp, then the config information isn't up-to-date and - * can't even be validated - */ - if (CompareTimeStamps (configTime, pScrPriv->lastConfigTime) != 0) - { - rep.status = RRSetConfigInvalidConfigTime; - goto sendReply; - } - - /* - * Search for the requested size - */ - pSize = 0; - for (i = 0; i < pScrPriv->nSizes; i++) - { - pSize = &pScrPriv->pSizes[i]; - if (pSize->referenced && pSize->id == stuff->sizeID) - { - break; - } - } - if (i == pScrPriv->nSizes) - { - /* - * Invalid size ID - */ - client->errorValue = stuff->sizeID; - return BadValue; - } - - /* - * Validate requested rotation - */ - rotation = (Rotation) stuff->rotation; - - /* test the rotation bits only! */ - switch (rotation & 0xf) { - case RR_Rotate_0: - case RR_Rotate_90: - case RR_Rotate_180: - case RR_Rotate_270: - break; - default: - /* - * Invalid rotation - */ - client->errorValue = stuff->rotation; - return BadValue; - } - - if ((~pScrPriv->rotations) & rotation) - { - /* - * requested rotation or reflection not supported by screen - */ - client->errorValue = stuff->rotation; - return BadMatch; - } - - /* - * Validate requested refresh - */ - if (has_rate) - rate = (int) stuff->rate; - else - rate = 0; - - if (rate) - { - for (i = 0; i < pSize->nRates; i++) - { - RRScreenRatePtr pRate = &pSize->pRates[i]; - if (pRate->referenced && pRate->rate == rate) - break; - } - if (i == pSize->nRates) - { - /* - * Invalid rate - */ - client->errorValue = rate; - return BadValue; - } - } - - /* - * Make sure the requested set-time is not older than - * the last set-time - */ - if (CompareTimeStamps (time, pScrPriv->lastSetTime) < 0) - { - rep.status = RRSetConfigInvalidTime; - goto sendReply; - } - - /* - * call out to ddx routine to effect the change - */ - if (!(*pScrPriv->rrSetConfig) (pScreen, rotation, rate, - pSize)) - { - /* - * unknown DDX failure, report to client - */ - rep.status = RRSetConfigFailed; - goto sendReply; - } - - /* - * set current extension configuration pointers - */ - RRSetCurrentConfig (pScreen, rotation, rate, pSize); - - /* - * Deliver ScreenChangeNotify events whenever - * the configuration is updated - */ - WalkTree (pScreen, TellChanged, (pointer) pScreen); - - /* - * Deliver ConfigureNotify events when root changes - * pixel size - */ - if (oldWidth != pScreen->width || oldHeight != pScreen->height) - RRSendConfigNotify (pScreen); - RREditConnectionInfo (pScreen); - - /* - * Fix pointer bounds and location - */ - ScreenRestructured (pScreen); - pScrPriv->lastSetTime = time; - - /* - * Report Success - */ - rep.status = RRSetConfigSuccess; - -sendReply: - - rep.type = X_Reply; - /* rep.status has already been filled in */ - rep.length = 0; - rep.sequenceNumber = client->sequence; - - rep.newTimestamp = pScrPriv->lastSetTime.milliseconds; - rep.newConfigTimestamp = pScrPriv->lastConfigTime.milliseconds; - rep.root = WindowTable[pDraw->pScreen->myNum]->drawable.id; - - if (client->swapped) - { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.newTimestamp, n); - swapl(&rep.newConfigTimestamp, n); - swapl(&rep.root, n); - } - WriteToClient(client, sizeof(xRRSetScreenConfigReply), (char *)&rep); - - return (client->noClientException); -} - -static int -ProcRRSelectInput (ClientPtr client) -{ - REQUEST(xRRSelectInputReq); - rrClientPriv(client); - RRTimesPtr pTimes; - WindowPtr pWin; - RREventPtr pRREvent, pNewRREvent, *pHead; - XID clientResource; - - REQUEST_SIZE_MATCH(xRRSelectInputReq); - pWin = SecurityLookupWindow (stuff->window, client, SecurityWriteAccess); - if (!pWin) - return BadWindow; - pHead = (RREventPtr *)SecurityLookupIDByType(client, - pWin->drawable.id, EventType, - SecurityWriteAccess); - - if (stuff->enable & (RRScreenChangeNotifyMask)) - { - ScreenPtr pScreen = pWin->drawable.pScreen; - rrScrPriv (pScreen); - - if (pHead) - { - /* check for existing entry. */ - for (pRREvent = *pHead; pRREvent; pRREvent = pRREvent->next) - if (pRREvent->client == client) - return Success; - } - - /* build the entry */ - pNewRREvent = (RREventPtr) xalloc (sizeof (RREventRec)); - if (!pNewRREvent) - return BadAlloc; - pNewRREvent->next = 0; - pNewRREvent->client = client; - pNewRREvent->window = pWin; - pNewRREvent->mask = stuff->enable; - /* - * add a resource that will be deleted when - * the client goes away - */ - clientResource = FakeClientID (client->index); - pNewRREvent->clientResource = clientResource; - if (!AddResource (clientResource, ClientType, (pointer)pNewRREvent)) - 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 = (RREventPtr *) xalloc (sizeof (RREventPtr)); - if (!pHead || - !AddResource (pWin->drawable.id, EventType, (pointer)pHead)) - { - FreeResource (clientResource, RT_NONE); - return BadAlloc; - } - *pHead = 0; - } - pNewRREvent->next = *pHead; - *pHead = pNewRREvent; - /* - * Now see if the client needs an event - */ - if (pScrPriv) - { - pTimes = &((RRTimesPtr) (pRRClient + 1))[pScreen->myNum]; - if (CompareTimeStamps (pTimes->setTime, - pScrPriv->lastSetTime) != 0 || - CompareTimeStamps (pTimes->configTime, - pScrPriv->lastConfigTime) != 0) - { - TellChanged (pWin, (pointer) pScreen); - } - } - } - else if (stuff->enable == xFalse) - { - /* delete the interest */ - if (pHead) { - pNewRREvent = 0; - for (pRREvent = *pHead; pRREvent; pRREvent = pRREvent->next) { - if (pRREvent->client == client) - break; - pNewRREvent = pRREvent; - } - if (pRREvent) { - FreeResource (pRREvent->clientResource, ClientType); - if (pNewRREvent) - pNewRREvent->next = pRREvent->next; - else - *pHead = pRREvent->next; - xfree (pRREvent); - } - } - } - else - { - client->errorValue = stuff->enable; - return BadValue; - } - return Success; -} - - -static int -ProcRRDispatch (ClientPtr client) -{ - REQUEST(xReq); - switch (stuff->data) - { - case X_RRQueryVersion: - return ProcRRQueryVersion(client); - case X_RRSetScreenConfig: - return ProcRRSetScreenConfig(client); - case X_RRSelectInput: - return ProcRRSelectInput(client); - case X_RRGetScreenInfo: - return ProcRRGetScreenInfo(client); - default: - return BadRequest; - } -} - -static int -SProcRRQueryVersion (ClientPtr client) -{ - register int n; - REQUEST(xRRQueryVersionReq); - - swaps(&stuff->length, n); - swapl(&stuff->majorVersion, n); - swapl(&stuff->minorVersion, n); - return ProcRRQueryVersion(client); -} - -static int -SProcRRGetScreenInfo (ClientPtr client) -{ - register int n; - REQUEST(xRRGetScreenInfoReq); - - swaps(&stuff->length, n); - swapl(&stuff->window, n); - return ProcRRGetScreenInfo(client); -} - -static int -SProcRRSetScreenConfig (ClientPtr client) -{ - register int n; - REQUEST(xRRSetScreenConfigReq); - - if (RRClientKnowsRates (client)) - { - REQUEST_SIZE_MATCH (xRRSetScreenConfigReq); - swaps (&stuff->rate, n); - } - else - { - REQUEST_SIZE_MATCH (xRR1_0SetScreenConfigReq); - } - - swaps(&stuff->length, n); - swapl(&stuff->drawable, n); - swapl(&stuff->timestamp, n); - swaps(&stuff->sizeID, n); - swaps(&stuff->rotation, n); - return ProcRRSetScreenConfig(client); -} - -static int -SProcRRSelectInput (ClientPtr client) -{ - register int n; - REQUEST(xRRSelectInputReq); - - swaps(&stuff->length, n); - swapl(&stuff->window, n); - return ProcRRSelectInput(client); -} - - -static int -SProcRRDispatch (ClientPtr client) -{ - REQUEST(xReq); - switch (stuff->data) - { - case X_RRQueryVersion: - return SProcRRQueryVersion(client); - case X_RRSetScreenConfig: - return SProcRRSetScreenConfig(client); - case X_RRSelectInput: - return SProcRRSelectInput(client); - case X_RRGetScreenInfo: - return SProcRRGetScreenInfo(client); - default: - return BadRequest; - } -} - - -static Bool -RRScreenSizeMatches (RRScreenSizePtr a, - RRScreenSizePtr b) -{ - if (a->width != b->width) - return FALSE; - if (a->height != b->height) - return FALSE; - if (a->mmWidth != b->mmWidth) - return FALSE; - if (a->mmHeight != b->mmHeight) - return FALSE; - return TRUE; -} - -RRScreenSizePtr -RRRegisterSize (ScreenPtr pScreen, - short width, - short height, - short mmWidth, - short mmHeight) -{ - rrScrPriv (pScreen); - int i; - RRScreenSize tmp; - RRScreenSizePtr pNew; - - if (!pScrPriv) - return 0; - - /* - * FIXME: The compiler reports that field - * id is used uninitialized here. - */ - - tmp.id = 0; - - tmp.width = width; - tmp.height= height; - tmp.mmWidth = mmWidth; - tmp.mmHeight = mmHeight; - tmp.pRates = 0; - tmp.nRates = 0; - tmp.nRatesInUse = 0; - tmp.referenced = TRUE; - tmp.oldReferenced = FALSE; - for (i = 0; i < pScrPriv->nSizes; i++) - if (RRScreenSizeMatches (&tmp, &pScrPriv->pSizes[i])) - { - pScrPriv->pSizes[i].referenced = TRUE; - return &pScrPriv->pSizes[i]; - } - pNew = xrealloc (pScrPriv->pSizes, - (pScrPriv->nSizes + 1) * sizeof (RRScreenSize)); - if (!pNew) - return 0; - pNew[pScrPriv->nSizes++] = tmp; - pScrPriv->pSizes = pNew; - return &pNew[pScrPriv->nSizes-1]; -} - -Bool RRRegisterRate (ScreenPtr pScreen, - RRScreenSizePtr pSize, - int rate) -{ - rrScrPriv(pScreen); - int i; - RRScreenRatePtr pNew, pRate; - - if (!pScrPriv) - return FALSE; - - for (i = 0; i < pSize->nRates; i++) - { - pRate = &pSize->pRates[i]; - if (pRate->rate == rate) - { - pRate->referenced = TRUE; - return TRUE; - } - } - - pNew = xrealloc (pSize->pRates, - (pSize->nRates + 1) * sizeof (RRScreenRate)); - if (!pNew) - return FALSE; - pRate = &pNew[pSize->nRates++]; - pRate->rate = rate; - pRate->referenced = TRUE; - pRate->oldReferenced = FALSE; - pSize->pRates = pNew; - return TRUE; -} - -void -RRSetCurrentConfig (ScreenPtr pScreen, - Rotation rotation, - int rate, - RRScreenSizePtr pSize) -{ - rrScrPriv (pScreen); - - if (!pScrPriv) - return; - - pScrPriv->rotation = rotation; - pScrPriv->size = pSize - pScrPriv->pSizes; - pScrPriv->rate = rate; -} - -#endif /* #ifdef NXAGENT_UPGRADE */ diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXrandr.c.XF86.original b/nx-X11/programs/Xserver/hw/nxagent/NXrandr.c.XF86.original deleted file mode 100644 index 666605e96..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/NXrandr.c.XF86.original +++ /dev/null @@ -1,1197 +0,0 @@ -/* - * $XFree86: xc/programs/Xserver/randr/randr.c,v 1.19 2003/02/08 03:52:30 dawes Exp $ - * - * Copyright © 2000, Compaq Computer Corporation, - * Copyright © 2002, Hewlett Packard, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Compaq or HP not be used in advertising - * or publicity pertaining to distribution of the software without specific, - * written prior permission. HP makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * HP DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HP - * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Author: Jim Gettys, HP Labs, Hewlett-Packard, Inc. - */ - - -#define NEED_REPLIES -#define NEED_EVENTS -#include "X.h" -#include "Xproto.h" -#include "misc.h" -#include "os.h" -#include "dixstruct.h" -#include "resource.h" -#include "scrnintstr.h" -#include "windowstr.h" -#include "pixmapstr.h" -#include "extnsionst.h" -#include "servermd.h" -#include "randr.h" -#include "randrproto.h" -#include "randrstr.h" -#include "render.h" /* we share subpixel order information */ -#include "picturestr.h" -#include "Xfuncproto.h" -#ifdef EXTMODULE -#include "xf86_ansic.h" -#endif - -#define RR_VALIDATE -int RRGeneration; -int RRNScreens; - -static int ProcRRQueryVersion (ClientPtr pClient); -static int ProcRRDispatch (ClientPtr pClient); -static int SProcRRDispatch (ClientPtr pClient); -static int SProcRRQueryVersion (ClientPtr pClient); - -#define wrap(priv,real,mem,func) {\ - priv->mem = real->mem; \ - real->mem = func; \ -} - -#define unwrap(priv,real,mem) {\ - real->mem = priv->mem; \ -} - -static CARD8 RRReqCode; -static int RRErrBase; -static int RREventBase; -static RESTYPE ClientType, EventType; /* resource types for event masks */ -static int RRClientPrivateIndex; - -typedef struct _RRTimes { - TimeStamp setTime; - TimeStamp configTime; -} RRTimesRec, *RRTimesPtr; - -typedef struct _RRClient { - int major_version; - int minor_version; -/* RRTimesRec times[0]; */ -} RRClientRec, *RRClientPtr; - -/* - * each window has a list of clients requesting - * RRNotify events. Each client has a resource - * for each window it selects RRNotify input for, - * this resource is used to delete the RRNotifyRec - * entry from the per-window queue. - */ - -typedef struct _RREvent *RREventPtr; - -typedef struct _RREvent { - RREventPtr next; - ClientPtr client; - WindowPtr window; - XID clientResource; - int mask; -} RREventRec; - -int rrPrivIndex = -1; - -#define GetRRClient(pClient) ((RRClientPtr) (pClient)->devPrivates[RRClientPrivateIndex].ptr) -#define rrClientPriv(pClient) RRClientPtr pRRClient = GetRRClient(pClient) - -static Bool -RRClientKnowsRates (ClientPtr pClient) -{ - rrClientPriv(pClient); - - return (pRRClient->major_version > 1 || - (pRRClient->major_version == 1 && pRRClient->minor_version >= 1)); -} - -static void -RRClientCallback (CallbackListPtr *list, - pointer closure, - pointer data) -{ - NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; - ClientPtr pClient = clientinfo->client; - rrClientPriv(pClient); - RRTimesPtr pTimes = (RRTimesPtr) (pRRClient + 1); - int i; - - pRRClient->major_version = 0; - pRRClient->minor_version = 0; - for (i = 0; i < screenInfo.numScreens; i++) - { - ScreenPtr pScreen = screenInfo.screens[i]; - rrScrPriv(pScreen); - - if (pScrPriv) - { - pTimes[i].setTime = pScrPriv->lastSetTime; - pTimes[i].configTime = pScrPriv->lastConfigTime; - } - } -} - -static void -RRResetProc (ExtensionEntry *extEntry) -{ -} - -static Bool -RRCloseScreen (int i, ScreenPtr pScreen) -{ - rrScrPriv(pScreen); - - unwrap (pScrPriv, pScreen, CloseScreen); - if (pScrPriv->pSizes) - xfree (pScrPriv->pSizes); - xfree (pScrPriv); - RRNScreens -= 1; /* ok, one fewer screen with RandR running */ - return (*pScreen->CloseScreen) (i, pScreen); -} - -static void -SRRScreenChangeNotifyEvent(xRRScreenChangeNotifyEvent *from, - xRRScreenChangeNotifyEvent *to) -{ - to->type = from->type; - to->rotation = from->rotation; - cpswaps(from->sequenceNumber, to->sequenceNumber); - cpswapl(from->timestamp, to->timestamp); - cpswapl(from->configTimestamp, to->configTimestamp); - cpswapl(from->root, to->root); - cpswapl(from->window, to->window); - cpswaps(from->sizeID, to->sizeID); - cpswaps(from->widthInPixels, to->widthInPixels); - cpswaps(from->heightInPixels, to->heightInPixels); - cpswaps(from->widthInMillimeters, to->widthInMillimeters); - cpswaps(from->heightInMillimeters, to->heightInMillimeters); - cpswaps(from->subpixelOrder, to->subpixelOrder); -} - -Bool RRScreenInit(ScreenPtr pScreen) -{ - rrScrPrivPtr pScrPriv; - - if (RRGeneration != serverGeneration) - { - if ((rrPrivIndex = AllocateScreenPrivateIndex()) < 0) - return FALSE; - RRGeneration = serverGeneration; - } - - pScrPriv = (rrScrPrivPtr) xalloc (sizeof (rrScrPrivRec)); - if (!pScrPriv) - return FALSE; - - SetRRScreen(pScreen, pScrPriv); - - /* - * Calling function best set these function vectors - */ - pScrPriv->rrSetConfig = 0; - pScrPriv->rrGetInfo = 0; - /* - * This value doesn't really matter -- any client must call - * GetScreenInfo before reading it which will automatically update - * the time - */ - pScrPriv->lastSetTime = currentTime; - pScrPriv->lastConfigTime = currentTime; - - wrap (pScrPriv, pScreen, CloseScreen, RRCloseScreen); - - pScrPriv->rotations = RR_Rotate_0; - - pScrPriv->nSizes = 0; - pScrPriv->nSizesInUse = 0; - pScrPriv->pSizes = 0; - - pScrPriv->rotation = RR_Rotate_0; - pScrPriv->size = -1; - - RRNScreens += 1; /* keep count of screens that implement randr */ - return TRUE; -} - -/*ARGSUSED*/ -static int -RRFreeClient (pointer data, XID id) -{ - RREventPtr pRREvent; - WindowPtr pWin; - RREventPtr *pHead, pCur, pPrev; - - pRREvent = (RREventPtr) data; - pWin = pRREvent->window; - pHead = (RREventPtr *) LookupIDByType(pWin->drawable.id, EventType); - if (pHead) { - pPrev = 0; - for (pCur = *pHead; pCur && pCur != pRREvent; pCur=pCur->next) - pPrev = pCur; - if (pCur) - { - if (pPrev) - pPrev->next = pRREvent->next; - else - *pHead = pRREvent->next; - } - } - xfree ((pointer) pRREvent); - return 1; -} - -/*ARGSUSED*/ -static int -RRFreeEvents (pointer data, XID id) -{ - RREventPtr *pHead, pCur, pNext; - - pHead = (RREventPtr *) data; - for (pCur = *pHead; pCur; pCur = pNext) { - pNext = pCur->next; - FreeResource (pCur->clientResource, ClientType); - xfree ((pointer) pCur); - } - xfree ((pointer) pHead); - return 1; -} - -void -RRExtensionInit (void) -{ - ExtensionEntry *extEntry; - - if (RRNScreens == 0) return; - - RRClientPrivateIndex = AllocateClientPrivateIndex (); - if (!AllocateClientPrivate (RRClientPrivateIndex, - sizeof (RRClientRec) + - screenInfo.numScreens * sizeof (RRTimesRec))) - return; - if (!AddCallback (&ClientStateCallback, RRClientCallback, 0)) - return; - - ClientType = CreateNewResourceType(RRFreeClient); - if (!ClientType) - return; - EventType = CreateNewResourceType(RRFreeEvents); - if (!EventType) - return; - extEntry = AddExtension (RANDR_NAME, RRNumberEvents, RRNumberErrors, - ProcRRDispatch, SProcRRDispatch, - RRResetProc, StandardMinorOpcode); - if (!extEntry) - return; - RRReqCode = (CARD8) extEntry->base; - RRErrBase = extEntry->errorBase; - RREventBase = extEntry->eventBase; - EventSwapVector[RREventBase + RRScreenChangeNotify] = (EventSwapPtr) - SRRScreenChangeNotifyEvent; - - return; -} - -static int -TellChanged (WindowPtr pWin, pointer value) -{ - RREventPtr *pHead, pRREvent; - ClientPtr client; - xRRScreenChangeNotifyEvent se; - ScreenPtr pScreen = pWin->drawable.pScreen; - rrScrPriv(pScreen); - RRScreenSizePtr pSize; - WindowPtr pRoot = WindowTable[pScreen->myNum]; - - pHead = (RREventPtr *) LookupIDByType (pWin->drawable.id, EventType); - if (!pHead) - return WT_WALKCHILDREN; - - se.type = RRScreenChangeNotify + RREventBase; - se.rotation = (CARD8) pScrPriv->rotation; - se.timestamp = pScrPriv->lastSetTime.milliseconds; - se.configTimestamp = pScrPriv->lastConfigTime.milliseconds; - se.root = pRoot->drawable.id; - se.window = pWin->drawable.id; - se.subpixelOrder = PictureGetSubpixelOrder (pScreen); - if (pScrPriv->size >= 0) - { - pSize = &pScrPriv->pSizes[pScrPriv->size]; - se.sizeID = pSize->id; - se.widthInPixels = pSize->width; - se.heightInPixels = pSize->height; - se.widthInMillimeters = pSize->mmWidth; - se.heightInMillimeters = pSize->mmHeight; - } - else - { - /* - * This "shouldn't happen", but a broken DDX can - * forget to set the current configuration on GetInfo - */ - se.sizeID = 0xffff; - se.widthInPixels = 0; - se.heightInPixels = 0; - se.widthInMillimeters = 0; - se.heightInMillimeters = 0; - } - for (pRREvent = *pHead; pRREvent; pRREvent = pRREvent->next) - { - client = pRREvent->client; - if (client == serverClient || client->clientGone) - continue; - se.sequenceNumber = client->sequence; - if(pRREvent->mask & RRScreenChangeNotifyMask) - WriteEventsToClient (client, 1, (xEvent *) &se); - } - return WT_WALKCHILDREN; -} - -static Bool -RRGetInfo (ScreenPtr pScreen) -{ - rrScrPriv (pScreen); - int i, j, k, l; - Bool changed; - Rotation rotations; - RRScreenSizePtr pSize; - RRScreenRatePtr pRate; - - for (i = 0; i < pScrPriv->nSizes; i++) - { - pSize = &pScrPriv->pSizes[i]; - pSize->oldReferenced = pSize->referenced; - pSize->referenced = FALSE; - for (k = 0; k < pSize->nRates; k++) - { - pRate = &pSize->pRates[k]; - pRate->oldReferenced = pRate->referenced; - pRate->referenced = FALSE; - } - } - if (!(*pScrPriv->rrGetInfo) (pScreen, &rotations)) - return FALSE; - - changed = FALSE; - - /* - * Check whether anything changed and simultaneously generate - * the protocol id values for the objects - */ - if (rotations != pScrPriv->rotations) - { - pScrPriv->rotations = rotations; - changed = TRUE; - } - - j = 0; - for (i = 0; i < pScrPriv->nSizes; i++) - { - pSize = &pScrPriv->pSizes[i]; - if (pSize->oldReferenced != pSize->referenced) - changed = TRUE; - if (pSize->referenced) - pSize->id = j++; - l = 0; - for (k = 0; k < pSize->nRates; k++) - { - pRate = &pSize->pRates[k]; - if (pRate->oldReferenced != pRate->referenced) - changed = TRUE; - if (pRate->referenced) - l++; - } - pSize->nRatesInUse = l; - } - pScrPriv->nSizesInUse = j; - if (changed) - { - UpdateCurrentTime (); - pScrPriv->lastConfigTime = currentTime; - WalkTree (pScreen, TellChanged, (pointer) pScreen); - } - return TRUE; -} - -static void -RRSendConfigNotify (ScreenPtr pScreen) -{ - WindowPtr pWin = WindowTable[pScreen->myNum]; - xEvent event; - - event.u.u.type = ConfigureNotify; - event.u.configureNotify.window = pWin->drawable.id; - event.u.configureNotify.aboveSibling = None; - event.u.configureNotify.x = 0; - event.u.configureNotify.y = 0; - - /* XXX xinerama stuff ? */ - - event.u.configureNotify.width = pWin->drawable.width; - event.u.configureNotify.height = pWin->drawable.height; - event.u.configureNotify.borderWidth = wBorderWidth (pWin); - event.u.configureNotify.override = pWin->overrideRedirect; - DeliverEvents(pWin, &event, 1, NullWindow); -} - -static int -ProcRRQueryVersion (ClientPtr client) -{ - xRRQueryVersionReply rep; - register int n; - REQUEST(xRRQueryVersionReq); - rrClientPriv(client); - - REQUEST_SIZE_MATCH(xRRQueryVersionReq); - pRRClient->major_version = stuff->majorVersion; - pRRClient->minor_version = stuff->minorVersion; - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.majorVersion = RANDR_MAJOR; - rep.minorVersion = RANDR_MINOR; - if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.majorVersion, n); - swapl(&rep.minorVersion, n); - } - WriteToClient(client, sizeof(xRRQueryVersionReply), (char *)&rep); - return (client->noClientException); -} - - -extern char *ConnectionInfo; - -static int padlength[4] = {0, 3, 2, 1}; - -static void -RREditConnectionInfo (ScreenPtr pScreen) -{ - xConnSetup *connSetup; - char *vendor; - xPixmapFormat *formats; - xWindowRoot *root; - xDepth *depth; - xVisualType *visual; - int screen = 0; - int d; - - connSetup = (xConnSetup *) ConnectionInfo; - vendor = (char *) connSetup + sizeof (xConnSetup); - formats = (xPixmapFormat *) ((char *) vendor + - connSetup->nbytesVendor + - padlength[connSetup->nbytesVendor & 3]); - root = (xWindowRoot *) ((char *) formats + - sizeof (xPixmapFormat) * screenInfo.numPixmapFormats); - while (screen != pScreen->myNum) - { - depth = (xDepth *) ((char *) root + - sizeof (xWindowRoot)); - for (d = 0; d < root->nDepths; d++) - { - visual = (xVisualType *) ((char *) depth + - sizeof (xDepth)); - depth = (xDepth *) ((char *) visual + - depth->nVisuals * sizeof (xVisualType)); - } - root = (xWindowRoot *) ((char *) depth); - screen++; - } - root->pixWidth = pScreen->width; - root->pixHeight = pScreen->height; - root->mmWidth = pScreen->mmWidth; - root->mmHeight = pScreen->mmHeight; -} - -static int -ProcRRGetScreenInfo (ClientPtr client) -{ - REQUEST(xRRGetScreenInfoReq); - xRRGetScreenInfoReply rep; - WindowPtr pWin; - int n; - ScreenPtr pScreen; - rrScrPrivPtr pScrPriv; - CARD8 *extra; - int extraLen; - - REQUEST_SIZE_MATCH(xRRGetScreenInfoReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityReadAccess); - - if (!pWin) - return BadWindow; - - pScreen = pWin->drawable.pScreen; - pScrPriv = rrGetScrPriv(pScreen); - rep.pad = 0; - if (!pScrPriv) - { - rep.type = X_Reply; - rep.setOfRotations = RR_Rotate_0;; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.root = WindowTable[pWin->drawable.pScreen->myNum]->drawable.id; - rep.timestamp = currentTime.milliseconds; - rep.configTimestamp = currentTime.milliseconds; - rep.nSizes = 0; - rep.sizeID = 0; - rep.rotation = RR_Rotate_0; - rep.rate = 0; - rep.nrateEnts = 0; - extra = 0; - extraLen = 0; - } - else - { - int i, j; - xScreenSizes *size; - CARD16 *rates; - CARD8 *data8; - Bool has_rate = RRClientKnowsRates (client); - - RRGetInfo (pScreen); - - rep.type = X_Reply; - rep.setOfRotations = pScrPriv->rotations; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.root = WindowTable[pWin->drawable.pScreen->myNum]->drawable.id; - rep.timestamp = pScrPriv->lastSetTime.milliseconds; - rep.configTimestamp = pScrPriv->lastConfigTime.milliseconds; - rep.rotation = pScrPriv->rotation; - rep.nSizes = pScrPriv->nSizesInUse; - rep.rate = pScrPriv->rate; - rep.nrateEnts = 0; - if (has_rate) - { - for (i = 0; i < pScrPriv->nSizes; i++) - { - RRScreenSizePtr pSize = &pScrPriv->pSizes[i]; - if (pSize->referenced) - { - rep.nrateEnts += (1 + pSize->nRatesInUse); - } - } - } - - if (pScrPriv->size >= 0) - rep.sizeID = pScrPriv->pSizes[pScrPriv->size].id; - else - return BadImplementation; - - extraLen = (rep.nSizes * sizeof (xScreenSizes) + - rep.nrateEnts * sizeof (CARD16)); - - extra = (CARD8 *) xalloc (extraLen); - if (!extra) - return BadAlloc; - /* - * First comes the size information - */ - size = (xScreenSizes *) extra; - rates = (CARD16 *) (size + rep.nSizes); - for (i = 0; i < pScrPriv->nSizes; i++) - { - RRScreenSizePtr pSize = &pScrPriv->pSizes[i]; - if (pSize->referenced) - { - size->widthInPixels = pSize->width; - size->heightInPixels = pSize->height; - size->widthInMillimeters = pSize->mmWidth; - size->heightInMillimeters = pSize->mmHeight; - if (client->swapped) - { - swaps (&size->widthInPixels, n); - swaps (&size->heightInPixels, n); - swaps (&size->widthInMillimeters, n); - swaps (&size->heightInMillimeters, n); - } - size++; - if (has_rate) - { - *rates = pSize->nRatesInUse; - if (client->swapped) - { - swaps (rates, n); - } - rates++; - for (j = 0; j < pSize->nRates; j++) - { - RRScreenRatePtr pRate = &pSize->pRates[j]; - if (pRate->referenced) - { - *rates = pRate->rate; - if (client->swapped) - { - swaps (rates, n); - } - rates++; - } - } - } - } - } - data8 = (CARD8 *) rates; - - if (data8 - (CARD8 *) extra != extraLen) - FatalError ("RRGetScreenInfo bad extra len %d != %d\n", - data8 - (CARD8 *) extra, extraLen); - rep.length = (extraLen + 3) >> 2; - } - if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.timestamp, n); - swaps(&rep.rotation, n); - swaps(&rep.nSizes, n); - swaps(&rep.sizeID, n); - swaps(&rep.rate, n); - swaps(&rep.nrateEnts, n); - } - WriteToClient(client, sizeof(xRRGetScreenInfoReply), (char *)&rep); - if (extraLen) - { - WriteToClient (client, extraLen, (char *) extra); - xfree (extra); - } - return (client->noClientException); -} - -static int -ProcRRSetScreenConfig (ClientPtr client) -{ - REQUEST(xRRSetScreenConfigReq); - xRRSetScreenConfigReply rep; - DrawablePtr pDraw; - int n; - ScreenPtr pScreen; - rrScrPrivPtr pScrPriv; - TimeStamp configTime; - TimeStamp time; - RRScreenSizePtr pSize; - int i; - Rotation rotation; - int rate; - short oldWidth, oldHeight; - Bool has_rate; - - UpdateCurrentTime (); - - if (RRClientKnowsRates (client)) - { - REQUEST_SIZE_MATCH (xRRSetScreenConfigReq); - has_rate = TRUE; - } - else - { - REQUEST_SIZE_MATCH (xRR1_0SetScreenConfigReq); - has_rate = FALSE; - } - - SECURITY_VERIFY_DRAWABLE(pDraw, stuff->drawable, client, - SecurityWriteAccess); - - pScreen = pDraw->pScreen; - - pScrPriv= rrGetScrPriv(pScreen); - - time = ClientTimeToServerTime(stuff->timestamp); - configTime = ClientTimeToServerTime(stuff->configTimestamp); - - oldWidth = pScreen->width; - oldHeight = pScreen->height; - - if (!pScrPriv) - { - time = currentTime; - rep.status = RRSetConfigFailed; - goto sendReply; - } - if (!RRGetInfo (pScreen)) - return BadAlloc; - - /* - * if the client's config timestamp is not the same as the last config - * timestamp, then the config information isn't up-to-date and - * can't even be validated - */ - if (CompareTimeStamps (configTime, pScrPriv->lastConfigTime) != 0) - { - rep.status = RRSetConfigInvalidConfigTime; - goto sendReply; - } - - /* - * Search for the requested size - */ - pSize = 0; - for (i = 0; i < pScrPriv->nSizes; i++) - { - pSize = &pScrPriv->pSizes[i]; - if (pSize->referenced && pSize->id == stuff->sizeID) - { - break; - } - } - if (i == pScrPriv->nSizes) - { - /* - * Invalid size ID - */ - client->errorValue = stuff->sizeID; - return BadValue; - } - - /* - * Validate requested rotation - */ - rotation = (Rotation) stuff->rotation; - - /* test the rotation bits only! */ - switch (rotation & 0xf) { - case RR_Rotate_0: - case RR_Rotate_90: - case RR_Rotate_180: - case RR_Rotate_270: - break; - default: - /* - * Invalid rotation - */ - client->errorValue = stuff->rotation; - return BadValue; - } - - if ((~pScrPriv->rotations) & rotation) - { - /* - * requested rotation or reflection not supported by screen - */ - client->errorValue = stuff->rotation; - return BadMatch; - } - - /* - * Validate requested refresh - */ - if (has_rate) - rate = (int) stuff->rate; - else - rate = 0; - - if (rate) - { - for (i = 0; i < pSize->nRates; i++) - { - RRScreenRatePtr pRate = &pSize->pRates[i]; - if (pRate->referenced && pRate->rate == rate) - break; - } - if (i == pSize->nRates) - { - /* - * Invalid rate - */ - client->errorValue = rate; - return BadValue; - } - } - - /* - * Make sure the requested set-time is not older than - * the last set-time - */ - if (CompareTimeStamps (time, pScrPriv->lastSetTime) < 0) - { - rep.status = RRSetConfigInvalidTime; - goto sendReply; - } - - /* - * call out to ddx routine to effect the change - */ - if (!(*pScrPriv->rrSetConfig) (pScreen, rotation, rate, - pSize)) - { - /* - * unknown DDX failure, report to client - */ - rep.status = RRSetConfigFailed; - goto sendReply; - } - - /* - * set current extension configuration pointers - */ - RRSetCurrentConfig (pScreen, rotation, rate, pSize); - - /* - * Deliver ScreenChangeNotify events whenever - * the configuration is updated - */ - WalkTree (pScreen, TellChanged, (pointer) pScreen); - - /* - * Deliver ConfigureNotify events when root changes - * pixel size - */ - if (oldWidth != pScreen->width || oldHeight != pScreen->height) - RRSendConfigNotify (pScreen); - RREditConnectionInfo (pScreen); - - /* - * Fix pointer bounds and location - */ - ScreenRestructured (pScreen); - pScrPriv->lastSetTime = time; - - /* - * Report Success - */ - rep.status = RRSetConfigSuccess; - -sendReply: - - rep.type = X_Reply; - /* rep.status has already been filled in */ - rep.length = 0; - rep.sequenceNumber = client->sequence; - - rep.newTimestamp = pScrPriv->lastSetTime.milliseconds; - rep.newConfigTimestamp = pScrPriv->lastConfigTime.milliseconds; - rep.root = WindowTable[pDraw->pScreen->myNum]->drawable.id; - - if (client->swapped) - { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.newTimestamp, n); - swapl(&rep.newConfigTimestamp, n); - swapl(&rep.root, n); - } - WriteToClient(client, sizeof(xRRSetScreenConfigReply), (char *)&rep); - - return (client->noClientException); -} - -static int -ProcRRSelectInput (ClientPtr client) -{ - REQUEST(xRRSelectInputReq); - rrClientPriv(client); - RRTimesPtr pTimes; - WindowPtr pWin; - RREventPtr pRREvent, pNewRREvent, *pHead; - XID clientResource; - - REQUEST_SIZE_MATCH(xRRSelectInputReq); - pWin = SecurityLookupWindow (stuff->window, client, SecurityWriteAccess); - if (!pWin) - return BadWindow; - pHead = (RREventPtr *)SecurityLookupIDByType(client, - pWin->drawable.id, EventType, - SecurityWriteAccess); - - if (stuff->enable & (RRScreenChangeNotifyMask)) - { - ScreenPtr pScreen = pWin->drawable.pScreen; - rrScrPriv (pScreen); - - if (pHead) - { - /* check for existing entry. */ - for (pRREvent = *pHead; pRREvent; pRREvent = pRREvent->next) - if (pRREvent->client == client) - return Success; - } - - /* build the entry */ - pNewRREvent = (RREventPtr) xalloc (sizeof (RREventRec)); - if (!pNewRREvent) - return BadAlloc; - pNewRREvent->next = 0; - pNewRREvent->client = client; - pNewRREvent->window = pWin; - pNewRREvent->mask = stuff->enable; - /* - * add a resource that will be deleted when - * the client goes away - */ - clientResource = FakeClientID (client->index); - pNewRREvent->clientResource = clientResource; - if (!AddResource (clientResource, ClientType, (pointer)pNewRREvent)) - 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 = (RREventPtr *) xalloc (sizeof (RREventPtr)); - if (!pHead || - !AddResource (pWin->drawable.id, EventType, (pointer)pHead)) - { - FreeResource (clientResource, RT_NONE); - return BadAlloc; - } - *pHead = 0; - } - pNewRREvent->next = *pHead; - *pHead = pNewRREvent; - /* - * Now see if the client needs an event - */ - if (pScrPriv) - { - pTimes = &((RRTimesPtr) (pRRClient + 1))[pScreen->myNum]; - if (CompareTimeStamps (pTimes->setTime, - pScrPriv->lastSetTime) != 0 || - CompareTimeStamps (pTimes->configTime, - pScrPriv->lastConfigTime) != 0) - { - TellChanged (pWin, (pointer) pScreen); - } - } - } - else if (stuff->enable == xFalse) - { - /* delete the interest */ - if (pHead) { - pNewRREvent = 0; - for (pRREvent = *pHead; pRREvent; pRREvent = pRREvent->next) { - if (pRREvent->client == client) - break; - pNewRREvent = pRREvent; - } - if (pRREvent) { - FreeResource (pRREvent->clientResource, ClientType); - if (pNewRREvent) - pNewRREvent->next = pRREvent->next; - else - *pHead = pRREvent->next; - xfree (pRREvent); - } - } - } - else - { - client->errorValue = stuff->enable; - return BadValue; - } - return Success; -} - - -static int -ProcRRDispatch (ClientPtr client) -{ - REQUEST(xReq); - switch (stuff->data) - { - case X_RRQueryVersion: - return ProcRRQueryVersion(client); - case X_RRSetScreenConfig: - return ProcRRSetScreenConfig(client); - case X_RRSelectInput: - return ProcRRSelectInput(client); - case X_RRGetScreenInfo: - return ProcRRGetScreenInfo(client); - default: - return BadRequest; - } -} - -static int -SProcRRQueryVersion (ClientPtr client) -{ - register int n; - REQUEST(xRRQueryVersionReq); - - swaps(&stuff->length, n); - swapl(&stuff->majorVersion, n); - swapl(&stuff->minorVersion, n); - return ProcRRQueryVersion(client); -} - -static int -SProcRRGetScreenInfo (ClientPtr client) -{ - register int n; - REQUEST(xRRGetScreenInfoReq); - - swaps(&stuff->length, n); - swapl(&stuff->window, n); - return ProcRRGetScreenInfo(client); -} - -static int -SProcRRSetScreenConfig (ClientPtr client) -{ - register int n; - REQUEST(xRRSetScreenConfigReq); - - if (RRClientKnowsRates (client)) - { - REQUEST_SIZE_MATCH (xRRSetScreenConfigReq); - swaps (&stuff->rate, n); - } - else - { - REQUEST_SIZE_MATCH (xRR1_0SetScreenConfigReq); - } - - swaps(&stuff->length, n); - swapl(&stuff->drawable, n); - swapl(&stuff->timestamp, n); - swaps(&stuff->sizeID, n); - swaps(&stuff->rotation, n); - return ProcRRSetScreenConfig(client); -} - -static int -SProcRRSelectInput (ClientPtr client) -{ - register int n; - REQUEST(xRRSelectInputReq); - - swaps(&stuff->length, n); - swapl(&stuff->window, n); - return ProcRRSelectInput(client); -} - - -static int -SProcRRDispatch (ClientPtr client) -{ - REQUEST(xReq); - switch (stuff->data) - { - case X_RRQueryVersion: - return SProcRRQueryVersion(client); - case X_RRSetScreenConfig: - return SProcRRSetScreenConfig(client); - case X_RRSelectInput: - return SProcRRSelectInput(client); - case X_RRGetScreenInfo: - return SProcRRGetScreenInfo(client); - default: - return BadRequest; - } -} - - -static Bool -RRScreenSizeMatches (RRScreenSizePtr a, - RRScreenSizePtr b) -{ - if (a->width != b->width) - return FALSE; - if (a->height != b->height) - return FALSE; - if (a->mmWidth != b->mmWidth) - return FALSE; - if (a->mmHeight != b->mmHeight) - return FALSE; - return TRUE; -} - -RRScreenSizePtr -RRRegisterSize (ScreenPtr pScreen, - short width, - short height, - short mmWidth, - short mmHeight) -{ - rrScrPriv (pScreen); - int i; - RRScreenSize tmp; - RRScreenSizePtr pNew; - - if (!pScrPriv) - return 0; - - tmp.width = width; - tmp.height= height; - tmp.mmWidth = mmWidth; - tmp.mmHeight = mmHeight; - tmp.pRates = 0; - tmp.nRates = 0; - tmp.nRatesInUse = 0; - tmp.referenced = TRUE; - tmp.oldReferenced = FALSE; - for (i = 0; i < pScrPriv->nSizes; i++) - if (RRScreenSizeMatches (&tmp, &pScrPriv->pSizes[i])) - { - pScrPriv->pSizes[i].referenced = TRUE; - return &pScrPriv->pSizes[i]; - } - pNew = xrealloc (pScrPriv->pSizes, - (pScrPriv->nSizes + 1) * sizeof (RRScreenSize)); - if (!pNew) - return 0; - pNew[pScrPriv->nSizes++] = tmp; - pScrPriv->pSizes = pNew; - return &pNew[pScrPriv->nSizes-1]; -} - -Bool RRRegisterRate (ScreenPtr pScreen, - RRScreenSizePtr pSize, - int rate) -{ - rrScrPriv(pScreen); - int i; - RRScreenRatePtr pNew, pRate; - - if (!pScrPriv) - return FALSE; - - for (i = 0; i < pSize->nRates; i++) - { - pRate = &pSize->pRates[i]; - if (pRate->rate == rate) - { - pRate->referenced = TRUE; - return TRUE; - } - } - - pNew = xrealloc (pSize->pRates, - (pSize->nRates + 1) * sizeof (RRScreenRate)); - if (!pNew) - return FALSE; - pRate = &pNew[pSize->nRates++]; - pRate->rate = rate; - pRate->referenced = TRUE; - pRate->oldReferenced = FALSE; - pSize->pRates = pNew; - return TRUE; -} - -void -RRSetCurrentConfig (ScreenPtr pScreen, - Rotation rotation, - int rate, - RRScreenSizePtr pSize) -{ - rrScrPriv (pScreen); - - if (!pScrPriv) - return; - - pScrPriv->rotation = rotation; - pScrPriv->size = pSize - pScrPriv->pSizes; - pScrPriv->rate = rate; -} diff --git a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c index b78660240..90b80799c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Reconnect.c @@ -598,7 +598,8 @@ Bool nxagentReconnectSession(void) if (nxagentResizeDesktopAtStartup || nxagentOption(Rootless) == True) { - nxagentRRSetScreenConfig(nxagentDefaultScreen, nxagentOption(RootWidth), nxagentOption(RootHeight)); + nxagentChangeScreenConfig(0, nxagentOption(RootWidth), + nxagentOption(RootHeight), 0, 0); nxagentResizeDesktopAtStartup = False; } diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.c b/nx-X11/programs/Xserver/hw/nxagent/Screen.c index 0a0d409eb..b847b08e6 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.c @@ -2120,8 +2120,8 @@ static void nxagentSetRootClip (ScreenPtr pScreen, Bool enable) if (anyMarked) (*pScreen->ValidateTree)(pWin, NullWindow, VTOther); } - - if (pWin->backStorage && + + if (pWin->backStorage && pOldClip && ((pWin->backingStore == Always) || WasViewable)) { if (!WasViewable) @@ -2265,6 +2265,52 @@ FIXME: We should try to restore the previously nxagentChangeOption(ViewportXSpan, nxagentOption(Width) - nxagentOption(RootWidth)); nxagentChangeOption(ViewportYSpan, nxagentOption(Height) - nxagentOption(RootHeight)); + /* + * Change agent window size and size hints. + */ + + if ((nxagentOption(Fullscreen) == 0 && nxagentOption(AllScreens) == 0)) + { + sizeHints.flags = PPosition | PMinSize | PMaxSize; + sizeHints.x = nxagentOption(X); + sizeHints.y = nxagentOption(Y); + + sizeHints.min_width = MIN_NXAGENT_WIDTH; + sizeHints.min_height = MIN_NXAGENT_HEIGHT; + sizeHints.width = width; + sizeHints.height = height; + + if (nxagentOption(DesktopResize) == 1) + { + sizeHints.max_width = WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); + sizeHints.max_height = HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)); + } + else + { + sizeHints.max_width = nxagentOption(RootWidth); + sizeHints.max_height = nxagentOption(RootHeight); + } + + if (nxagentUserGeometry.flag & XValue || nxagentUserGeometry.flag & YValue) + { + sizeHints.flags |= USPosition; + } + + if (nxagentUserGeometry.flag & WidthValue || nxagentUserGeometry.flag & HeightValue) + { + sizeHints.flags |= USSize; + } + + XSetWMNormalHints(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum], &sizeHints); + + XResizeWindow(nxagentDisplay, nxagentDefaultWindows[pScreen->myNum], width, height); + + if (nxagentOption(Rootless) == 0) + { + XResizeWindow(nxagentDisplay, nxagentInputWindows[pScreen -> myNum], width, height); + } + } + /* * Set properties for the agent root window. */ @@ -2654,9 +2700,12 @@ int nxagentShadowInit(ScreenPtr pScreen, WindowPtr pWin) nxagentShadowCreateMainWindow(pScreen, pWin, nxagentShadowWidth, nxagentShadowHeight); - nxagentShadowSetWindowsSize(); + if (nxagentRemoteMajor <= 3) + { + nxagentShadowSetWindowsSize(); - nxagentSetWMNormalHints(0); + nxagentSetWMNormalHints(0); + } XMapWindow(nxagentDisplay, nxagentDefaultWindows[0]); @@ -3453,118 +3502,123 @@ Bool nxagentReconnectScreen(void *p0) return True; } -int nxagentRRSetScreenConfig(ScreenPtr pScreen, int width, int height) -{ - rrScrPrivPtr pScrPriv; - RRScreenSizePtr pSize; - Rotation rotation; - int rate; - short oldWidth, oldHeight; - int mmWidth, mmHeight; - int oldSize; - RRScreenSizePtr oldSizes; +RRModePtr nxagentRRCustomMode = NULL; - pScrPriv = rrGetScrPriv(pScreen); +int nxagentChangeScreenConfig(int screen, int width, int height, int mmWidth, int mmHeight) +{ + ScreenPtr pScreen; + rrScrPrivPtr pScrPriv; + RROutputPtr output; + RRCrtcPtr crtc; + RRModePtr mode; + xRRModeInfo modeInfo; + char name[100]; + int r, c, m; + int refresh = 60; + int doNotify = 1; + + if (WindowTable[screen] == NULL) + { + return 0; + } - oldWidth = pScreen->width; - oldHeight = pScreen->height; + UpdateCurrentTime(); - if (!pScrPriv) - { - return 1; - } + if (nxagentGrabServerInfo.grabstate == SERVER_GRABBED) + { + /* + * If any client grabbed the server it won't expect that screen + * configuration changes until it releases the grab. That could + * get an X error because available modes are chanded meanwhile. + */ - if (!RRGetInfo (pScreen)) - { - return 1; - } + #ifdef TEST + fprintf(stderr, "nxagentChangeScreenConfig: Cancel with grabbed server.\n"); + #endif - rotation = RR_Rotate_0; + return 0; + } - rate = 0; + pScreen = WindowTable[screen] -> drawable.pScreen; - mmWidth = (width * 254 + monitorResolution * 5) / (monitorResolution * 10); + #ifdef TEST + fprintf(stderr, "nxagentChangeScreenConfig: Changing config to %dx%d.\n", width, height); + #endif - if (mmWidth < 1) - { - mmWidth = 1; - } + r = nxagentResizeScreen(pScreen, width, height, mmWidth, mmHeight); - mmHeight = (height * 254 + monitorResolution * 5) / (monitorResolution * 10); + if (r != 0) + { + pScrPriv = rrGetScrPriv(pScreen); - if (mmHeight < 1) + if (pScrPriv) { - mmHeight = 1; - } - - pSize = xalloc(sizeof(RRScreenSize)); - - pSize -> width = width; - pSize -> height = height; - pSize -> mmWidth = mmWidth; - pSize -> mmHeight = mmHeight; + output = RRFirstOutput(pScreen); - /* - * call out to ddx routine to effect the change - */ - - if (!(*pScrPriv->rrSetConfig) (pScreen, rotation, rate, - pSize)) - { - /* - * unknown DDX failure. - */ + if (output && output -> crtc) + { + crtc = output -> crtc; - xfree(pSize); + for (c = 0; c < pScrPriv -> numCrtcs; c++) + { + RRCrtcSet(pScrPriv -> crtcs[c], NULL, 0, 0, RR_Rotate_0, 0, NULL); + } - return 1; - } + memset(&modeInfo, '\0', sizeof(modeInfo)); + sprintf(name, "%dx%d", width, height); - /* - * TellChanged uses this privates. - */ + modeInfo.width = width; + modeInfo.height = height; + modeInfo.hTotal = width; + modeInfo.vTotal = height; + modeInfo.dotClock = ((CARD32) width * (CARD32) height * + (CARD32) refresh); + modeInfo.nameLength = strlen(name); - oldSize = pScrPriv->size; - oldSizes = pScrPriv->pSizes; + if (nxagentRRCustomMode != NULL) + { + RROutputDeleteUserMode(output, nxagentRRCustomMode); + FreeResource(nxagentRRCustomMode -> mode.id, 0); - pScrPriv->size = 0; - pScrPriv->pSizes = pSize; + if (crtc != NULL && crtc -> mode == nxagentRRCustomMode) + { + RRCrtcSet(crtc, NULL, 0, 0, RR_Rotate_0, 0, NULL); + } - /* - * Deliver ScreenChangeNotify events whenever - * the configuration is updated - */ + #ifdef TEST + fprintf(stderr, "nxagentChangeScreenConfig: " + "Going to destroy mode %p with refcnt %d.\n", + nxagentRRCustomMode, nxagentRRCustomMode->refcnt); + #endif - WalkTree (pScreen, TellChanged, (pointer) pScreen); + RRModeDestroy(nxagentRRCustomMode); + } - /* - * Deliver ConfigureNotify events when root changes - * pixel size - */ + nxagentRRCustomMode = RRModeGet(&modeInfo, name); - if (oldWidth != pScreen->width || oldHeight != pScreen->height) - { - RRSendConfigNotify (pScreen); - } + RROutputAddUserMode(output, nxagentRRCustomMode); - RREditConnectionInfo (pScreen); + RRCrtcSet(crtc, nxagentRRCustomMode, 0, 0, RR_Rotate_0, 1, &output); - /* - * Fix pointer bounds and location - */ + RROutputChanged(output, 1); - ScreenRestructured (pScreen); + doNotify = 0; + } - /* - * Restore old privates. - */ + pScrPriv -> lastSetTime = currentTime; - pScrPriv->pSizes = oldSizes; - pScrPriv->size = oldSize; + pScrPriv->changed = 1; + pScrPriv->configChanged = 1; + } - xfree(pSize); + if (doNotify +) + { + RRScreenSizeNotify(pScreen); + } + } - return 0; + return r; } void nxagentSaveAreas(PixmapPtr pPixmap, RegionPtr prgnSave, int xorg, int yorg, WindowPtr pWin) diff --git a/nx-X11/programs/Xserver/hw/nxagent/Screen.h b/nx-X11/programs/Xserver/hw/nxagent/Screen.h index 5b1957755..aab3ba19c 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Screen.h +++ b/nx-X11/programs/Xserver/hw/nxagent/Screen.h @@ -100,7 +100,7 @@ Bool nxagentMagicPixelZone(int x, int y); Bool nxagentResizeScreen(ScreenPtr pScreen, int width, int height, int mmWidth, int mmHeight); -int nxagentRRSetScreenConfig(ScreenPtr pScreen, int width, int height); +int nxagentChangeScreenConfig(int screen, int width, int height, int mmWidth, int mmHeight); extern Bool nxagentReconnectScreen(void *p0); diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c index 3e6d41d04..988193609 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Window.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c @@ -899,8 +899,8 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn) { if (nxagentOption(Shadow) == 0) { - nxagentRRSetScreenConfig(pScreen, WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)), - HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay))); + nxagentChangeScreenConfig(0, WidthOfScreen(DefaultScreenOfDisplay(nxagentDisplay)), + HeightOfScreen(DefaultScreenOfDisplay(nxagentDisplay)), 0, 0); } else { @@ -953,7 +953,8 @@ void nxagentSwitchAllScreens(ScreenPtr pScreen, Bool switchOn) if (nxagentOption(Shadow) == 0) { - nxagentRRSetScreenConfig(pScreen, nxagentOption(RootWidth), nxagentOption(RootHeight)); + nxagentChangeScreenConfig(0, nxagentOption(RootWidth), + nxagentOption(RootHeight), 0, 0); } } diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXdixfonts.c b/nx-X11/programs/Xserver/hw/nxagent/X/NXdixfonts.c index 04fc047fc..3234c9929 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXdixfonts.c +++ b/nx-X11/programs/Xserver/hw/nxagent/X/NXdixfonts.c @@ -148,7 +148,8 @@ static const char *_NXGetFontPath(const char *path) _NXGetFontPathError: - strcpy(_NXFontPath, path); + strncpy(_NXFontPath, path, 1023); + _NXFontPath[1023] = '\0'; #ifdef NX_TRANS_TEST fprintf(stderr, "_NXGetFontPath: Using default font path [%s].\n", _NXFontPath); diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXrandr.c b/nx-X11/programs/Xserver/hw/nxagent/X/NXrandr.c deleted file mode 100644 index 5f460f23e..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXrandr.c +++ /dev/null @@ -1,1344 +0,0 @@ -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NXAGENT, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -/* - * $XFree86: xc/programs/Xserver/randr/randr.c,v 1.21tsi Exp $ - * - * Copyright © 2000, Compaq Computer Corporation, - * Copyright © 2002, Hewlett Packard, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Compaq or HP not be used in advertising - * or publicity pertaining to distribution of the software without specific, - * written prior permission. HP makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * HP DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HP - * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Author: Jim Gettys, HP Labs, Hewlett-Packard, Inc. - */ - - -#define NEED_REPLIES -#define NEED_EVENTS -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include "misc.h" -#include "os.h" -#include "dixstruct.h" -#include "resource.h" -#include "scrnintstr.h" -#include "windowstr.h" -#include "pixmapstr.h" -#include "extnsionst.h" -#include "servermd.h" -#include -#include -#include "../../randr/randrstr.h" -#ifdef RENDER -#include /* we share subpixel order information */ -#include "picturestr.h" -#endif -#include -#ifdef EXTMODULE -#include "xf86_ansic.h" -#endif - -/* From render.h */ -#ifndef SubPixelUnknown -#define SubPixelUnknown 0 -#endif - -#define RR_VALIDATE -int RRGeneration; -int RRNScreens; - -static int ProcRRQueryVersion (ClientPtr pClient); -static int ProcRRDispatch (ClientPtr pClient); -static int SProcRRDispatch (ClientPtr pClient); -static int SProcRRQueryVersion (ClientPtr pClient); - -#define wrap(priv,real,mem,func) {\ - priv->mem = real->mem; \ - real->mem = func; \ -} - -#define unwrap(priv,real,mem) {\ - real->mem = priv->mem; \ -} - -#if 0 -static CARD8 RRReqCode; -static int RRErrBase; -#endif -static int RREventBase; -static RESTYPE ClientType, EventType; /* resource types for event masks */ -static int RRClientPrivateIndex; - -typedef struct _RRTimes { - TimeStamp setTime; - TimeStamp configTime; -} RRTimesRec, *RRTimesPtr; - -typedef struct _RRClient { - int major_version; - int minor_version; -/* RRTimesRec times[0]; */ -} RRClientRec, *RRClientPtr; - -/* - * each window has a list of clients requesting - * RRNotify events. Each client has a resource - * for each window it selects RRNotify input for, - * this resource is used to delete the RRNotifyRec - * entry from the per-window queue. - */ - -typedef struct _RREvent *RREventPtr; - -typedef struct _RREvent { - RREventPtr next; - ClientPtr client; - WindowPtr window; - XID clientResource; - int mask; -} RREventRec; - -int rrPrivIndex = -1; - -#define GetRRClient(pClient) ((RRClientPtr) (pClient)->devPrivates[RRClientPrivateIndex].ptr) -#define rrClientPriv(pClient) RRClientPtr pRRClient = GetRRClient(pClient) - -static Bool -RRClientKnowsRates (ClientPtr pClient) -{ - rrClientPriv(pClient); - - return (pRRClient->major_version > 1 || - (pRRClient->major_version == 1 && pRRClient->minor_version >= 1)); -} - -static void -RRClientCallback (CallbackListPtr *list, - pointer closure, - pointer data) -{ - NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; - ClientPtr pClient = clientinfo->client; - rrClientPriv(pClient); - RRTimesPtr pTimes = (RRTimesPtr) (pRRClient + 1); - int i; - - pRRClient->major_version = 0; - pRRClient->minor_version = 0; - for (i = 0; i < screenInfo.numScreens; i++) - { - ScreenPtr pScreen = screenInfo.screens[i]; - rrScrPriv(pScreen); - - if (pScrPriv) - { - pTimes[i].setTime = pScrPriv->lastSetTime; - pTimes[i].configTime = pScrPriv->lastConfigTime; - } - } -} - -static void -RRResetProc (ExtensionEntry *extEntry) -{ -} - -static Bool -RRCloseScreen (int i, ScreenPtr pScreen) -{ - rrScrPriv(pScreen); - - unwrap (pScrPriv, pScreen, CloseScreen); - if (pScrPriv->pSizes) - xfree (pScrPriv->pSizes); - xfree (pScrPriv); - RRNScreens -= 1; /* ok, one fewer screen with RandR running */ - return (*pScreen->CloseScreen) (i, pScreen); -} - -static void -SRRScreenChangeNotifyEvent(xRRScreenChangeNotifyEvent *from, - xRRScreenChangeNotifyEvent *to) -{ - to->type = from->type; - to->rotation = from->rotation; - cpswaps(from->sequenceNumber, to->sequenceNumber); - cpswapl(from->timestamp, to->timestamp); - cpswapl(from->configTimestamp, to->configTimestamp); - cpswapl(from->root, to->root); - cpswapl(from->window, to->window); - cpswaps(from->sizeID, to->sizeID); - cpswaps(from->widthInPixels, to->widthInPixels); - cpswaps(from->heightInPixels, to->heightInPixels); - cpswaps(from->widthInMillimeters, to->widthInMillimeters); - cpswaps(from->heightInMillimeters, to->heightInMillimeters); - cpswaps(from->subpixelOrder, to->subpixelOrder); -} - -Bool RRScreenInit(ScreenPtr pScreen) -{ - rrScrPrivPtr pScrPriv; - - if (RRGeneration != serverGeneration) - { - if ((rrPrivIndex = AllocateScreenPrivateIndex()) < 0) - return FALSE; - RRGeneration = serverGeneration; - } - - pScrPriv = (rrScrPrivPtr) xalloc (sizeof (rrScrPrivRec)); - if (!pScrPriv) - return FALSE; - - SetRRScreen(pScreen, pScrPriv); - - /* - * Calling function best set these function vectors - */ - pScrPriv->rrSetConfig = 0; - pScrPriv->rrGetInfo = 0; - /* - * This value doesn't really matter -- any client must call - * GetScreenInfo before reading it which will automatically update - * the time - */ - pScrPriv->lastSetTime = currentTime; - pScrPriv->lastConfigTime = currentTime; - - wrap (pScrPriv, pScreen, CloseScreen, RRCloseScreen); - - pScrPriv->rotations = RR_Rotate_0; - - pScrPriv->nSizes = 0; - pScrPriv->nSizesInUse = 0; - pScrPriv->pSizes = 0; - - pScrPriv->rotation = RR_Rotate_0; - pScrPriv->size = -1; - - RRNScreens += 1; /* keep count of screens that implement randr */ - return TRUE; -} - -/*ARGSUSED*/ -static int -RRFreeClient (pointer data, XID id) -{ - RREventPtr pRREvent; - WindowPtr pWin; - RREventPtr *pHead, pCur, pPrev; - - pRREvent = (RREventPtr) data; - pWin = pRREvent->window; - pHead = (RREventPtr *) LookupIDByType(pWin->drawable.id, EventType); - if (pHead) { - pPrev = 0; - for (pCur = *pHead; pCur && pCur != pRREvent; pCur=pCur->next) - pPrev = pCur; - if (pCur) - { - if (pPrev) - pPrev->next = pRREvent->next; - else - *pHead = pRREvent->next; - } - } - xfree ((pointer) pRREvent); - return 1; -} - -/*ARGSUSED*/ -static int -RRFreeEvents (pointer data, XID id) -{ - RREventPtr *pHead, pCur, pNext; - - pHead = (RREventPtr *) data; - for (pCur = *pHead; pCur; pCur = pNext) { - pNext = pCur->next; - FreeResource (pCur->clientResource, ClientType); - xfree ((pointer) pCur); - } - xfree ((pointer) pHead); - return 1; -} - -void -RRExtensionInit (void) -{ - ExtensionEntry *extEntry; - - if (RRNScreens == 0) return; - - RRClientPrivateIndex = AllocateClientPrivateIndex (); - if (!AllocateClientPrivate (RRClientPrivateIndex, - sizeof (RRClientRec) + - screenInfo.numScreens * sizeof (RRTimesRec))) - return; - if (!AddCallback (&ClientStateCallback, RRClientCallback, 0)) - return; - - ClientType = CreateNewResourceType(RRFreeClient); - if (!ClientType) - return; - EventType = CreateNewResourceType(RRFreeEvents); - if (!EventType) - return; - extEntry = AddExtension (RANDR_NAME, RRNumberEvents, RRNumberErrors, - ProcRRDispatch, SProcRRDispatch, - RRResetProc, StandardMinorOpcode); - if (!extEntry) - return; -#if 0 - RRReqCode = (CARD8) extEntry->base; - RRErrBase = extEntry->errorBase; -#endif - RREventBase = extEntry->eventBase; - EventSwapVector[RREventBase + RRScreenChangeNotify] = (EventSwapPtr) - SRRScreenChangeNotifyEvent; - - return; -} - -int -TellChanged (WindowPtr pWin, pointer value) -{ - RREventPtr *pHead, pRREvent; - ClientPtr client; - xRRScreenChangeNotifyEvent se; - ScreenPtr pScreen = pWin->drawable.pScreen; - rrScrPriv(pScreen); - RRScreenSizePtr pSize; - WindowPtr pRoot = WindowTable[pScreen->myNum]; - - pHead = (RREventPtr *) LookupIDByType (pWin->drawable.id, EventType); - if (!pHead) - return WT_WALKCHILDREN; - - se.type = RRScreenChangeNotify + RREventBase; - se.rotation = (CARD8) pScrPriv->rotation; - se.timestamp = pScrPriv->lastSetTime.milliseconds; - se.configTimestamp = pScrPriv->lastConfigTime.milliseconds; - se.root = pRoot->drawable.id; - se.window = pWin->drawable.id; -#ifdef RENDER - se.subpixelOrder = PictureGetSubpixelOrder (pScreen); -#else - se.subpixelOrder = SubPixelUnknown; -#endif - if (pScrPriv->size >= 0) - { - pSize = &pScrPriv->pSizes[pScrPriv->size]; - se.sizeID = pSize->id; - se.widthInPixels = pSize->width; - se.heightInPixels = pSize->height; - se.widthInMillimeters = pSize->mmWidth; - se.heightInMillimeters = pSize->mmHeight; - } - else - { - /* - * This "shouldn't happen", but a broken DDX can - * forget to set the current configuration on GetInfo - */ - se.sizeID = 0xffff; - se.widthInPixels = 0; - se.heightInPixels = 0; - se.widthInMillimeters = 0; - se.heightInMillimeters = 0; - } - for (pRREvent = *pHead; pRREvent; pRREvent = pRREvent->next) - { - client = pRREvent->client; - if (client == serverClient || client->clientGone) - continue; - se.sequenceNumber = client->sequence; - if(pRREvent->mask & RRScreenChangeNotifyMask) - WriteEventsToClient (client, 1, (xEvent *) &se); - } - return WT_WALKCHILDREN; -} - -Bool -RRGetInfo (ScreenPtr pScreen) -{ - rrScrPriv (pScreen); - int i, j, k, l; - Bool changed; - Rotation rotations; - RRScreenSizePtr pSize; - RRScreenRatePtr pRate; - - for (i = 0; i < pScrPriv->nSizes; i++) - { - pSize = &pScrPriv->pSizes[i]; - pSize->oldReferenced = pSize->referenced; - pSize->referenced = FALSE; - for (k = 0; k < pSize->nRates; k++) - { - pRate = &pSize->pRates[k]; - pRate->oldReferenced = pRate->referenced; - pRate->referenced = FALSE; - } - } - if (!(*pScrPriv->rrGetInfo) (pScreen, &rotations)) - return FALSE; - - changed = FALSE; - - /* - * Check whether anything changed and simultaneously generate - * the protocol id values for the objects - */ - if (rotations != pScrPriv->rotations) - { - pScrPriv->rotations = rotations; - changed = TRUE; - } - - j = 0; - for (i = 0; i < pScrPriv->nSizes; i++) - { - pSize = &pScrPriv->pSizes[i]; - if (pSize->oldReferenced != pSize->referenced) - changed = TRUE; - if (pSize->referenced) - pSize->id = j++; - l = 0; - for (k = 0; k < pSize->nRates; k++) - { - pRate = &pSize->pRates[k]; - if (pRate->oldReferenced != pRate->referenced) - changed = TRUE; - if (pRate->referenced) - l++; - } - pSize->nRatesInUse = l; - } - pScrPriv->nSizesInUse = j; - if (changed) - { - UpdateCurrentTime (); - pScrPriv->lastConfigTime = currentTime; - WalkTree (pScreen, TellChanged, (pointer) pScreen); - } - return TRUE; -} - -void -RRSendConfigNotify (ScreenPtr pScreen) -{ - WindowPtr pWin = WindowTable[pScreen->myNum]; - xEvent event; - - event.u.u.type = ConfigureNotify; - event.u.configureNotify.window = pWin->drawable.id; - event.u.configureNotify.aboveSibling = None; - event.u.configureNotify.x = 0; - event.u.configureNotify.y = 0; - - /* XXX xinerama stuff ? */ - - event.u.configureNotify.width = pWin->drawable.width; - event.u.configureNotify.height = pWin->drawable.height; - event.u.configureNotify.borderWidth = wBorderWidth (pWin); - event.u.configureNotify.override = pWin->overrideRedirect; - DeliverEvents(pWin, &event, 1, NullWindow); -} - -static int -ProcRRQueryVersion (ClientPtr client) -{ - xRRQueryVersionReply rep; - register int n; - REQUEST(xRRQueryVersionReq); - rrClientPriv(client); - - REQUEST_SIZE_MATCH(xRRQueryVersionReq); - pRRClient->major_version = stuff->majorVersion; - pRRClient->minor_version = stuff->minorVersion; - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.majorVersion = RANDR_MAJOR; - rep.minorVersion = RANDR_MINOR; - if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.majorVersion, n); - swapl(&rep.minorVersion, n); - } - WriteToClient(client, sizeof(xRRQueryVersionReply), (char *)&rep); - return (client->noClientException); -} - - -extern char *ConnectionInfo; - -static int padlength[4] = {0, 3, 2, 1}; - -void -RREditConnectionInfo (ScreenPtr pScreen) -{ - xConnSetup *connSetup; - char *vendor; - xPixmapFormat *formats; - xWindowRoot *root; - xDepth *depth; - xVisualType *visual; - int screen = 0; - int d; - - connSetup = (xConnSetup *) ConnectionInfo; - vendor = (char *) connSetup + sizeof (xConnSetup); - formats = (xPixmapFormat *) ((char *) vendor + - connSetup->nbytesVendor + - padlength[connSetup->nbytesVendor & 3]); - root = (xWindowRoot *) ((char *) formats + - sizeof (xPixmapFormat) * screenInfo.numPixmapFormats); - while (screen != pScreen->myNum) - { - depth = (xDepth *) ((char *) root + - sizeof (xWindowRoot)); - for (d = 0; d < root->nDepths; d++) - { - visual = (xVisualType *) ((char *) depth + - sizeof (xDepth)); - depth = (xDepth *) ((char *) visual + - depth->nVisuals * sizeof (xVisualType)); - } - root = (xWindowRoot *) ((char *) depth); - screen++; - } - root->pixWidth = pScreen->width; - root->pixHeight = pScreen->height; - root->mmWidth = pScreen->mmWidth; - root->mmHeight = pScreen->mmHeight; -} - -static int -ProcRRGetScreenInfo (ClientPtr client) -{ - REQUEST(xRRGetScreenInfoReq); - xRRGetScreenInfoReply rep; - WindowPtr pWin; - int n; - ScreenPtr pScreen; - rrScrPrivPtr pScrPriv; - CARD8 *extra; - unsigned long extraLen; - - REQUEST_SIZE_MATCH(xRRGetScreenInfoReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityReadAccess); - - if (!pWin) - return BadWindow; - - pScreen = pWin->drawable.pScreen; - pScrPriv = rrGetScrPriv(pScreen); - rep.pad = 0; - if (!pScrPriv) - { - rep.type = X_Reply; - rep.setOfRotations = RR_Rotate_0;; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.root = WindowTable[pWin->drawable.pScreen->myNum]->drawable.id; - rep.timestamp = currentTime.milliseconds; - rep.configTimestamp = currentTime.milliseconds; - rep.nSizes = 0; - rep.sizeID = 0; - rep.rotation = RR_Rotate_0; - rep.rate = 0; - rep.nrateEnts = 0; - extra = 0; - extraLen = 0; - } - else - { - int i, j; - xScreenSizes *size; - CARD16 *rates; - CARD8 *data8; - Bool has_rate = RRClientKnowsRates (client); - - RRGetInfo (pScreen); - - rep.type = X_Reply; - rep.setOfRotations = pScrPriv->rotations; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.root = WindowTable[pWin->drawable.pScreen->myNum]->drawable.id; - rep.timestamp = pScrPriv->lastSetTime.milliseconds; - rep.configTimestamp = pScrPriv->lastConfigTime.milliseconds; - rep.rotation = pScrPriv->rotation; - rep.nSizes = pScrPriv->nSizesInUse; - rep.rate = pScrPriv->rate; - rep.nrateEnts = 0; - if (has_rate) - { - for (i = 0; i < pScrPriv->nSizes; i++) - { - RRScreenSizePtr pSize = &pScrPriv->pSizes[i]; - if (pSize->referenced) - { - rep.nrateEnts += (1 + pSize->nRatesInUse); - } - } - } - - if (pScrPriv->size >= 0) - rep.sizeID = pScrPriv->pSizes[pScrPriv->size].id; - else - return BadImplementation; - - extraLen = (rep.nSizes * sizeof (xScreenSizes) + - rep.nrateEnts * sizeof (CARD16)); - - extra = (CARD8 *) xalloc (extraLen); - if (!extra) - return BadAlloc; - /* - * First comes the size information - */ - size = (xScreenSizes *) extra; - rates = (CARD16 *) (size + rep.nSizes); - for (i = 0; i < pScrPriv->nSizes; i++) - { - RRScreenSizePtr pSize = &pScrPriv->pSizes[i]; - if (pSize->referenced) - { - size->widthInPixels = pSize->width; - size->heightInPixels = pSize->height; - size->widthInMillimeters = pSize->mmWidth; - size->heightInMillimeters = pSize->mmHeight; - if (client->swapped) - { - swaps (&size->widthInPixels, n); - swaps (&size->heightInPixels, n); - swaps (&size->widthInMillimeters, n); - swaps (&size->heightInMillimeters, n); - } - size++; - if (has_rate) - { - *rates = pSize->nRatesInUse; - if (client->swapped) - { - swaps (rates, n); - } - rates++; - for (j = 0; j < pSize->nRates; j++) - { - RRScreenRatePtr pRate = &pSize->pRates[j]; - if (pRate->referenced) - { - *rates = pRate->rate; - if (client->swapped) - { - swaps (rates, n); - } - rates++; - } - } - } - } - } - data8 = (CARD8 *) rates; - - if (data8 - (CARD8 *) extra != extraLen) - FatalError ("RRGetScreenInfo bad extra len %ld != %ld\n", - (unsigned long)(data8 - (CARD8 *) extra), extraLen); - rep.length = (extraLen + 3) >> 2; - } - if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.timestamp, n); - swaps(&rep.rotation, n); - swaps(&rep.nSizes, n); - swaps(&rep.sizeID, n); - swaps(&rep.rate, n); - swaps(&rep.nrateEnts, n); - } - WriteToClient(client, sizeof(xRRGetScreenInfoReply), (char *)&rep); - if (extraLen) - { - WriteToClient (client, extraLen, (char *) extra); - xfree (extra); - } - return (client->noClientException); -} - -static int -ProcRRSetScreenConfig (ClientPtr client) -{ - REQUEST(xRRSetScreenConfigReq); - xRRSetScreenConfigReply rep; - DrawablePtr pDraw; - int n; - ScreenPtr pScreen; - rrScrPrivPtr pScrPriv; - TimeStamp configTime; - TimeStamp time; - RRScreenSizePtr pSize; - int i; - Rotation rotation; - int rate; - short oldWidth, oldHeight; - Bool has_rate; - - UpdateCurrentTime (); - - if (RRClientKnowsRates (client)) - { - REQUEST_SIZE_MATCH (xRRSetScreenConfigReq); - has_rate = TRUE; - } - else - { - REQUEST_SIZE_MATCH (xRR1_0SetScreenConfigReq); - has_rate = FALSE; - } - - SECURITY_VERIFY_DRAWABLE(pDraw, stuff->drawable, client, - SecurityWriteAccess); - - pScreen = pDraw->pScreen; - - pScrPriv = rrGetScrPriv(pScreen); - - time = ClientTimeToServerTime(stuff->timestamp); - configTime = ClientTimeToServerTime(stuff->configTimestamp); - - oldWidth = pScreen->width; - oldHeight = pScreen->height; - - if (!pScrPriv) - { - time = currentTime; - rep.status = RRSetConfigFailed; - goto sendReply; - } - if (!RRGetInfo (pScreen)) - return BadAlloc; - - /* - * if the client's config timestamp is not the same as the last config - * timestamp, then the config information isn't up-to-date and - * can't even be validated - */ - if (CompareTimeStamps (configTime, pScrPriv->lastConfigTime) != 0) - { - rep.status = RRSetConfigInvalidConfigTime; - goto sendReply; - } - - /* - * Search for the requested size - */ - pSize = 0; - for (i = 0; i < pScrPriv->nSizes; i++) - { - pSize = &pScrPriv->pSizes[i]; - if (pSize->referenced && pSize->id == stuff->sizeID) - { - break; - } - } - if (i == pScrPriv->nSizes) - { - /* - * Invalid size ID - */ - client->errorValue = stuff->sizeID; - return BadValue; - } - - /* - * Validate requested rotation - */ - rotation = (Rotation) stuff->rotation; - - /* test the rotation bits only! */ - switch (rotation & 0xf) { - case RR_Rotate_0: - case RR_Rotate_90: - case RR_Rotate_180: - case RR_Rotate_270: - break; - default: - /* - * Invalid rotation - */ - client->errorValue = stuff->rotation; - return BadValue; - } - - if ((~pScrPriv->rotations) & rotation) - { - /* - * requested rotation or reflection not supported by screen - */ - client->errorValue = stuff->rotation; - return BadMatch; - } - - /* - * Validate requested refresh - */ - if (has_rate) - rate = (int) stuff->rate; - else - rate = 0; - - if (rate) - { - for (i = 0; i < pSize->nRates; i++) - { - RRScreenRatePtr pRate = &pSize->pRates[i]; - if (pRate->referenced && pRate->rate == rate) - break; - } - if (i == pSize->nRates) - { - /* - * Invalid rate - */ - client->errorValue = rate; - return BadValue; - } - } - - /* - * Make sure the requested set-time is not older than - * the last set-time - */ - if (CompareTimeStamps (time, pScrPriv->lastSetTime) < 0) - { - rep.status = RRSetConfigInvalidTime; - goto sendReply; - } - - /* - * call out to ddx routine to effect the change - */ - if (!(*pScrPriv->rrSetConfig) (pScreen, rotation, rate, - pSize)) - { - /* - * unknown DDX failure, report to client - */ - rep.status = RRSetConfigFailed; - goto sendReply; - } - - /* - * set current extension configuration pointers - */ - RRSetCurrentConfig (pScreen, rotation, rate, pSize); - - /* - * Deliver ScreenChangeNotify events whenever - * the configuration is updated - */ - WalkTree (pScreen, TellChanged, (pointer) pScreen); - - /* - * Deliver ConfigureNotify events when root changes - * pixel size - */ - if (oldWidth != pScreen->width || oldHeight != pScreen->height) - RRSendConfigNotify (pScreen); - RREditConnectionInfo (pScreen); - - /* - * Fix pointer bounds and location - */ - ScreenRestructured (pScreen); - pScrPriv->lastSetTime = time; - - /* - * Report Success - */ - rep.status = RRSetConfigSuccess; - -sendReply: - - rep.type = X_Reply; - /* rep.status has already been filled in */ - rep.length = 0; - rep.sequenceNumber = client->sequence; - - rep.newTimestamp = pScrPriv->lastSetTime.milliseconds; - rep.newConfigTimestamp = pScrPriv->lastConfigTime.milliseconds; - rep.root = WindowTable[pDraw->pScreen->myNum]->drawable.id; - - if (client->swapped) - { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.newTimestamp, n); - swapl(&rep.newConfigTimestamp, n); - swapl(&rep.root, n); - } - WriteToClient(client, sizeof(xRRSetScreenConfigReply), (char *)&rep); - - return (client->noClientException); -} - -int -RRSetScreenConfig (ScreenPtr pScreen, - Rotation rotation, - int rate, - RRScreenSizePtr pSize) -{ - rrScrPrivPtr pScrPriv; - int i; - short oldWidth, oldHeight; - - pScrPriv = rrGetScrPriv(pScreen); - - oldWidth = pScreen->width; - oldHeight = pScreen->height; - - if (!RRGetInfo (pScreen)) - return BadAlloc; - - /* - * Validate requested rotation - */ - - /* test the rotation bits only! */ - switch (rotation & 0xf) { - case RR_Rotate_0: - case RR_Rotate_90: - case RR_Rotate_180: - case RR_Rotate_270: - break; - default: - /* - * Invalid rotation - */ - return BadValue; - } - - if ((~pScrPriv->rotations) & rotation) - { - /* - * requested rotation or reflection not supported by screen - */ - return BadMatch; - } - - /* - * Validate requested refresh - */ - if (rate) - { - for (i = 0; i < pSize->nRates; i++) - { - RRScreenRatePtr pRate = &pSize->pRates[i]; - if (pRate->referenced && pRate->rate == rate) - break; - } - if (i == pSize->nRates) - { - /* - * Invalid rate - */ - return BadValue; - } - } - - /* - * call out to ddx routine to effect the change - */ - if (!(*pScrPriv->rrSetConfig) (pScreen, rotation, rate, - pSize)) - { - /* - * unknown DDX failure, report to client - */ - return BadImplementation; - } - - /* - * set current extension configuration pointers - */ - RRSetCurrentConfig (pScreen, rotation, rate, pSize); - - /* - * Deliver ScreenChangeNotify events whenever - * the configuration is updated - */ - WalkTree (pScreen, TellChanged, (pointer) pScreen); - - /* - * Deliver ConfigureNotify events when root changes - * pixel size - */ - if (oldWidth != pScreen->width || oldHeight != pScreen->height) - RRSendConfigNotify (pScreen); - RREditConnectionInfo (pScreen); - - /* - * Fix pointer bounds and location - */ - ScreenRestructured (pScreen); - - return Success; -} - -static int -ProcRRSelectInput (ClientPtr client) -{ - REQUEST(xRRSelectInputReq); - rrClientPriv(client); - RRTimesPtr pTimes; - WindowPtr pWin; - RREventPtr pRREvent, pNewRREvent, *pHead; - XID clientResource; - - REQUEST_SIZE_MATCH(xRRSelectInputReq); - pWin = SecurityLookupWindow (stuff->window, client, SecurityWriteAccess); - if (!pWin) - return BadWindow; - pHead = (RREventPtr *)SecurityLookupIDByType(client, - pWin->drawable.id, EventType, - SecurityWriteAccess); - - if (stuff->enable & (RRScreenChangeNotifyMask)) - { - ScreenPtr pScreen = pWin->drawable.pScreen; - rrScrPriv (pScreen); - - if (pHead) - { - /* check for existing entry. */ - for (pRREvent = *pHead; pRREvent; pRREvent = pRREvent->next) - if (pRREvent->client == client) - return Success; - } - - /* build the entry */ - pNewRREvent = (RREventPtr) xalloc (sizeof (RREventRec)); - if (!pNewRREvent) - return BadAlloc; - pNewRREvent->next = 0; - pNewRREvent->client = client; - pNewRREvent->window = pWin; - pNewRREvent->mask = stuff->enable; - /* - * add a resource that will be deleted when - * the client goes away - */ - clientResource = FakeClientID (client->index); - pNewRREvent->clientResource = clientResource; - if (!AddResource (clientResource, ClientType, (pointer)pNewRREvent)) - 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 = (RREventPtr *) xalloc (sizeof (RREventPtr)); - if (!pHead || - !AddResource (pWin->drawable.id, EventType, (pointer)pHead)) - { - FreeResource (clientResource, RT_NONE); - return BadAlloc; - } - *pHead = 0; - } - pNewRREvent->next = *pHead; - *pHead = pNewRREvent; - /* - * Now see if the client needs an event - */ - if (pScrPriv) - { - pTimes = &((RRTimesPtr) (pRRClient + 1))[pScreen->myNum]; - if (CompareTimeStamps (pTimes->setTime, - pScrPriv->lastSetTime) != 0 || - CompareTimeStamps (pTimes->configTime, - pScrPriv->lastConfigTime) != 0) - { - TellChanged (pWin, (pointer) pScreen); - } - } - } - else if (stuff->enable == xFalse) - { - /* delete the interest */ - if (pHead) { - pNewRREvent = 0; - for (pRREvent = *pHead; pRREvent; pRREvent = pRREvent->next) { - if (pRREvent->client == client) - break; - pNewRREvent = pRREvent; - } - if (pRREvent) { - FreeResource (pRREvent->clientResource, ClientType); - if (pNewRREvent) - pNewRREvent->next = pRREvent->next; - else - *pHead = pRREvent->next; - xfree (pRREvent); - } - } - } - else - { - client->errorValue = stuff->enable; - return BadValue; - } - return Success; -} - - -static int -ProcRRDispatch (ClientPtr client) -{ - REQUEST(xReq); - switch (stuff->data) - { - case X_RRQueryVersion: - return ProcRRQueryVersion(client); - case X_RRSetScreenConfig: - return ProcRRSetScreenConfig(client); - case X_RRSelectInput: - return ProcRRSelectInput(client); - case X_RRGetScreenInfo: - return ProcRRGetScreenInfo(client); - default: - return BadRequest; - } -} - -static int -SProcRRQueryVersion (ClientPtr client) -{ - register int n; - REQUEST(xRRQueryVersionReq); - - swaps(&stuff->length, n); - swapl(&stuff->majorVersion, n); - swapl(&stuff->minorVersion, n); - return ProcRRQueryVersion(client); -} - -static int -SProcRRGetScreenInfo (ClientPtr client) -{ - register int n; - REQUEST(xRRGetScreenInfoReq); - - swaps(&stuff->length, n); - swapl(&stuff->window, n); - return ProcRRGetScreenInfo(client); -} - -static int -SProcRRSetScreenConfig (ClientPtr client) -{ - register int n; - REQUEST(xRRSetScreenConfigReq); - - if (RRClientKnowsRates (client)) - { - REQUEST_SIZE_MATCH (xRRSetScreenConfigReq); - swaps (&stuff->rate, n); - } - else - { - REQUEST_SIZE_MATCH (xRR1_0SetScreenConfigReq); - } - - swaps(&stuff->length, n); - swapl(&stuff->drawable, n); - swapl(&stuff->timestamp, n); - swaps(&stuff->sizeID, n); - swaps(&stuff->rotation, n); - return ProcRRSetScreenConfig(client); -} - -static int -SProcRRSelectInput (ClientPtr client) -{ - register int n; - REQUEST(xRRSelectInputReq); - - swaps(&stuff->length, n); - swapl(&stuff->window, n); - return ProcRRSelectInput(client); -} - - -static int -SProcRRDispatch (ClientPtr client) -{ - REQUEST(xReq); - switch (stuff->data) - { - case X_RRQueryVersion: - return SProcRRQueryVersion(client); - case X_RRSetScreenConfig: - return SProcRRSetScreenConfig(client); - case X_RRSelectInput: - return SProcRRSelectInput(client); - case X_RRGetScreenInfo: - return SProcRRGetScreenInfo(client); - default: - return BadRequest; - } -} - - -static Bool -RRScreenSizeMatches (RRScreenSizePtr a, - RRScreenSizePtr b) -{ - if (a->width != b->width) - return FALSE; - if (a->height != b->height) - return FALSE; - if (a->mmWidth != b->mmWidth) - return FALSE; - if (a->mmHeight != b->mmHeight) - return FALSE; - return TRUE; -} - -RRScreenSizePtr -RRRegisterSize (ScreenPtr pScreen, - short width, - short height, - short mmWidth, - short mmHeight) -{ - rrScrPriv (pScreen); - int i; - RRScreenSize tmp; - RRScreenSizePtr pNew; - - if (!pScrPriv) - return 0; - - /* - * FIXME: The compiler reports that field - * id is used uninitialized here. - */ - - tmp.id = 0; - - tmp.width = width; - tmp.height= height; - tmp.mmWidth = mmWidth; - tmp.mmHeight = mmHeight; - tmp.pRates = 0; - tmp.nRates = 0; - tmp.nRatesInUse = 0; - tmp.referenced = TRUE; - tmp.oldReferenced = FALSE; - for (i = 0; i < pScrPriv->nSizes; i++) - if (RRScreenSizeMatches (&tmp, &pScrPriv->pSizes[i])) - { - pScrPriv->pSizes[i].referenced = TRUE; - return &pScrPriv->pSizes[i]; - } - pNew = xrealloc (pScrPriv->pSizes, - (pScrPriv->nSizes + 1) * sizeof (RRScreenSize)); - if (!pNew) - return 0; - pNew[pScrPriv->nSizes++] = tmp; - pScrPriv->pSizes = pNew; - return &pNew[pScrPriv->nSizes-1]; -} - -Bool RRRegisterRate (ScreenPtr pScreen, - RRScreenSizePtr pSize, - int rate) -{ - rrScrPriv(pScreen); - int i; - RRScreenRatePtr pNew, pRate; - - if (!pScrPriv) - return FALSE; - - for (i = 0; i < pSize->nRates; i++) - { - pRate = &pSize->pRates[i]; - if (pRate->rate == rate) - { - pRate->referenced = TRUE; - return TRUE; - } - } - - pNew = xrealloc (pSize->pRates, - (pSize->nRates + 1) * sizeof (RRScreenRate)); - if (!pNew) - return FALSE; - pRate = &pNew[pSize->nRates++]; - pRate->rate = rate; - pRate->referenced = TRUE; - pRate->oldReferenced = FALSE; - pSize->pRates = pNew; - return TRUE; -} - -void -RRSetCurrentConfig (ScreenPtr pScreen, - Rotation rotation, - int rate, - RRScreenSizePtr pSize) -{ - rrScrPriv (pScreen); - - if (!pScrPriv) - return; - - pScrPriv->rotation = rotation; - pScrPriv->size = pSize - pScrPriv->pSizes; - pScrPriv->rate = rate; -} - diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXrandr.c.NX.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXrandr.c.NX.original deleted file mode 100644 index 5f460f23e..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXrandr.c.NX.original +++ /dev/null @@ -1,1344 +0,0 @@ -/**************************************************************************/ -/* */ -/* Copyright (c) 2001, 2011 NoMachine, http://www.nomachine.com/. */ -/* */ -/* NXAGENT, NX protocol compression and NX extensions to this software */ -/* are copyright of NoMachine. Redistribution and use of the present */ -/* software is allowed according to terms specified in the file LICENSE */ -/* which comes in the source distribution. */ -/* */ -/* Check http://www.nomachine.com/licensing.html for applicability. */ -/* */ -/* NX and NoMachine are trademarks of Medialogic S.p.A. */ -/* */ -/* All rights reserved. */ -/* */ -/**************************************************************************/ - -/* - * $XFree86: xc/programs/Xserver/randr/randr.c,v 1.21tsi Exp $ - * - * Copyright © 2000, Compaq Computer Corporation, - * Copyright © 2002, Hewlett Packard, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Compaq or HP not be used in advertising - * or publicity pertaining to distribution of the software without specific, - * written prior permission. HP makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * HP DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HP - * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Author: Jim Gettys, HP Labs, Hewlett-Packard, Inc. - */ - - -#define NEED_REPLIES -#define NEED_EVENTS -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include "misc.h" -#include "os.h" -#include "dixstruct.h" -#include "resource.h" -#include "scrnintstr.h" -#include "windowstr.h" -#include "pixmapstr.h" -#include "extnsionst.h" -#include "servermd.h" -#include -#include -#include "../../randr/randrstr.h" -#ifdef RENDER -#include /* we share subpixel order information */ -#include "picturestr.h" -#endif -#include -#ifdef EXTMODULE -#include "xf86_ansic.h" -#endif - -/* From render.h */ -#ifndef SubPixelUnknown -#define SubPixelUnknown 0 -#endif - -#define RR_VALIDATE -int RRGeneration; -int RRNScreens; - -static int ProcRRQueryVersion (ClientPtr pClient); -static int ProcRRDispatch (ClientPtr pClient); -static int SProcRRDispatch (ClientPtr pClient); -static int SProcRRQueryVersion (ClientPtr pClient); - -#define wrap(priv,real,mem,func) {\ - priv->mem = real->mem; \ - real->mem = func; \ -} - -#define unwrap(priv,real,mem) {\ - real->mem = priv->mem; \ -} - -#if 0 -static CARD8 RRReqCode; -static int RRErrBase; -#endif -static int RREventBase; -static RESTYPE ClientType, EventType; /* resource types for event masks */ -static int RRClientPrivateIndex; - -typedef struct _RRTimes { - TimeStamp setTime; - TimeStamp configTime; -} RRTimesRec, *RRTimesPtr; - -typedef struct _RRClient { - int major_version; - int minor_version; -/* RRTimesRec times[0]; */ -} RRClientRec, *RRClientPtr; - -/* - * each window has a list of clients requesting - * RRNotify events. Each client has a resource - * for each window it selects RRNotify input for, - * this resource is used to delete the RRNotifyRec - * entry from the per-window queue. - */ - -typedef struct _RREvent *RREventPtr; - -typedef struct _RREvent { - RREventPtr next; - ClientPtr client; - WindowPtr window; - XID clientResource; - int mask; -} RREventRec; - -int rrPrivIndex = -1; - -#define GetRRClient(pClient) ((RRClientPtr) (pClient)->devPrivates[RRClientPrivateIndex].ptr) -#define rrClientPriv(pClient) RRClientPtr pRRClient = GetRRClient(pClient) - -static Bool -RRClientKnowsRates (ClientPtr pClient) -{ - rrClientPriv(pClient); - - return (pRRClient->major_version > 1 || - (pRRClient->major_version == 1 && pRRClient->minor_version >= 1)); -} - -static void -RRClientCallback (CallbackListPtr *list, - pointer closure, - pointer data) -{ - NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; - ClientPtr pClient = clientinfo->client; - rrClientPriv(pClient); - RRTimesPtr pTimes = (RRTimesPtr) (pRRClient + 1); - int i; - - pRRClient->major_version = 0; - pRRClient->minor_version = 0; - for (i = 0; i < screenInfo.numScreens; i++) - { - ScreenPtr pScreen = screenInfo.screens[i]; - rrScrPriv(pScreen); - - if (pScrPriv) - { - pTimes[i].setTime = pScrPriv->lastSetTime; - pTimes[i].configTime = pScrPriv->lastConfigTime; - } - } -} - -static void -RRResetProc (ExtensionEntry *extEntry) -{ -} - -static Bool -RRCloseScreen (int i, ScreenPtr pScreen) -{ - rrScrPriv(pScreen); - - unwrap (pScrPriv, pScreen, CloseScreen); - if (pScrPriv->pSizes) - xfree (pScrPriv->pSizes); - xfree (pScrPriv); - RRNScreens -= 1; /* ok, one fewer screen with RandR running */ - return (*pScreen->CloseScreen) (i, pScreen); -} - -static void -SRRScreenChangeNotifyEvent(xRRScreenChangeNotifyEvent *from, - xRRScreenChangeNotifyEvent *to) -{ - to->type = from->type; - to->rotation = from->rotation; - cpswaps(from->sequenceNumber, to->sequenceNumber); - cpswapl(from->timestamp, to->timestamp); - cpswapl(from->configTimestamp, to->configTimestamp); - cpswapl(from->root, to->root); - cpswapl(from->window, to->window); - cpswaps(from->sizeID, to->sizeID); - cpswaps(from->widthInPixels, to->widthInPixels); - cpswaps(from->heightInPixels, to->heightInPixels); - cpswaps(from->widthInMillimeters, to->widthInMillimeters); - cpswaps(from->heightInMillimeters, to->heightInMillimeters); - cpswaps(from->subpixelOrder, to->subpixelOrder); -} - -Bool RRScreenInit(ScreenPtr pScreen) -{ - rrScrPrivPtr pScrPriv; - - if (RRGeneration != serverGeneration) - { - if ((rrPrivIndex = AllocateScreenPrivateIndex()) < 0) - return FALSE; - RRGeneration = serverGeneration; - } - - pScrPriv = (rrScrPrivPtr) xalloc (sizeof (rrScrPrivRec)); - if (!pScrPriv) - return FALSE; - - SetRRScreen(pScreen, pScrPriv); - - /* - * Calling function best set these function vectors - */ - pScrPriv->rrSetConfig = 0; - pScrPriv->rrGetInfo = 0; - /* - * This value doesn't really matter -- any client must call - * GetScreenInfo before reading it which will automatically update - * the time - */ - pScrPriv->lastSetTime = currentTime; - pScrPriv->lastConfigTime = currentTime; - - wrap (pScrPriv, pScreen, CloseScreen, RRCloseScreen); - - pScrPriv->rotations = RR_Rotate_0; - - pScrPriv->nSizes = 0; - pScrPriv->nSizesInUse = 0; - pScrPriv->pSizes = 0; - - pScrPriv->rotation = RR_Rotate_0; - pScrPriv->size = -1; - - RRNScreens += 1; /* keep count of screens that implement randr */ - return TRUE; -} - -/*ARGSUSED*/ -static int -RRFreeClient (pointer data, XID id) -{ - RREventPtr pRREvent; - WindowPtr pWin; - RREventPtr *pHead, pCur, pPrev; - - pRREvent = (RREventPtr) data; - pWin = pRREvent->window; - pHead = (RREventPtr *) LookupIDByType(pWin->drawable.id, EventType); - if (pHead) { - pPrev = 0; - for (pCur = *pHead; pCur && pCur != pRREvent; pCur=pCur->next) - pPrev = pCur; - if (pCur) - { - if (pPrev) - pPrev->next = pRREvent->next; - else - *pHead = pRREvent->next; - } - } - xfree ((pointer) pRREvent); - return 1; -} - -/*ARGSUSED*/ -static int -RRFreeEvents (pointer data, XID id) -{ - RREventPtr *pHead, pCur, pNext; - - pHead = (RREventPtr *) data; - for (pCur = *pHead; pCur; pCur = pNext) { - pNext = pCur->next; - FreeResource (pCur->clientResource, ClientType); - xfree ((pointer) pCur); - } - xfree ((pointer) pHead); - return 1; -} - -void -RRExtensionInit (void) -{ - ExtensionEntry *extEntry; - - if (RRNScreens == 0) return; - - RRClientPrivateIndex = AllocateClientPrivateIndex (); - if (!AllocateClientPrivate (RRClientPrivateIndex, - sizeof (RRClientRec) + - screenInfo.numScreens * sizeof (RRTimesRec))) - return; - if (!AddCallback (&ClientStateCallback, RRClientCallback, 0)) - return; - - ClientType = CreateNewResourceType(RRFreeClient); - if (!ClientType) - return; - EventType = CreateNewResourceType(RRFreeEvents); - if (!EventType) - return; - extEntry = AddExtension (RANDR_NAME, RRNumberEvents, RRNumberErrors, - ProcRRDispatch, SProcRRDispatch, - RRResetProc, StandardMinorOpcode); - if (!extEntry) - return; -#if 0 - RRReqCode = (CARD8) extEntry->base; - RRErrBase = extEntry->errorBase; -#endif - RREventBase = extEntry->eventBase; - EventSwapVector[RREventBase + RRScreenChangeNotify] = (EventSwapPtr) - SRRScreenChangeNotifyEvent; - - return; -} - -int -TellChanged (WindowPtr pWin, pointer value) -{ - RREventPtr *pHead, pRREvent; - ClientPtr client; - xRRScreenChangeNotifyEvent se; - ScreenPtr pScreen = pWin->drawable.pScreen; - rrScrPriv(pScreen); - RRScreenSizePtr pSize; - WindowPtr pRoot = WindowTable[pScreen->myNum]; - - pHead = (RREventPtr *) LookupIDByType (pWin->drawable.id, EventType); - if (!pHead) - return WT_WALKCHILDREN; - - se.type = RRScreenChangeNotify + RREventBase; - se.rotation = (CARD8) pScrPriv->rotation; - se.timestamp = pScrPriv->lastSetTime.milliseconds; - se.configTimestamp = pScrPriv->lastConfigTime.milliseconds; - se.root = pRoot->drawable.id; - se.window = pWin->drawable.id; -#ifdef RENDER - se.subpixelOrder = PictureGetSubpixelOrder (pScreen); -#else - se.subpixelOrder = SubPixelUnknown; -#endif - if (pScrPriv->size >= 0) - { - pSize = &pScrPriv->pSizes[pScrPriv->size]; - se.sizeID = pSize->id; - se.widthInPixels = pSize->width; - se.heightInPixels = pSize->height; - se.widthInMillimeters = pSize->mmWidth; - se.heightInMillimeters = pSize->mmHeight; - } - else - { - /* - * This "shouldn't happen", but a broken DDX can - * forget to set the current configuration on GetInfo - */ - se.sizeID = 0xffff; - se.widthInPixels = 0; - se.heightInPixels = 0; - se.widthInMillimeters = 0; - se.heightInMillimeters = 0; - } - for (pRREvent = *pHead; pRREvent; pRREvent = pRREvent->next) - { - client = pRREvent->client; - if (client == serverClient || client->clientGone) - continue; - se.sequenceNumber = client->sequence; - if(pRREvent->mask & RRScreenChangeNotifyMask) - WriteEventsToClient (client, 1, (xEvent *) &se); - } - return WT_WALKCHILDREN; -} - -Bool -RRGetInfo (ScreenPtr pScreen) -{ - rrScrPriv (pScreen); - int i, j, k, l; - Bool changed; - Rotation rotations; - RRScreenSizePtr pSize; - RRScreenRatePtr pRate; - - for (i = 0; i < pScrPriv->nSizes; i++) - { - pSize = &pScrPriv->pSizes[i]; - pSize->oldReferenced = pSize->referenced; - pSize->referenced = FALSE; - for (k = 0; k < pSize->nRates; k++) - { - pRate = &pSize->pRates[k]; - pRate->oldReferenced = pRate->referenced; - pRate->referenced = FALSE; - } - } - if (!(*pScrPriv->rrGetInfo) (pScreen, &rotations)) - return FALSE; - - changed = FALSE; - - /* - * Check whether anything changed and simultaneously generate - * the protocol id values for the objects - */ - if (rotations != pScrPriv->rotations) - { - pScrPriv->rotations = rotations; - changed = TRUE; - } - - j = 0; - for (i = 0; i < pScrPriv->nSizes; i++) - { - pSize = &pScrPriv->pSizes[i]; - if (pSize->oldReferenced != pSize->referenced) - changed = TRUE; - if (pSize->referenced) - pSize->id = j++; - l = 0; - for (k = 0; k < pSize->nRates; k++) - { - pRate = &pSize->pRates[k]; - if (pRate->oldReferenced != pRate->referenced) - changed = TRUE; - if (pRate->referenced) - l++; - } - pSize->nRatesInUse = l; - } - pScrPriv->nSizesInUse = j; - if (changed) - { - UpdateCurrentTime (); - pScrPriv->lastConfigTime = currentTime; - WalkTree (pScreen, TellChanged, (pointer) pScreen); - } - return TRUE; -} - -void -RRSendConfigNotify (ScreenPtr pScreen) -{ - WindowPtr pWin = WindowTable[pScreen->myNum]; - xEvent event; - - event.u.u.type = ConfigureNotify; - event.u.configureNotify.window = pWin->drawable.id; - event.u.configureNotify.aboveSibling = None; - event.u.configureNotify.x = 0; - event.u.configureNotify.y = 0; - - /* XXX xinerama stuff ? */ - - event.u.configureNotify.width = pWin->drawable.width; - event.u.configureNotify.height = pWin->drawable.height; - event.u.configureNotify.borderWidth = wBorderWidth (pWin); - event.u.configureNotify.override = pWin->overrideRedirect; - DeliverEvents(pWin, &event, 1, NullWindow); -} - -static int -ProcRRQueryVersion (ClientPtr client) -{ - xRRQueryVersionReply rep; - register int n; - REQUEST(xRRQueryVersionReq); - rrClientPriv(client); - - REQUEST_SIZE_MATCH(xRRQueryVersionReq); - pRRClient->major_version = stuff->majorVersion; - pRRClient->minor_version = stuff->minorVersion; - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.majorVersion = RANDR_MAJOR; - rep.minorVersion = RANDR_MINOR; - if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.majorVersion, n); - swapl(&rep.minorVersion, n); - } - WriteToClient(client, sizeof(xRRQueryVersionReply), (char *)&rep); - return (client->noClientException); -} - - -extern char *ConnectionInfo; - -static int padlength[4] = {0, 3, 2, 1}; - -void -RREditConnectionInfo (ScreenPtr pScreen) -{ - xConnSetup *connSetup; - char *vendor; - xPixmapFormat *formats; - xWindowRoot *root; - xDepth *depth; - xVisualType *visual; - int screen = 0; - int d; - - connSetup = (xConnSetup *) ConnectionInfo; - vendor = (char *) connSetup + sizeof (xConnSetup); - formats = (xPixmapFormat *) ((char *) vendor + - connSetup->nbytesVendor + - padlength[connSetup->nbytesVendor & 3]); - root = (xWindowRoot *) ((char *) formats + - sizeof (xPixmapFormat) * screenInfo.numPixmapFormats); - while (screen != pScreen->myNum) - { - depth = (xDepth *) ((char *) root + - sizeof (xWindowRoot)); - for (d = 0; d < root->nDepths; d++) - { - visual = (xVisualType *) ((char *) depth + - sizeof (xDepth)); - depth = (xDepth *) ((char *) visual + - depth->nVisuals * sizeof (xVisualType)); - } - root = (xWindowRoot *) ((char *) depth); - screen++; - } - root->pixWidth = pScreen->width; - root->pixHeight = pScreen->height; - root->mmWidth = pScreen->mmWidth; - root->mmHeight = pScreen->mmHeight; -} - -static int -ProcRRGetScreenInfo (ClientPtr client) -{ - REQUEST(xRRGetScreenInfoReq); - xRRGetScreenInfoReply rep; - WindowPtr pWin; - int n; - ScreenPtr pScreen; - rrScrPrivPtr pScrPriv; - CARD8 *extra; - unsigned long extraLen; - - REQUEST_SIZE_MATCH(xRRGetScreenInfoReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityReadAccess); - - if (!pWin) - return BadWindow; - - pScreen = pWin->drawable.pScreen; - pScrPriv = rrGetScrPriv(pScreen); - rep.pad = 0; - if (!pScrPriv) - { - rep.type = X_Reply; - rep.setOfRotations = RR_Rotate_0;; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.root = WindowTable[pWin->drawable.pScreen->myNum]->drawable.id; - rep.timestamp = currentTime.milliseconds; - rep.configTimestamp = currentTime.milliseconds; - rep.nSizes = 0; - rep.sizeID = 0; - rep.rotation = RR_Rotate_0; - rep.rate = 0; - rep.nrateEnts = 0; - extra = 0; - extraLen = 0; - } - else - { - int i, j; - xScreenSizes *size; - CARD16 *rates; - CARD8 *data8; - Bool has_rate = RRClientKnowsRates (client); - - RRGetInfo (pScreen); - - rep.type = X_Reply; - rep.setOfRotations = pScrPriv->rotations; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.root = WindowTable[pWin->drawable.pScreen->myNum]->drawable.id; - rep.timestamp = pScrPriv->lastSetTime.milliseconds; - rep.configTimestamp = pScrPriv->lastConfigTime.milliseconds; - rep.rotation = pScrPriv->rotation; - rep.nSizes = pScrPriv->nSizesInUse; - rep.rate = pScrPriv->rate; - rep.nrateEnts = 0; - if (has_rate) - { - for (i = 0; i < pScrPriv->nSizes; i++) - { - RRScreenSizePtr pSize = &pScrPriv->pSizes[i]; - if (pSize->referenced) - { - rep.nrateEnts += (1 + pSize->nRatesInUse); - } - } - } - - if (pScrPriv->size >= 0) - rep.sizeID = pScrPriv->pSizes[pScrPriv->size].id; - else - return BadImplementation; - - extraLen = (rep.nSizes * sizeof (xScreenSizes) + - rep.nrateEnts * sizeof (CARD16)); - - extra = (CARD8 *) xalloc (extraLen); - if (!extra) - return BadAlloc; - /* - * First comes the size information - */ - size = (xScreenSizes *) extra; - rates = (CARD16 *) (size + rep.nSizes); - for (i = 0; i < pScrPriv->nSizes; i++) - { - RRScreenSizePtr pSize = &pScrPriv->pSizes[i]; - if (pSize->referenced) - { - size->widthInPixels = pSize->width; - size->heightInPixels = pSize->height; - size->widthInMillimeters = pSize->mmWidth; - size->heightInMillimeters = pSize->mmHeight; - if (client->swapped) - { - swaps (&size->widthInPixels, n); - swaps (&size->heightInPixels, n); - swaps (&size->widthInMillimeters, n); - swaps (&size->heightInMillimeters, n); - } - size++; - if (has_rate) - { - *rates = pSize->nRatesInUse; - if (client->swapped) - { - swaps (rates, n); - } - rates++; - for (j = 0; j < pSize->nRates; j++) - { - RRScreenRatePtr pRate = &pSize->pRates[j]; - if (pRate->referenced) - { - *rates = pRate->rate; - if (client->swapped) - { - swaps (rates, n); - } - rates++; - } - } - } - } - } - data8 = (CARD8 *) rates; - - if (data8 - (CARD8 *) extra != extraLen) - FatalError ("RRGetScreenInfo bad extra len %ld != %ld\n", - (unsigned long)(data8 - (CARD8 *) extra), extraLen); - rep.length = (extraLen + 3) >> 2; - } - if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.timestamp, n); - swaps(&rep.rotation, n); - swaps(&rep.nSizes, n); - swaps(&rep.sizeID, n); - swaps(&rep.rate, n); - swaps(&rep.nrateEnts, n); - } - WriteToClient(client, sizeof(xRRGetScreenInfoReply), (char *)&rep); - if (extraLen) - { - WriteToClient (client, extraLen, (char *) extra); - xfree (extra); - } - return (client->noClientException); -} - -static int -ProcRRSetScreenConfig (ClientPtr client) -{ - REQUEST(xRRSetScreenConfigReq); - xRRSetScreenConfigReply rep; - DrawablePtr pDraw; - int n; - ScreenPtr pScreen; - rrScrPrivPtr pScrPriv; - TimeStamp configTime; - TimeStamp time; - RRScreenSizePtr pSize; - int i; - Rotation rotation; - int rate; - short oldWidth, oldHeight; - Bool has_rate; - - UpdateCurrentTime (); - - if (RRClientKnowsRates (client)) - { - REQUEST_SIZE_MATCH (xRRSetScreenConfigReq); - has_rate = TRUE; - } - else - { - REQUEST_SIZE_MATCH (xRR1_0SetScreenConfigReq); - has_rate = FALSE; - } - - SECURITY_VERIFY_DRAWABLE(pDraw, stuff->drawable, client, - SecurityWriteAccess); - - pScreen = pDraw->pScreen; - - pScrPriv = rrGetScrPriv(pScreen); - - time = ClientTimeToServerTime(stuff->timestamp); - configTime = ClientTimeToServerTime(stuff->configTimestamp); - - oldWidth = pScreen->width; - oldHeight = pScreen->height; - - if (!pScrPriv) - { - time = currentTime; - rep.status = RRSetConfigFailed; - goto sendReply; - } - if (!RRGetInfo (pScreen)) - return BadAlloc; - - /* - * if the client's config timestamp is not the same as the last config - * timestamp, then the config information isn't up-to-date and - * can't even be validated - */ - if (CompareTimeStamps (configTime, pScrPriv->lastConfigTime) != 0) - { - rep.status = RRSetConfigInvalidConfigTime; - goto sendReply; - } - - /* - * Search for the requested size - */ - pSize = 0; - for (i = 0; i < pScrPriv->nSizes; i++) - { - pSize = &pScrPriv->pSizes[i]; - if (pSize->referenced && pSize->id == stuff->sizeID) - { - break; - } - } - if (i == pScrPriv->nSizes) - { - /* - * Invalid size ID - */ - client->errorValue = stuff->sizeID; - return BadValue; - } - - /* - * Validate requested rotation - */ - rotation = (Rotation) stuff->rotation; - - /* test the rotation bits only! */ - switch (rotation & 0xf) { - case RR_Rotate_0: - case RR_Rotate_90: - case RR_Rotate_180: - case RR_Rotate_270: - break; - default: - /* - * Invalid rotation - */ - client->errorValue = stuff->rotation; - return BadValue; - } - - if ((~pScrPriv->rotations) & rotation) - { - /* - * requested rotation or reflection not supported by screen - */ - client->errorValue = stuff->rotation; - return BadMatch; - } - - /* - * Validate requested refresh - */ - if (has_rate) - rate = (int) stuff->rate; - else - rate = 0; - - if (rate) - { - for (i = 0; i < pSize->nRates; i++) - { - RRScreenRatePtr pRate = &pSize->pRates[i]; - if (pRate->referenced && pRate->rate == rate) - break; - } - if (i == pSize->nRates) - { - /* - * Invalid rate - */ - client->errorValue = rate; - return BadValue; - } - } - - /* - * Make sure the requested set-time is not older than - * the last set-time - */ - if (CompareTimeStamps (time, pScrPriv->lastSetTime) < 0) - { - rep.status = RRSetConfigInvalidTime; - goto sendReply; - } - - /* - * call out to ddx routine to effect the change - */ - if (!(*pScrPriv->rrSetConfig) (pScreen, rotation, rate, - pSize)) - { - /* - * unknown DDX failure, report to client - */ - rep.status = RRSetConfigFailed; - goto sendReply; - } - - /* - * set current extension configuration pointers - */ - RRSetCurrentConfig (pScreen, rotation, rate, pSize); - - /* - * Deliver ScreenChangeNotify events whenever - * the configuration is updated - */ - WalkTree (pScreen, TellChanged, (pointer) pScreen); - - /* - * Deliver ConfigureNotify events when root changes - * pixel size - */ - if (oldWidth != pScreen->width || oldHeight != pScreen->height) - RRSendConfigNotify (pScreen); - RREditConnectionInfo (pScreen); - - /* - * Fix pointer bounds and location - */ - ScreenRestructured (pScreen); - pScrPriv->lastSetTime = time; - - /* - * Report Success - */ - rep.status = RRSetConfigSuccess; - -sendReply: - - rep.type = X_Reply; - /* rep.status has already been filled in */ - rep.length = 0; - rep.sequenceNumber = client->sequence; - - rep.newTimestamp = pScrPriv->lastSetTime.milliseconds; - rep.newConfigTimestamp = pScrPriv->lastConfigTime.milliseconds; - rep.root = WindowTable[pDraw->pScreen->myNum]->drawable.id; - - if (client->swapped) - { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.newTimestamp, n); - swapl(&rep.newConfigTimestamp, n); - swapl(&rep.root, n); - } - WriteToClient(client, sizeof(xRRSetScreenConfigReply), (char *)&rep); - - return (client->noClientException); -} - -int -RRSetScreenConfig (ScreenPtr pScreen, - Rotation rotation, - int rate, - RRScreenSizePtr pSize) -{ - rrScrPrivPtr pScrPriv; - int i; - short oldWidth, oldHeight; - - pScrPriv = rrGetScrPriv(pScreen); - - oldWidth = pScreen->width; - oldHeight = pScreen->height; - - if (!RRGetInfo (pScreen)) - return BadAlloc; - - /* - * Validate requested rotation - */ - - /* test the rotation bits only! */ - switch (rotation & 0xf) { - case RR_Rotate_0: - case RR_Rotate_90: - case RR_Rotate_180: - case RR_Rotate_270: - break; - default: - /* - * Invalid rotation - */ - return BadValue; - } - - if ((~pScrPriv->rotations) & rotation) - { - /* - * requested rotation or reflection not supported by screen - */ - return BadMatch; - } - - /* - * Validate requested refresh - */ - if (rate) - { - for (i = 0; i < pSize->nRates; i++) - { - RRScreenRatePtr pRate = &pSize->pRates[i]; - if (pRate->referenced && pRate->rate == rate) - break; - } - if (i == pSize->nRates) - { - /* - * Invalid rate - */ - return BadValue; - } - } - - /* - * call out to ddx routine to effect the change - */ - if (!(*pScrPriv->rrSetConfig) (pScreen, rotation, rate, - pSize)) - { - /* - * unknown DDX failure, report to client - */ - return BadImplementation; - } - - /* - * set current extension configuration pointers - */ - RRSetCurrentConfig (pScreen, rotation, rate, pSize); - - /* - * Deliver ScreenChangeNotify events whenever - * the configuration is updated - */ - WalkTree (pScreen, TellChanged, (pointer) pScreen); - - /* - * Deliver ConfigureNotify events when root changes - * pixel size - */ - if (oldWidth != pScreen->width || oldHeight != pScreen->height) - RRSendConfigNotify (pScreen); - RREditConnectionInfo (pScreen); - - /* - * Fix pointer bounds and location - */ - ScreenRestructured (pScreen); - - return Success; -} - -static int -ProcRRSelectInput (ClientPtr client) -{ - REQUEST(xRRSelectInputReq); - rrClientPriv(client); - RRTimesPtr pTimes; - WindowPtr pWin; - RREventPtr pRREvent, pNewRREvent, *pHead; - XID clientResource; - - REQUEST_SIZE_MATCH(xRRSelectInputReq); - pWin = SecurityLookupWindow (stuff->window, client, SecurityWriteAccess); - if (!pWin) - return BadWindow; - pHead = (RREventPtr *)SecurityLookupIDByType(client, - pWin->drawable.id, EventType, - SecurityWriteAccess); - - if (stuff->enable & (RRScreenChangeNotifyMask)) - { - ScreenPtr pScreen = pWin->drawable.pScreen; - rrScrPriv (pScreen); - - if (pHead) - { - /* check for existing entry. */ - for (pRREvent = *pHead; pRREvent; pRREvent = pRREvent->next) - if (pRREvent->client == client) - return Success; - } - - /* build the entry */ - pNewRREvent = (RREventPtr) xalloc (sizeof (RREventRec)); - if (!pNewRREvent) - return BadAlloc; - pNewRREvent->next = 0; - pNewRREvent->client = client; - pNewRREvent->window = pWin; - pNewRREvent->mask = stuff->enable; - /* - * add a resource that will be deleted when - * the client goes away - */ - clientResource = FakeClientID (client->index); - pNewRREvent->clientResource = clientResource; - if (!AddResource (clientResource, ClientType, (pointer)pNewRREvent)) - 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 = (RREventPtr *) xalloc (sizeof (RREventPtr)); - if (!pHead || - !AddResource (pWin->drawable.id, EventType, (pointer)pHead)) - { - FreeResource (clientResource, RT_NONE); - return BadAlloc; - } - *pHead = 0; - } - pNewRREvent->next = *pHead; - *pHead = pNewRREvent; - /* - * Now see if the client needs an event - */ - if (pScrPriv) - { - pTimes = &((RRTimesPtr) (pRRClient + 1))[pScreen->myNum]; - if (CompareTimeStamps (pTimes->setTime, - pScrPriv->lastSetTime) != 0 || - CompareTimeStamps (pTimes->configTime, - pScrPriv->lastConfigTime) != 0) - { - TellChanged (pWin, (pointer) pScreen); - } - } - } - else if (stuff->enable == xFalse) - { - /* delete the interest */ - if (pHead) { - pNewRREvent = 0; - for (pRREvent = *pHead; pRREvent; pRREvent = pRREvent->next) { - if (pRREvent->client == client) - break; - pNewRREvent = pRREvent; - } - if (pRREvent) { - FreeResource (pRREvent->clientResource, ClientType); - if (pNewRREvent) - pNewRREvent->next = pRREvent->next; - else - *pHead = pRREvent->next; - xfree (pRREvent); - } - } - } - else - { - client->errorValue = stuff->enable; - return BadValue; - } - return Success; -} - - -static int -ProcRRDispatch (ClientPtr client) -{ - REQUEST(xReq); - switch (stuff->data) - { - case X_RRQueryVersion: - return ProcRRQueryVersion(client); - case X_RRSetScreenConfig: - return ProcRRSetScreenConfig(client); - case X_RRSelectInput: - return ProcRRSelectInput(client); - case X_RRGetScreenInfo: - return ProcRRGetScreenInfo(client); - default: - return BadRequest; - } -} - -static int -SProcRRQueryVersion (ClientPtr client) -{ - register int n; - REQUEST(xRRQueryVersionReq); - - swaps(&stuff->length, n); - swapl(&stuff->majorVersion, n); - swapl(&stuff->minorVersion, n); - return ProcRRQueryVersion(client); -} - -static int -SProcRRGetScreenInfo (ClientPtr client) -{ - register int n; - REQUEST(xRRGetScreenInfoReq); - - swaps(&stuff->length, n); - swapl(&stuff->window, n); - return ProcRRGetScreenInfo(client); -} - -static int -SProcRRSetScreenConfig (ClientPtr client) -{ - register int n; - REQUEST(xRRSetScreenConfigReq); - - if (RRClientKnowsRates (client)) - { - REQUEST_SIZE_MATCH (xRRSetScreenConfigReq); - swaps (&stuff->rate, n); - } - else - { - REQUEST_SIZE_MATCH (xRR1_0SetScreenConfigReq); - } - - swaps(&stuff->length, n); - swapl(&stuff->drawable, n); - swapl(&stuff->timestamp, n); - swaps(&stuff->sizeID, n); - swaps(&stuff->rotation, n); - return ProcRRSetScreenConfig(client); -} - -static int -SProcRRSelectInput (ClientPtr client) -{ - register int n; - REQUEST(xRRSelectInputReq); - - swaps(&stuff->length, n); - swapl(&stuff->window, n); - return ProcRRSelectInput(client); -} - - -static int -SProcRRDispatch (ClientPtr client) -{ - REQUEST(xReq); - switch (stuff->data) - { - case X_RRQueryVersion: - return SProcRRQueryVersion(client); - case X_RRSetScreenConfig: - return SProcRRSetScreenConfig(client); - case X_RRSelectInput: - return SProcRRSelectInput(client); - case X_RRGetScreenInfo: - return SProcRRGetScreenInfo(client); - default: - return BadRequest; - } -} - - -static Bool -RRScreenSizeMatches (RRScreenSizePtr a, - RRScreenSizePtr b) -{ - if (a->width != b->width) - return FALSE; - if (a->height != b->height) - return FALSE; - if (a->mmWidth != b->mmWidth) - return FALSE; - if (a->mmHeight != b->mmHeight) - return FALSE; - return TRUE; -} - -RRScreenSizePtr -RRRegisterSize (ScreenPtr pScreen, - short width, - short height, - short mmWidth, - short mmHeight) -{ - rrScrPriv (pScreen); - int i; - RRScreenSize tmp; - RRScreenSizePtr pNew; - - if (!pScrPriv) - return 0; - - /* - * FIXME: The compiler reports that field - * id is used uninitialized here. - */ - - tmp.id = 0; - - tmp.width = width; - tmp.height= height; - tmp.mmWidth = mmWidth; - tmp.mmHeight = mmHeight; - tmp.pRates = 0; - tmp.nRates = 0; - tmp.nRatesInUse = 0; - tmp.referenced = TRUE; - tmp.oldReferenced = FALSE; - for (i = 0; i < pScrPriv->nSizes; i++) - if (RRScreenSizeMatches (&tmp, &pScrPriv->pSizes[i])) - { - pScrPriv->pSizes[i].referenced = TRUE; - return &pScrPriv->pSizes[i]; - } - pNew = xrealloc (pScrPriv->pSizes, - (pScrPriv->nSizes + 1) * sizeof (RRScreenSize)); - if (!pNew) - return 0; - pNew[pScrPriv->nSizes++] = tmp; - pScrPriv->pSizes = pNew; - return &pNew[pScrPriv->nSizes-1]; -} - -Bool RRRegisterRate (ScreenPtr pScreen, - RRScreenSizePtr pSize, - int rate) -{ - rrScrPriv(pScreen); - int i; - RRScreenRatePtr pNew, pRate; - - if (!pScrPriv) - return FALSE; - - for (i = 0; i < pSize->nRates; i++) - { - pRate = &pSize->pRates[i]; - if (pRate->rate == rate) - { - pRate->referenced = TRUE; - return TRUE; - } - } - - pNew = xrealloc (pSize->pRates, - (pSize->nRates + 1) * sizeof (RRScreenRate)); - if (!pNew) - return FALSE; - pRate = &pNew[pSize->nRates++]; - pRate->rate = rate; - pRate->referenced = TRUE; - pRate->oldReferenced = FALSE; - pSize->pRates = pNew; - return TRUE; -} - -void -RRSetCurrentConfig (ScreenPtr pScreen, - Rotation rotation, - int rate, - RRScreenSizePtr pSize) -{ - rrScrPriv (pScreen); - - if (!pScrPriv) - return; - - pScrPriv->rotation = rotation; - pScrPriv->size = pSize - pScrPriv->pSizes; - pScrPriv->rate = rate; -} - diff --git a/nx-X11/programs/Xserver/hw/nxagent/X/NXrandr.c.X.original b/nx-X11/programs/Xserver/hw/nxagent/X/NXrandr.c.X.original deleted file mode 100644 index 3911a3498..000000000 --- a/nx-X11/programs/Xserver/hw/nxagent/X/NXrandr.c.X.original +++ /dev/null @@ -1,1319 +0,0 @@ -/* - * $XFree86: xc/programs/Xserver/randr/randr.c,v 1.21tsi Exp $ - * - * Copyright © 2000, Compaq Computer Corporation, - * Copyright © 2002, Hewlett Packard, Inc. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Compaq or HP not be used in advertising - * or publicity pertaining to distribution of the software without specific, - * written prior permission. HP makes no representations about the - * suitability of this software for any purpose. It is provided "as is" - * without express or implied warranty. - * - * HP DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HP - * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - * Author: Jim Gettys, HP Labs, Hewlett-Packard, Inc. - */ - - -#define NEED_REPLIES -#define NEED_EVENTS -#ifdef HAVE_DIX_CONFIG_H -#include -#endif - -#include -#include -#include "misc.h" -#include "os.h" -#include "dixstruct.h" -#include "resource.h" -#include "scrnintstr.h" -#include "windowstr.h" -#include "pixmapstr.h" -#include "extnsionst.h" -#include "servermd.h" -#include -#include -#include "randrstr.h" -#ifdef RENDER -#include /* we share subpixel order information */ -#include "picturestr.h" -#endif -#include -#ifdef EXTMODULE -#include "xf86_ansic.h" -#endif - -/* From render.h */ -#ifndef SubPixelUnknown -#define SubPixelUnknown 0 -#endif - -#define RR_VALIDATE -int RRGeneration; -int RRNScreens; - -static int ProcRRQueryVersion (ClientPtr pClient); -static int ProcRRDispatch (ClientPtr pClient); -static int SProcRRDispatch (ClientPtr pClient); -static int SProcRRQueryVersion (ClientPtr pClient); - -#define wrap(priv,real,mem,func) {\ - priv->mem = real->mem; \ - real->mem = func; \ -} - -#define unwrap(priv,real,mem) {\ - real->mem = priv->mem; \ -} - -#if 0 -static CARD8 RRReqCode; -static int RRErrBase; -#endif -static int RREventBase; -static RESTYPE ClientType, EventType; /* resource types for event masks */ -static int RRClientPrivateIndex; - -typedef struct _RRTimes { - TimeStamp setTime; - TimeStamp configTime; -} RRTimesRec, *RRTimesPtr; - -typedef struct _RRClient { - int major_version; - int minor_version; -/* RRTimesRec times[0]; */ -} RRClientRec, *RRClientPtr; - -/* - * each window has a list of clients requesting - * RRNotify events. Each client has a resource - * for each window it selects RRNotify input for, - * this resource is used to delete the RRNotifyRec - * entry from the per-window queue. - */ - -typedef struct _RREvent *RREventPtr; - -typedef struct _RREvent { - RREventPtr next; - ClientPtr client; - WindowPtr window; - XID clientResource; - int mask; -} RREventRec; - -int rrPrivIndex = -1; - -#define GetRRClient(pClient) ((RRClientPtr) (pClient)->devPrivates[RRClientPrivateIndex].ptr) -#define rrClientPriv(pClient) RRClientPtr pRRClient = GetRRClient(pClient) - -static Bool -RRClientKnowsRates (ClientPtr pClient) -{ - rrClientPriv(pClient); - - return (pRRClient->major_version > 1 || - (pRRClient->major_version == 1 && pRRClient->minor_version >= 1)); -} - -static void -RRClientCallback (CallbackListPtr *list, - pointer closure, - pointer data) -{ - NewClientInfoRec *clientinfo = (NewClientInfoRec *) data; - ClientPtr pClient = clientinfo->client; - rrClientPriv(pClient); - RRTimesPtr pTimes = (RRTimesPtr) (pRRClient + 1); - int i; - - pRRClient->major_version = 0; - pRRClient->minor_version = 0; - for (i = 0; i < screenInfo.numScreens; i++) - { - ScreenPtr pScreen = screenInfo.screens[i]; - rrScrPriv(pScreen); - - if (pScrPriv) - { - pTimes[i].setTime = pScrPriv->lastSetTime; - pTimes[i].configTime = pScrPriv->lastConfigTime; - } - } -} - -static void -RRResetProc (ExtensionEntry *extEntry) -{ -} - -static Bool -RRCloseScreen (int i, ScreenPtr pScreen) -{ - rrScrPriv(pScreen); - - unwrap (pScrPriv, pScreen, CloseScreen); - if (pScrPriv->pSizes) - xfree (pScrPriv->pSizes); - xfree (pScrPriv); - RRNScreens -= 1; /* ok, one fewer screen with RandR running */ - return (*pScreen->CloseScreen) (i, pScreen); -} - -static void -SRRScreenChangeNotifyEvent(xRRScreenChangeNotifyEvent *from, - xRRScreenChangeNotifyEvent *to) -{ - to->type = from->type; - to->rotation = from->rotation; - cpswaps(from->sequenceNumber, to->sequenceNumber); - cpswapl(from->timestamp, to->timestamp); - cpswapl(from->configTimestamp, to->configTimestamp); - cpswapl(from->root, to->root); - cpswapl(from->window, to->window); - cpswaps(from->sizeID, to->sizeID); - cpswaps(from->widthInPixels, to->widthInPixels); - cpswaps(from->heightInPixels, to->heightInPixels); - cpswaps(from->widthInMillimeters, to->widthInMillimeters); - cpswaps(from->heightInMillimeters, to->heightInMillimeters); - cpswaps(from->subpixelOrder, to->subpixelOrder); -} - -Bool RRScreenInit(ScreenPtr pScreen) -{ - rrScrPrivPtr pScrPriv; - - if (RRGeneration != serverGeneration) - { - if ((rrPrivIndex = AllocateScreenPrivateIndex()) < 0) - return FALSE; - RRGeneration = serverGeneration; - } - - pScrPriv = (rrScrPrivPtr) xalloc (sizeof (rrScrPrivRec)); - if (!pScrPriv) - return FALSE; - - SetRRScreen(pScreen, pScrPriv); - - /* - * Calling function best set these function vectors - */ - pScrPriv->rrSetConfig = 0; - pScrPriv->rrGetInfo = 0; - /* - * This value doesn't really matter -- any client must call - * GetScreenInfo before reading it which will automatically update - * the time - */ - pScrPriv->lastSetTime = currentTime; - pScrPriv->lastConfigTime = currentTime; - - wrap (pScrPriv, pScreen, CloseScreen, RRCloseScreen); - - pScrPriv->rotations = RR_Rotate_0; - - pScrPriv->nSizes = 0; - pScrPriv->nSizesInUse = 0; - pScrPriv->pSizes = 0; - - pScrPriv->rotation = RR_Rotate_0; - pScrPriv->size = -1; - - RRNScreens += 1; /* keep count of screens that implement randr */ - return TRUE; -} - -/*ARGSUSED*/ -static int -RRFreeClient (pointer data, XID id) -{ - RREventPtr pRREvent; - WindowPtr pWin; - RREventPtr *pHead, pCur, pPrev; - - pRREvent = (RREventPtr) data; - pWin = pRREvent->window; - pHead = (RREventPtr *) LookupIDByType(pWin->drawable.id, EventType); - if (pHead) { - pPrev = 0; - for (pCur = *pHead; pCur && pCur != pRREvent; pCur=pCur->next) - pPrev = pCur; - if (pCur) - { - if (pPrev) - pPrev->next = pRREvent->next; - else - *pHead = pRREvent->next; - } - } - xfree ((pointer) pRREvent); - return 1; -} - -/*ARGSUSED*/ -static int -RRFreeEvents (pointer data, XID id) -{ - RREventPtr *pHead, pCur, pNext; - - pHead = (RREventPtr *) data; - for (pCur = *pHead; pCur; pCur = pNext) { - pNext = pCur->next; - FreeResource (pCur->clientResource, ClientType); - xfree ((pointer) pCur); - } - xfree ((pointer) pHead); - return 1; -} - -void -RRExtensionInit (void) -{ - ExtensionEntry *extEntry; - - if (RRNScreens == 0) return; - - RRClientPrivateIndex = AllocateClientPrivateIndex (); - if (!AllocateClientPrivate (RRClientPrivateIndex, - sizeof (RRClientRec) + - screenInfo.numScreens * sizeof (RRTimesRec))) - return; - if (!AddCallback (&ClientStateCallback, RRClientCallback, 0)) - return; - - ClientType = CreateNewResourceType(RRFreeClient); - if (!ClientType) - return; - EventType = CreateNewResourceType(RRFreeEvents); - if (!EventType) - return; - extEntry = AddExtension (RANDR_NAME, RRNumberEvents, RRNumberErrors, - ProcRRDispatch, SProcRRDispatch, - RRResetProc, StandardMinorOpcode); - if (!extEntry) - return; -#if 0 - RRReqCode = (CARD8) extEntry->base; - RRErrBase = extEntry->errorBase; -#endif - RREventBase = extEntry->eventBase; - EventSwapVector[RREventBase + RRScreenChangeNotify] = (EventSwapPtr) - SRRScreenChangeNotifyEvent; - - return; -} - -static int -TellChanged (WindowPtr pWin, pointer value) -{ - RREventPtr *pHead, pRREvent; - ClientPtr client; - xRRScreenChangeNotifyEvent se; - ScreenPtr pScreen = pWin->drawable.pScreen; - rrScrPriv(pScreen); - RRScreenSizePtr pSize; - WindowPtr pRoot = WindowTable[pScreen->myNum]; - - pHead = (RREventPtr *) LookupIDByType (pWin->drawable.id, EventType); - if (!pHead) - return WT_WALKCHILDREN; - - se.type = RRScreenChangeNotify + RREventBase; - se.rotation = (CARD8) pScrPriv->rotation; - se.timestamp = pScrPriv->lastSetTime.milliseconds; - se.configTimestamp = pScrPriv->lastConfigTime.milliseconds; - se.root = pRoot->drawable.id; - se.window = pWin->drawable.id; -#ifdef RENDER - se.subpixelOrder = PictureGetSubpixelOrder (pScreen); -#else - se.subpixelOrder = SubPixelUnknown; -#endif - if (pScrPriv->size >= 0) - { - pSize = &pScrPriv->pSizes[pScrPriv->size]; - se.sizeID = pSize->id; - se.widthInPixels = pSize->width; - se.heightInPixels = pSize->height; - se.widthInMillimeters = pSize->mmWidth; - se.heightInMillimeters = pSize->mmHeight; - } - else - { - /* - * This "shouldn't happen", but a broken DDX can - * forget to set the current configuration on GetInfo - */ - se.sizeID = 0xffff; - se.widthInPixels = 0; - se.heightInPixels = 0; - se.widthInMillimeters = 0; - se.heightInMillimeters = 0; - } - for (pRREvent = *pHead; pRREvent; pRREvent = pRREvent->next) - { - client = pRREvent->client; - if (client == serverClient || client->clientGone) - continue; - se.sequenceNumber = client->sequence; - if(pRREvent->mask & RRScreenChangeNotifyMask) - WriteEventsToClient (client, 1, (xEvent *) &se); - } - return WT_WALKCHILDREN; -} - -static Bool -RRGetInfo (ScreenPtr pScreen) -{ - rrScrPriv (pScreen); - int i, j, k, l; - Bool changed; - Rotation rotations; - RRScreenSizePtr pSize; - RRScreenRatePtr pRate; - - for (i = 0; i < pScrPriv->nSizes; i++) - { - pSize = &pScrPriv->pSizes[i]; - pSize->oldReferenced = pSize->referenced; - pSize->referenced = FALSE; - for (k = 0; k < pSize->nRates; k++) - { - pRate = &pSize->pRates[k]; - pRate->oldReferenced = pRate->referenced; - pRate->referenced = FALSE; - } - } - if (!(*pScrPriv->rrGetInfo) (pScreen, &rotations)) - return FALSE; - - changed = FALSE; - - /* - * Check whether anything changed and simultaneously generate - * the protocol id values for the objects - */ - if (rotations != pScrPriv->rotations) - { - pScrPriv->rotations = rotations; - changed = TRUE; - } - - j = 0; - for (i = 0; i < pScrPriv->nSizes; i++) - { - pSize = &pScrPriv->pSizes[i]; - if (pSize->oldReferenced != pSize->referenced) - changed = TRUE; - if (pSize->referenced) - pSize->id = j++; - l = 0; - for (k = 0; k < pSize->nRates; k++) - { - pRate = &pSize->pRates[k]; - if (pRate->oldReferenced != pRate->referenced) - changed = TRUE; - if (pRate->referenced) - l++; - } - pSize->nRatesInUse = l; - } - pScrPriv->nSizesInUse = j; - if (changed) - { - UpdateCurrentTime (); - pScrPriv->lastConfigTime = currentTime; - WalkTree (pScreen, TellChanged, (pointer) pScreen); - } - return TRUE; -} - -static void -RRSendConfigNotify (ScreenPtr pScreen) -{ - WindowPtr pWin = WindowTable[pScreen->myNum]; - xEvent event; - - event.u.u.type = ConfigureNotify; - event.u.configureNotify.window = pWin->drawable.id; - event.u.configureNotify.aboveSibling = None; - event.u.configureNotify.x = 0; - event.u.configureNotify.y = 0; - - /* XXX xinerama stuff ? */ - - event.u.configureNotify.width = pWin->drawable.width; - event.u.configureNotify.height = pWin->drawable.height; - event.u.configureNotify.borderWidth = wBorderWidth (pWin); - event.u.configureNotify.override = pWin->overrideRedirect; - DeliverEvents(pWin, &event, 1, NullWindow); -} - -static int -ProcRRQueryVersion (ClientPtr client) -{ - xRRQueryVersionReply rep; - register int n; - REQUEST(xRRQueryVersionReq); - rrClientPriv(client); - - REQUEST_SIZE_MATCH(xRRQueryVersionReq); - pRRClient->major_version = stuff->majorVersion; - pRRClient->minor_version = stuff->minorVersion; - rep.type = X_Reply; - rep.length = 0; - rep.sequenceNumber = client->sequence; - rep.majorVersion = RANDR_MAJOR; - rep.minorVersion = RANDR_MINOR; - if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.majorVersion, n); - swapl(&rep.minorVersion, n); - } - WriteToClient(client, sizeof(xRRQueryVersionReply), (char *)&rep); - return (client->noClientException); -} - - -extern char *ConnectionInfo; - -static int padlength[4] = {0, 3, 2, 1}; - -static void -RREditConnectionInfo (ScreenPtr pScreen) -{ - xConnSetup *connSetup; - char *vendor; - xPixmapFormat *formats; - xWindowRoot *root; - xDepth *depth; - xVisualType *visual; - int screen = 0; - int d; - - connSetup = (xConnSetup *) ConnectionInfo; - vendor = (char *) connSetup + sizeof (xConnSetup); - formats = (xPixmapFormat *) ((char *) vendor + - connSetup->nbytesVendor + - padlength[connSetup->nbytesVendor & 3]); - root = (xWindowRoot *) ((char *) formats + - sizeof (xPixmapFormat) * screenInfo.numPixmapFormats); - while (screen != pScreen->myNum) - { - depth = (xDepth *) ((char *) root + - sizeof (xWindowRoot)); - for (d = 0; d < root->nDepths; d++) - { - visual = (xVisualType *) ((char *) depth + - sizeof (xDepth)); - depth = (xDepth *) ((char *) visual + - depth->nVisuals * sizeof (xVisualType)); - } - root = (xWindowRoot *) ((char *) depth); - screen++; - } - root->pixWidth = pScreen->width; - root->pixHeight = pScreen->height; - root->mmWidth = pScreen->mmWidth; - root->mmHeight = pScreen->mmHeight; -} - -static int -ProcRRGetScreenInfo (ClientPtr client) -{ - REQUEST(xRRGetScreenInfoReq); - xRRGetScreenInfoReply rep; - WindowPtr pWin; - int n; - ScreenPtr pScreen; - rrScrPrivPtr pScrPriv; - CARD8 *extra; - unsigned long extraLen; - - REQUEST_SIZE_MATCH(xRRGetScreenInfoReq); - pWin = (WindowPtr)SecurityLookupWindow(stuff->window, client, - SecurityReadAccess); - - if (!pWin) - return BadWindow; - - pScreen = pWin->drawable.pScreen; - pScrPriv = rrGetScrPriv(pScreen); - rep.pad = 0; - if (!pScrPriv) - { - rep.type = X_Reply; - rep.setOfRotations = RR_Rotate_0;; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.root = WindowTable[pWin->drawable.pScreen->myNum]->drawable.id; - rep.timestamp = currentTime.milliseconds; - rep.configTimestamp = currentTime.milliseconds; - rep.nSizes = 0; - rep.sizeID = 0; - rep.rotation = RR_Rotate_0; - rep.rate = 0; - rep.nrateEnts = 0; - extra = 0; - extraLen = 0; - } - else - { - int i, j; - xScreenSizes *size; - CARD16 *rates; - CARD8 *data8; - Bool has_rate = RRClientKnowsRates (client); - - RRGetInfo (pScreen); - - rep.type = X_Reply; - rep.setOfRotations = pScrPriv->rotations; - rep.sequenceNumber = client->sequence; - rep.length = 0; - rep.root = WindowTable[pWin->drawable.pScreen->myNum]->drawable.id; - rep.timestamp = pScrPriv->lastSetTime.milliseconds; - rep.configTimestamp = pScrPriv->lastConfigTime.milliseconds; - rep.rotation = pScrPriv->rotation; - rep.nSizes = pScrPriv->nSizesInUse; - rep.rate = pScrPriv->rate; - rep.nrateEnts = 0; - if (has_rate) - { - for (i = 0; i < pScrPriv->nSizes; i++) - { - RRScreenSizePtr pSize = &pScrPriv->pSizes[i]; - if (pSize->referenced) - { - rep.nrateEnts += (1 + pSize->nRatesInUse); - } - } - } - - if (pScrPriv->size >= 0) - rep.sizeID = pScrPriv->pSizes[pScrPriv->size].id; - else - return BadImplementation; - - extraLen = (rep.nSizes * sizeof (xScreenSizes) + - rep.nrateEnts * sizeof (CARD16)); - - extra = (CARD8 *) xalloc (extraLen); - if (!extra) - return BadAlloc; - /* - * First comes the size information - */ - size = (xScreenSizes *) extra; - rates = (CARD16 *) (size + rep.nSizes); - for (i = 0; i < pScrPriv->nSizes; i++) - { - RRScreenSizePtr pSize = &pScrPriv->pSizes[i]; - if (pSize->referenced) - { - size->widthInPixels = pSize->width; - size->heightInPixels = pSize->height; - size->widthInMillimeters = pSize->mmWidth; - size->heightInMillimeters = pSize->mmHeight; - if (client->swapped) - { - swaps (&size->widthInPixels, n); - swaps (&size->heightInPixels, n); - swaps (&size->widthInMillimeters, n); - swaps (&size->heightInMillimeters, n); - } - size++; - if (has_rate) - { - *rates = pSize->nRatesInUse; - if (client->swapped) - { - swaps (rates, n); - } - rates++; - for (j = 0; j < pSize->nRates; j++) - { - RRScreenRatePtr pRate = &pSize->pRates[j]; - if (pRate->referenced) - { - *rates = pRate->rate; - if (client->swapped) - { - swaps (rates, n); - } - rates++; - } - } - } - } - } - data8 = (CARD8 *) rates; - - if (data8 - (CARD8 *) extra != extraLen) - FatalError ("RRGetScreenInfo bad extra len %ld != %ld\n", - (unsigned long)(data8 - (CARD8 *) extra), extraLen); - rep.length = (extraLen + 3) >> 2; - } - if (client->swapped) { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.timestamp, n); - swaps(&rep.rotation, n); - swaps(&rep.nSizes, n); - swaps(&rep.sizeID, n); - swaps(&rep.rate, n); - swaps(&rep.nrateEnts, n); - } - WriteToClient(client, sizeof(xRRGetScreenInfoReply), (char *)&rep); - if (extraLen) - { - WriteToClient (client, extraLen, (char *) extra); - xfree (extra); - } - return (client->noClientException); -} - -static int -ProcRRSetScreenConfig (ClientPtr client) -{ - REQUEST(xRRSetScreenConfigReq); - xRRSetScreenConfigReply rep; - DrawablePtr pDraw; - int n; - ScreenPtr pScreen; - rrScrPrivPtr pScrPriv; - TimeStamp configTime; - TimeStamp time; - RRScreenSizePtr pSize; - int i; - Rotation rotation; - int rate; - short oldWidth, oldHeight; - Bool has_rate; - - UpdateCurrentTime (); - - if (RRClientKnowsRates (client)) - { - REQUEST_SIZE_MATCH (xRRSetScreenConfigReq); - has_rate = TRUE; - } - else - { - REQUEST_SIZE_MATCH (xRR1_0SetScreenConfigReq); - has_rate = FALSE; - } - - SECURITY_VERIFY_DRAWABLE(pDraw, stuff->drawable, client, - SecurityWriteAccess); - - pScreen = pDraw->pScreen; - - pScrPriv = rrGetScrPriv(pScreen); - - time = ClientTimeToServerTime(stuff->timestamp); - configTime = ClientTimeToServerTime(stuff->configTimestamp); - - oldWidth = pScreen->width; - oldHeight = pScreen->height; - - if (!pScrPriv) - { - time = currentTime; - rep.status = RRSetConfigFailed; - goto sendReply; - } - if (!RRGetInfo (pScreen)) - return BadAlloc; - - /* - * if the client's config timestamp is not the same as the last config - * timestamp, then the config information isn't up-to-date and - * can't even be validated - */ - if (CompareTimeStamps (configTime, pScrPriv->lastConfigTime) != 0) - { - rep.status = RRSetConfigInvalidConfigTime; - goto sendReply; - } - - /* - * Search for the requested size - */ - pSize = 0; - for (i = 0; i < pScrPriv->nSizes; i++) - { - pSize = &pScrPriv->pSizes[i]; - if (pSize->referenced && pSize->id == stuff->sizeID) - { - break; - } - } - if (i == pScrPriv->nSizes) - { - /* - * Invalid size ID - */ - client->errorValue = stuff->sizeID; - return BadValue; - } - - /* - * Validate requested rotation - */ - rotation = (Rotation) stuff->rotation; - - /* test the rotation bits only! */ - switch (rotation & 0xf) { - case RR_Rotate_0: - case RR_Rotate_90: - case RR_Rotate_180: - case RR_Rotate_270: - break; - default: - /* - * Invalid rotation - */ - client->errorValue = stuff->rotation; - return BadValue; - } - - if ((~pScrPriv->rotations) & rotation) - { - /* - * requested rotation or reflection not supported by screen - */ - client->errorValue = stuff->rotation; - return BadMatch; - } - - /* - * Validate requested refresh - */ - if (has_rate) - rate = (int) stuff->rate; - else - rate = 0; - - if (rate) - { - for (i = 0; i < pSize->nRates; i++) - { - RRScreenRatePtr pRate = &pSize->pRates[i]; - if (pRate->referenced && pRate->rate == rate) - break; - } - if (i == pSize->nRates) - { - /* - * Invalid rate - */ - client->errorValue = rate; - return BadValue; - } - } - - /* - * Make sure the requested set-time is not older than - * the last set-time - */ - if (CompareTimeStamps (time, pScrPriv->lastSetTime) < 0) - { - rep.status = RRSetConfigInvalidTime; - goto sendReply; - } - - /* - * call out to ddx routine to effect the change - */ - if (!(*pScrPriv->rrSetConfig) (pScreen, rotation, rate, - pSize)) - { - /* - * unknown DDX failure, report to client - */ - rep.status = RRSetConfigFailed; - goto sendReply; - } - - /* - * set current extension configuration pointers - */ - RRSetCurrentConfig (pScreen, rotation, rate, pSize); - - /* - * Deliver ScreenChangeNotify events whenever - * the configuration is updated - */ - WalkTree (pScreen, TellChanged, (pointer) pScreen); - - /* - * Deliver ConfigureNotify events when root changes - * pixel size - */ - if (oldWidth != pScreen->width || oldHeight != pScreen->height) - RRSendConfigNotify (pScreen); - RREditConnectionInfo (pScreen); - - /* - * Fix pointer bounds and location - */ - ScreenRestructured (pScreen); - pScrPriv->lastSetTime = time; - - /* - * Report Success - */ - rep.status = RRSetConfigSuccess; - -sendReply: - - rep.type = X_Reply; - /* rep.status has already been filled in */ - rep.length = 0; - rep.sequenceNumber = client->sequence; - - rep.newTimestamp = pScrPriv->lastSetTime.milliseconds; - rep.newConfigTimestamp = pScrPriv->lastConfigTime.milliseconds; - rep.root = WindowTable[pDraw->pScreen->myNum]->drawable.id; - - if (client->swapped) - { - swaps(&rep.sequenceNumber, n); - swapl(&rep.length, n); - swapl(&rep.newTimestamp, n); - swapl(&rep.newConfigTimestamp, n); - swapl(&rep.root, n); - } - WriteToClient(client, sizeof(xRRSetScreenConfigReply), (char *)&rep); - - return (client->noClientException); -} - -int -RRSetScreenConfig (ScreenPtr pScreen, - Rotation rotation, - int rate, - RRScreenSizePtr pSize) -{ - rrScrPrivPtr pScrPriv; - int i; - short oldWidth, oldHeight; - - pScrPriv = rrGetScrPriv(pScreen); - - oldWidth = pScreen->width; - oldHeight = pScreen->height; - - if (!RRGetInfo (pScreen)) - return BadAlloc; - - /* - * Validate requested rotation - */ - - /* test the rotation bits only! */ - switch (rotation & 0xf) { - case RR_Rotate_0: - case RR_Rotate_90: - case RR_Rotate_180: - case RR_Rotate_270: - break; - default: - /* - * Invalid rotation - */ - return BadValue; - } - - if ((~pScrPriv->rotations) & rotation) - { - /* - * requested rotation or reflection not supported by screen - */ - return BadMatch; - } - - /* - * Validate requested refresh - */ - if (rate) - { - for (i = 0; i < pSize->nRates; i++) - { - RRScreenRatePtr pRate = &pSize->pRates[i]; - if (pRate->referenced && pRate->rate == rate) - break; - } - if (i == pSize->nRates) - { - /* - * Invalid rate - */ - return BadValue; - } - } - - /* - * call out to ddx routine to effect the change - */ - if (!(*pScrPriv->rrSetConfig) (pScreen, rotation, rate, - pSize)) - { - /* - * unknown DDX failure, report to client - */ - return BadImplementation; - } - - /* - * set current extension configuration pointers - */ - RRSetCurrentConfig (pScreen, rotation, rate, pSize); - - /* - * Deliver ScreenChangeNotify events whenever - * the configuration is updated - */ - WalkTree (pScreen, TellChanged, (pointer) pScreen); - - /* - * Deliver ConfigureNotify events when root changes - * pixel size - */ - if (oldWidth != pScreen->width || oldHeight != pScreen->height) - RRSendConfigNotify (pScreen); - RREditConnectionInfo (pScreen); - - /* - * Fix pointer bounds and location - */ - ScreenRestructured (pScreen); - - return Success; -} - -static int -ProcRRSelectInput (ClientPtr client) -{ - REQUEST(xRRSelectInputReq); - rrClientPriv(client); - RRTimesPtr pTimes; - WindowPtr pWin; - RREventPtr pRREvent, pNewRREvent, *pHead; - XID clientResource; - - REQUEST_SIZE_MATCH(xRRSelectInputReq); - pWin = SecurityLookupWindow (stuff->window, client, SecurityWriteAccess); - if (!pWin) - return BadWindow; - pHead = (RREventPtr *)SecurityLookupIDByType(client, - pWin->drawable.id, EventType, - SecurityWriteAccess); - - if (stuff->enable & (RRScreenChangeNotifyMask)) - { - ScreenPtr pScreen = pWin->drawable.pScreen; - rrScrPriv (pScreen); - - if (pHead) - { - /* check for existing entry. */ - for (pRREvent = *pHead; pRREvent; pRREvent = pRREvent->next) - if (pRREvent->client == client) - return Success; - } - - /* build the entry */ - pNewRREvent = (RREventPtr) xalloc (sizeof (RREventRec)); - if (!pNewRREvent) - return BadAlloc; - pNewRREvent->next = 0; - pNewRREvent->client = client; - pNewRREvent->window = pWin; - pNewRREvent->mask = stuff->enable; - /* - * add a resource that will be deleted when - * the client goes away - */ - clientResource = FakeClientID (client->index); - pNewRREvent->clientResource = clientResource; - if (!AddResource (clientResource, ClientType, (pointer)pNewRREvent)) - 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 = (RREventPtr *) xalloc (sizeof (RREventPtr)); - if (!pHead || - !AddResource (pWin->drawable.id, EventType, (pointer)pHead)) - { - FreeResource (clientResource, RT_NONE); - return BadAlloc; - } - *pHead = 0; - } - pNewRREvent->next = *pHead; - *pHead = pNewRREvent; - /* - * Now see if the client needs an event - */ - if (pScrPriv) - { - pTimes = &((RRTimesPtr) (pRRClient + 1))[pScreen->myNum]; - if (CompareTimeStamps (pTimes->setTime, - pScrPriv->lastSetTime) != 0 || - CompareTimeStamps (pTimes->configTime, - pScrPriv->lastConfigTime) != 0) - { - TellChanged (pWin, (pointer) pScreen); - } - } - } - else if (stuff->enable == xFalse) - { - /* delete the interest */ - if (pHead) { - pNewRREvent = 0; - for (pRREvent = *pHead; pRREvent; pRREvent = pRREvent->next) { - if (pRREvent->client == client) - break; - pNewRREvent = pRREvent; - } - if (pRREvent) { - FreeResource (pRREvent->clientResource, ClientType); - if (pNewRREvent) - pNewRREvent->next = pRREvent->next; - else - *pHead = pRREvent->next; - xfree (pRREvent); - } - } - } - else - { - client->errorValue = stuff->enable; - return BadValue; - } - return Success; -} - - -static int -ProcRRDispatch (ClientPtr client) -{ - REQUEST(xReq); - switch (stuff->data) - { - case X_RRQueryVersion: - return ProcRRQueryVersion(client); - case X_RRSetScreenConfig: - return ProcRRSetScreenConfig(client); - case X_RRSelectInput: - return ProcRRSelectInput(client); - case X_RRGetScreenInfo: - return ProcRRGetScreenInfo(client); - default: - return BadRequest; - } -} - -static int -SProcRRQueryVersion (ClientPtr client) -{ - register int n; - REQUEST(xRRQueryVersionReq); - - swaps(&stuff->length, n); - swapl(&stuff->majorVersion, n); - swapl(&stuff->minorVersion, n); - return ProcRRQueryVersion(client); -} - -static int -SProcRRGetScreenInfo (ClientPtr client) -{ - register int n; - REQUEST(xRRGetScreenInfoReq); - - swaps(&stuff->length, n); - swapl(&stuff->window, n); - return ProcRRGetScreenInfo(client); -} - -static int -SProcRRSetScreenConfig (ClientPtr client) -{ - register int n; - REQUEST(xRRSetScreenConfigReq); - - if (RRClientKnowsRates (client)) - { - REQUEST_SIZE_MATCH (xRRSetScreenConfigReq); - swaps (&stuff->rate, n); - } - else - { - REQUEST_SIZE_MATCH (xRR1_0SetScreenConfigReq); - } - - swaps(&stuff->length, n); - swapl(&stuff->drawable, n); - swapl(&stuff->timestamp, n); - swaps(&stuff->sizeID, n); - swaps(&stuff->rotation, n); - return ProcRRSetScreenConfig(client); -} - -static int -SProcRRSelectInput (ClientPtr client) -{ - register int n; - REQUEST(xRRSelectInputReq); - - swaps(&stuff->length, n); - swapl(&stuff->window, n); - return ProcRRSelectInput(client); -} - - -static int -SProcRRDispatch (ClientPtr client) -{ - REQUEST(xReq); - switch (stuff->data) - { - case X_RRQueryVersion: - return SProcRRQueryVersion(client); - case X_RRSetScreenConfig: - return SProcRRSetScreenConfig(client); - case X_RRSelectInput: - return SProcRRSelectInput(client); - case X_RRGetScreenInfo: - return SProcRRGetScreenInfo(client); - default: - return BadRequest; - } -} - - -static Bool -RRScreenSizeMatches (RRScreenSizePtr a, - RRScreenSizePtr b) -{ - if (a->width != b->width) - return FALSE; - if (a->height != b->height) - return FALSE; - if (a->mmWidth != b->mmWidth) - return FALSE; - if (a->mmHeight != b->mmHeight) - return FALSE; - return TRUE; -} - -RRScreenSizePtr -RRRegisterSize (ScreenPtr pScreen, - short width, - short height, - short mmWidth, - short mmHeight) -{ - rrScrPriv (pScreen); - int i; - RRScreenSize tmp; - RRScreenSizePtr pNew; - - if (!pScrPriv) - return 0; - - tmp.width = width; - tmp.height= height; - tmp.mmWidth = mmWidth; - tmp.mmHeight = mmHeight; - tmp.pRates = 0; - tmp.nRates = 0; - tmp.nRatesInUse = 0; - tmp.referenced = TRUE; - tmp.oldReferenced = FALSE; - for (i = 0; i < pScrPriv->nSizes; i++) - if (RRScreenSizeMatches (&tmp, &pScrPriv->pSizes[i])) - { - pScrPriv->pSizes[i].referenced = TRUE; - return &pScrPriv->pSizes[i]; - } - pNew = xrealloc (pScrPriv->pSizes, - (pScrPriv->nSizes + 1) * sizeof (RRScreenSize)); - if (!pNew) - return 0; - pNew[pScrPriv->nSizes++] = tmp; - pScrPriv->pSizes = pNew; - return &pNew[pScrPriv->nSizes-1]; -} - -Bool RRRegisterRate (ScreenPtr pScreen, - RRScreenSizePtr pSize, - int rate) -{ - rrScrPriv(pScreen); - int i; - RRScreenRatePtr pNew, pRate; - - if (!pScrPriv) - return FALSE; - - for (i = 0; i < pSize->nRates; i++) - { - pRate = &pSize->pRates[i]; - if (pRate->rate == rate) - { - pRate->referenced = TRUE; - return TRUE; - } - } - - pNew = xrealloc (pSize->pRates, - (pSize->nRates + 1) * sizeof (RRScreenRate)); - if (!pNew) - return FALSE; - pRate = &pNew[pSize->nRates++]; - pRate->rate = rate; - pRate->referenced = TRUE; - pRate->oldReferenced = FALSE; - pSize->pRates = pNew; - return TRUE; -} - -void -RRSetCurrentConfig (ScreenPtr pScreen, - Rotation rotation, - int rate, - RRScreenSizePtr pSize) -{ - rrScrPriv (pScreen); - - if (!pScrPriv) - return; - - pScrPriv->rotation = rotation; - pScrPriv->size = pSize - pScrPriv->pSizes; - pScrPriv->rate = rate; -} -- cgit v1.2.3