aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2020-05-25 18:52:36 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2020-10-17 22:38:05 +0200
commita4dd6a462d79c5c85ba43923fb5414cef62574f3 (patch)
tree8c1ba3139d2091038d5edd97d4f1808a7a3c1b6e
parentffbc63f918d1ae1f340a67b96f89906ccc88758e (diff)
downloadnx-libs-a4dd6a462d79c5c85ba43923fb5414cef62574f3.tar.gz
nx-libs-a4dd6a462d79c5c85ba43923fb5414cef62574f3.tar.bz2
nx-libs-a4dd6a462d79c5c85ba43923fb5414cef62574f3.zip
Events.c: store parent window from event to meaningful variable
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Events.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Events.c b/nx-X11/programs/Xserver/hw/nxagent/Events.c
index bfce2f012..172715987 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Events.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Events.c
@@ -3602,9 +3602,9 @@ int nxagentHandleReparentNotify(XEvent* X)
* Calculate the absolute upper-left X e Y
*/
+ XlibWindow parent = X -> xreparent.parent;
XWindowAttributes attributes;
- if ((XGetWindowAttributes(nxagentDisplay, X -> xreparent.window,
- &attributes) == 0))
+ if ((XGetWindowAttributes(nxagentDisplay, parent, &attributes) == 0))
{
#ifdef WARNING
fprintf(stderr, "%s: WARNING! XGetWindowAttributes for parent window failed.\n", __func__);
@@ -3622,7 +3622,7 @@ int nxagentHandleReparentNotify(XEvent* X)
int before_y = y;
#endif
- XTranslateCoordinates(nxagentDisplay, X -> xreparent.window,
+ XTranslateCoordinates(nxagentDisplay, parent,
attributes.root, -attributes.border_width,
-attributes.border_width, &x, &y, &junk);
@@ -3634,9 +3634,7 @@ int nxagentHandleReparentNotify(XEvent* X)
* Calculate the parent X and parent Y.
*/
- XlibWindow w = X -> xreparent.parent;
-
- if (w != DefaultRootWindow(nxagentDisplay))
+ if (parent != DefaultRootWindow(nxagentDisplay))
{
XlibWindow rootReturn = 0;
XlibWindow parentReturn = 0;
@@ -3645,7 +3643,7 @@ int nxagentHandleReparentNotify(XEvent* X)
do
{
- Status result = XQueryTree(nxagentDisplay, w, &rootReturn, &parentReturn,
+ Status result = XQueryTree(nxagentDisplay, parent, &rootReturn, &parentReturn,
&childrenReturn, &nchildrenReturn);
SAFE_XFree(childrenReturn);
@@ -3655,7 +3653,7 @@ int nxagentHandleReparentNotify(XEvent* X)
break;
}
- w = parentReturn;
+ parent = parentReturn;
}
while (True);
@@ -3663,7 +3661,7 @@ int nxagentHandleReparentNotify(XEvent* X)
* WM reparented. Find edge of the frame.
*/
- if (XGetWindowAttributes(nxagentDisplay, w, &attributes) == 0)
+ if (XGetWindowAttributes(nxagentDisplay, parent, &attributes) == 0)
{
#ifdef WARNING
fprintf(stderr, "%s: WARNING! XGetWindowAttributes failed for parent window.\n", __func__);