aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/hw/nxagent/Events.c
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2015-05-02 21:53:25 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2015-12-30 00:05:53 +0100
commitc6482d24fff982d5e11636167c719766f8207d48 (patch)
treeec795c2bb2bc56d76e8d8e67fec48ce5d55512e5 /nx-X11/programs/Xserver/hw/nxagent/Events.c
parent2d776b14fddc5ec70c97aa82672f3a7c9caef6a3 (diff)
downloadnx-libs-c6482d24fff982d5e11636167c719766f8207d48.tar.gz
nx-libs-c6482d24fff982d5e11636167c719766f8207d48.tar.bz2
nx-libs-c6482d24fff982d5e11636167c719766f8207d48.zip
Reimplement xinerama via randr in nxagent (not libNX_Xinerama). (Fixes ArcticaProject/nx-libs#23).
No more xinerama faking, just use existing xrandr extension and initalize it properly. Xinerama then works automatically. Fixes ArcticaProject/nx-libs#23
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..03b14f0dc 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))
+ {
+ #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);
/*