aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/hw/nxagent/Events.c
diff options
context:
space:
mode:
authorReinhard Tartler <siretart@tauware.de>2011-10-10 17:58:55 +0200
committerReinhard Tartler <siretart@tauware.de>2011-10-10 17:58:55 +0200
commitb79164001d1eb06f4591c59b7a7c2c0fb29e992b (patch)
treed211626f0f91a07ac22c1b254a6300bebf732ea6 /nx-X11/programs/Xserver/hw/nxagent/Events.c
parent1c25e92b9ea5811d8ab9c2bfdc0dcb2e4d21bd0a (diff)
downloadnx-libs-b79164001d1eb06f4591c59b7a7c2c0fb29e992b.tar.gz
nx-libs-b79164001d1eb06f4591c59b7a7c2c0fb29e992b.tar.bz2
nx-libs-b79164001d1eb06f4591c59b7a7c2c0fb29e992b.zip
Imported nxagent-3.2.0-5.tar.gznxagent/3.2.0-5
Summary: Imported nxagent-3.2.0-5.tar.gz Keywords: Imported nxagent-3.2.0-5.tar.gz into Git repository
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent/Events.c')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Events.c56
1 files changed, 51 insertions, 5 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c
index b37d81adf..90fb7641b 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Events.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c
@@ -2261,11 +2261,7 @@ int nxagentHandleClientMessageEvent(XEvent *X, enum HandleEventResult *result)
{
pScreen = nxagentScreen(X -> xmap.window);
- XMapRaised(nxagentDisplay, nxagentFullscreenWindow);
-
- XIconifyWindow(nxagentDisplay, nxagentIconWindow,
- DefaultScreen(nxagentDisplay));
-
+ nxagentMaximizeToFullScreen(pScreen);
}
if (X -> xclient.window == (nxagentOption(Fullscreen) ?
@@ -3062,6 +3058,56 @@ int nxagentHandleReparentNotify(XEvent* X)
return 1;
}
+ else
+ {
+ /*
+ * This code is supposed to detect if a window manager
+ * is running but in some cases it may be unreliable.
+ * Each window manager behaves differently so the check
+ * can fail for some less common WMs.
+ */
+
+ if (!nxagentWMIsRunning && nxagentOption(Fullscreen) &&
+ X -> xreparent.window == nxagentDefaultWindows[pScreen -> myNum])
+ {
+ #ifdef WARNING
+ fprintf(stderr, "Warning: The agent window was reparented. Is a "
+ "window manager running?\n");
+ #endif
+
+ /*
+ * If no window manager is running and we are supposed to
+ * be in fullscreen mode then don't wait for the reparent
+ * event. We can assume that there is an undetected window
+ * manager and, as switching to fullscreen could have fail-
+ * ed, we try it again.
+ */
+
+ nxagentSwitchFullscreen(pScreen, True);
+
+ nxagentWMIsRunning = True;
+ }
+ else if (nxagentWMIsRunning && X -> xreparent.window ==
+ nxagentDefaultWindows[pScreen -> myNum] && X -> xreparent.parent ==
+ RootWindow(nxagentDisplay, (pScreen -> myNum)))
+ {
+ #ifdef WARNING
+
+ fprintf(stderr, "Warning: The agent window has been reparented to the root.\n");
+
+ fprintf(stderr, "Warning: No window manager seems to be running.\n");
+
+ #endif
+
+ /*
+ * The agent window was unexpectedly reparented
+ * to the root window. We assume that the window
+ * manager was terminated.
+ */
+
+ nxagentWMIsRunning = False;
+ }
+ }
return 1;
}