aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/hw/nxagent/Events.c
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2015-12-30 00:06:58 +0100
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2015-12-30 00:06:58 +0100
commit1391c0ad76cb1f8588a08f9350d2ba1fe98b8b6b (patch)
treec2d62e905a69bdbc787a6599b8b0f0e21fcdfe70 /nx-X11/programs/Xserver/hw/nxagent/Events.c
parente4763fb4879ce8782e50c784ed9e7d8c5a1b7322 (diff)
parentc4a388937baad8215f2650d746d3ddba4d4d1ee3 (diff)
downloadnx-libs-1391c0ad76cb1f8588a08f9350d2ba1fe98b8b6b.tar.gz
nx-libs-1391c0ad76cb1f8588a08f9350d2ba1fe98b8b6b.tar.bz2
nx-libs-1391c0ad76cb1f8588a08f9350d2ba1fe98b8b6b.zip
Merge branch 'sunweaver-pr/xinerama-xrandr' into 3.6.x
Attributes GH PR #66: https://github.com/ArcticaProject/nx-libs/pull/66
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent/Events.c')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Events.c46
1 files changed, 42 insertions, 4 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c
index 9f7d6280f..c04481c92 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Events.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c
@@ -568,6 +568,10 @@ void nxagentSwitchResizeMode(ScreenPtr pScreen)
{
XSizeHints sizeHints;
+ #ifdef DEBUG
+ fprintf(stderr, "nxagentSwitchResizeMode called.\n");
+ #endif
+
int desktopResize = nxagentOption(DesktopResize);
nxagentChangeOption(DesktopResize, !desktopResize);
@@ -3366,7 +3370,9 @@ int nxagentHandleConfigureNotify(XEvent* X)
if (nxagentOption(DesktopResize) == 1)
{
if (nxagentOption(Width) != X -> xconfigure.width ||
- nxagentOption(Height) != X -> xconfigure.height)
+ nxagentOption(Height) != X -> xconfigure.height ||
+ nxagentOption(X) != X -> xconfigure.x ||
+ nxagentOption(Y) != X -> xconfigure.y)
{
Bool newEvents = False;
@@ -3423,11 +3429,16 @@ int nxagentHandleConfigureNotify(XEvent* X)
nxagentMoveViewport(pScreen, 0, 0);
+ /* if in shadowing mode or if neither size nor position have
+ changed we do not need to adjust RandR */
+ /* FIXME: Comment makes no sense */
if (nxagentOption(Shadow) == 1 ||
(nxagentOption(Width) == nxagentOption(RootWidth) &&
- nxagentOption(Height) == nxagentOption(RootHeight)))
+ nxagentOption(Height) == nxagentOption(RootHeight) &&
+ nxagentOption(X) == nxagentOption(RootX) &&
+ nxagentOption(Y) == nxagentOption(RootY)))
{
- doRandR = 0;
+ doRandR = False;
}
nxagentChangeOption(Width, X -> xconfigure.width);
@@ -3466,12 +3477,31 @@ int nxagentHandleConfigureNotify(XEvent* X)
#endif
nxagentChangeScreenConfig(0, nxagentOption(Width),
- nxagentOption(Height), 0, 0);
+ nxagentOption(Height), 0, 0);
}
}
return 1;
}
+ else
+ {
+ if ( (X -> xconfigure.window == DefaultRootWindow(nxagentDisplay)) || nxagentFullscreenWindow )
+ {
+ #ifdef TEST
+ fprintf(stderr, "nxagentHandleConfigureNotify: remote root window has changed: %d,%d %dx%d\n", X -> xconfigure.x, X -> xconfigure.y, X -> xconfigure.width, X -> xconfigure.height);
+ #endif
+
+ nxagentChangeOption(RootX, X -> xconfigure.x);
+ nxagentChangeOption(RootY, X -> xconfigure.y);
+ nxagentChangeOption(RootWidth, X -> xconfigure.width);
+ nxagentChangeOption(RootHeight, X -> xconfigure.height);
+
+ nxagentChangeScreenConfig(0, nxagentOption(Width),
+ nxagentOption(Height), 0, 0);
+
+ return 1;
+ }
+ }
}
return 0;
@@ -4416,6 +4446,10 @@ int nxagentHandleRRScreenChangeNotify(XEvent *X)
{
XRRScreenChangeNotifyEvent *Xr;
+ #ifdef DEBUG
+ fprintf(stderr, "nxagentHandleRRScreenChangeNotify called.\n");
+ #endif
+
Xr = (XRRScreenChangeNotifyEvent *) X;
nxagentResizeScreen(screenInfo.screens[DefaultScreen(nxagentDisplay)], Xr -> width, Xr -> height,
@@ -4504,6 +4538,10 @@ int nxagentWaitEvents(Display *dpy, struct timeval *tm)
{
XEvent ev;
+ #ifdef DEBUG
+ fprintf(stderr, "nxagentWaitEvents called.\n");
+ #endif
+
NXFlushDisplay(dpy, NXFlushLink);
/*