aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/hw/nxagent
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2024-06-04 23:45:58 +0200
committerUlrich Sibiller <uli42@gmx.de>2024-06-05 00:06:57 +0200
commit4bed83a2e29fcb1b92b7a8f8cba9134682f80a7a (patch)
tree8f6bf9cf6e292e4b670874349e5c9ac616ecbe79 /nx-X11/programs/Xserver/hw/nxagent
parent48fd5937aca3abaed0a4fd4d8ea105c3dc5c0c69 (diff)
downloadnx-libs-4bed83a2e29fcb1b92b7a8f8cba9134682f80a7a.tar.gz
nx-libs-4bed83a2e29fcb1b92b7a8f8cba9134682f80a7a.tar.bz2
nx-libs-4bed83a2e29fcb1b92b7a8f8cba9134682f80a7a.zip
Window.c: align identical code
nxagentCreateWindow and nxagentReconnectWindow are very similar. So let's try to give identical code identical structure.
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Window.c48
1 files changed, 26 insertions, 22 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c
index 1b34687a5..25735afe9 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Window.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c
@@ -351,17 +351,16 @@ Bool nxagentCreateWindow(WindowPtr pWin)
nxagentWindowPriv(pWin)->window = XCreateWindow(nxagentDisplay,
nxagentWindowParent(pWin),
- pWin->origin.x -
- wBorderWidth(pWin),
- pWin->origin.y -
- wBorderWidth(pWin),
+ pWin->origin.x - wBorderWidth(pWin),
+ pWin->origin.y - wBorderWidth(pWin),
pWin->drawable.width,
pWin->drawable.height,
pWin->borderWidth,
pWin->drawable.depth,
pWin->drawable.class,
visual,
- mask, &attributes);
+ mask,
+ &attributes);
nxagentWindowPriv(pWin) -> isMapped = 0;
nxagentWindowPriv(pWin) -> isRedirected = 0;
@@ -2933,6 +2932,8 @@ static void nxagentReconnectWindow(void * param0, XID param1, void * data_buffer
(void *) pWin, pWin->drawable.id, nxagentWindow(pWin));
#endif
+ /* FIXME: this is largely identical to nxagentCreateWindow */
+
if (pWin->drawable.class == InputOnly)
{
mask = CWEventMask;
@@ -2942,8 +2943,6 @@ static void nxagentReconnectWindow(void * param0, XID param1, void * data_buffer
{
mask = CWEventMask | CWBackingStore;
- attributes.backing_store = NotUseful;
-
if (pWin->optional)
{
mask |= CWBackingPlanes | CWBackingPixel;
@@ -2951,6 +2950,13 @@ static void nxagentReconnectWindow(void * param0, XID param1, void * data_buffer
attributes.backing_pixel = pWin->optional->backingPixel;
}
+ attributes.backing_store = NotUseful;
+
+ #ifdef TEST
+ fprintf(stderr, "%s: Backing store on window at [%p] is [%d].\n", __func__,
+ (void*)pWin, attributes.backing_store);
+ #endif
+
/*
FIXME: Do we need to set save unders attribute here?
*/
@@ -2976,7 +2982,7 @@ static void nxagentReconnectWindow(void * param0, XID param1, void * data_buffer
attributes.colormap = nxagentDefaultVisualColormap(visual);
}
}
- else
+ else /* FIXME? nxagentCreateWindow has >if (pWin->optional)< here */
{
visual = CopyFromParent;
}
@@ -3034,20 +3040,18 @@ static void nxagentReconnectWindow(void * param0, XID param1, void * data_buffer
}
}
- nxagentWindow(pWin) = XCreateWindow(nxagentDisplay,
- nxagentWindowParent(pWin),
- pWin->origin.x -
- wBorderWidth(pWin),
- pWin->origin.y -
- wBorderWidth(pWin),
- pWin->drawable.width,
- pWin->drawable.height,
- pWin->borderWidth,
- pWin->drawable.depth,
- pWin->drawable.class,
- visual,
- mask,
- &attributes);
+ nxagentWindowPriv(pWin)->window = XCreateWindow(nxagentDisplay,
+ nxagentWindowParent(pWin),
+ pWin->origin.x - wBorderWidth(pWin),
+ pWin->origin.y - wBorderWidth(pWin),
+ pWin->drawable.width,
+ pWin->drawable.height,
+ pWin->borderWidth,
+ pWin->drawable.depth,
+ pWin->drawable.class,
+ visual,
+ mask,
+ &attributes);
if (nxagentReportPrivateWindowIds)
{