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
a2523273
Unverified
Commit
a2523273
authored
Jun 11, 2019
by
Mike Gabriel
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'uli42-pr/various_small_things' into 3.6.x
Attributes GH PR #813:
https://github.com/ArcticaProject/nx-libs/pull/813
parents
92f41213
2da476a6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
226 additions
and
37 deletions
+226
-37
Clipboard.c
nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
+20
-7
Events.c
nx-X11/programs/Xserver/hw/nxagent/Events.c
+7
-0
Screen.c
nx-X11/programs/Xserver/hw/nxagent/Screen.c
+33
-22
Window.c
nx-X11/programs/Xserver/hw/nxagent/Window.c
+166
-8
No files found.
nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
View file @
a2523273
...
@@ -305,7 +305,7 @@ void nxagentPrintClipboardStat(char *header)
...
@@ -305,7 +305,7 @@ void nxagentPrintClipboardStat(char *header)
fprintf
(
stderr
,
" lastClientSelection (Atom) [% 4d][%s]
\n
"
,
lastClientSelection
,
NameForAtom
(
lastClientSelection
));
fprintf
(
stderr
,
" lastClientSelection (Atom) [% 4d][%s]
\n
"
,
lastClientSelection
,
NameForAtom
(
lastClientSelection
));
fprintf
(
stderr
,
" lastClientTarget (Atom) [% 4d][%s]
\n
"
,
lastClientTarget
,
NameForAtom
(
lastClientTarget
));
fprintf
(
stderr
,
" lastClientTarget (Atom) [% 4d][%s]
\n
"
,
lastClientTarget
,
NameForAtom
(
lastClientTarget
));
fprintf
(
stderr
,
" lastClientTime (Time) [%u]
\n
"
,
lastServerTime
);
fprintf
(
stderr
,
" lastClientTime (Time) [%u]
\n
"
,
lastServerTime
);
fprintf
(
stderr
,
" lastClientReqTime (Time) [%u]
\n
"
,
lastServerTime
);
fprintf
(
stderr
,
" lastClientReqTime (Time) [%u]
\n
"
,
lastServer
Req
Time
);
fprintf
(
stderr
,
" lastClientPropertySize (unsigned long) [%lu]
\n
"
,
lastClientPropertySize
);
fprintf
(
stderr
,
" lastClientPropertySize (unsigned long) [%lu]
\n
"
,
lastClientPropertySize
);
fprintf
(
stderr
,
" lastClientStage (ClientSelectionStage) [%d][%s]
\n
"
,
lastClientStage
,
GetClientSelectionStageString
(
lastClientStage
));
fprintf
(
stderr
,
" lastClientStage (ClientSelectionStage) [%d][%s]
\n
"
,
lastClientStage
,
GetClientSelectionStageString
(
lastClientStage
));
...
@@ -392,8 +392,6 @@ Bool nxagentValidServerTargets(Atom target)
...
@@ -392,8 +392,6 @@ Bool nxagentValidServerTargets(Atom target)
void
nxagentClearClipboard
(
ClientPtr
pClient
,
WindowPtr
pWindow
)
void
nxagentClearClipboard
(
ClientPtr
pClient
,
WindowPtr
pWindow
)
{
{
int
i
;
#ifdef DEBUG
#ifdef DEBUG
fprintf
(
stderr
,
"%s: Called with client [%p] window [%p].
\n
"
,
__func__
,
fprintf
(
stderr
,
"%s: Called with client [%p] window [%p].
\n
"
,
__func__
,
(
void
*
)
pClient
,
(
void
*
)
pWindow
);
(
void
*
)
pClient
,
(
void
*
)
pWindow
);
...
@@ -405,7 +403,7 @@ void nxagentClearClipboard(ClientPtr pClient, WindowPtr pWindow)
...
@@ -405,7 +403,7 @@ void nxagentClearClipboard(ClientPtr pClient, WindowPtr pWindow)
* Only for PRIMARY and CLIPBOARD selections.
* Only for PRIMARY and CLIPBOARD selections.
*/
*/
for
(
i
=
0
;
i
<
nxagentMaxSelections
;
i
++
)
for
(
i
nt
i
=
0
;
i
<
nxagentMaxSelections
;
i
++
)
{
{
if
((
pClient
!=
NULL
&&
lastSelectionOwner
[
i
].
client
==
pClient
)
||
if
((
pClient
!=
NULL
&&
lastSelectionOwner
[
i
].
client
==
pClient
)
||
(
pWindow
!=
NULL
&&
lastSelectionOwner
[
i
].
windowPtr
==
pWindow
))
(
pWindow
!=
NULL
&&
lastSelectionOwner
[
i
].
windowPtr
==
pWindow
))
...
@@ -1241,7 +1239,9 @@ void nxagentResetSelectionOwner(void)
...
@@ -1241,7 +1239,9 @@ void nxagentResetSelectionOwner(void)
{
{
XSetSelectionOwner
(
nxagentDisplay
,
lastSelectionOwner
[
i
].
selection
,
serverWindow
,
CurrentTime
);
XSetSelectionOwner
(
nxagentDisplay
,
lastSelectionOwner
[
i
].
selection
,
serverWindow
,
CurrentTime
);
#ifdef DEBUG
fprintf
(
stderr
,
"%s: Reset clipboard state.
\n
"
,
__func__
);
fprintf
(
stderr
,
"%s: Reset clipboard state.
\n
"
,
__func__
);
#endif
lastSelectionOwner
[
i
].
client
=
NULL
;
lastSelectionOwner
[
i
].
client
=
NULL
;
lastSelectionOwner
[
i
].
window
=
None
;
lastSelectionOwner
[
i
].
window
=
None
;
...
@@ -1259,7 +1259,6 @@ void nxagentResetSelectionOwner(void)
...
@@ -1259,7 +1259,6 @@ void nxagentResetSelectionOwner(void)
void
nxagentSetSelectionOwner
(
Selection
*
pSelection
)
void
nxagentSetSelectionOwner
(
Selection
*
pSelection
)
{
{
int
i
;
#ifdef DEBUG
#ifdef DEBUG
fprintf
(
stderr
,
"%s: Got called.
\n
"
,
__func__
);
fprintf
(
stderr
,
"%s: Got called.
\n
"
,
__func__
);
#endif
#endif
...
@@ -1270,7 +1269,7 @@ void nxagentSetSelectionOwner(Selection *pSelection)
...
@@ -1270,7 +1269,7 @@ void nxagentSetSelectionOwner(Selection *pSelection)
}
}
#ifdef DEBUG
#ifdef DEBUG
fprintf
(
stderr
,
"%s: Setting selection owner to
window [0x%x]
.
\n
"
,
__func__
,
fprintf
(
stderr
,
"%s: Setting selection owner to
serverwindow ([0x%x])
.
\n
"
,
__func__
,
serverWindow
);
serverWindow
);
#endif
#endif
...
@@ -1286,10 +1285,24 @@ void nxagentSetSelectionOwner(Selection *pSelection)
...
@@ -1286,10 +1285,24 @@ void nxagentSetSelectionOwner(Selection *pSelection)
* Only for PRIMARY and CLIPBOARD selections.
* Only for PRIMARY and CLIPBOARD selections.
*/
*/
for
(
i
=
0
;
i
<
nxagentMaxSelections
;
i
++
)
for
(
i
nt
i
=
0
;
i
<
nxagentMaxSelections
;
i
++
)
{
{
if
(
pSelection
->
selection
==
CurrentSelections
[
i
].
selection
)
if
(
pSelection
->
selection
==
CurrentSelections
[
i
].
selection
)
{
{
#ifdef DEBUG
fprintf
(
stderr
,
"%s: lastSelectionOwner.client [0x%x] -> [0x%x]
\n
"
,
__func__
,
lastSelectionOwner
[
i
].
client
,
pSelection
->
client
);
fprintf
(
stderr
,
"%s: lastSelectionOwner.window [0x%x] -> [0x%x]
\n
"
,
__func__
,
lastSelectionOwner
[
i
].
window
,
pSelection
->
window
);
fprintf
(
stderr
,
"%s: lastSelectionOwner.windowPtr [0x%x] -> [0x%x] [0x%x] (serverWindow: [0x%x])
\n
"
,
__func__
,
lastSelectionOwner
[
i
].
windowPtr
,
pSelection
->
pWin
,
nxagentWindow
(
pSelection
->
pWin
),
serverWindow
);
fprintf
(
stderr
,
"%s: lastSelectionOwner.lastTimeChanged [%d]
\n
"
,
__func__
,
lastSelectionOwner
[
i
].
lastTimeChanged
);
#endif
/*
* inform the real X server that our serverWindow is the
* clipboard owner. The real owner window (inside nxagent) is
* stored in lastSelectionOwner.window.
* lastSelectionOwner.windowPtr points to the struct that
* contains all information about the owner window
*/
XSetSelectionOwner
(
nxagentDisplay
,
lastSelectionOwner
[
i
].
selection
,
serverWindow
,
CurrentTime
);
XSetSelectionOwner
(
nxagentDisplay
,
lastSelectionOwner
[
i
].
selection
,
serverWindow
,
CurrentTime
);
lastSelectionOwner
[
i
].
client
=
pSelection
->
client
;
lastSelectionOwner
[
i
].
client
=
pSelection
->
client
;
...
...
nx-X11/programs/Xserver/hw/nxagent/Events.c
View file @
a2523273
...
@@ -2940,6 +2940,13 @@ int nxagentHandleXFixesSelectionNotify(XEvent *X)
...
@@ -2940,6 +2940,13 @@ int nxagentHandleXFixesSelectionNotify(XEvent *X)
#endif
#endif
#ifdef DEBUG
#ifdef DEBUG
fprintf
(
stderr
,
"%s: CurrentSelections[i].lastTimeChanged [%d]
\n
"
,
__func__
,
CurrentSelections
[
i
].
lastTimeChanged
.
milliseconds
);
fprintf
(
stderr
,
"%s: Event timestamp [%ld]
\n
"
,
__func__
,
xfixesEvent
->
xfixesselection
.
timestamp
);
fprintf
(
stderr
,
"%s: Event selection timestamp [%ld]
\n
"
,
__func__
,
xfixesEvent
->
xfixesselection
.
selection_timestamp
);
fprintf
(
stderr
,
"%s: Event selection window [0x%x]
\n
"
,
__func__
,
xfixesEvent
->
xfixesselection
.
window
);
fprintf
(
stderr
,
"%s: Event selection owner [0x%x]
\n
"
,
__func__
,
xfixesEvent
->
xfixesselection
.
owner
);
fprintf
(
stderr
,
"%s: Event selection [%s]
\n
"
,
__func__
,
NameForAtom
(
nxagentRemoteToLocalAtom
(
xfixesEvent
->
xfixesselection
.
selection
)));
fprintf
(
stderr
,
"nxagentHandleXFixesSelectionNotify: Subtype "
);
fprintf
(
stderr
,
"nxagentHandleXFixesSelectionNotify: Subtype "
);
switch
(
xfixesEvent
->
xfixesselection
.
subtype
)
switch
(
xfixesEvent
->
xfixesselection
.
subtype
)
...
...
nx-X11/programs/Xserver/hw/nxagent/Screen.c
View file @
a2523273
...
@@ -404,11 +404,11 @@ Window nxagentCreateIconWindow(void)
...
@@ -404,11 +404,11 @@ Window nxagentCreateIconWindow(void)
if
(
nxagentReportWindowIds
)
if
(
nxagentReportWindowIds
)
{
{
fprintf
(
stderr
,
"NXAGENT_WINDOW_ID: ICON_WINDOW,WID:[0x%x]
\n
"
,
nxagentIconWindo
w
);
fprintf
(
stderr
,
"NXAGENT_WINDOW_ID: ICON_WINDOW,WID:[0x%x]
\n
"
,
w
);
}
}
#ifdef TEST
#ifdef TEST
fprintf
(
stderr
,
"nxagentCreateIconWindow: Created new icon window with id [0x%x].
\n
"
,
fprintf
(
stderr
,
"nxagentCreateIconWindow: Created new icon window with id [0x%x].
\n
"
,
nxagentIconWindo
w
);
w
);
#endif
#endif
/*
/*
...
@@ -1776,32 +1776,43 @@ N/A
...
@@ -1776,32 +1776,43 @@ N/A
nxagentDefaultVisual
(
pScreen
),
nxagentDefaultVisual
(
pScreen
),
valuemask
,
&
attributes
);
valuemask
,
&
attributes
);
if
(
nxagentOption
(
Rootless
)
==
0
)
{
valuemask
=
CWEventMask
;
mask
=
PointerMotionMask
;
attributes
.
event_mask
=
mask
;
nxagentInputWindows
[
pScreen
->
myNum
]
=
XCreateWindow
(
nxagentDisplay
,
nxagentDefaultWindows
[
pScreen
->
myNum
],
0
,
0
,
nxagentOption
(
Width
),
nxagentOption
(
Height
),
0
,
0
,
InputOnly
,
nxagentDefaultVisual
(
pScreen
),
valuemask
,
&
attributes
);
}
if
(
nxagentReportWindowIds
)
if
(
nxagentReportWindowIds
)
{
{
fprintf
(
stderr
,
"NXAGENT_WINDOW_ID: SCREEN_WINDOW:[%d],WID:[0x%x]
\n
"
,
pScreen
->
myNum
,
nxagentInpu
tWindows
[
pScreen
->
myNum
]);
fprintf
(
stderr
,
"NXAGENT_WINDOW_ID: SCREEN_WINDOW:[%d],WID:[0x%x]
\n
"
,
pScreen
->
myNum
,
nxagentDefaul
tWindows
[
pScreen
->
myNum
]);
}
}
#ifdef TEST
#ifdef TEST
fprintf
(
stderr
,
"nxagentOpenScreen: Created new default window with id [0x%x].
\n
"
,
fprintf
(
stderr
,
"nxagentOpenScreen: Created new default window
for screen [%d]
with id [0x%x].
\n
"
,
nxagentDefaultWindows
[
pScreen
->
myNum
]);
pScreen
->
myNum
,
nxagentDefaultWindows
[
pScreen
->
myNum
]);
#endif
#endif
if
(
nxagentOption
(
Rootless
)
==
0
)
{
valuemask
=
CWEventMask
;
mask
=
PointerMotionMask
;
attributes
.
event_mask
=
mask
;
nxagentInputWindows
[
pScreen
->
myNum
]
=
XCreateWindow
(
nxagentDisplay
,
nxagentDefaultWindows
[
pScreen
->
myNum
],
0
,
0
,
nxagentOption
(
Width
),
nxagentOption
(
Height
),
0
,
0
,
InputOnly
,
nxagentDefaultVisual
(
pScreen
),
valuemask
,
&
attributes
);
if
(
nxagentReportWindowIds
)
{
fprintf
(
stderr
,
"NXAGENT_WINDOW_ID: INPUT_WINDOW:[%d],WID:[0x%x]
\n
"
,
pScreen
->
myNum
,
nxagentInputWindows
[
pScreen
->
myNum
]);
}
#ifdef TEST
fprintf
(
stderr
,
"nxagentOpenScreen: Created new input window for screen [%d] with id [0x%x].
\n
"
,
pScreen
->
myNum
,
nxagentInputWindows
[
pScreen
->
myNum
]);
#endif
}
/*
/*
* Setting WM_CLASS to "X2GoAgent" when running in X2Go Agent mode
* Setting WM_CLASS to "X2GoAgent" when running in X2Go Agent mode
* we need it to properly display all window parameters by some WMs
* we need it to properly display all window parameters by some WMs
...
...
nx-X11/programs/Xserver/hw/nxagent/Window.c
View file @
a2523273
...
@@ -247,6 +247,15 @@ WindowPtr nxagentWindowPtr(Window window)
...
@@ -247,6 +247,15 @@ WindowPtr nxagentWindowPtr(Window window)
return
match
.
pWin
;
return
match
.
pWin
;
}
}
/*
* from "Definition of the Porting Layer for X v11 Sample Server":
*
* This routine is a hook for when DIX creates a window. It should
* fill in the "Window Procedures in the WindowRec" below and also
* allocate the devPrivate block for it.
*
* See Xserver/fb/fbwindow.c for the sample server implementation.
*/
Bool
nxagentCreateWindow
(
WindowPtr
pWin
)
Bool
nxagentCreateWindow
(
WindowPtr
pWin
)
{
{
unsigned
long
mask
;
unsigned
long
mask
;
...
@@ -530,7 +539,7 @@ void nxagentSetVersionProperty(WindowPtr pWin)
...
@@ -530,7 +539,7 @@ void nxagentSetVersionProperty(WindowPtr pWin)
#ifdef DEBUG
#ifdef DEBUG
else
else
{
{
fprintf
(
stderr
,
"%s: Added property [%s], value [%s] for root window [%x].
\n
"
,
__func__
,
name
,
NX_VERSION_CURRENT_STRING
,
pWin
);
fprintf
(
stderr
,
"%s: Added property [%s], value [%s] for root window [%x].
\n
"
,
__func__
,
name
,
NX_VERSION_CURRENT_STRING
,
pWin
);
}
}
#endif
#endif
}
}
...
@@ -553,6 +562,15 @@ Bool nxagentSomeWindowsAreMapped(void)
...
@@ -553,6 +562,15 @@ Bool nxagentSomeWindowsAreMapped(void)
return
False
;
return
False
;
}
}
/*
* from "Definition of the Porting Layer for X v11 Sample Server":
*
* This routine is a hook for when DIX destroys a window. It should
* deallocate the devPrivate block for it and any other blocks that
* need to be freed, besides doing other cleanup actions.
*
* See Xserver/fb/fbwindow.c for the sample server implementation.
*/
Bool
nxagentDestroyWindow
(
WindowPtr
pWin
)
Bool
nxagentDestroyWindow
(
WindowPtr
pWin
)
{
{
nxagentPrivWindowPtr
pWindowPriv
;
nxagentPrivWindowPtr
pWindowPriv
;
...
@@ -683,6 +701,20 @@ Bool nxagentDestroyWindow(WindowPtr pWin)
...
@@ -683,6 +701,20 @@ Bool nxagentDestroyWindow(WindowPtr pWin)
return
True
;
return
True
;
}
}
/*
* from "Definition of the Porting Layer for X v11 Sample Server":
*
* This routine is a hook for when DIX moves or resizes a window. It
* should do whatever private operations need to be done when a window
* is moved or resized. For instance, if DDX keeps a pixmap tile used
* for drawing the background or border, and it keeps the tile rotated
* such that it is longword aligned to longword locations in the frame
* buffer, then you should rotate your tiles here. The actual graphics
* involved in moving the pixels on the screen and drawing the border
* are handled by CopyWindow(), below.
*
* See Xserver/fb/fbwindow.c for the sample server implementation.
*/
Bool
nxagentPositionWindow
(
WindowPtr
pWin
,
int
x
,
int
y
)
Bool
nxagentPositionWindow
(
WindowPtr
pWin
,
int
x
,
int
y
)
{
{
if
(
nxagentScreenTrap
==
1
)
if
(
nxagentScreenTrap
==
1
)
...
@@ -1218,6 +1250,15 @@ void nxagentMoveViewport(ScreenPtr pScreen, int hShift, int vShift)
...
@@ -1218,6 +1250,15 @@ void nxagentMoveViewport(ScreenPtr pScreen, int hShift, int vShift)
nxagentOption
(
Width
),
nxagentOption
(
Height
));
nxagentOption
(
Width
),
nxagentOption
(
Height
));
}
}
/*
* This will update the window on the real X server by calling
* XConfigureWindow()/XMapWindow()/XLowerWindow()/XRaiseWindow()
* mask definesthe values that need to be updated, see e.g
* man XConfigureWindow.
*
* In addition to the bit flags known to Xorg it uses these
* self-defined ones: CW_Update, CW_Shape, CW_Map, CW_RootlessRestack.
*/
void
nxagentConfigureWindow
(
WindowPtr
pWin
,
unsigned
int
mask
)
void
nxagentConfigureWindow
(
WindowPtr
pWin
,
unsigned
int
mask
)
{
{
unsigned
int
valuemask
;
unsigned
int
valuemask
;
...
@@ -1510,6 +1551,16 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask)
...
@@ -1510,6 +1551,16 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask)
}
}
}
}
/*
* from "Definition of the Porting Layer for X v11 Sample Server":
*
* This function will be called when a window is reparented. At the
* time of the call, pWin will already be spliced into its new
* position in the window tree, and pPriorParent is its previous
* parent. This function can be NULL.
*
* We simply pass this pver to the real X server.
*/
void
nxagentReparentWindow
(
WindowPtr
pWin
,
WindowPtr
pOldParent
)
void
nxagentReparentWindow
(
WindowPtr
pWin
,
WindowPtr
pOldParent
)
{
{
if
(
nxagentScreenTrap
)
if
(
nxagentScreenTrap
)
...
@@ -1529,6 +1580,16 @@ void nxagentReparentWindow(WindowPtr pWin, WindowPtr pOldParent)
...
@@ -1529,6 +1580,16 @@ void nxagentReparentWindow(WindowPtr pWin, WindowPtr pOldParent)
pWin
->
origin
.
y
-
wBorderWidth
(
pWin
));
pWin
->
origin
.
y
-
wBorderWidth
(
pWin
));
}
}
/*
* from "Definition of the Porting Layer for X v11 Sample Server":
*
* ChangeWindowAttributes is called whenever DIX changes window
* attributes, such as the size, front-to-back ordering, title, or
* anything of lesser severity that affects the window itself. The
* sample server implements this routine. It computes accelerators for
* quickly putting up background and border tiles. (See description of
* the set of routines stored in the WindowRec.)
*/
Bool
nxagentChangeWindowAttributes
(
WindowPtr
pWin
,
unsigned
long
mask
)
Bool
nxagentChangeWindowAttributes
(
WindowPtr
pWin
,
unsigned
long
mask
)
{
{
XSetWindowAttributes
attributes
;
XSetWindowAttributes
attributes
;
...
@@ -1822,6 +1883,7 @@ Bool nxagentChangeWindowAttributes(WindowPtr pWin, unsigned long mask)
...
@@ -1822,6 +1883,7 @@ Bool nxagentChangeWindowAttributes(WindowPtr pWin, unsigned long mask)
return
1
;
return
1
;
}
}
/* Set the WM_STATE property of pWin to the desired value */
void
nxagentSetWMState
(
WindowPtr
pWin
,
CARD32
desired
)
void
nxagentSetWMState
(
WindowPtr
pWin
,
CARD32
desired
)
{
{
Atom
prop
=
MakeAtom
(
"WM_STATE"
,
strlen
(
"WM_STATE"
),
True
);
Atom
prop
=
MakeAtom
(
"WM_STATE"
,
strlen
(
"WM_STATE"
),
True
);
...
@@ -1834,6 +1896,20 @@ void nxagentSetWMState(WindowPtr pWin, CARD32 desired)
...
@@ -1834,6 +1896,20 @@ void nxagentSetWMState(WindowPtr pWin, CARD32 desired)
}
}
}
}
/*
* from "Definition of the Porting Layer for X v11 Sample Server":
*
* RealizeWindow/UnRealizeWindow:
* These routines are hooks for when DIX maps (makes visible) and
* unmaps (makes invisible) a window. It should do whatever private
* operations need to be done when these happen, such as allocating or
* deallocating structures that are only needed for visible
* windows. RealizeWindow does NOT draw the window border, background
* or contents; UnrealizeWindow does NOT erase the window or generate
* exposure events for underlying windows; this is taken care of by
* DIX. DIX does, however, call PaintWindowBackground() and
* PaintWindowBorder() to perform some of these.
-+ */
Bool
nxagentRealizeWindow
(
WindowPtr
pWin
)
Bool
nxagentRealizeWindow
(
WindowPtr
pWin
)
{
{
if
(
nxagentScreenTrap
==
1
)
if
(
nxagentScreenTrap
==
1
)
...
@@ -1894,6 +1970,7 @@ Bool nxagentRealizeWindow(WindowPtr pWin)
...
@@ -1894,6 +1970,7 @@ Bool nxagentRealizeWindow(WindowPtr pWin)
return
True
;
return
True
;
}
}
/* See nxagentRealizeWindow for a description */
Bool
nxagentUnrealizeWindow
(
WindowPtr
pWin
)
Bool
nxagentUnrealizeWindow
(
WindowPtr
pWin
)
{
{
if
(
nxagentScreenTrap
)
if
(
nxagentScreenTrap
)
...
@@ -1918,8 +1995,6 @@ Bool nxagentUnrealizeWindow(WindowPtr pWin)
...
@@ -1918,8 +1995,6 @@ Bool nxagentUnrealizeWindow(WindowPtr pWin)
void
nxagentFrameBufferPaintWindow
(
WindowPtr
pWin
,
RegionPtr
pRegion
,
int
what
)
void
nxagentFrameBufferPaintWindow
(
WindowPtr
pWin
,
RegionPtr
pRegion
,
int
what
)
{
{
void
(
*
PaintWindowBackgroundBackup
)(
WindowPtr
,
RegionPtr
,
int
);
if
(
pWin
->
backgroundState
==
BackgroundPixmap
)
if
(
pWin
->
backgroundState
==
BackgroundPixmap
)
{
{
pWin
->
background
.
pixmap
=
nxagentVirtualPixmap
(
pWin
->
background
.
pixmap
);
pWin
->
background
.
pixmap
=
nxagentVirtualPixmap
(
pWin
->
background
.
pixmap
);
...
@@ -1930,13 +2005,22 @@ void nxagentFrameBufferPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what)
...
@@ -1930,13 +2005,22 @@ void nxagentFrameBufferPaintWindow(WindowPtr pWin, RegionPtr pRegion, int what)
pWin
->
border
.
pixmap
=
nxagentVirtualPixmap
(
pWin
->
border
.
pixmap
);
pWin
->
border
.
pixmap
=
nxagentVirtualPixmap
(
pWin
->
border
.
pixmap
);
}
}
PaintWindowBackgroundBackup
=
pWin
->
drawable
.
pScreen
->
PaintWindowBackground
;
/*
* Call fbPaintWindow(). We need to temporarily replace
* PaintWindowBackground() by ourself because fbPaintWindow() is
* recursively calling it for parent windows, too.
*/
{
void
(
*
PaintWindowBackgroundBackup
)(
WindowPtr
,
RegionPtr
,
int
);
pWin
->
drawable
.
pScreen
->
PaintWindowBackground
=
nxagentFrameBufferPaintWindow
;
PaintWindowBackgroundBackup
=
pWin
->
drawable
.
pScreen
->
PaintWindowBackground
;
fbPaintWindow
(
pWin
,
pRegion
,
what
)
;
pWin
->
drawable
.
pScreen
->
PaintWindowBackground
=
nxagentFrameBufferPaintWindow
;
pWin
->
drawable
.
pScreen
->
PaintWindowBackground
=
PaintWindowBackgroundBackup
;
fbPaintWindow
(
pWin
,
pRegion
,
what
);
pWin
->
drawable
.
pScreen
->
PaintWindowBackground
=
PaintWindowBackgroundBackup
;
}
if
(
pWin
->
backgroundState
==
BackgroundPixmap
)
if
(
pWin
->
backgroundState
==
BackgroundPixmap
)
{
{
...
@@ -2003,11 +2087,46 @@ void nxagentPaintWindowBorder(WindowPtr pWin, RegionPtr pRegion, int what)
...
@@ -2003,11 +2087,46 @@ void nxagentPaintWindowBorder(WindowPtr pWin, RegionPtr pRegion, int what)
RegionUninit
(
&
temp
);
RegionUninit
(
&
temp
);
}
}
/*
* from "Definition of the Porting Layer for X v11 Sample Server":
*
* CopyWindow is called when a window is moved, and graphically moves
* to pixels of a window on the screen. It should not change any other
* state within DDX (see PositionWindow(), above).
*
* oldpt is the old location of the upper-left corner. oldRegion is
* the old region it is coming from. The new location and new region
* is stored in the WindowRec. oldRegion might modified in place by
* this routine (the sample implementation does this).
*
* CopyArea could be used, except that this operation has more
* complications. First of all, you do not want to copy a rectangle
* onto a rectangle. The original window may be obscured by other
* windows, and the new window location may be similarly
* obscured. Second, some hardware supports multiple windows with
* multiple depths, and your routine needs to take care of that.
*
* The pixels in oldRegion (with reference point oldpt) are copied to
* the window's new region (pWin->borderClip). pWin->borderClip is
* gotten directly from the window, rather than passing it as a
* parameter.
*
* The sample server implementation is in Xserver/fb/fbwindow.c.
*/
void
nxagentCopyWindow
(
WindowPtr
pWin
,
xPoint
oldOrigin
,
RegionPtr
oldRegion
)
void
nxagentCopyWindow
(
WindowPtr
pWin
,
xPoint
oldOrigin
,
RegionPtr
oldRegion
)
{
{
fbCopyWindow
(
pWin
,
oldOrigin
,
oldRegion
);
fbCopyWindow
(
pWin
,
oldOrigin
,
oldRegion
);
}
}
/*
* from "Definition of the Porting Layer for X v11 Sample Server":
*
* Whenever the cliplist for a window is changed, this function is
* called to perform whatever hardware manipulations might be
* necessary. When called, the clip list and border clip regions in
* the window are set to the new values. dx,dy are the distance that
* the window has been moved (if at all).
*/
void
nxagentClipNotify
(
WindowPtr
pWin
,
int
dx
,
int
dy
)
void
nxagentClipNotify
(
WindowPtr
pWin
,
int
dx
,
int
dy
)
{
{
/*
/*
...
@@ -2026,6 +2145,20 @@ void nxagentClipNotify(WindowPtr pWin, int dx, int dy)
...
@@ -2026,6 +2145,20 @@ void nxagentClipNotify(WindowPtr pWin, int dx, int dy)
#endif
/* NXAGENT_SHAPE */
#endif
/* NXAGENT_SHAPE */
}
}
/*
* from "Definition of the Porting Layer for X v11 Sample Server":
*
* The WindowExposures() routine paints the border and generates
* exposure events for the window. pRegion is an unoccluded region of
* the window, and pBSRegion is an occluded region that has backing
* store. Since exposure events include a rectangle describing what
* was exposed, this routine may have to send back a series of
* exposure events, one for each rectangle of the region. The count
* field in the expose event is a hint to the client as to the number
* of regions that are after this one. This routine must be
* provided. The sample server has a machine-independent version in
* Xserver/mi/miexpose.c.
*/
void
nxagentWindowExposures
(
WindowPtr
pWin
,
RegionPtr
pRgn
,
RegionPtr
other_exposed
)
void
nxagentWindowExposures
(
WindowPtr
pWin
,
RegionPtr
pRgn
,
RegionPtr
other_exposed
)
{
{
/*
/*
...
@@ -3340,6 +3473,7 @@ Bool nxagentIsIconic(WindowPtr pWin)
...
@@ -3340,6 +3473,7 @@ Bool nxagentIsIconic(WindowPtr pWin)
}
}
}
}
/* pass Eventmask to the real X server (for the rootless toplevel window only) */
void
nxagentSetTopLevelEventMask
(
WindowPtr
pWin
)
void
nxagentSetTopLevelEventMask
(
WindowPtr
pWin
)
{
{
if
(
nxagentOption
(
Rootless
)
&&
nxagentWindowTopLevel
(
pWin
))
if
(
nxagentOption
(
Rootless
)
&&
nxagentWindowTopLevel
(
pWin
))
...
@@ -3408,7 +3542,7 @@ void nxagentFlushConfigureWindow(void)
...
@@ -3408,7 +3542,7 @@ void nxagentFlushConfigureWindow(void)
index
=
index
->
prev
;
index
=
index
->
prev
;
free
(
tmp
);
free
(
tmp
);
}
}
}
}
nxagentConfiguredWindowList
=
NULL
;
nxagentConfiguredWindowList
=
NULL
;
...
@@ -3438,6 +3572,14 @@ void nxagentFlushConfigureWindow(void)
...
@@ -3438,6 +3572,14 @@ void nxagentFlushConfigureWindow(void)
return
;
return
;
}
}
/*
* from "Definition of the Porting Layer for X v11 Sample Server":
*
* If this routine is not NULL, DIX calls it shortly after calling
* ValidateTree, passing it the same arguments. This is useful for
* managing multi-layered framebuffers. The sample server sets this to
* NULL.
*/
void
nxagentPostValidateTree
(
WindowPtr
pParent
,
WindowPtr
pChild
,
VTKind
kind
)
void
nxagentPostValidateTree
(
WindowPtr
pParent
,
WindowPtr
pChild
,
VTKind
kind
)
{
{
/*
/*
...
@@ -3449,6 +3591,16 @@ void nxagentPostValidateTree(WindowPtr pParent, WindowPtr pChild, VTKind kind)
...
@@ -3449,6 +3591,16 @@ void nxagentPostValidateTree(WindowPtr pParent, WindowPtr pChild, VTKind kind)
return
;
return
;
}
}
/*
* Add the given window to the beginning of
* nxagentconfiguredWindowList. This list collects all windows that
* need to be reconfigured on the real X server. valuemask defines
* what changes need to be done. The required values (like position,
* size, ...) are already stored in pWin).
*
* Note that we just add the window to the list here. The actual work
* will be done by nxagentFlushConfigureWindow() later.
*/
void
nxagentAddConfiguredWindow
(
WindowPtr
pWin
,
unsigned
int
valuemask
)
void
nxagentAddConfiguredWindow
(
WindowPtr
pWin
,
unsigned
int
valuemask
)
{
{
unsigned
int
mask
;
unsigned
int
mask
;
...
@@ -3518,6 +3670,12 @@ void nxagentAddConfiguredWindow(WindowPtr pWin, unsigned int valuemask)
...
@@ -3518,6 +3670,12 @@ void nxagentAddConfiguredWindow(WindowPtr pWin, unsigned int valuemask)
return
;
return
;
}
}
/*
* remove pWin from nxgentConfigureWindowList
*
* This is just updating the linked list and freeing the
* given entry. It will not perform any X stuff
*/
void
nxagentDeleteConfiguredWindow
(
WindowPtr
pWin
)
void
nxagentDeleteConfiguredWindow
(
WindowPtr
pWin
)
{
{
ConfiguredWindowStruct
*
index
,
*
previous
,
*
tmp
;
ConfiguredWindowStruct
*
index
,
*
previous
,
*
tmp
;
...
...
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