Skip to content

Commit

Permalink
Adding LRandR extension.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nexarian committed May 10, 2022
1 parent 87b822e commit 0dd978c
Show file tree
Hide file tree
Showing 5 changed files with 1,435 additions and 7 deletions.
6 changes: 6 additions & 0 deletions module/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ EXTRA_HEADERS += rdpEgl.h
EGLLIB += -lepoxy
endif

if WITH_LRANDR
EXTRA_FLAGS += -DXORGXRDP_LRANDR
EXTRA_SOURCES += rdpLRandR.c
EXTRA_HEADERS += rdpLRandR.h
endif

AM_CFLAGS = \
$(XORG_SERVER_CFLAGS) \
$(XRDP_CFLAGS) \
Expand Down
21 changes: 19 additions & 2 deletions module/rdpClientCon.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,14 @@ Client connection to xrdp
#include "rdpInput.h"
#include "rdpReg.h"
#include "rdpCapture.h"
#include "rdpRandR.h"
#include <limits.h>

#if defined(XORGXRDP_LRANDR)
#include "rdpLRandR.h"
#else
#include "rdpRandR.h"
#endif

#define LOG_LEVEL 1
#define LLOGLN(_level, _args) \
do { if (_level < LOG_LEVEL) { ErrorF _args ; ErrorF("\n"); } } while (0)
Expand Down Expand Up @@ -843,11 +848,16 @@ rdpClientConProcessScreenSizeMsg(rdpPtr dev, rdpClientCon *clientCon,

if ((dev->width != width) || (dev->height != height))
{
#if defined(XORGXRDP_LRANDR)
ok = rdpLRRScreenSizeSet(dev, width, height, mmwidth, mmheight);
LLOGLN(0, ("rdpClientConProcessScreenSizeMsg: LRRScreenSizeSet ok=[%d]", ok));
#else
dev->allow_screen_resize = 1;
ok = RRScreenSizeSet(dev->pScreen, width, height, mmwidth, mmheight);
dev->allow_screen_resize = 0;
LLOGLN(0, ("rdpClientConProcessScreenSizeMsg: RRScreenSizeSet ok=[%d]", ok));
RRTellChanged(dev->pScreen);
#endif
}

return 0;
Expand Down Expand Up @@ -1235,18 +1245,25 @@ rdpClientConProcessMsgClientInfo(rdpPtr dev, rdpClientCon *clientCon)
dev->minfo[index].right,
dev->minfo[index].bottom));
}

#if defined(XORGXRDP_LRANDR)
rdpLRRSetRdpOutputs(dev);
#else
rdpRRSetRdpOutputs(dev);
RRTellChanged(dev->pScreen);
#endif
}
else
{
LLOGLN(0, (" client can not do multimon"));
clientCon->doMultimon = 0;
dev->doMultimon = 0;
dev->monitorCount = 0;
#if defined(XORGXRDP_LRANDR)
rdpLRRSetRdpOutputs(dev);
#else
rdpRRSetRdpOutputs(dev);
RRTellChanged(dev->pScreen);
#endif
}

/* rdpLoadLayout */
Expand Down
Loading

0 comments on commit 0dd978c

Please sign in to comment.