diff options
Diffstat (limited to 'xorg/X11R7.6/rdp')
-rw-r--r-- | xorg/X11R7.6/rdp/Makefile | 24 | ||||
-rw-r--r-- | xorg/X11R7.6/rdp/rdp.h | 10 | ||||
-rw-r--r-- | xorg/X11R7.6/rdp/rdpComposite.c | 12 | ||||
-rw-r--r-- | xorg/X11R7.6/rdp/rdpPolyFillRect.c | 8 | ||||
-rw-r--r-- | xorg/X11R7.6/rdp/rdpdraw.c | 6 | ||||
-rw-r--r-- | xorg/X11R7.6/rdp/rdpglyph.c | 4 | ||||
-rw-r--r-- | xorg/X11R7.6/rdp/rdpinput.c | 44 | ||||
-rw-r--r-- | xorg/X11R7.6/rdp/rdpkeyboardbase.c | 6 | ||||
-rw-r--r-- | xorg/X11R7.6/rdp/rdpkeyboardevdev.c | 4 | ||||
-rw-r--r-- | xorg/X11R7.6/rdp/rdpmain.c | 19 | ||||
-rw-r--r-- | xorg/X11R7.6/rdp/rdpmisc.c | 4 | ||||
-rw-r--r-- | xorg/X11R7.6/rdp/rdprandr.c | 176 | ||||
-rw-r--r-- | xorg/X11R7.6/rdp/rdprandr.h | 3 | ||||
-rw-r--r-- | xorg/X11R7.6/rdp/rdpup.c | 81 | ||||
-rw-r--r-- | xorg/X11R7.6/rdp/rdpxv.c | 2 |
15 files changed, 318 insertions, 85 deletions
diff --git a/xorg/X11R7.6/rdp/Makefile b/xorg/X11R7.6/rdp/Makefile index c18e01b6..cdfea385 100644 --- a/xorg/X11R7.6/rdp/Makefile +++ b/xorg/X11R7.6/rdp/Makefile @@ -1,6 +1,9 @@ +# X11RDPBASE is the top-level X11rdp install directory +ifeq ($(X11RDPBASE),) +$(error X11RDPBASE needs to be set) +endif -#X11RDPBASE is an environment variable that needs to be set - +BINBASE = $(X11RDPBASE)/bin INCBASE = $(X11RDPBASE)/include LIBBASE = $(X11RDPBASE)/lib @@ -23,23 +26,24 @@ fbcmap_mi.o #fbcmap_mi.o #fbcmap.o -LIBS = $(XSRCBASE)/dbe/.libs/libdbe.a \ - $(XSRCBASE)/dix/.libs/libdix.a \ +LIBS = \ $(XSRCBASE)/dix/.libs/libmain.a \ + librdp.a \ + $(XSRCBASE)/dbe/.libs/libdbe.a \ + $(XSRCBASE)/dix/.libs/libdix.a \ $(XSRCBASE)/fb/.libs/libfb.a \ $(XSRCBASE)/mi/.libs/libmi.a \ - $(XSRCBASE)/os/.libs/libos.a \ $(XSRCBASE)/randr/.libs/librandr.a \ - $(XSRCBASE)/record/.libs/librecord.a \ $(XSRCBASE)/render/.libs/librender.a \ + $(XSRCBASE)/os/.libs/libos.a \ + $(XSRCBASE)/record/.libs/librecord.a \ $(XSRCBASE)/xkb/.libs/libxkb.a \ $(XSRCBASE)/Xext/.libs/libXext.a \ $(XSRCBASE)/Xi/.libs/libXi.a \ $(XSRCBASE)/glx/.libs/libglx.a \ $(XSRCBASE)/xfixes/.libs/libxfixes.a \ $(XSRCBASE)/damageext/.libs/libdamageext.a \ - $(XSRCBASE)/miext/damage/.libs/libdamage.a \ - librdp.a + $(XSRCBASE)/miext/damage/.libs/libdamage.a LLIBS = -Wl,-rpath=$(LIBBASE) -lfreetype -lz -lm -lXfont -lXau \ -lXdmcp -lpixman-1 -lrt -ldl -lcrypto -lGL -lXdamage @@ -98,7 +102,7 @@ all: X11rdp X11rdp: $(OBJS) $(AR) rvu librdp.a $(OBJS) ranlib librdp.a - $(CC) $(LDFLAGS) -o X11rdp $(LIBS) $(LIBS) $(LLIBS) + $(CC) $(LDFLAGS) -o X11rdp $(LIBS) $(LLIBS) clean: rm -f $(OBJS) librdp.a @@ -113,4 +117,4 @@ fbcmap_mi.o: ../build_dir/xorg-server-1.9.3/fb/fbcmap_mi.c $(CC) $(CFLAGS) -c ../build_dir/xorg-server-1.9.3/fb/fbcmap_mi.c install: all - $(INSTALL) X11rdp $(X11RDPBASE)/bin/X11rdp + $(INSTALL) X11rdp $(BINBASE)/X11rdp diff --git a/xorg/X11R7.6/rdp/rdp.h b/xorg/X11R7.6/rdp/rdp.h index 00725d11..9c373068 100644 --- a/xorg/X11R7.6/rdp/rdp.h +++ b/xorg/X11R7.6/rdp/rdp.h @@ -90,7 +90,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # endif #endif -#define X11RDPVER "0.7.0" +#define X11RDPVER "0.9.1" #define PixelDPI 100 #define PixelToMM(_size) (((_size) * 254 + (PixelDPI) * 5) / ((PixelDPI) * 10)) @@ -558,9 +558,9 @@ rdpup_set_cursor(short x, short y, char* cur_data, char* cur_mask); int rdpup_set_cursor_ex(short x, short y, char *cur_data, char *cur_mask, int bpp); int -rdpup_create_os_surface(int rdpindexd, int width, int height); +rdpup_create_os_surface(int rdpindex, int width, int height); int -rdpup_create_os_surface_bpp(int rdpindexd, int width, int height, int bpp); +rdpup_create_os_surface_bpp(int rdpindex, int width, int height, int bpp); int rdpup_switch_os_surface(int rdpindex); int @@ -582,10 +582,10 @@ rdpup_check_alpha_dirty(PixmapPtr pDirtyPixmap, rdpPixmapRec* pDirtyPriv); int rdpup_check_dirty_screen(rdpPixmapRec* pDirtyPriv); int -rdpup_add_char(int font, int charactor, short x, short y, int cx, int cy, +rdpup_add_char(int font, int character, short x, short y, int cx, int cy, char* bmpdata, int bmpdata_bytes); int -rdpup_add_char_alpha(int font, int charactor, short x, short y, int cx, int cy, +rdpup_add_char_alpha(int font, int character, short x, short y, int cx, int cy, char* bmpdata, int bmpdata_bytes); int rdpup_draw_text(int font, int flags, int mixmode, diff --git a/xorg/X11R7.6/rdp/rdpComposite.c b/xorg/X11R7.6/rdp/rdpComposite.c index f763783e..9376a533 100644 --- a/xorg/X11R7.6/rdp/rdpComposite.c +++ b/xorg/X11R7.6/rdp/rdpComposite.c @@ -224,7 +224,7 @@ print_format(PictFormatShort format) /******************************************************************************/ static int -compsoite_print(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst, +composite_print(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst, INT16 xSrc, INT16 ySrc, INT16 xMask, INT16 yMask, INT16 xDst, INT16 yDst, CARD16 width, CARD16 height) { @@ -233,7 +233,7 @@ compsoite_print(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst, rdpPixmapRec* pSrcPriv; rdpPixmapRec* pDstPriv; - LLOGLN(0, ("compsoite_print: op %d xSrc %d ySrc %d xDst %d yDst %d " + LLOGLN(0, ("composite_print: op %d xSrc %d ySrc %d xDst %d yDst %d " "width %d height %d", op, xSrc, ySrc, xDst, yDst, width, height)); @@ -493,7 +493,7 @@ check_drawables(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst, { LLOGLN(10, ("check_drawables: can not remote [%s]", g_com_fail_strings[fail_reason])); #if 0 - compsoite_print(op, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask, + composite_print(op, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask, xDst, yDst, width, height); #endif } @@ -501,7 +501,7 @@ check_drawables(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst, { LLOGLN(10, ("check_drawables: can remote [%s]", g_com_fail_strings[fail_reason])); #if 0 - compsoite_print(op, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask, + composite_print(op, pSrc, pMask, pDst, xSrc, ySrc, xMask, yMask, xDst, yDst, width, height); #endif } @@ -707,7 +707,7 @@ rdpComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst, { if (pMask != 0) { - /* TODO: here we can try to send it as a gylph */ + /* TODO: here we can try to send it as a glyph */ } } } @@ -745,7 +745,7 @@ rdpComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst, post_process = 1; if (g_do_dirty_os) { - LLOGLN(10, ("rdpComposite: gettig dirty")); + LLOGLN(10, ("rdpComposite: getting dirty")); pDstPriv->is_dirty = 1; dirty_type = g_doing_font ? RDI_IMGLL : RDI_IMGLY; pDirtyPriv = pDstPriv; diff --git a/xorg/X11R7.6/rdp/rdpPolyFillRect.c b/xorg/X11R7.6/rdp/rdpPolyFillRect.c index 7db4be69..6d37f587 100644 --- a/xorg/X11R7.6/rdp/rdpPolyFillRect.c +++ b/xorg/X11R7.6/rdp/rdpPolyFillRect.c @@ -188,7 +188,7 @@ rdpPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill, pGC->alu == GXnoop || pGC->alu == GXand || pGC->alu == GXcopy /*|| - pGC->alu == GXxor*/)) /* todo, why dosen't xor work? */ + pGC->alu == GXxor*/)) /* todo, why doesn't xor work? */ { draw_item_add_fill_region(pDirtyPriv, fill_reg, pGC->fgPixel, pGC->alu); @@ -210,7 +210,7 @@ rdpPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill, pGC->alu == GXnoop || pGC->alu == GXand || pGC->alu == GXcopy /*|| - pGC->alu == GXxor*/)) /* todo, why dosen't xor work? */ + pGC->alu == GXxor*/)) /* todo, why doesn't xor work? */ { rdpup_set_fgcolor(pGC->fgPixel); rdpup_set_opcode(pGC->alu); @@ -253,7 +253,7 @@ rdpPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill, pGC->alu == GXnoop || pGC->alu == GXand || pGC->alu == GXcopy /*|| - pGC->alu == GXxor*/)) /* todo, why dosen't xor work? */ + pGC->alu == GXxor*/)) /* todo, why doesn't xor work? */ { LLOGLN(10, ("rdpPolyFillRect: 3")); draw_item_add_fill_region(pDirtyPriv, &clip_reg, @@ -280,7 +280,7 @@ rdpPolyFillRect(DrawablePtr pDrawable, GCPtr pGC, int nrectFill, pGC->alu == GXnoop || pGC->alu == GXand || pGC->alu == GXcopy /*|| - pGC->alu == GXxor*/)) /* todo, why dosen't xor work? */ + pGC->alu == GXxor*/)) /* todo, why doesn't xor work? */ { rdpup_set_fgcolor(pGC->fgPixel); rdpup_set_opcode(pGC->alu); diff --git a/xorg/X11R7.6/rdp/rdpdraw.c b/xorg/X11R7.6/rdp/rdpdraw.c index e276c0b7..51fe5c61 100644 --- a/xorg/X11R7.6/rdp/rdpdraw.c +++ b/xorg/X11R7.6/rdp/rdpdraw.c @@ -108,7 +108,7 @@ rdp_get_clip(RegionPtr pRegion, DrawablePtr pDrawable, GCPtr pGC) break; case CT_REGION: rv = 2; - RegionCopy(pRegion, pGC->clientClip); + RegionCopy(pRegion, pGC->pCompositeClip); break; default: rdpLog("unimp clip type %d\n", pGC->clientClipType); @@ -608,7 +608,7 @@ dump_draw_list(rdpPixmapRec* priv) /******************************************************************************/ /* returns boolean */ static int -region_interect_at_all(RegionPtr reg_small, RegionPtr reg_big) +region_intersect_at_all(RegionPtr reg_small, RegionPtr reg_big) { int rv; RegionRec reg; @@ -719,7 +719,7 @@ draw_item_pack(PixmapPtr pix, rdpPixmapRec *priv) { if ((di->type == RDI_TEXT) && (di_prev->type == RDI_IMGLY)) { - if (region_interect_at_all(di->reg, di_prev->reg)) + if (region_intersect_at_all(di->reg, di_prev->reg)) { di_prev->type = RDI_IMGLL; } diff --git a/xorg/X11R7.6/rdp/rdpglyph.c b/xorg/X11R7.6/rdp/rdpglyph.c index cb895ae5..f0dda8d4 100644 --- a/xorg/X11R7.6/rdp/rdpglyph.c +++ b/xorg/X11R7.6/rdp/rdpglyph.c @@ -503,7 +503,7 @@ rdp_text_chars_to_data(struct rdp_text* rtext) PictFormatPtr format; } GlyphListRec, *GlyphListPtr; */ -/* see ghyphstr.h but the follow is not in there +/* see glyphstr.h but the following is not in there typedef struct _XGlyphInfo { unsigned short width; unsigned short height; @@ -557,7 +557,7 @@ rdpGlyphu(CARD8 op, PicturePtr pSrc, PicturePtr pDst, post_process = 1; if (g_do_dirty_os) { - LLOGLN(10, ("rdpGlyphu: gettig dirty")); + LLOGLN(10, ("rdpGlyphu: getting dirty")); pDstPriv->is_dirty = 1; dirty_type = RDI_IMGLL; pDirtyPriv = pDstPriv; diff --git a/xorg/X11R7.6/rdp/rdpinput.c b/xorg/X11R7.6/rdp/rdpinput.c index a13c7b5b..6ef432e6 100644 --- a/xorg/X11R7.6/rdp/rdpinput.c +++ b/xorg/X11R7.6/rdp/rdpinput.c @@ -26,8 +26,8 @@ keyboard and mouse stuff flags right so control down is used to determine between pause and num lock */ /* this should be fixed in rdesktop */ -/* g_pause_spe flag for specal control sent by ms client before scan code - 69 is sent to tell that its pause, not num lock. both pause and num +/* g_pause_spe flag for special control sent by ms client before scan code + 69 is sent to tell that it's pause, not num lock. both pause and num lock use scan code 69 */ /* tab notes */ @@ -59,6 +59,8 @@ extern int g_alt_down; /* in rdpmain.c */ extern int g_ctrl_down; /* in rdpmain.c */ static int g_old_button_mask = 0; +static int g_old_x = 0; +static int g_old_y = 0; /* this is toggled every time num lock key is released, not like the above *_down vars */ static int g_scroll_lock_down = 0; @@ -66,7 +68,7 @@ static OsTimerPtr g_kbtimer = 0; static OsTimerPtr g_timer = 0; static int g_x = 0; static int g_y = 0; -static int g_timer_schedualed = 0; +static int g_timer_scheduled = 0; static int g_delay_motion = 1; /* turn on or off */ static int g_use_evdev = 0; @@ -180,7 +182,7 @@ rdpChangeKeyboardControl(DeviceIntPtr pDev, KeybdCtrl *ctrl) if (ctrls->enabled_ctrls & XkbRepeatKeysMask) { LLOGLN(10, ("rdpChangeKeyboardControl: autoRepeat on")); - /* schedual to turn off the autorepeat after 100 ms so any app + /* schedule to turn off the autorepeat after 100 ms so any app * polling it will be happy it's on */ g_kbtimer = TimerSet(g_kbtimer, 0, 100, rdpInDeferredUpdateCallback, 0); @@ -236,7 +238,7 @@ rdpChangeKeyboardControl(DeviceIntPtr pDev, KeybdCtrl *ctrl) 0x0000042C Azeri Latin 0x0000042F FYRO Macedonian 0x00000437 Georgian -0x00000438 Faeroese +0x00000438 Faroese 0x00000439 Devanagari - INSCRIPT 0x0000043A Maltese 47-key 0x0000043B Norwegian with Sami @@ -323,6 +325,10 @@ rdpLoadLayout(struct xrdp_client_info *client_info) { set.layout = client_info->layout; } + if (strlen(client_info->options) > 0) + { + set.options = client_info->options; + } retry: /* free some stuff so we can call InitKeyboardDeviceStruct again */ @@ -857,8 +863,13 @@ static CARD32 rdpDeferredInputCallback(OsTimerPtr timer, CARD32 now, pointer arg) { LLOGLN(10, ("rdpDeferredInputCallback:")); - g_timer_schedualed = 0; - rdpEnqueueMotion(g_x, g_y); + g_timer_scheduled = 0; + if ((g_old_x != g_x) || (g_old_y != g_y)) + { + rdpEnqueueMotion(g_x, g_y); + g_old_x = g_x; + g_old_y = g_x; + } return 0; } @@ -877,16 +888,21 @@ PtrAddEvent(int buttonMask, int x, int y) return; } send_now = (buttonMask ^ g_old_button_mask) || (g_delay_motion == 0); - LLOGLN(10, ("PtrAddEvent: send_now %d g_timer_schedualed %d", - send_now, g_timer_schedualed)); + LLOGLN(10, ("PtrAddEvent: send_now %d g_timer_scheduled %d", + send_now, g_timer_scheduled)); if (send_now) { - if (g_timer_schedualed) + if (g_timer_scheduled) { - g_timer_schedualed = 0; + g_timer_scheduled = 0; TimerCancel(g_timer); } - rdpEnqueueMotion(x, y); + if ((g_old_x != x) || (g_old_y != y)) + { + rdpEnqueueMotion(x, y); + g_old_x = x; + g_old_y = y; + } for (i = 0; i < 5; i++) { if ((buttonMask ^ g_old_button_mask) & (1 << i)) @@ -911,9 +927,9 @@ PtrAddEvent(int buttonMask, int x, int y) { g_x = x; g_y = y; - if (!g_timer_schedualed) + if (!g_timer_scheduled) { - g_timer_schedualed = 1; + g_timer_scheduled = 1; g_timer = TimerSet(g_timer, 0, 60, rdpDeferredInputCallback, 0); } } diff --git a/xorg/X11R7.6/rdp/rdpkeyboardbase.c b/xorg/X11R7.6/rdp/rdpkeyboardbase.c index 1c62541d..c35a0392 100644 --- a/xorg/X11R7.6/rdp/rdpkeyboardbase.c +++ b/xorg/X11R7.6/rdp/rdpkeyboardbase.c @@ -56,7 +56,7 @@ extern int g_tab_down; /* in rdpmain.c */ #define XSCAN_KP_3 89 #define XSCAN_KP_0 90 #define XSCAN_KP_Decimal 91 -/* "/ ?" on br keybaord */ +/* "/ ?" on br keyboard */ #define XSCAN_97 97 /* ------------------------------? */ #define XSCAN_Enter 108 /* 104 */ /* on keypad */ #define XSCAN_Control_R 109 /* 105 */ @@ -81,7 +81,7 @@ extern int g_tab_down; /* in rdpmain.c */ #define XSCAN_Menu 117 /* 135 */ #define XSCAN_LMeta 156 #define XSCAN_RMeta 156 -#define XSCAN_211 211 /* "/ ?" on br keybaord, "\ _" on jp keyboard */ +#define XSCAN_211 211 /* "/ ?" on br keyboard, "\ _" on jp keyboard */ /******************************************************************************/ void @@ -279,7 +279,7 @@ KbdAddEvent_base(int down, int param1, int param2, int param3, int param4) break; case RDPSCAN_115: - rdpEnqueueKey(type, XSCAN_211); /* "/ ?" on br keybaord, "\ _" on jp keyboard */ + rdpEnqueueKey(type, XSCAN_211); /* "/ ?" on br keyboard, "\ _" on jp keyboard */ break; case RDPSCAN_126: diff --git a/xorg/X11R7.6/rdp/rdpkeyboardevdev.c b/xorg/X11R7.6/rdp/rdpkeyboardevdev.c index 770a102f..0c560c83 100644 --- a/xorg/X11R7.6/rdp/rdpkeyboardevdev.c +++ b/xorg/X11R7.6/rdp/rdpkeyboardevdev.c @@ -56,7 +56,7 @@ extern int g_tab_down; /* in rdpmain.c */ #define XSCAN_KP_3 89 #define XSCAN_KP_0 90 #define XSCAN_KP_Decimal 91 -/* "/ ?" on br keybaord */ +/* "/ ?" on br keyboard */ #define XSCAN_97 97 #define XSCAN_Enter 104 /* on keypad */ #define XSCAN_Control_R 105 @@ -278,7 +278,7 @@ KbdAddEvent_evdev(int down, int param1, int param2, int param3, int param4) break; case RDPSCAN_115: - rdpEnqueueKey(type, XSCAN_97); /* "/ ?" on br keybaord */ + rdpEnqueueKey(type, XSCAN_97); /* "/ ?" on br keyboard */ break; case RDPSCAN_126: diff --git a/xorg/X11R7.6/rdp/rdpmain.c b/xorg/X11R7.6/rdp/rdpmain.c index 884b8a3a..7540e12e 100644 --- a/xorg/X11R7.6/rdp/rdpmain.c +++ b/xorg/X11R7.6/rdp/rdpmain.c @@ -41,7 +41,7 @@ Sets up the functions #endif #if XRDP_DISABLE_LINUX_ABSTRACT -/* because including <X11/Xtrans/Xtransint.h> in problematic +/* because including <X11/Xtrans/Xtransint.h> is problematic * we dup a small struct * we need to set flags to zero to turn off abstract sockets */ struct _MyXtransport @@ -139,6 +139,8 @@ static miPointerScreenFuncRec g_rdpPointerCursorFuncs = rdpPointerNewEventScreen }; +int glGetBufferSubData(void); + /******************************************************************************/ /* returns error, zero is good */ static int @@ -189,6 +191,11 @@ set_bpp(int bpp) g_greenBits = 8; g_blueBits = 8; } + else if (g_bpp == 33) + { + /* will never happen */ + glGetBufferSubData(); + } else { rv = 1; @@ -297,8 +304,8 @@ rdpScreenInit(int index, ScreenPtr pScreen, int argc, char **argv) ErrorF("\n"); ErrorF("X11rdp, an X server for xrdp\n"); ErrorF("Version %s\n", X11RDPVER); - ErrorF("Copyright (C) 2005-2012 Jay Sorg\n"); - ErrorF("See http://xrdp.sf.net for information on xrdp.\n"); + ErrorF("Copyright (C) 2005-2015 Jay Sorg\n"); + ErrorF("See http://www.xrdp.org for information on xrdp.\n"); #if defined(XORG_VERSION_CURRENT) && defined (XVENDORNAME) ErrorF("Underlying X server release %d, %s\n", XORG_VERSION_CURRENT, XVENDORNAME); @@ -414,7 +421,7 @@ rdpScreenInit(int index, ScreenPtr pScreen, int argc, char **argv) g_rdpScreen.CloseScreen = pScreen->CloseScreen; /* GC procedures */ g_rdpScreen.CreateGC = pScreen->CreateGC; - /* Pixmap procudures */ + /* Pixmap procedures */ g_rdpScreen.CreatePixmap = pScreen->CreatePixmap; g_rdpScreen.DestroyPixmap = pScreen->DestroyPixmap; @@ -590,7 +597,7 @@ rdpScreenInit(int index, ScreenPtr pScreen, int argc, char **argv) /******************************************************************************/ /* this is the first function called, it can be called many times returns the number or parameters processed - if it dosen't apply to the rdp part, return 0 */ + if it doesn't apply to the rdp part, return 0 */ int ddxProcessArgument(int argc, char **argv, int i) { @@ -654,7 +661,7 @@ void OsVendorInit(void) { #if XRDP_DISABLE_LINUX_ABSTRACT - /* turn off the Linux abstract unix doamin sockets TRANS_ABSTRACT */ + /* turn off the Linux abstract unix domain sockets TRANS_ABSTRACT */ /* TRANS_NOLISTEN = 1 << 3 */ _XSERVTransSocketLocalFuncs.flags = 0; #endif diff --git a/xorg/X11R7.6/rdp/rdpmisc.c b/xorg/X11R7.6/rdp/rdpmisc.c index 1d57d1fa..f8316ff8 100644 --- a/xorg/X11R7.6/rdp/rdpmisc.c +++ b/xorg/X11R7.6/rdp/rdpmisc.c @@ -254,7 +254,7 @@ g_malloc(int size, int zero) //#ifdef _XSERVER64 #if 1 - /* I thought xalloc whould work here but I guess not, why, todo */ + /* I thought xalloc would work here but I guess not, why, todo */ rv = (char *)malloc(size); #else rv = (char *)Xalloc(size); @@ -279,7 +279,7 @@ g_free(void *ptr) { //#ifdef _XSERVER64 #if 1 - /* I thought xfree whould work here but I guess not, why, todo */ + /* I thought xfree would work here but I guess not, why, todo */ free(ptr); #else Xfree(ptr); diff --git a/xorg/X11R7.6/rdp/rdprandr.c b/xorg/X11R7.6/rdp/rdprandr.c index d0ee6b1c..664a2244 100644 --- a/xorg/X11R7.6/rdp/rdprandr.c +++ b/xorg/X11R7.6/rdp/rdprandr.c @@ -38,6 +38,14 @@ extern WindowPtr g_invalidate_window; /* in rdpmain.c */ static XID g_wid = 0; +static int g_panning = 0; + +#define LOG_LEVEL 1 +#define LLOG(_level, _args) \ + do { if (_level < LOG_LEVEL) { ErrorF _args ; } } while (0) +#define LLOGLN(_level, _args) \ + do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0) + /******************************************************************************/ Bool rdpRRRegisterSize(ScreenPtr pScreen, int width, int height) @@ -68,15 +76,8 @@ rdpRRSetConfig(ScreenPtr pScreen, Rotation rotateKind, int rate, Bool rdpRRGetInfo(ScreenPtr pScreen, Rotation *pRotations) { - int width; - int height; - ErrorF("rdpRRGetInfo:\n"); *pRotations = RR_Rotate_0; - - width = g_rdpScreen.width; - height = g_rdpScreen.height; - rdpRRRegisterSize(pScreen, width, height); return TRUE; } @@ -214,6 +215,19 @@ Bool rdpRRCrtcGetGamma(ScreenPtr pScreen, RRCrtcPtr crtc) { ErrorF("rdpRRCrtcGetGamma:\n"); + crtc->gammaSize = 1; + if (crtc->gammaRed == NULL) + { + crtc->gammaRed = g_malloc(32, 1); + } + if (crtc->gammaBlue == NULL) + { + crtc->gammaBlue = g_malloc(32, 1); + } + if (crtc->gammaGreen == NULL) + { + crtc->gammaGreen = g_malloc(32, 1); + } return TRUE; } @@ -257,6 +271,11 @@ rdpRRGetPanning(ScreenPtr pScrn, RRCrtcPtr crtc, BoxPtr totalArea, { ErrorF("rdpRRGetPanning:\n"); + if (!g_panning) + { + return FALSE; + } + if (totalArea != 0) { totalArea->x1 = 0; @@ -292,3 +311,146 @@ rdpRRSetPanning(ScreenPtr pScrn, RRCrtcPtr crtc, BoxPtr totalArea, ErrorF("rdpRRSetPanning:\n"); return TRUE; } + +/******************************************************************************/ +static RROutputPtr +rdpRRAddOutput(const char *aname, int x, int y, int width, int height) +{ + RRModePtr mode; + RRCrtcPtr crtc; + RROutputPtr output; + xRRModeInfo modeInfo; + char name[64]; + const int vfreq = 50; + + sprintf (name, "%dx%d", width, height); + memset (&modeInfo, 0, sizeof(modeInfo)); + modeInfo.width = width; + modeInfo.height = height; + modeInfo.hTotal = width; + modeInfo.vTotal = height; + modeInfo.dotClock = vfreq * width * height; + modeInfo.nameLength = strlen(name); + mode = RRModeGet(&modeInfo, name); + if (mode == 0) + { + LLOGLN(0, ("rdpRRAddOutput: RRModeGet failed")); + return 0; + } + + crtc = RRCrtcCreate(g_pScreen, NULL); + if (crtc == 0) + { + LLOGLN(0, ("rdpRRAddOutput: RRCrtcCreate failed")); + RRModeDestroy(mode); + return 0; + } + output = RROutputCreate(g_pScreen, aname, strlen(aname), NULL); + if (output == 0) + { + LLOGLN(0, ("rdpRRAddOutput: RROutputCreate failed")); + RRCrtcDestroy(crtc); + RRModeDestroy(mode); + return 0; + } + if (!RROutputSetClones(output, NULL, 0)) + { + LLOGLN(0, ("rdpRRAddOutput: RROutputSetClones failed")); + } + if (!RROutputSetModes(output, &mode, 1, 0)) + { + LLOGLN(0, ("rdpRRAddOutput: RROutputSetModes failed")); + } + if (!RROutputSetCrtcs(output, &crtc, 1)) + { + LLOGLN(0, ("rdpRRAddOutput: RROutputSetCrtcs failed")); + } + if (!RROutputSetConnection(output, RR_Connected)) + { + LLOGLN(0, ("rdpRRAddOutput: RROutputSetConnection failed")); + } + RRCrtcNotify(crtc, mode, x, y, RR_Rotate_0, NULL, 1, &output); + + return output; +} + +/******************************************************************************/ +static void +RRSetPrimaryOutput(rrScrPrivPtr pScrPriv, RROutputPtr output) +{ + if (pScrPriv->primaryOutput == output) + { + return; + } + /* clear the old primary */ + if (pScrPriv->primaryOutput) + { + RROutputChanged(pScrPriv->primaryOutput, 0); + pScrPriv->primaryOutput = NULL; + } + /* set the new primary */ + if (output) + { + pScrPriv->primaryOutput = output; + RROutputChanged(output, 0); + } + pScrPriv->layoutChanged = TRUE; +} + +/******************************************************************************/ +int +rdpRRSetRdpOutputs(void) +{ + rrScrPrivPtr pRRScrPriv; + int index; + int width; + int height; + char text[256]; + RROutputPtr output; + + pRRScrPriv = rrGetScrPriv(g_pScreen); + + LLOGLN(0, ("rdpRRSetRdpOutputs: numCrtcs %d", pRRScrPriv->numCrtcs)); + while (pRRScrPriv->numCrtcs > 0) + { + RRCrtcDestroy(pRRScrPriv->crtcs[0]); + } + LLOGLN(0, ("rdpRRSetRdpOutputs: numOutputs %d", pRRScrPriv->numOutputs)); + while (pRRScrPriv->numOutputs > 0) + { + RROutputDestroy(pRRScrPriv->outputs[0]); + } + + if (g_rdpScreen.client_info.monitorCount == 0) + { + rdpRRAddOutput("rdp0", 0, 0, g_rdpScreen.width, g_rdpScreen.height); + } + else + { + for (index = 0; index < g_rdpScreen.client_info.monitorCount; index++) + { + snprintf(text, 255, "rdp%d", index); + width = g_rdpScreen.client_info.minfo[index].right - g_rdpScreen.client_info.minfo[index].left + 1; + height = g_rdpScreen.client_info.minfo[index].bottom - g_rdpScreen.client_info.minfo[index].top + 1; + output = rdpRRAddOutput(text, + g_rdpScreen.client_info.minfo[index].left, + g_rdpScreen.client_info.minfo[index].top, + width, height); + if ((output != 0) && (g_rdpScreen.client_info.minfo[index].is_primary)) + { + RRSetPrimaryOutput(pRRScrPriv, output); + } + } + } + +#if 0 + for (index = 0; index < pRRScrPriv->numOutputs; index++) + { + RROutputSetCrtcs(pRRScrPriv->outputs[index], pRRScrPriv->crtcs, + pRRScrPriv->numCrtcs); + } +#endif + + return 0; +} + diff --git a/xorg/X11R7.6/rdp/rdprandr.h b/xorg/X11R7.6/rdp/rdprandr.h index 3aba7e1a..1860fa96 100644 --- a/xorg/X11R7.6/rdp/rdprandr.h +++ b/xorg/X11R7.6/rdp/rdprandr.h @@ -57,4 +57,7 @@ Bool rdpRRSetPanning(ScreenPtr pScrn, RRCrtcPtr crtc, BoxPtr totalArea, BoxPtr trackingArea, INT16* border); +int +rdpRRSetRdpOutputs(void); + #endif diff --git a/xorg/X11R7.6/rdp/rdpup.c b/xorg/X11R7.6/rdp/rdpup.c index f25b390a..54eb779d 100644 --- a/xorg/X11R7.6/rdp/rdpup.c +++ b/xorg/X11R7.6/rdp/rdpup.c @@ -22,6 +22,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "rdp.h" #include "xrdp_rail.h" #include "rdpglyph.h" +#include "rdprandr.h" #include <signal.h> #include <sys/ipc.h> @@ -35,7 +36,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0) static int g_use_shmem = 1; /* turns on or off */ -static int g_shmemid = 0; +static int g_shmemid = -1; static char *g_shmemptr = 0; static int g_shmem_lineBytes = 0; static RegionPtr g_shm_reg = 0; @@ -712,7 +713,6 @@ sck_can_recv(int sck, int millis) static int process_screen_size_msg(int width, int height, int bpp) { - RRScreenSizePtr pSize; int mmwidth; int mmheight; int bytes; @@ -750,29 +750,40 @@ process_screen_size_msg(int width, int height, int bpp) if (g_shmemptr != 0) { shmdt(g_shmemptr); + g_shmemptr = 0; } bytes = g_rdpScreen.rdp_width * g_rdpScreen.rdp_height * g_rdpScreen.rdp_Bpp; g_shmemid = shmget(IPC_PRIVATE, bytes, IPC_CREAT | 0777); - g_shmemptr = shmat(g_shmemid, 0, 0); - shmctl(g_shmemid, IPC_RMID, NULL); - LLOGLN(0, ("process_screen_size_msg: g_shmemid %d g_shmemptr %p", - g_shmemid, g_shmemptr)); - g_shmem_lineBytes = g_rdpScreen.rdp_Bpp * g_rdpScreen.rdp_width; - - if (g_shm_reg != 0) + if (g_shmemid != -1) { - RegionDestroy(g_shm_reg); + g_shmemptr = shmat(g_shmemid, 0, 0); + if (g_shmemptr == (void *) -1) + { + LLOGLN(0, ("process_screen_size_msg: shmat failed for %d " + "bytes g_shmemid %d", bytes, g_shmemid)); + g_shmemptr = 0; + shmctl(g_shmemid, IPC_RMID, NULL); + g_shmemid = -1; + } + else + { + shmctl(g_shmemid, IPC_RMID, NULL); + } + LLOGLN(0, ("process_screen_size_msg: g_shmemid %d g_shmemptr %p", + g_shmemid, g_shmemptr)); + g_shmem_lineBytes = g_rdpScreen.rdp_Bpp * g_rdpScreen.rdp_width; + if (g_shm_reg != 0) + { + RegionDestroy(g_shm_reg); + } + g_shm_reg = RegionCreate(NullBox, 0); } - g_shm_reg = RegionCreate(NullBox, 0); } mmwidth = PixelToMM(width); mmheight = PixelToMM(height); - pSize = RRRegisterSize(g_pScreen, width, height, mmwidth, mmheight); - RRSetCurrentConfig(g_pScreen, RR_Rotate_0, 0, pSize); - if ((g_rdpScreen.width != width) || (g_rdpScreen.height != height)) { LLOGLN(0, (" calling RRScreenSizeSet")); @@ -916,6 +927,7 @@ rdpup_process_msg(struct stream *s) int y; int cx; int cy; + int index; RegionRec reg; BoxRec box; @@ -1105,16 +1117,45 @@ rdpup_process_msg(struct stream *s) { LLOGLN(0, (" client can not do new(color) cursor")); } + if (g_rdpScreen.client_info.monitorCount > 0) { LLOGLN(0, (" client can do multimon")); LLOGLN(0, (" client monitor data, monitorCount= %d", g_rdpScreen.client_info.monitorCount)); + box.x1 = g_rdpScreen.client_info.minfo[0].left; + box.y1 = g_rdpScreen.client_info.minfo[0].top; + box.x2 = g_rdpScreen.client_info.minfo[0].right; + box.y2 = g_rdpScreen.client_info.minfo[0].bottom; g_do_multimon = 1; + /* adjust monitor info so it's not negative */ + for (index = 1; index < g_rdpScreen.client_info.monitorCount; index++) + { + box.x1 = min(box.x1, g_rdpScreen.client_info.minfo[index].left); + box.y1 = min(box.y1, g_rdpScreen.client_info.minfo[index].top); + box.x2 = max(box.x2, g_rdpScreen.client_info.minfo[index].right); + box.y2 = max(box.y2, g_rdpScreen.client_info.minfo[index].bottom); + } + for (index = 0; index < g_rdpScreen.client_info.monitorCount; index++) + { + g_rdpScreen.client_info.minfo[index].left -= box.x1; + g_rdpScreen.client_info.minfo[index].top -= box.y1; + g_rdpScreen.client_info.minfo[index].right -= box.x1; + g_rdpScreen.client_info.minfo[index].bottom -= box.y1; + LLOGLN(0, (" left %d top %d right %d bottom %d", + g_rdpScreen.client_info.minfo[index].left, + g_rdpScreen.client_info.minfo[index].top, + g_rdpScreen.client_info.minfo[index].right, + g_rdpScreen.client_info.minfo[index].bottom)); + } + rdpRRSetRdpOutputs(); + RRTellChanged(g_pScreen); } else { LLOGLN(0, (" client can not do multimon")); g_do_multimon = 0; + rdpRRSetRdpOutputs(); + RRTellChanged(g_pScreen); } rdpLoadLayout(&(g_rdpScreen.client_info)); @@ -1305,7 +1346,7 @@ rdpup_init(void) g_disconnect_timeout_s = 60; } - rdpLog("kill disconencted [%d] timeout [%d] sec\n", g_do_kill_disconnected, + rdpLog("kill disconnected [%d] timeout [%d] sec\n", g_do_kill_disconnected, g_disconnect_timeout_s); return 1; @@ -2108,7 +2149,7 @@ rdpup_send_area(struct image_data *id, int x, int y, int w, int h) safety = 0; while (RegionContainsRect(g_shm_reg, &box)) { - /* instread of rdpup_end_update, call rdpup_send_pending */ + /* instead of rdpup_end_update, call rdpup_send_pending */ rdpup_send_pending(); rdpup_begin_update(); safety++; @@ -2809,7 +2850,7 @@ rdpup_check_alpha_dirty(PixmapPtr pDirtyPixmap, rdpPixmapRec* pDirtyPriv) /******************************************************************************/ int -rdpup_add_char(int font, int charactor, short x, short y, int cx, int cy, +rdpup_add_char(int font, int character, short x, short y, int cx, int cy, char* bmpdata, int bmpdata_bytes) { if (g_connected) @@ -2820,7 +2861,7 @@ rdpup_add_char(int font, int charactor, short x, short y, int cx, int cy, out_uint16_le(g_out_s, 18 + bmpdata_bytes); /* size */ g_count++; out_uint16_le(g_out_s, font); - out_uint16_le(g_out_s, charactor); + out_uint16_le(g_out_s, character); out_uint16_le(g_out_s, x); out_uint16_le(g_out_s, y); out_uint16_le(g_out_s, cx); @@ -2833,7 +2874,7 @@ rdpup_add_char(int font, int charactor, short x, short y, int cx, int cy, /******************************************************************************/ int -rdpup_add_char_alpha(int font, int charactor, short x, short y, int cx, int cy, +rdpup_add_char_alpha(int font, int character, short x, short y, int cx, int cy, char* bmpdata, int bmpdata_bytes) { if (g_connected) @@ -2844,7 +2885,7 @@ rdpup_add_char_alpha(int font, int charactor, short x, short y, int cx, int cy, out_uint16_le(g_out_s, 18 + bmpdata_bytes); /* size */ g_count++; out_uint16_le(g_out_s, font); - out_uint16_le(g_out_s, charactor); + out_uint16_le(g_out_s, character); out_uint16_le(g_out_s, x); out_uint16_le(g_out_s, y); out_uint16_le(g_out_s, cx); diff --git a/xorg/X11R7.6/rdp/rdpxv.c b/xorg/X11R7.6/rdp/rdpxv.c index d0ce8345..99fbd993 100644 --- a/xorg/X11R7.6/rdp/rdpxv.c +++ b/xorg/X11R7.6/rdp/rdpxv.c @@ -165,7 +165,7 @@ static int rdpXvSetPortAttribute(ClientPtr client, XvPortPtr pPort, Atom attribute, INT32 value) { - LLOGLN(0, ("rdpXvxSetPortAttribute:")); + LLOGLN(0, ("rdpXvSetPortAttribute:")); return Success; } |