Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nx-libs
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dimbor
nx-libs
Commits
eb8c16ef
Unverified
Commit
eb8c16ef
authored
Nov 02, 2019
by
Mike Gabriel
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'uli42-pr/simplify_nxwindow' into 3.6.x
Attributes GH PR #866:
https://github.com/ArcticaProject/nx-libs/pull/866
parents
5f806ddf
7675af8e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
169 deletions
+31
-169
window.c
nx-X11/programs/Xserver/dix/window.c
+4
-6
NXwindow.c
nx-X11/programs/Xserver/hw/nxagent/NXwindow.c
+23
-163
Window.c
nx-X11/programs/Xserver/hw/nxagent/Window.c
+4
-0
No files found.
nx-X11/programs/Xserver/dix/window.c
View file @
eb8c16ef
...
@@ -497,9 +497,12 @@ CreateRootWindow(ScreenPtr pScreen)
...
@@ -497,9 +497,12 @@ CreateRootWindow(ScreenPtr pScreen)
return
TRUE
;
return
TRUE
;
}
}
#ifndef NXAGENT_SERVER
void
void
#ifdef NXAGENT_SERVER
xorg_InitRootWindow
(
WindowPtr
pWin
)
#else
InitRootWindow
(
WindowPtr
pWin
)
InitRootWindow
(
WindowPtr
pWin
)
#endif
{
{
ScreenPtr
pScreen
=
pWin
->
drawable
.
pScreen
;
ScreenPtr
pScreen
=
pWin
->
drawable
.
pScreen
;
int
backFlag
=
CWBorderPixel
|
CWCursor
|
CWBackingStore
;
int
backFlag
=
CWBorderPixel
|
CWCursor
|
CWBackingStore
;
...
@@ -531,7 +534,6 @@ InitRootWindow(WindowPtr pWin)
...
@@ -531,7 +534,6 @@ InitRootWindow(WindowPtr pWin)
MapWindow
(
pWin
,
serverClient
);
MapWindow
(
pWin
,
serverClient
);
}
}
#endif
/* NXAGENT_SERVER */
/* Set the region to the intersection of the rectangle and the
/* Set the region to the intersection of the rectangle and the
* window's winSize. The window is typically the parent of the
* window's winSize. The window is typically the parent of the
...
@@ -913,7 +915,6 @@ CrushTree(WindowPtr pWin)
...
@@ -913,7 +915,6 @@ CrushTree(WindowPtr pWin)
* If wid is None, don't send any events
* If wid is None, don't send any events
*****/
*****/
#ifndef NXAGENT_SERVER
int
int
DeleteWindow
(
void
*
value
,
XID
wid
)
DeleteWindow
(
void
*
value
,
XID
wid
)
{
{
...
@@ -949,7 +950,6 @@ DeleteWindow(void * value, XID wid)
...
@@ -949,7 +950,6 @@ DeleteWindow(void * value, XID wid)
free
(
pWin
);
free
(
pWin
);
return
Success
;
return
Success
;
}
}
#endif
/* NXAGENT_SERVER */
void
void
DestroySubwindows
(
register
WindowPtr
pWin
,
ClientPtr
client
)
DestroySubwindows
(
register
WindowPtr
pWin
,
ClientPtr
client
)
...
@@ -2988,7 +2988,6 @@ UnrealizeTree(
...
@@ -2988,7 +2988,6 @@ UnrealizeTree(
* generated. Cannot unmap a root window.
* generated. Cannot unmap a root window.
*****/
*****/
#ifndef NXAGENT_SERVER
int
int
UnmapWindow
(
register
WindowPtr
pWin
,
Bool
fromConfigure
)
UnmapWindow
(
register
WindowPtr
pWin
,
Bool
fromConfigure
)
{
{
...
@@ -3042,7 +3041,6 @@ UnmapWindow(register WindowPtr pWin, Bool fromConfigure)
...
@@ -3042,7 +3041,6 @@ UnmapWindow(register WindowPtr pWin, Bool fromConfigure)
WindowsRestructured
();
WindowsRestructured
();
return
(
Success
);
return
(
Success
);
}
}
#endif
/* NXAGENT_SERVER */
/*****
/*****
* UnmapSubwindows
* UnmapSubwindows
...
...
nx-X11/programs/Xserver/hw/nxagent/NXwindow.c
View file @
eb8c16ef
...
@@ -132,24 +132,6 @@ extern void nxagentSetVersionProperty(WindowPtr pWin);
...
@@ -132,24 +132,6 @@ extern void nxagentSetVersionProperty(WindowPtr pWin);
void
void
InitRootWindow
(
WindowPtr
pWin
)
InitRootWindow
(
WindowPtr
pWin
)
{
{
ScreenPtr
pScreen
=
pWin
->
drawable
.
pScreen
;
int
backFlag
=
CWBorderPixel
|
CWCursor
|
CWBackingStore
;
#ifdef TEST
fprintf
(
stderr
,
"InitRootWindow: Called for window at [%p][%ld] with parent [%p].
\n
"
,
(
void
*
)
pWin
,
nxagentWindowPriv
(
pWin
)
->
window
,
(
void
*
)
pWin
->
parent
);
#endif
if
(
nxagentOption
(
Rootless
))
{
#ifdef TEST
fprintf
(
stderr
,
"InitRootWindow: Assigned agent root to window at [%p][%ld] with parent [%p].
\n
"
,
(
void
*
)
pWin
,
nxagentWindowPriv
(
pWin
)
->
window
,
(
void
*
)
pWin
->
parent
);
#endif
nxagentRootlessWindow
=
pWin
;
}
/*
/*
* A root window is created for each screen by main
* A root window is created for each screen by main
* and the pointer is saved in screenInfo.screens as
* and the pointer is saved in screenInfo.screens as
...
@@ -164,36 +146,17 @@ InitRootWindow(WindowPtr pWin)
...
@@ -164,36 +146,17 @@ InitRootWindow(WindowPtr pWin)
* if you prefer) fits in the big picture.
* if you prefer) fits in the big picture.
*/
*/
if
(
nxagentOption
(
Rootless
))
{
#ifdef TEST
#ifdef TEST
fprintf
(
stderr
,
"InitRootWindow: Going to create window as root at [%p][%ld] with parent [%p].
\n
"
,
fprintf
(
stderr
,
"InitRootWindow: Assigned agent root to window at [%p][%ld] with parent [%p].
\n
"
,
(
void
*
)
pWin
,
nxagentWindowPriv
(
pWin
)
->
window
,
(
void
*
)
pWin
->
parent
);
#endif
if
(
!
(
*
pScreen
->
CreateWindow
)(
pWin
))
return
;
/* XXX */
#ifdef TEST
fprintf
(
stderr
,
"InitRootWindow: Created window as root at [%p][%ld] with parent [%p].
\n
"
,
(
void
*
)
pWin
,
nxagentWindowPriv
(
pWin
)
->
window
,
(
void
*
)
pWin
->
parent
);
(
void
*
)
pWin
,
nxagentWindowPriv
(
pWin
)
->
window
,
(
void
*
)
pWin
->
parent
);
#endif
#endif
(
*
pScreen
->
PositionWindow
)(
pWin
,
0
,
0
);
nxagentRootlessWindow
=
pWin
;
}
pWin
->
cursorIsNone
=
FALSE
;
pWin
->
optional
->
cursor
=
rootCursor
;
rootCursor
->
refcnt
++
;
if
(
blackRoot
)
pWin
->
background
.
pixel
=
pScreen
->
blackPixel
;
else
pWin
->
background
.
pixel
=
pScreen
->
whitePixel
;
backFlag
|=
CWBackPixel
;
pWin
->
backingStore
=
defaultBackingStore
;
pWin
->
forcedBS
=
(
defaultBackingStore
!=
NotUseful
);
/* We SHOULD check for an error value here XXX */
xorg_InitRootWindow
(
pWin
);
(
*
pScreen
->
ChangeWindowAttributes
)(
pWin
,
backFlag
);
/*
/*
* Map both the root and the default agent window.
* Map both the root and the default agent window.
...
@@ -214,63 +177,13 @@ InitRootWindow(WindowPtr pWin)
...
@@ -214,63 +177,13 @@ InitRootWindow(WindowPtr pWin)
char
artsd_port
[
10
];
char
artsd_port
[
10
];
short
int
nPort
=
atoi
(
display
)
+
7000
;
short
int
nPort
=
atoi
(
display
)
+
7000
;
sprintf
(
artsd_port
,
"%d"
,
nPort
);
sprintf
(
artsd_port
,
"%d"
,
nPort
);
nxagentPropagateArtsdProperties
(
pScreen
,
artsd_port
);
nxagentPropagateArtsdProperties
(
p
Win
->
drawable
.
p
Screen
,
artsd_port
);
}
}
#endif
#endif
nxagentSetVersionProperty
(
pWin
);
nxagentSetVersionProperty
(
pWin
);
}
}
/*****
* DeleteWindow
* Deletes child of window then window itself
* If wid is None, don't send any events
*****/
int
DeleteWindow
(
void
*
value
,
XID
wid
)
{
register
WindowPtr
pParent
;
register
WindowPtr
pWin
=
(
WindowPtr
)
value
;
xEvent
event
;
UnmapWindow
(
pWin
,
FALSE
);
CrushTree
(
pWin
);
pParent
=
pWin
->
parent
;
if
(
wid
&&
pParent
&&
SubStrSend
(
pWin
,
pParent
))
{
memset
(
&
event
,
0
,
sizeof
(
xEvent
));
event
.
u
.
u
.
type
=
DestroyNotify
;
event
.
u
.
destroyNotify
.
window
=
pWin
->
drawable
.
id
;
DeliverEvents
(
pWin
,
&
event
,
1
,
NullWindow
);
}
FreeWindowResources
(
pWin
);
if
(
pParent
)
{
if
(
pParent
->
firstChild
==
pWin
)
pParent
->
firstChild
=
pWin
->
nextSib
;
if
(
pParent
->
lastChild
==
pWin
)
pParent
->
lastChild
=
pWin
->
prevSib
;
if
(
pWin
->
nextSib
)
pWin
->
nextSib
->
prevSib
=
pWin
->
prevSib
;
if
(
pWin
->
prevSib
)
pWin
->
prevSib
->
nextSib
=
pWin
->
nextSib
;
}
if
(
pWin
->
optional
&&
pWin
->
optional
->
colormap
&&
pWin
->
parent
)
{
nxagentSetInstalledColormapWindows
(
pWin
->
drawable
.
pScreen
);
}
free
(
pWin
);
return
Success
;
}
/* XXX need to retile border on each window with ParentRelative origin */
/* XXX need to retile border on each window with ParentRelative origin */
void
void
ResizeChildrenWinSize
(
register
WindowPtr
pWin
,
int
dx
,
int
dy
,
int
dw
,
int
dh
)
ResizeChildrenWinSize
(
register
WindowPtr
pWin
,
int
dx
,
int
dy
,
int
dw
,
int
dh
)
...
@@ -308,6 +221,7 @@ ResizeChildrenWinSize(register WindowPtr pWin, int dx, int dy, int dw, int dh)
...
@@ -308,6 +221,7 @@ ResizeChildrenWinSize(register WindowPtr pWin, int dx, int dy, int dw, int dh)
SetWinSize
(
pSib
);
SetWinSize
(
pSib
);
SetBorderSize
(
pSib
);
SetBorderSize
(
pSib
);
#ifdef NXAGENT_SERVER
/*
/*
* Don't force X to move children. It will position them
* Don't force X to move children. It will position them
* according with gravity.
* according with gravity.
...
@@ -320,6 +234,9 @@ ResizeChildrenWinSize(register WindowPtr pWin, int dx, int dy, int dw, int dh)
...
@@ -320,6 +234,9 @@ ResizeChildrenWinSize(register WindowPtr pWin, int dx, int dy, int dw, int dh)
*/
*/
nxagentAddConfiguredWindow
(
pSib
,
CW_Update
);
nxagentAddConfiguredWindow
(
pSib
,
CW_Update
);
#else
(
*
pScreen
->
PositionWindow
)(
pSib
,
pSib
->
drawable
.
x
,
pSib
->
drawable
.
y
);
#endif
if
(
(
pChild
=
pSib
->
firstChild
)
)
if
(
(
pChild
=
pSib
->
firstChild
)
)
{
{
...
@@ -460,6 +377,7 @@ ConfigureWindow(register WindowPtr pWin, register Mask mask, XID *vlist, ClientP
...
@@ -460,6 +377,7 @@ ConfigureWindow(register WindowPtr pWin, register Mask mask, XID *vlist, ClientP
/* Figure out if the window should be moved. Doesn't
/* Figure out if the window should be moved. Doesn't
make the changes to the window if event sent */
make the changes to the window if event sent */
#ifdef NXAGENT_SERVER
#ifdef TEST
#ifdef TEST
if
(
nxagentWindowTopLevel
(
pWin
))
if
(
nxagentWindowTopLevel
(
pWin
))
{
{
...
@@ -481,6 +399,7 @@ ConfigureWindow(register WindowPtr pWin, register Mask mask, XID *vlist, ClientP
...
@@ -481,6 +399,7 @@ ConfigureWindow(register WindowPtr pWin, register Mask mask, XID *vlist, ClientP
return
Success
;
return
Success
;
}
}
#endif
if
(
mask
&
CWStackMode
)
if
(
mask
&
CWStackMode
)
pSib
=
WhereDoIGoInTheStack
(
pWin
,
pSib
,
pParent
->
drawable
.
x
+
x
,
pSib
=
WhereDoIGoInTheStack
(
pWin
,
pSib
,
pParent
->
drawable
.
x
+
x
,
...
@@ -624,7 +543,9 @@ ActuallyDoSomething:
...
@@ -624,7 +543,9 @@ ActuallyDoSomething:
if
(
action
!=
RESTACK_WIN
)
if
(
action
!=
RESTACK_WIN
)
CheckCursorConfinement
(
pWin
);
CheckCursorConfinement
(
pWin
);
#ifdef NXAGENT_SERVER
nxagentFlushConfigureWindow
();
nxagentFlushConfigureWindow
();
#endif
return
(
Success
);
return
(
Success
);
#undef RESTACK_WIN
#undef RESTACK_WIN
...
@@ -687,10 +608,12 @@ ReparentWindow(register WindowPtr pWin, register WindowPtr pParent,
...
@@ -687,10 +608,12 @@ ReparentWindow(register WindowPtr pWin, register WindowPtr pParent,
pWin
->
parent
=
pParent
;
pWin
->
parent
=
pParent
;
pPrev
=
RealChildHead
(
pParent
);
pPrev
=
RealChildHead
(
pParent
);
#ifdef NXAGENT_SERVER
if
(
pWin
->
parent
==
screenInfo
.
screens
[
0
]
->
root
)
if
(
pWin
->
parent
==
screenInfo
.
screens
[
0
]
->
root
)
{
{
nxagentSetTopLevelEventMask
(
pWin
);
nxagentSetTopLevelEventMask
(
pWin
);
}
}
#endif
if
(
pPrev
)
if
(
pPrev
)
{
{
...
@@ -756,12 +679,14 @@ MapWindow(register WindowPtr pWin, ClientPtr client)
...
@@ -756,12 +679,14 @@ MapWindow(register WindowPtr pWin, ClientPtr client)
#endif
#endif
WindowPtr
pLayerWin
;
WindowPtr
pLayerWin
;
#ifdef NXAGENT_SERVER
#ifdef TEST
#ifdef TEST
if
(
nxagentWindowTopLevel
(
pWin
))
if
(
nxagentWindowTopLevel
(
pWin
))
{
{
fprintf
(
stderr
,
"MapWindow: pWin [%p] client [%p]
\n
"
,
pWin
,
client
);
fprintf
(
stderr
,
"MapWindow: pWin [%p] client [%p]
\n
"
,
pWin
,
client
);
}
}
#endif
#endif
#endif
if
(
pWin
->
mapped
)
if
(
pWin
->
mapped
)
return
(
Success
);
return
(
Success
);
...
@@ -852,80 +777,13 @@ MapWindow(register WindowPtr pWin, ClientPtr client)
...
@@ -852,80 +777,13 @@ MapWindow(register WindowPtr pWin, ClientPtr client)
RegionUninit
(
&
temp
);
RegionUninit
(
&
temp
);
}
}
#ifdef NXAGENT_SERVER
nxagentFlushConfigureWindow
();
nxagentFlushConfigureWindow
();
#endif
return
(
Success
);
return
(
Success
);
}
}
/*****
* UnmapWindow
* If the window is already unmapped, this request has no effect.
* Otherwise, the window is unmapped and an UnMapNotify event is
* generated. Cannot unmap a root window.
*****/
int
UnmapWindow
(
register
WindowPtr
pWin
,
Bool
fromConfigure
)
{
register
WindowPtr
pParent
;
xEvent
event
;
Bool
wasRealized
=
(
Bool
)
pWin
->
realized
;
Bool
wasViewable
=
(
Bool
)
pWin
->
viewable
;
ScreenPtr
pScreen
=
pWin
->
drawable
.
pScreen
;
WindowPtr
pLayerWin
=
pWin
;
#ifdef TEST
if
(
nxagentWindowTopLevel
(
pWin
))
{
fprintf
(
stderr
,
"UnmapWindow: pWin [%p] fromConfigure [%d]
\n
"
,
pWin
,
fromConfigure
);
}
#endif
if
((
!
pWin
->
mapped
)
||
(
!
(
pParent
=
pWin
->
parent
)))
return
(
Success
);
if
(
SubStrSend
(
pWin
,
pParent
)
&&
MapUnmapEventsEnabled
(
pWin
))
{
memset
(
&
event
,
0
,
sizeof
(
xEvent
));
event
.
u
.
u
.
type
=
UnmapNotify
;
event
.
u
.
unmapNotify
.
window
=
pWin
->
drawable
.
id
;
event
.
u
.
unmapNotify
.
fromConfigure
=
fromConfigure
;
DeliverEvents
(
pWin
,
&
event
,
1
,
NullWindow
);
}
if
(
wasViewable
&&
!
fromConfigure
)
{
pWin
->
valdata
=
UnmapValData
;
(
*
pScreen
->
MarkOverlappedWindows
)(
pWin
,
pWin
->
nextSib
,
&
pLayerWin
);
(
*
pScreen
->
MarkWindow
)(
pLayerWin
->
parent
);
}
pWin
->
mapped
=
FALSE
;
if
(
wasRealized
)
UnrealizeTree
(
pWin
,
fromConfigure
);
if
(
wasViewable
)
{
if
(
!
fromConfigure
)
{
(
*
pScreen
->
ValidateTree
)(
pLayerWin
->
parent
,
pWin
,
VTUnmap
);
(
*
pScreen
->
HandleExposures
)(
pLayerWin
->
parent
);
}
#ifdef DO_SAVE_UNDERS
if
(
DO_SAVE_UNDERS
(
pWin
))
{
if
(
(
*
pScreen
->
ChangeSaveUnder
)(
pLayerWin
,
pWin
->
nextSib
)
)
{
(
*
pScreen
->
PostChangeSaveUnder
)(
pLayerWin
,
pWin
->
nextSib
);
}
}
pWin
->
DIXsaveUnder
=
FALSE
;
#endif
/* DO_SAVE_UNDERS */
if
(
!
fromConfigure
&&
pScreen
->
PostValidateTree
)
(
*
pScreen
->
PostValidateTree
)(
pLayerWin
->
parent
,
pWin
,
VTUnmap
);
}
if
(
wasRealized
&&
!
fromConfigure
)
WindowsRestructured
();
return
(
Success
);
}
void
void
SaveScreens
(
int
on
,
int
mode
)
SaveScreens
(
int
on
,
int
mode
)
{
{
...
@@ -954,6 +812,7 @@ SaveScreens(int on, int mode)
...
@@ -954,6 +812,7 @@ SaveScreens(int on, int mode)
(
*
screenInfo
.
screens
[
i
]
->
SaveScreen
)
(
screenInfo
.
screens
[
i
],
on
);
(
*
screenInfo
.
screens
[
i
]
->
SaveScreen
)
(
screenInfo
.
screens
[
i
],
on
);
if
(
savedScreenInfo
[
i
].
ExternalScreenSaver
)
if
(
savedScreenInfo
[
i
].
ExternalScreenSaver
)
{
{
#ifdef NXAGENT_SERVER
if
(
nxagentOption
(
Timeout
)
!=
0
)
if
(
nxagentOption
(
Timeout
)
!=
0
)
{
{
#ifdef TEST
#ifdef TEST
...
@@ -962,6 +821,7 @@ SaveScreens(int on, int mode)
...
@@ -962,6 +821,7 @@ SaveScreens(int on, int mode)
#endif
#endif
}
}
else
else
#endif
{
{
if
((
*
savedScreenInfo
[
i
].
ExternalScreenSaver
)
if
((
*
savedScreenInfo
[
i
].
ExternalScreenSaver
)
(
screenInfo
.
screens
[
i
],
type
,
on
==
SCREEN_SAVER_FORCER
))
(
screenInfo
.
screens
[
i
],
type
,
on
==
SCREEN_SAVER_FORCER
))
...
...
nx-X11/programs/Xserver/hw/nxagent/Window.c
View file @
eb8c16ef
...
@@ -2538,6 +2538,10 @@ void nxagentMapDefaultWindows(void)
...
@@ -2538,6 +2538,10 @@ void nxagentMapDefaultWindows(void)
WindowPtr
pWin
=
screenInfo
.
screens
[
i
]
->
root
;
WindowPtr
pWin
=
screenInfo
.
screens
[
i
]
->
root
;
ScreenPtr
pScreen
=
pWin
->
drawable
.
pScreen
;
ScreenPtr
pScreen
=
pWin
->
drawable
.
pScreen
;
/*
* InitRootWindow does that already, but as MapWindow() is
* idempotent we keep it here, too
*/
MapWindow
(
pWin
,
serverClient
);
MapWindow
(
pWin
,
serverClient
);
if
(
nxagentOption
(
Rootless
)
==
0
)
if
(
nxagentOption
(
Rootless
)
==
0
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment