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
b7494f08
Commit
b7494f08
authored
Oct 10, 2011
by
Reinhard Tartler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Imported nxagent-3.4.0-8.tar.gz
Summary: Imported nxagent-3.4.0-8.tar.gz Keywords: Imported nxagent-3.4.0-8.tar.gz into Git repository
parent
c0780240
Show whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
1082 additions
and
486 deletions
+1082
-486
Atoms.c
nx-X11/programs/Xserver/hw/nxagent/Atoms.c
+2
-0
Atoms.h
nx-X11/programs/Xserver/hw/nxagent/Atoms.h
+1
-1
CHANGELOG
nx-X11/programs/Xserver/hw/nxagent/CHANGELOG
+56
-0
Events.c
nx-X11/programs/Xserver/hw/nxagent/Events.c
+399
-38
Events.h
nx-X11/programs/Xserver/hw/nxagent/Events.h
+1
-0
Imakefile
nx-X11/programs/Xserver/hw/nxagent/Imakefile
+2
-1
Keystroke.c
nx-X11/programs/Xserver/hw/nxagent/Keystroke.c
+12
-0
Pixels.h
nx-X11/programs/Xserver/hw/nxagent/Pixels.h
+18
-0
Pointer.c
nx-X11/programs/Xserver/hw/nxagent/Pointer.c
+34
-0
Pointer.h
nx-X11/programs/Xserver/hw/nxagent/Pointer.h
+9
-0
Reconnect.c
nx-X11/programs/Xserver/hw/nxagent/Reconnect.c
+4
-0
Render.c
nx-X11/programs/Xserver/hw/nxagent/Render.c
+251
-2
Render.h
nx-X11/programs/Xserver/hw/nxagent/Render.h
+2
-0
Rootless.c
nx-X11/programs/Xserver/hw/nxagent/Rootless.c
+27
-2
Screen.c
nx-X11/programs/Xserver/hw/nxagent/Screen.c
+14
-220
Screen.h
nx-X11/programs/Xserver/hw/nxagent/Screen.h
+0
-3
Window.c
nx-X11/programs/Xserver/hw/nxagent/Window.c
+48
-211
NXpicture.c
nx-X11/programs/Xserver/hw/nxagent/X/NXpicture.c
+46
-1
NXpicture.c.NX.original
nx-X11/programs/Xserver/hw/nxagent/X/NXpicture.c.NX.original
+46
-1
NXrender.c
nx-X11/programs/Xserver/hw/nxagent/X/NXrender.c
+55
-3
NXrender.c.NX.original
nx-X11/programs/Xserver/hw/nxagent/X/NXrender.c.NX.original
+55
-3
No files found.
nx-X11/programs/Xserver/hw/nxagent/Atoms.c
View file @
b7494f08
...
@@ -79,6 +79,8 @@ static char *nxagentAtomNames[NXAGENT_NUMBER_OF_ATOMS + 1] =
...
@@ -79,6 +79,8 @@ static char *nxagentAtomNames[NXAGENT_NUMBER_OF_ATOMS + 1] =
"CLIPBOARD"
,
/* 10 */
"CLIPBOARD"
,
/* 10 */
"TIMESTAMP"
,
/* 11 */
"TIMESTAMP"
,
/* 11 */
"UTF8_STRING"
,
/* 12 */
"UTF8_STRING"
,
/* 12 */
"_NET_WM_STATE"
,
/* 13 */
"_NET_WM_STATE_FULLSCREEN"
,
/* 14 */
NULL
,
NULL
,
NULL
NULL
};
};
...
...
nx-X11/programs/Xserver/hw/nxagent/Atoms.h
View file @
b7494f08
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
#include "../../include/window.h"
#include "../../include/window.h"
#include "screenint.h"
#include "screenint.h"
#define NXAGENT_NUMBER_OF_ATOMS 1
4
#define NXAGENT_NUMBER_OF_ATOMS 1
6
extern
Atom
nxagentAtoms
[
NXAGENT_NUMBER_OF_ATOMS
];
extern
Atom
nxagentAtoms
[
NXAGENT_NUMBER_OF_ATOMS
];
...
...
nx-X11/programs/Xserver/hw/nxagent/CHANGELOG
View file @
b7494f08
ChangeLog:
ChangeLog:
nxagent-3.4.0-8
- Grab the keyboard in fullscreen mode on EnterNotify only if mode is
'NotifyNormal'.
- Yield control in the dispatch loop in case we stop the smart sche-
duler timer while waiting for a reply from the remote display.
nxagent-3.4.0-7
- Fixed TR08D01478. The communication with the compiz window manager
by means of the _NET_WM_PING property was not handled properly.
- Fixed a type mismatch in XKB events on 64 bit platforms.
- Moved grab/ungrab keyboard from focus in/out event to enter/leave
notify event.
- Removed nxagentIconWindow because it's not longer used.
nxagent-3.4.0-6
- Fixed TR09F02102. Problem was with pointer buttons map.
- Fixed TR02H02327. Some KeyRelease events was discarded.
- Fixed up Num and Caps locks.
- Fixed TR03H02335. Emulated right mouse button for Mac clients.
- Added utilities to print info about internal and remote windows.
- Fixed TR01F01995. Solved a picture resource leak by destroying remo-
te pictures only when their reference counter returns to zero.
- Fixed TR04H02337. Errors occurred because pictures with no drawable
were handled badly.
- Implemented handling nxagent's private for gradient pictures and so-
lid fill picture.
- Fixed BadMatch condition check in function ProcRenderComposite.
- Fixed nxagentComposite() to handle situations with source picture
drawable pointing to NULL.
- Implemented render acceleration for requests: CreateSolidFill,
CreateLinearGradient, CreateRadialGradient, CreateConicalGradient.
- Fixed TR03G02196. Dialogs are shown to the fore when the NX session
is in fullscreen mode.
- Changed mechanism to switch to fullscreen mode. Now the override
redirect attribute is no longer used and _NET_WM_STATE_FULLSCREEN
hint is sent to the WM.
nxagent-3.4.0-5
nxagent-3.4.0-5
- Updated copyright to year 2010.
- Updated copyright to year 2010.
...
...
nx-X11/programs/Xserver/hw/nxagent/Events.c
View file @
b7494f08
...
@@ -76,7 +76,9 @@
...
@@ -76,7 +76,9 @@
#include "input.h"
#include "input.h"
#endif
#endif
#define Time XlibXID
#include "XKBlib.h"
#include "XKBlib.h"
#undef Time
#define GC XlibGC
#define GC XlibGC
#define Font XlibFont
#define Font XlibFont
...
@@ -203,6 +205,8 @@ CARD32 nxagentLastEventTime = 0;
...
@@ -203,6 +205,8 @@ CARD32 nxagentLastEventTime = 0;
CARD32
nxagentLastKeyPressTime
=
0
;
CARD32
nxagentLastKeyPressTime
=
0
;
Time
nxagentLastServerTime
=
0
;
Time
nxagentLastServerTime
=
0
;
int
nxagentPointerAndKeyboardGrabbed
=
0
;
/*
/*
* Used for storing windows that need to
* Used for storing windows that need to
* receive expose events from the agent.
* receive expose events from the agent.
...
@@ -219,6 +223,16 @@ static void nxagentForwardRemoteExpose(void);
...
@@ -219,6 +223,16 @@ static void nxagentForwardRemoteExpose(void);
static
int
nxagentClipAndSendExpose
(
WindowPtr
pWin
,
pointer
ptr
);
static
int
nxagentClipAndSendExpose
(
WindowPtr
pWin
,
pointer
ptr
);
/*
/*
* This is from NXproperty.c.
*/
int
GetWindowProperty
(
WindowPtr
pWin
,
Atom
property
,
long
longOffset
,
long
longLength
,
Bool
delete
,
Atom
type
,
Atom
*
actualType
,
int
*
format
,
unsigned
long
*
nItems
,
unsigned
long
*
bytesAfter
,
unsigned
char
**
propData
);
/*
* Associate a resource to a drawable and
* Associate a resource to a drawable and
* store the region affected by the split
* store the region affected by the split
* operation.
* operation.
...
@@ -274,6 +288,280 @@ void ProcessInputEvents()
...
@@ -274,6 +288,280 @@ void ProcessInputEvents()
mieqProcessInputEvents
();
mieqProcessInputEvents
();
}
}
#ifdef DEBUG_TREE
/*
* Print ID and name of window.
*/
void
nxagentRemoteWindowID
(
Window
window
,
Bool
newline
)
{
#ifdef NO_I18N
char
*
winName
;
#else
XTextProperty
tp
;
#endif
fprintf
(
stderr
,
"0x%lx"
,
window
);
if
(
!
window
)
{
fprintf
(
stderr
,
" (none) "
);
}
else
{
if
(
window
==
DefaultRootWindow
(
nxagentDisplay
))
{
fprintf
(
stderr
,
" (the root window) "
);
}
#ifdef NO_I18N
if
(
!
XFetchName
(
nxagentDisplay
,
window
,
&
winName
))
{
fprintf
(
stderr
,
" (has no name) "
);
}
else
if
(
winName
)
{
fprintf
(
stderr
,
"
\"
%s
\"
"
,
winName
);
XFree
(
winName
);
}
#else
if
(
XGetWMName
(
nxagentDisplay
,
window
,
&
tp
)
!=
0
)
{
fprintf
(
stderr
,
" (has no name) "
);
}
else
if
(
tp
.
nitems
>
0
)
{
int
count
=
0
;
int
i
,
ret
;
char
**
list
=
NULL
;
fprintf
(
stderr
,
"
\"
"
);
ret
=
XmbTextPropertyToTextList
(
nxagentDisplay
,
&
tp
,
&
list
,
&
count
);
if
((
ret
==
Success
||
ret
>
0
)
&&
list
!=
NULL
)
{
for
(
i
=
0
;
i
<
count
;
i
++
)
{
fprintf
(
stderr
,
"%s"
,
list
[
i
]);
}
XFreeStringList
(
list
);
}
else
{
fprintf
(
stderr
,
"%s"
,
tp
.
value
);
}
fprintf
(
stderr
,
"
\"
"
);
}
#endif
else
{
fprintf
(
stderr
,
" (has no name) "
);
}
}
if
(
newline
==
TRUE
)
{
fprintf
(
stderr
,
"
\n
"
);
}
return
;
}
/*
* Print info about remote window.
*/
void
nxagentRemoteWindowInfo
(
Window
win
,
int
indent
,
Bool
newLine
)
{
XWindowAttributes
attributes
;
int
i
;
if
(
XGetWindowAttributes
(
nxagentDisplay
,
win
,
&
attributes
)
==
0
)
{
return
;
}
for
(
i
=
0
;
i
<
indent
;
i
++
)
{
fprintf
(
stderr
,
" "
);
}
fprintf
(
stderr
,
"x=%d y=%d width=%d height=%d class=%s map_state=%s "
"override_redirect=%s
\n
"
,
attributes
.
x
,
attributes
.
y
,
attributes
.
width
,
attributes
.
height
,
(
attributes
.
class
==
0
)
?
"InputOutput"
:
"InputOnly"
,
(
attributes
.
map_state
==
0
)
?
"IsUnmapped"
:
(
attributes
.
map_state
==
1
?
"IsUnviewable"
:
"IsViewable"
),
(
attributes
.
override_redirect
==
0
)
?
"No"
:
"Yes"
);
if
(
newLine
==
TRUE
)
{
fprintf
(
stderr
,
"
\n
"
);
}
}
/*
* Walk remote windows tree.
*/
void
nxagentRemoteWindowsTree
(
Window
window
,
int
level
)
{
int
i
,
j
;
Window
rootWin
,
parentWin
;
unsigned
int
numChildren
;
Window
*
childList
;
if
(
!
XQueryTree
(
nxagentDisplay
,
window
,
&
rootWin
,
&
parentWin
,
&
childList
,
&
numChildren
))
{
fprintf
(
stderr
,
"nxagentRemoteWindowsTree - XQueryTree failed.
\n
"
);
return
;
}
if
(
level
==
0
)
{
fprintf
(
stderr
,
"
\n
"
);
fprintf
(
stderr
,
" Root Window ID: "
);
nxagentRemoteWindowID
(
rootWin
,
TRUE
);
fprintf
(
stderr
,
" Parent window ID: "
);
nxagentRemoteWindowID
(
parentWin
,
TRUE
);
}
if
(
level
==
0
||
numChildren
>
0
)
{
fprintf
(
stderr
,
" "
);
for
(
j
=
0
;
j
<
level
;
j
++
)
{
fprintf
(
stderr
,
" "
);
}
fprintf
(
stderr
,
"%d child%s%s
\n
"
,
numChildren
,
(
numChildren
==
1
)
?
""
:
"ren"
,
(
numChildren
==
1
)
?
":"
:
"."
);
}
for
(
i
=
(
int
)
numChildren
-
1
;
i
>=
0
;
i
--
)
{
fprintf
(
stderr
,
" "
);
for
(
j
=
0
;
j
<
level
;
j
++
)
{
fprintf
(
stderr
,
" "
);
}
nxagentRemoteWindowID
(
childList
[
i
],
TRUE
);
nxagentRemoteWindowInfo
(
childList
[
i
],
(
level
*
5
)
+
6
,
TRUE
);
nxagentRemoteWindowsTree
(
childList
[
i
],
level
+
1
);
}
if
(
childList
)
{
XFree
((
char
*
)
childList
);
}
}
/*
* Print info about internal window.
*/
void
nxagentInternalWindowInfo
(
WindowPtr
pWin
,
int
indent
,
Bool
newLine
)
{
int
i
;
int
result
;
unsigned
long
ulReturnItems
;
unsigned
long
ulReturnBytesLeft
;
Atom
atomReturnType
;
int
iReturnFormat
;
unsigned
char
*
pszReturnData
=
NULL
;
fprintf
(
stderr
,
"Window ID=[0x%lx] Remote ID=[0x%lx] "
,
pWin
->
drawable
.
id
,
nxagentWindow
(
pWin
));
result
=
GetWindowProperty
(
pWin
,
MakeAtom
(
"WM_NAME"
,
7
,
False
)
,
0
,
sizeof
(
CARD32
),
False
,
AnyPropertyType
,
&
atomReturnType
,
&
iReturnFormat
,
&
ulReturnItems
,
&
ulReturnBytesLeft
,
&
pszReturnData
);
fprintf
(
stderr
,
"Name: "
);
if
(
result
==
Success
&&
pszReturnData
!=
NULL
)
{
pszReturnData
[
ulReturnItems
]
=
'\0'
;
fprintf
(
stderr
,
"
\"
%s
\"\n
"
,
(
char
*
)
pszReturnData
);
}
else
{
fprintf
(
stderr
,
"%s
\n
"
,
"( has no name )"
);
}
for
(
i
=
0
;
i
<
indent
;
i
++
)
{
fprintf
(
stderr
,
" "
);
}
fprintf
(
stderr
,
"x=%d y=%d width=%d height=%d class=%s map_state=%s "
"override_redirect=%s"
,
pWin
->
drawable
.
x
,
pWin
->
drawable
.
y
,
pWin
->
drawable
.
width
,
pWin
->
drawable
.
height
,
(
pWin
->
drawable
.
class
==
0
)
?
"InputOutput"
:
"InputOnly"
,
(
pWin
->
mapped
==
0
)
?
"IsUnmapped"
:
(
pWin
->
mapped
==
1
?
"IsUnviewable"
:
"IsViewable"
),
(
pWin
->
overrideRedirect
==
0
)
?
"No"
:
"Yes"
);
if
(
newLine
==
TRUE
)
{
fprintf
(
stderr
,
"
\n
"
);
}
}
/*
* Walk internal windows tree.
*/
void
nxagentInternalWindowsTree
(
WindowPtr
pWin
,
int
indent
)
{
WindowPtr
pChild
;
int
i
;
while
(
pWin
)
{
pChild
=
pWin
->
firstChild
;
for
(
i
=
0
;
i
<
indent
;
i
++
)
{
fprintf
(
stderr
,
" "
);
}
nxagentInternalWindowInfo
(
pWin
,
indent
,
TRUE
);
fprintf
(
stderr
,
"
\n
"
);
nxagentInternalWindowsTree
(
pChild
,
indent
+
4
);
pWin
=
pWin
->
nextSib
;
}
}
#endif
/* DEBUG_TREE */
void
nxagentSwitchResizeMode
(
ScreenPtr
pScreen
)
void
nxagentSwitchResizeMode
(
ScreenPtr
pScreen
)
{
{
XSizeHints
sizeHints
;
XSizeHints
sizeHints
;
...
@@ -290,17 +578,18 @@ void nxagentSwitchResizeMode(ScreenPtr pScreen)
...
@@ -290,17 +578,18 @@ void nxagentSwitchResizeMode(ScreenPtr pScreen)
nxagentLaunchDialog
(
DIALOG_DISABLE_DESKTOP_RESIZE_MODE
);
nxagentLaunchDialog
(
DIALOG_DISABLE_DESKTOP_RESIZE_MODE
);
if
(
nxagentOption
(
Fullscreen
)
==
0
)
{
sizeHints
.
max_width
=
nxagentOption
(
RootWidth
);
sizeHints
.
max_width
=
nxagentOption
(
RootWidth
);
sizeHints
.
max_height
=
nxagentOption
(
RootHeight
);
sizeHints
.
max_height
=
nxagentOption
(
RootHeight
);
}
}
}
else
else
{
{
fprintf
(
stderr
,
"Info: Enabled desktop resize mode in agent.
\n
"
);
fprintf
(
stderr
,
"Info: Enabled desktop resize mode in agent.
\n
"
);
nxagentLaunchDialog
(
DIALOG_ENABLE_DESKTOP_RESIZE_MODE
);
nxagentLaunchDialog
(
DIALOG_ENABLE_DESKTOP_RESIZE_MODE
);
nxagentRRSetScreenConfig
(
pScreen
,
nxagentOption
(
Width
),
nxagentOption
(
Height
));
if
(
nxagentOption
(
ClientOs
)
==
ClientOsWinnt
)
if
(
nxagentOption
(
ClientOs
)
==
ClientOsWinnt
)
{
{
NXSetExposeParameters
(
nxagentDisplay
,
0
,
0
,
0
);
NXSetExposeParameters
(
nxagentDisplay
,
0
,
0
,
0
);
...
@@ -655,6 +944,22 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate)
...
@@ -655,6 +944,22 @@ void nxagentDispatchEvents(PredicateFuncPtr predicate)
{
{
break
;
break
;
}
}
#ifdef DEBUG_TREE
case
doDebugTree
:
{
fprintf
(
stderr
,
"
\n
========== nxagentRemoteWindowsTree ==========
\n
"
);
nxagentRemoteWindowsTree
(
nxagentWindow
(
WindowTable
[
0
]),
0
);
fprintf
(
stderr
,
"
\n
========== nxagentInternalWindowsTree ==========
\n
"
);
nxagentInternalWindowsTree
(
WindowTable
[
0
],
0
);
break
;
}
#endif
/* DEBUG_TREE */
case
doCloseSession
:
case
doCloseSession
:
{
{
closeSession
=
TRUE
;
closeSession
=
TRUE
;
...
@@ -797,7 +1102,8 @@ FIXME: Don't enqueue the KeyRelease event if the key was
...
@@ -797,7 +1102,8 @@ FIXME: Don't enqueue the KeyRelease event if the key was
enqueued and to remove the KeyPress afterwards.
enqueued and to remove the KeyPress afterwards.
*/
*/
if
(
inputInfo
.
keyboard
->
key
->
down
[
X
.
xkey
.
keycode
>>
3
]
&
(
1
<<
(
X
.
xkey
.
keycode
&
7
)))
if
(
BitIsOn
(
inputInfo
.
keyboard
->
key
->
down
,
nxagentConvertKeycode
(
X
.
xkey
.
keycode
)))
{
{
sendKey
=
1
;
sendKey
=
1
;
}
}
...
@@ -871,6 +1177,23 @@ FIXME: Don't enqueue the KeyRelease event if the key was
...
@@ -871,6 +1177,23 @@ FIXME: Don't enqueue the KeyRelease event if the key was
nxagentInputEvent
=
1
;
nxagentInputEvent
=
1
;
if
(
nxagentOption
(
ClientOs
)
==
ClientOsMac
&&
(
X
.
xbutton
.
state
&
ControlMask
)
==
ControlMask
)
{
x
.
u
.
u
.
type
=
ButtonPress
;
x
.
u
.
u
.
detail
=
inputInfo
.
pointer
->
button
->
map
[
3
];
x
.
u
.
keyButtonPointer
.
time
=
nxagentLastEventTime
=
GetTimeInMillis
();
mieqEnqueue
(
&
x
);
x
.
u
.
u
.
type
=
ButtonRelease
;
x
.
u
.
u
.
detail
=
inputInfo
.
pointer
->
button
->
map
[
3
];
x
.
u
.
keyButtonPointer
.
time
=
nxagentLastEventTime
=
GetTimeInMillis
();
mieqEnqueue
(
&
x
);
break
;
}
if
(
nxagentOption
(
Fullscreen
))
if
(
nxagentOption
(
Fullscreen
))
{
{
if
(
nxagentMagicPixelZone
(
X
.
xbutton
.
x
,
X
.
xbutton
.
y
))
if
(
nxagentMagicPixelZone
(
X
.
xbutton
.
x
,
X
.
xbutton
.
y
))
...
@@ -917,7 +1240,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was
...
@@ -917,7 +1240,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was
X
.
xbutton
.
subwindow
==
None
))
X
.
xbutton
.
subwindow
==
None
))
{
{
x
.
u
.
u
.
type
=
ButtonPress
;
x
.
u
.
u
.
type
=
ButtonPress
;
x
.
u
.
u
.
detail
=
X
.
xbutton
.
button
;
x
.
u
.
u
.
detail
=
inputInfo
.
pointer
->
button
->
map
[
nxagentReversePointerMap
[
X
.
xbutton
.
button
-
1
]]
;
x
.
u
.
keyButtonPointer
.
time
=
nxagentLastEventTime
=
GetTimeInMillis
();
x
.
u
.
keyButtonPointer
.
time
=
nxagentLastEventTime
=
GetTimeInMillis
();
if
(
nxagentOption
(
Rootless
))
if
(
nxagentOption
(
Rootless
))
...
@@ -974,6 +1297,11 @@ FIXME: Don't enqueue the KeyRelease event if the key was
...
@@ -974,6 +1297,11 @@ FIXME: Don't enqueue the KeyRelease event if the key was
nxagentInputEvent
=
1
;
nxagentInputEvent
=
1
;
if
(
nxagentOption
(
ClientOs
)
==
ClientOsMac
&&
(
X
.
xbutton
.
state
&
ControlMask
)
==
ControlMask
)
{
break
;
}
if
(
viewportCursor
)
if
(
viewportCursor
)
{
{
/*
/*
...
@@ -990,7 +1318,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was
...
@@ -990,7 +1318,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was
if
(
minimize
!=
True
)
if
(
minimize
!=
True
)
{
{
x
.
u
.
u
.
type
=
ButtonRelease
;
x
.
u
.
u
.
type
=
ButtonRelease
;
x
.
u
.
u
.
detail
=
X
.
xbutton
.
button
;
x
.
u
.
u
.
detail
=
inputInfo
.
pointer
->
button
->
map
[
nxagentReversePointerMap
[
X
.
xbutton
.
button
-
1
]]
;
x
.
u
.
keyButtonPointer
.
time
=
nxagentLastEventTime
=
GetTimeInMillis
();
x
.
u
.
keyButtonPointer
.
time
=
nxagentLastEventTime
=
GetTimeInMillis
();
if
(
nxagentOption
(
Rootless
))
if
(
nxagentOption
(
Rootless
))
...
@@ -1344,10 +1672,11 @@ FIXME: Don't enqueue the KeyRelease event if the key was
...
@@ -1344,10 +1672,11 @@ FIXME: Don't enqueue the KeyRelease event if the key was
nxagentScreenTrap
=
0
;
nxagentScreenTrap
=
0
;
}
}
if
(
nxagentOption
(
Fullscreen
))
if
(
nxagentOption
(
Fullscreen
)
==
1
)
{
{
if
(
X
.
xcrossing
.
window
==
nxagentFullscreenWindow
&&
if
(
X
.
xcrossing
.
window
==
nxagentDefaultWindows
[
0
]
&&
X
.
xcrossing
.
detail
!=
NotifyInferior
)
X
.
xcrossing
.
detail
!=
NotifyInferior
&&
X
.
xcrossing
.
mode
==
NotifyNormal
)
{
{
nxagentGrabPointerAndKeyboard
(
&
X
);
nxagentGrabPointerAndKeyboard
(
&
X
);
}
}
...
@@ -1399,9 +1728,9 @@ FIXME: Don't enqueue the KeyRelease event if the key was
...
@@ -1399,9 +1728,9 @@ FIXME: Don't enqueue the KeyRelease event if the key was
nxagentLastEnteredWindow
=
NULL
;
nxagentLastEnteredWindow
=
NULL
;
}
}
if
(
nxagent
Option
(
Fullscreen
)
)
if
(
nxagent
PointerAndKeyboardGrabbed
==
1
)
{
{
if
(
X
.
xcrossing
.
window
==
nxagent
FullscreenWindow
&&
if
(
X
.
xcrossing
.
window
==
nxagent
DefaultWindows
[
0
]
&&
X
.
xcrossing
.
detail
!=
NotifyInferior
&&
X
.
xcrossing
.
detail
!=
NotifyInferior
&&
X
.
xcrossing
.
mode
==
NotifyNormal
)
X
.
xcrossing
.
mode
==
NotifyNormal
)
{
{
...
@@ -1660,7 +1989,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was
...
@@ -1660,7 +1989,7 @@ FIXME: Don't enqueue the KeyRelease event if the key was
}
}
if
(
nxagentUseNXTrans
==
1
&&
nxagentOption
(
Rootless
)
==
0
&&
if
(
nxagentUseNXTrans
==
1
&&
nxagentOption
(
Rootless
)
==
0
&&
nxagentOption
(
Nested
)
==
0
&&
X
.
xmap
.
window
!=
nxagentIconWindow
)
nxagentOption
(
Nested
)
==
0
)
{
{
nxagentVisibility
=
VisibilityFullyObscured
;
nxagentVisibility
=
VisibilityFullyObscured
;
}
}
...
@@ -1701,12 +2030,6 @@ FIXME: Don't enqueue the KeyRelease event if the key was
...
@@ -1701,12 +2030,6 @@ FIXME: Don't enqueue the KeyRelease event if the key was
if
(
nxagentOption
(
Fullscreen
)
==
1
)
if
(
nxagentOption
(
Fullscreen
)
==
1
)
{
{
if
(
X
.
xmap
.
window
==
nxagentIconWindow
)
{
pScreen
=
nxagentScreen
(
X
.
xmap
.
window
);
nxagentMaximizeToFullScreen
(
pScreen
);
}
nxagentVisibility
=
VisibilityUnobscured
;
nxagentVisibility
=
VisibilityUnobscured
;
nxagentVisibilityStop
=
False
;
nxagentVisibilityStop
=
False
;
nxagentVisibilityTimeout
=
GetTimeInMillis
()
+
2000
;
nxagentVisibilityTimeout
=
GetTimeInMillis
()
+
2000
;
...
@@ -1716,10 +2039,17 @@ FIXME: Don't enqueue the KeyRelease event if the key was
...
@@ -1716,10 +2039,17 @@ FIXME: Don't enqueue the KeyRelease event if the key was
}
}
case
MappingNotify
:
case
MappingNotify
:
{
{
XMappingEvent
*
mappingEvent
=
(
XMappingEvent
*
)
&
X
;
#ifdef DEBUG
#ifdef DEBUG
fprintf
(
stderr
,
"nxagentDispatchEvents: WARNING! Going to handle new MappingNotify event.
\n
"
);
fprintf
(
stderr
,
"nxagentDispatchEvents: WARNING! Going to handle new MappingNotify event.
\n
"
);
#endif
#endif
if
(
mappingEvent
->
request
==
MappingPointer
)
{
nxagentInitPointerMap
();
}
break
;
break
;
}
}
default:
default:
...
@@ -1959,8 +2289,16 @@ int nxagentHandleKeyPress(XEvent *X, enum HandleEventResult *result)
...
@@ -1959,8 +2289,16 @@ int nxagentHandleKeyPress(XEvent *X, enum HandleEventResult *result)
return
1
;
return
1
;
}
}
nxagentLastEventTime
=
nxagentLastKeyPressTime
=
GetTimeInMillis
();
if
(
X
->
xkey
.
keycode
==
66
)
{
nxagentXkbState
.
Caps
=
(
~
nxagentXkbState
.
Caps
&
1
);
}
else
if
(
X
->
xkey
.
keycode
==
77
)
{
nxagentXkbState
.
Num
=
(
~
nxagentXkbState
.
Num
&
1
);
}
nxagentLastEventTime
=
nxagentLastKeyPressTime
=
GetTimeInMillis
();
x
.
u
.
u
.
type
=
KeyPress
;
x
.
u
.
u
.
type
=
KeyPress
;
x
.
u
.
u
.
detail
=
nxagentConvertKeycode
(
X
->
xkey
.
keycode
);
x
.
u
.
u
.
detail
=
nxagentConvertKeycode
(
X
->
xkey
.
keycode
);
...
@@ -2270,7 +2608,6 @@ int nxagentHandleGraphicsExposeEvent(XEvent *X)
...
@@ -2270,7 +2608,6 @@ int nxagentHandleGraphicsExposeEvent(XEvent *X)
int
nxagentHandleClientMessageEvent
(
XEvent
*
X
,
enum
HandleEventResult
*
result
)
int
nxagentHandleClientMessageEvent
(
XEvent
*
X
,
enum
HandleEventResult
*
result
)
{
{
ScreenPtr
pScreen
;
WindowPtr
pWin
;
WindowPtr
pWin
;
xEvent
x
;
xEvent
x
;
...
@@ -2386,19 +2723,8 @@ int nxagentHandleClientMessageEvent(XEvent *X, enum HandleEventResult *result)
...
@@ -2386,19 +2723,8 @@ int nxagentHandleClientMessageEvent(XEvent *X, enum HandleEventResult *result)
fprintf
(
stderr
,
"Events: WM_DELETE_WINDOW arrived Atom = %ld.
\n
"
,
wmAtom
);
fprintf
(
stderr
,
"Events: WM_DELETE_WINDOW arrived Atom = %ld.
\n
"
,
wmAtom
);
#endif
#endif
if
(
X
->
xclient
.
window
==
nxagentIconWindow
)
if
(
X
->
xclient
.
window
==
nxagentDefaultWindows
[
0
]
||
{
nxagentWMIsRunning
==
0
)
pScreen
=
nxagentScreen
(
X
->
xmap
.
window
);
XMapRaised
(
nxagentDisplay
,
nxagentFullscreenWindow
);
XIconifyWindow
(
nxagentDisplay
,
nxagentIconWindow
,
DefaultScreen
(
nxagentDisplay
));
}
if
(
X
->
xclient
.
window
==
(
nxagentOption
(
Fullscreen
)
?
nxagentIconWindow
:
nxagentDefaultWindows
[
0
]))
{
{
*
result
=
doCloseSession
;
*
result
=
doCloseSession
;
}
}
...
@@ -2995,8 +3321,6 @@ int nxagentHandleConfigureNotify(XEvent* X)
...
@@ -2995,8 +3321,6 @@ int nxagentHandleConfigureNotify(XEvent* X)
if
(
X
->
xconfigure
.
window
==
nxagentDefaultWindows
[
pScreen
->
myNum
])
if
(
X
->
xconfigure
.
window
==
nxagentDefaultWindows
[
pScreen
->
myNum
])
{
{
if
(
nxagentOption
(
Fullscreen
)
==
0
)
{
if
(
nxagentOption
(
DesktopResize
)
==
1
)
if
(
nxagentOption
(
DesktopResize
)
==
1
)
{
{
if
(
nxagentOption
(
Width
)
!=
X
->
xconfigure
.
width
||
if
(
nxagentOption
(
Width
)
!=
X
->
xconfigure
.
width
||
...
@@ -3064,6 +3388,34 @@ int nxagentHandleConfigureNotify(XEvent* X)
...
@@ -3064,6 +3388,34 @@ int nxagentHandleConfigureNotify(XEvent* X)
doRandR
=
0
;
doRandR
=
0
;
}
}
nxagentChangeOption
(
Width
,
X
->
xconfigure
.
width
);
nxagentChangeOption
(
Height
,
X
->
xconfigure
.
height
);
XMoveResizeWindow
(
nxagentDisplay
,
nxagentInputWindows
[
0
],
0
,
0
,
X
->
xconfigure
.
width
,
X
->
xconfigure
.
height
);
if
(
nxagentOption
(
Fullscreen
)
==
0
)
{
nxagentMoveViewport
(
pScreen
,
0
,
0
);
}
else
{
nxagentChangeOption
(
RootX
,
(
nxagentOption
(
Width
)
-
nxagentOption
(
RootWidth
))
/
2
);
nxagentChangeOption
(
RootY
,
(
nxagentOption
(
Height
)
-
nxagentOption
(
RootHeight
))
/
2
);
nxagentChangeOption
(
ViewportXSpan
,
nxagentOption
(
Width
)
-
nxagentOption
(
RootWidth
));
nxagentChangeOption
(
ViewportYSpan
,
nxagentOption
(
Height
)
-
nxagentOption
(
RootHeight
));
nxagentUpdateViewportFrame
(
0
,
0
,
nxagentOption
(
RootWidth
),
nxagentOption
(
RootHeight
));
XMoveWindow
(
nxagentDisplay
,
nxagentWindow
(
WindowTable
[
pScreen
->
myNum
]),
nxagentOption
(
RootX
),
nxagentOption
(
RootY
));
}
if
(
doRandR
)
if
(
doRandR
)
{
{
#ifdef TEST
#ifdef TEST
...
@@ -3074,7 +3426,6 @@ int nxagentHandleConfigureNotify(XEvent* X)
...
@@ -3074,7 +3426,6 @@ int nxagentHandleConfigureNotify(XEvent* X)
nxagentRRSetScreenConfig
(
screenInfo
.
screens
[
DefaultScreen
(
nxagentDisplay
)],
nxagentRRSetScreenConfig
(
screenInfo
.
screens
[
DefaultScreen
(
nxagentDisplay
)],
nxagentOption
(
Width
),
nxagentOption
(
Height
));
nxagentOption
(
Width
),
nxagentOption
(
Height
));
}
}
}
return
1
;
return
1
;
}
}
...
@@ -3085,8 +3436,6 @@ int nxagentHandleConfigureNotify(XEvent* X)
...
@@ -3085,8 +3436,6 @@ int nxagentHandleConfigureNotify(XEvent* X)
int
nxagentHandleReparentNotify
(
XEvent
*
X
)
int
nxagentHandleReparentNotify
(
XEvent
*
X
)
{
{
ScreenPtr
pScreen
=
nxagentScreen
(
X
->
xreparent
.
window
);
#ifdef TEST
#ifdef TEST
fprintf
(
stderr
,
"nxagentHandleReparentNotify: Going to handle a new reparent event.
\n
"
);
fprintf
(
stderr
,
"nxagentHandleReparentNotify: Going to handle a new reparent event.
\n
"
);
#endif
#endif
...
@@ -3203,7 +3552,6 @@ int nxagentHandleReparentNotify(XEvent* X)
...
@@ -3203,7 +3552,6 @@ int nxagentHandleReparentNotify(XEvent* X)
XlibWindow
*
childrenReturn
=
NULL
;
XlibWindow
*
childrenReturn
=
NULL
;
unsigned
int
nchildrenReturn
=
0
;
unsigned
int
nchildrenReturn
=
0
;
Status
result
;
Status
result
;
XSizeHints
hints
;
XWindowAttributes
attributes
;
XWindowAttributes
attributes
;
int
x
,
y
;
int
x
,
y
;
int
xParent
,
yParent
;
int
xParent
,
yParent
;
...
@@ -3464,6 +3812,15 @@ void nxagentGrabPointerAndKeyboard(XEvent *X)
...
@@ -3464,6 +3812,15 @@ void nxagentGrabPointerAndKeyboard(XEvent *X)
XGrabKeyboard
(
nxagentDisplay
,
nxagentFullscreenWindow
,
XGrabKeyboard
(
nxagentDisplay
,
nxagentFullscreenWindow
,
True
,
GrabModeAsync
,
GrabModeAsync
,
now
);
True
,
GrabModeAsync
,
GrabModeAsync
,
now
);
/*
* The smart scheduler could be stopped while
* waiting for the reply. In this case we need
* to yield explicitly to avoid to be stuck in
* the dispatch loop forever.
*/
isItTimeToYield
=
1
;
#ifdef TEST
#ifdef TEST
fprintf
(
stderr
,
"nxagentGrabPointerAndKeyboard: Going to grab the pointer in context [B2].
\n
"
);
fprintf
(
stderr
,
"nxagentGrabPointerAndKeyboard: Going to grab the pointer in context [B2].
\n
"
);
#endif
#endif
...
@@ -3491,6 +3848,8 @@ void nxagentGrabPointerAndKeyboard(XEvent *X)
...
@@ -3491,6 +3848,8 @@ void nxagentGrabPointerAndKeyboard(XEvent *X)
XSetInputFocus
(
nxagentDisplay
,
nxagentFullscreenWindow
,
XSetInputFocus
(
nxagentDisplay
,
nxagentFullscreenWindow
,
RevertToParent
,
now
);
RevertToParent
,
now
);
}
}
nxagentPointerAndKeyboardGrabbed
=
1
;
}
}
void
nxagentUngrabPointerAndKeyboard
(
XEvent
*
X
)
void
nxagentUngrabPointerAndKeyboard
(
XEvent
*
X
)
...
@@ -3522,6 +3881,8 @@ void nxagentUngrabPointerAndKeyboard(XEvent *X)
...
@@ -3522,6 +3881,8 @@ void nxagentUngrabPointerAndKeyboard(XEvent *X)
#endif
#endif
XUngrabPointer
(
nxagentDisplay
,
now
);
XUngrabPointer
(
nxagentDisplay
,
now
);
nxagentPointerAndKeyboardGrabbed
=
0
;
}
}
void
nxagentDeactivatePointerGrab
()
void
nxagentDeactivatePointerGrab
()
...
...
nx-X11/programs/Xserver/hw/nxagent/Events.h
View file @
b7494f08
...
@@ -29,6 +29,7 @@ enum HandleEventResult
...
@@ -29,6 +29,7 @@ enum HandleEventResult
{
{
doNothing
=
0
,
doNothing
=
0
,
doMinimize
,
doMinimize
,
doDebugTree
,
doCloseSession
,
doCloseSession
,
doStartKbd
,
doStartKbd
,
doSwitchFullscreen
,
doSwitchFullscreen
,
...
...
nx-X11/programs/Xserver/hw/nxagent/Imakefile
View file @
b7494f08
...
@@ -206,7 +206,8 @@ DEFINES = -g $(OS_DEFINES) $(EXT_DEFINES) $(UPG_DEFINES) \
...
@@ -206,7 +206,8 @@ DEFINES = -g $(OS_DEFINES) $(EXT_DEFINES) $(UPG_DEFINES) \
-DNXAGENT_SPLASH \
-DNXAGENT_SPLASH \
-DNXAGENT_ARTSD \
-DNXAGENT_ARTSD \
-UNX_DEBUG_INPUT \
-UNX_DEBUG_INPUT \
-UPANORAMIX
-UPANORAMIX \
-UDEBUG_TREE
all:: $(OBJS)
all:: $(OBJS)
...
...
nx-X11/programs/Xserver/hw/nxagent/Keystroke.c
View file @
b7494f08
...
@@ -92,6 +92,18 @@ int nxagentCheckSpecialKeystroke(XKeyEvent *X, enum HandleEventResult *result)
...
@@ -92,6 +92,18 @@ int nxagentCheckSpecialKeystroke(XKeyEvent *X, enum HandleEventResult *result)
{
{
switch
(
sym
)
switch
(
sym
)
{
{
#ifdef DEBUG_TREE
case
XK_q
:
case
XK_Q
:
{
*
result
=
doDebugTree
;
break
;
}
#endif
/* DEBUG_TREE */
case
XK_t
:
case
XK_t
:
case
XK_T
:
case
XK_T
:
{
{
...
...
nx-X11/programs/Xserver/hw/nxagent/Pixels.h
View file @
b7494f08
...
@@ -108,6 +108,12 @@ FIXME: The condition checking for the render
...
@@ -108,6 +108,12 @@ FIXME: The condition checking for the render
avoid problems with the render composi-
avoid problems with the render composi-
te on XFree86 remote server.
te on XFree86 remote server.
*/
*/
/*
FIXME: Changed macro: NXAGENT_SHOULD_DEFER_COMPOSITE
to handle situation, when pSrc -> pDrawable
is NULL. This case happens with gradients
and solid fill.
#define NXAGENT_SHOULD_DEFER_COMPOSITE(pSrc, pMask, pDst) \
#define NXAGENT_SHOULD_DEFER_COMPOSITE(pSrc, pMask, pDst) \
((nxagentRenderVersionMajor == 0 && \
((nxagentRenderVersionMajor == 0 && \
nxagentRenderVersionMinor == 8 && \
nxagentRenderVersionMinor == 8 && \
...
@@ -118,6 +124,18 @@ FIXME: The condition checking for the render
...
@@ -118,6 +124,18 @@ FIXME: The condition checking for the render
nxagentOption(DeferLevel) == 1) || \
nxagentOption(DeferLevel) == 1) || \
(nxagentOption(DeferLevel) >= 2 && \
(nxagentOption(DeferLevel) >= 2 && \
nxagentOption(LinkType) < LINK_TYPE_ADSL))
nxagentOption(LinkType) < LINK_TYPE_ADSL))
*/
#define NXAGENT_SHOULD_DEFER_COMPOSITE(pSrc, pMask, pDst) \
((nxagentRenderVersionMajor == 0 && \
nxagentRenderVersionMinor == 8 && \
(pDst) -> pDrawable -> type == DRAWABLE_PIXMAP) || \
(nxagentOption(DeferLevel) >= 2 && \
nxagentOption(LinkType) < LINK_TYPE_ADSL) || \
(nxagentOption(DeferLevel) == 1 && \
(pDst) -> pDrawable -> type == DRAWABLE_PIXMAP && \
(((pSrc) -> pDrawable && nxagentDrawableStatus((pSrc) -> pDrawable) == NotSynchronized) || \
((pMask) && nxagentDrawableStatus((pMask) -> pDrawable) == NotSynchronized))))
#define NXAGENT_SHOULD_DEFER_PUTIMAGE(pDrawable) \
#define NXAGENT_SHOULD_DEFER_PUTIMAGE(pDrawable) \
(nxagentSplitTrap == 0 && \
(nxagentSplitTrap == 0 && \
...
...
nx-X11/programs/Xserver/hw/nxagent/Pointer.c
View file @
b7494f08
...
@@ -57,6 +57,13 @@ is" without express or implied warranty.
...
@@ -57,6 +57,13 @@ is" without express or implied warranty.
#undef TEST
#undef TEST
#undef DEBUG
#undef DEBUG
/*
* The nxagentReversePointerMap array is used to
* memorize remote display pointer map.
*/
unsigned
char
nxagentReversePointerMap
[
MAXBUTTONS
];
void
nxagentChangePointerControl
(
DeviceIntPtr
pDev
,
PtrCtrl
*
ctrl
)
void
nxagentChangePointerControl
(
DeviceIntPtr
pDev
,
PtrCtrl
*
ctrl
)
{
{
/*
/*
...
@@ -125,6 +132,8 @@ int nxagentPointerProc(DeviceIntPtr pDev, int onoff)
...
@@ -125,6 +132,8 @@ int nxagentPointerProc(DeviceIntPtr pDev, int onoff)
return
Success
;
return
Success
;
}
}
nxagentInitPointerMap
();
nxagentEnablePointerEvents
();
nxagentEnablePointerEvents
();
break
;
break
;
...
@@ -155,3 +164,28 @@ int nxagentPointerProc(DeviceIntPtr pDev, int onoff)
...
@@ -155,3 +164,28 @@ int nxagentPointerProc(DeviceIntPtr pDev, int onoff)
return
Success
;
return
Success
;
}
}
void
nxagentInitPointerMap
(
void
)
{
int
numButtons
;
int
i
;
unsigned
char
pointerMap
[
MAXBUTTONS
];
#ifdef DEBUG
fprintf
(
stderr
,
"nxagentInitPointerMap: Going to retrieve the "
"pointer map from remote display.
\n
"
);
#endif
numButtons
=
XGetPointerMapping
(
nxagentDisplay
,
pointerMap
,
MAXBUTTONS
);
/*
* Computing revers pointer map.
*/
for
(
i
=
1
;
i
<=
numButtons
;
i
++
)
{
nxagentReversePointerMap
[
pointerMap
[
i
-
1
]
-
1
]
=
i
;
}
}
nx-X11/programs/Xserver/hw/nxagent/Pointer.h
View file @
b7494f08
...
@@ -38,8 +38,17 @@ is" without express or implied warranty.
...
@@ -38,8 +38,17 @@ is" without express or implied warranty.
(ButtonPressMask | ButtonReleaseMask | PointerMotionMask | \
(ButtonPressMask | ButtonReleaseMask | PointerMotionMask | \
EnterWindowMask | LeaveWindowMask)
EnterWindowMask | LeaveWindowMask)
/*
* The nxagentReversePointerMap array is used to
* memorize remote display pointer map.
*/
extern
unsigned
char
nxagentReversePointerMap
[
MAXBUTTONS
];
void
nxagentChangePointerControl
(
DeviceIntPtr
pDev
,
PtrCtrl
*
ctrl
);
void
nxagentChangePointerControl
(
DeviceIntPtr
pDev
,
PtrCtrl
*
ctrl
);
int
nxagentPointerProc
(
DeviceIntPtr
pDev
,
int
onoff
);
int
nxagentPointerProc
(
DeviceIntPtr
pDev
,
int
onoff
);
void
nxagentInitPointerMap
(
void
);
#endif
/* __Pointer_H__ */
#endif
/* __Pointer_H__ */
nx-X11/programs/Xserver/hw/nxagent/Reconnect.c
View file @
b7494f08
...
@@ -81,6 +81,8 @@ extern Bool nxagentUninstallFontServerPath(void);
...
@@ -81,6 +81,8 @@ extern Bool nxagentUninstallFontServerPath(void);
extern
void
nxagentRemoveXConnection
(
void
);
extern
void
nxagentRemoveXConnection
(
void
);
extern
void
nxagentInitPointerMap
(
void
);
static
char
*
nxagentGetReconnectError
(
void
);
static
char
*
nxagentGetReconnectError
(
void
);
void
nxagentInitializeRecLossyLevel
(
void
);
void
nxagentInitializeRecLossyLevel
(
void
);
...
@@ -584,6 +586,8 @@ Bool nxagentReconnectSession(void)
...
@@ -584,6 +586,8 @@ Bool nxagentReconnectSession(void)
nxagentOldKeyboard
=
NULL
;
nxagentOldKeyboard
=
NULL
;
}
}
nxagentInitPointerMap
();
nxagentDeactivatePointerGrab
();
nxagentDeactivatePointerGrab
();
nxagentWakeupByReconnect
();
nxagentWakeupByReconnect
();
...
...
nx-X11/programs/Xserver/hw/nxagent/Render.c
View file @
b7494f08
...
@@ -147,8 +147,6 @@ void nxagentCursorPostSaveRenderInfo(CursorPtr pCursor, ScreenPtr pScreen,
...
@@ -147,8 +147,6 @@ void nxagentCursorPostSaveRenderInfo(CursorPtr pCursor, ScreenPtr pScreen,
int
nxagentCreatePicture
(
PicturePtr
pPicture
,
Mask
mask
);
int
nxagentCreatePicture
(
PicturePtr
pPicture
,
Mask
mask
);
void
nxagentDestroyPicture
(
PicturePtr
pPicture
);
int
nxagentChangePictureClip
(
PicturePtr
pPicture
,
int
clipType
,
int
nRects
,
int
nxagentChangePictureClip
(
PicturePtr
pPicture
,
int
clipType
,
int
nRects
,
xRectangle
*
rects
,
int
xOrigin
,
int
yOrigin
);
xRectangle
*
rects
,
int
xOrigin
,
int
yOrigin
);
...
@@ -1010,12 +1008,15 @@ void nxagentComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pD
...
@@ -1010,12 +1008,15 @@ void nxagentComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pD
#ifdef DEBUG
#ifdef DEBUG
if
(
pSrc
->
pDrawable
!=
NULL
)
{
fprintf
(
stderr
,
"nxagentComposite: Source Picture [%lu][%p] with drawable [%s%s][%p].
\n
"
,
fprintf
(
stderr
,
"nxagentComposite: Source Picture [%lu][%p] with drawable [%s%s][%p].
\n
"
,
nxagentPicturePriv
(
pSrc
)
->
picture
,
(
void
*
)
pSrc
,
nxagentPicturePriv
(
pSrc
)
->
picture
,
(
void
*
)
pSrc
,
(
pSrc
->
pDrawable
->
type
==
DRAWABLE_PIXMAP
&&
(
pSrc
->
pDrawable
->
type
==
DRAWABLE_PIXMAP
&&
nxagentIsShmPixmap
((
PixmapPtr
)
pSrc
->
pDrawable
))
?
"Shared "
:
""
,
nxagentIsShmPixmap
((
PixmapPtr
)
pSrc
->
pDrawable
))
?
"Shared "
:
""
,
pSrc
->
pDrawable
->
type
==
DRAWABLE_PIXMAP
?
"Pixmap"
:
"Window"
,
pSrc
->
pDrawable
->
type
==
DRAWABLE_PIXMAP
?
"Pixmap"
:
"Window"
,
(
void
*
)
pSrc
->
pDrawable
);
(
void
*
)
pSrc
->
pDrawable
);
}
fprintf
(
stderr
,
"nxagentComposite: Destination Picture [%lu][%p] with drawable [%s%s][%p].
\n
"
,
fprintf
(
stderr
,
"nxagentComposite: Destination Picture [%lu][%p] with drawable [%s%s][%p].
\n
"
,
nxagentPicturePriv
(
pDst
)
->
picture
,
(
void
*
)
pDst
,
nxagentPicturePriv
(
pDst
)
->
picture
,
(
void
*
)
pDst
,
...
@@ -1064,6 +1065,8 @@ void nxagentComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pD
...
@@ -1064,6 +1065,8 @@ void nxagentComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pD
* the wrong data.
* the wrong data.
*/
*/
if
(
pSrc
->
pDrawable
!=
NULL
)
{
nxagentSynchronizeShmPixmap
(
pSrc
->
pDrawable
,
xSrc
,
ySrc
,
width
,
height
);
nxagentSynchronizeShmPixmap
(
pSrc
->
pDrawable
,
xSrc
,
ySrc
,
width
,
height
);
if
(
nxagentDrawableStatus
(
pSrc
->
pDrawable
)
==
NotSynchronized
)
if
(
nxagentDrawableStatus
(
pSrc
->
pDrawable
)
==
NotSynchronized
)
...
@@ -1075,6 +1078,7 @@ void nxagentComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pD
...
@@ -1075,6 +1078,7 @@ void nxagentComposite(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pD
nxagentSynchronizeDrawable
(
pSrc
->
pDrawable
,
DO_WAIT
,
NEVER_BREAK
,
NULL
);
nxagentSynchronizeDrawable
(
pSrc
->
pDrawable
,
DO_WAIT
,
NEVER_BREAK
,
NULL
);
}
}
}
if
(
pDst
->
pDrawable
!=
pSrc
->
pDrawable
)
if
(
pDst
->
pDrawable
!=
pSrc
->
pDrawable
)
{
{
...
@@ -2811,3 +2815,248 @@ Bool nxagentDisconnectAllPicture()
...
@@ -2811,3 +2815,248 @@ Bool nxagentDisconnectAllPicture()
return
True
;
return
True
;
}
}
void
nxagentRenderCreateSolidFill
(
PicturePtr
pPicture
,
xRenderColor
*
color
)
{
Picture
id
;
if
(
nxagentRenderEnable
==
False
)
{
return
;
}
#ifdef DEBUG
fprintf
(
stderr
,
"nxagentRenderCreateSolidFill: Got called.
\n
"
);
if
(
pPicture
==
NULL
)
{
fprintf
(
stderr
,
"nxagentRenderCreateSolidFill: WARNING! pPicture pointer is NULL.
\n
"
);
}
if
(
color
==
NULL
)
{
fprintf
(
stderr
,
"nxagentRenderCreateSolidFill: WARNING! color pointer is NULL.
\n
"
);
}
#endif
/* #ifdef DEBUG */
memset
(
&
(
nxagentPicturePriv
(
pPicture
)
->
lastServerValues
),
0
,
sizeof
(
XRenderPictureAttributes_
));
id
=
XRenderCreateSolidFill
(
nxagentDisplay
,
(
XRenderColor
*
)
color
);
#ifdef DEBUG
XSync
(
nxagentDisplay
,
0
);
#endif
#ifdef TEST
fprintf
(
stderr
,
"nxagentRenderCreateSolidFill: Created solid fill xid [%lu].
\n
"
,
id
);
#endif
nxagentPicturePriv
(
pPicture
)
->
picture
=
id
;
}
void
nxagentRenderCreateLinearGradient
(
PicturePtr
pPicture
,
xPointFixed
*
p1
,
xPointFixed
*
p2
,
int
nStops
,
xFixed
*
stops
,
xRenderColor
*
colors
)
{
Picture
id
;
XLinearGradient
linearGradient
;
if
(
nxagentRenderEnable
==
False
)
{
return
;
}
#ifdef DEBUG
fprintf
(
stderr
,
"nxagentRenderCreateLinearGradient: Got called.
\n
"
);
if
(
pPicture
==
NULL
)
{
fprintf
(
stderr
,
"nxagentRenderCreateLinearGradient: WARNING! pPicture pointer is NULL.
\n
"
);
}
if
(
p1
==
NULL
)
{
fprintf
(
stderr
,
"nxagentRenderCreateLinearGradient: WARNING! p1 pointer is NULL.
\n
"
);
}
if
(
p2
==
NULL
)
{
fprintf
(
stderr
,
"nxagentRenderCreateLinearGradient: WARNING! p2 pointer is NULL.
\n
"
);
}
if
(
stops
==
NULL
)
{
fprintf
(
stderr
,
"nxagentRenderCreateLinearGradient: WARNING! stops pointer is NULL.
\n
"
);
}
if
(
colors
==
NULL
)
{
fprintf
(
stderr
,
"nxagentRenderCreateLinearGradient: WARNING! colors pointer is NULL.
\n
"
);
}
#endif
/* #ifdef DEBUG */
memset
(
&
(
nxagentPicturePriv
(
pPicture
)
->
lastServerValues
),
0
,
sizeof
(
XRenderPictureAttributes_
));
linearGradient
.
p1
.
x
=
(
XFixed
)
p1
->
x
;
linearGradient
.
p1
.
y
=
(
XFixed
)
p1
->
y
;
linearGradient
.
p2
.
x
=
(
XFixed
)
p2
->
x
;
linearGradient
.
p2
.
y
=
(
XFixed
)
p2
->
y
;
id
=
XRenderCreateLinearGradient
(
nxagentDisplay
,
&
linearGradient
,
(
XFixed
*
)
stops
,
(
XRenderColor
*
)
colors
,
nStops
);
#ifdef DEBUG
XSync
(
nxagentDisplay
,
0
);
#endif
#ifdef TEST
fprintf
(
stderr
,
"nxagentRenderCreateLinearGradient: Created linear gradient xid [%lu].
\n
"
,
id
);
#endif
nxagentPicturePriv
(
pPicture
)
->
picture
=
id
;
}
void
nxagentRenderCreateRadialGradient
(
PicturePtr
pPicture
,
xPointFixed
*
inner
,
xPointFixed
*
outer
,
xFixed
innerRadius
,
xFixed
outerRadius
,
int
nStops
,
xFixed
*
stops
,
xRenderColor
*
colors
)
{
Picture
id
;
XRadialGradient
radialGradient
;
if
(
nxagentRenderEnable
==
False
)
{
return
;
}
#ifdef DEBUG
fprintf
(
stderr
,
"nxagentRenderCreateRadialGradient: Got called.
\n
"
);
if
(
pPicture
==
NULL
)
{
fprintf
(
stderr
,
"nxagentRenderCreateRadialGradient: WARNING! pPicture pointer is NULL.
\n
"
);
}
if
(
inner
==
NULL
)
{
fprintf
(
stderr
,
"nxagentRenderCreateRadialGradient: WARNING! inner pointer is NULL.
\n
"
);
}
if
(
outer
==
NULL
)
{
fprintf
(
stderr
,
"nxagentRenderCreateRadialGradient: WARNING! outer pointer is NULL.
\n
"
);
}
if
(
stops
==
NULL
)
{
fprintf
(
stderr
,
"nxagentRenderCreateRadialGradient: WARNING! stops pointer is NULL.
\n
"
);
}
if
(
colors
==
NULL
)
{
fprintf
(
stderr
,
"nxagentRenderCreateRadialGradient: WARNING! colors pointer is NULL.
\n
"
);
}
#endif
/* #ifdef DEBUG */
memset
(
&
(
nxagentPicturePriv
(
pPicture
)
->
lastServerValues
),
0
,
sizeof
(
XRenderPictureAttributes_
));
radialGradient
.
inner
.
x
=
(
XFixed
)
inner
->
x
;
radialGradient
.
inner
.
y
=
(
XFixed
)
inner
->
y
;
radialGradient
.
inner
.
radius
=
(
XFixed
)
innerRadius
;
radialGradient
.
outer
.
x
=
(
XFixed
)
outer
->
x
;
radialGradient
.
outer
.
y
=
(
XFixed
)
outer
->
y
;
radialGradient
.
outer
.
radius
=
(
XFixed
)
outerRadius
;
id
=
XRenderCreateRadialGradient
(
nxagentDisplay
,
&
radialGradient
,
(
XFixed
*
)
stops
,
(
XRenderColor
*
)
colors
,
nStops
);
#ifdef DEBUG
XSync
(
nxagentDisplay
,
0
);
#endif
#ifdef TEST
fprintf
(
stderr
,
"nxagentRenderCreateRadialGradient: Created radial gradient xid [%lu].
\n
"
,
id
);
#endif
nxagentPicturePriv
(
pPicture
)
->
picture
=
id
;
}
void
nxagentRenderCreateConicalGradient
(
PicturePtr
pPicture
,
xPointFixed
*
center
,
xFixed
angle
,
int
nStops
,
xFixed
*
stops
,
xRenderColor
*
colors
)
{
Picture
id
;
XConicalGradient
conicalGradient
;
if
(
nxagentRenderEnable
==
False
)
{
return
;
}
#ifdef DEBUG
fprintf
(
stderr
,
"nxagentRenderCreateConicalGradient: Got called.
\n
"
);
if
(
pPicture
==
NULL
)
{
fprintf
(
stderr
,
"nxagentRenderCreateConicalGradient: WARNING! pPicture pointer is NULL.
\n
"
);
}
if
(
center
==
NULL
)
{
fprintf
(
stderr
,
"nxagentRenderCreateConicalGradient: WARNING! center pointer is NULL.
\n
"
);
}
if
(
stops
==
NULL
)
{
fprintf
(
stderr
,
"nxagentRenderCreateConicalGradient: WARNING! stops pointer is NULL.
\n
"
);
}
if
(
colors
==
NULL
)
{
fprintf
(
stderr
,
"nxagentRenderCreateConicalGradient: WARNING! colors pointer is NULL.
\n
"
);
}
#endif
/* #ifdef DEBUG */
memset
(
&
(
nxagentPicturePriv
(
pPicture
)
->
lastServerValues
),
0
,
sizeof
(
XRenderPictureAttributes_
));
conicalGradient
.
center
.
x
=
(
XFixed
)
center
->
x
;
conicalGradient
.
center
.
y
=
(
XFixed
)
center
->
y
;
conicalGradient
.
angle
=
(
XFixed
)
angle
;
id
=
XRenderCreateConicalGradient
(
nxagentDisplay
,
&
conicalGradient
,
(
XFixed
*
)
stops
,
(
XRenderColor
*
)
colors
,
nStops
);
#ifdef DEBUG
XSync
(
nxagentDisplay
,
0
);
#endif
#ifdef TEST
fprintf
(
stderr
,
"nxagentRenderCreateConicalGradient: Created conical gradient xid [%lu].
\n
"
,
id
);
#endif
nxagentPicturePriv
(
pPicture
)
->
picture
=
id
;
}
nx-X11/programs/Xserver/hw/nxagent/Render.h
View file @
b7494f08
...
@@ -105,4 +105,6 @@ void nxagentDisconnectPicture(pointer p0, XID x1, void* p2);
...
@@ -105,4 +105,6 @@ void nxagentDisconnectPicture(pointer p0, XID x1, void* p2);
void
nxagentReconnectGlyphSet
(
void
*
p0
,
XID
x1
,
void
*
p2
);
void
nxagentReconnectGlyphSet
(
void
*
p0
,
XID
x1
,
void
*
p2
);
void
nxagentDestroyPicture
(
PicturePtr
pPicture
);
#endif
/* __Render_H__ */
#endif
/* __Render_H__ */
nx-X11/programs/Xserver/hw/nxagent/Rootless.c
View file @
b7494f08
...
@@ -626,6 +626,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
...
@@ -626,6 +626,7 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
XlibAtom
*
atoms
=
malloc
(
nUnits
*
sizeof
(
*
atoms
));
XlibAtom
*
atoms
=
malloc
(
nUnits
*
sizeof
(
*
atoms
));
Atom
*
input
=
value
;
Atom
*
input
=
value
;
int
i
;
int
i
;
int
j
=
0
;
freeMem
=
True
;
freeMem
=
True
;
export
=
True
;
export
=
True
;
...
@@ -633,16 +634,40 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
...
@@ -633,16 +634,40 @@ int nxagentExportProperty(pWin, property, type, format, mode, nUnits, value)
for
(
i
=
0
;
i
<
nUnits
;
i
++
)
for
(
i
=
0
;
i
<
nUnits
;
i
++
)
{
{
atoms
[
i
]
=
nxagentLocalToRemoteAtom
(
input
[
i
]);
/*
* Exporting the _NET_WM_PING property could
* result in rootless windows being grayed out
* when the compiz window manager is running.
*
* Better solution would probably be to handle
* the communication with the window manager
* instead of just getting rid of the property.
*/
if
(
atoms
[
i
]
==
None
)
if
(
strcmp
(
NameForAtom
(
input
[
i
]),
"_NET_WM_PING"
)
!=
0
)
{
atoms
[
j
]
=
nxagentLocalToRemoteAtom
(
input
[
i
]);
if
(
atoms
[
j
]
==
None
)
{
{
#ifdef WARNING
#ifdef WARNING
fprintf
(
stderr
,
"nxagentExportProperty: WARNING! Failed to convert local atom %ld [%s].
\n
"
,
fprintf
(
stderr
,
"nxagentExportProperty: WARNING! Failed to convert local atom %ld [%s].
\n
"
,
(
long
int
)
input
[
i
],
validateString
(
NameForAtom
(
input
[
i
])));
(
long
int
)
input
[
i
],
validateString
(
NameForAtom
(
input
[
i
])));
#endif
#endif
}
}
j
++
;
}
#ifdef TEST
else
{
fprintf
(
stderr
,
"nxagentExportProperty: WARNING! "
"Not exporting the _NET_WM_PING property.
\n
"
);
}
}
#endif
}
nUnits
=
j
;
}
}
else
if
(
strcmp
(
typeS
,
"WINDOW"
)
==
0
)
else
if
(
strcmp
(
typeS
,
"WINDOW"
)
==
0
)
{
{
...
...
nx-X11/programs/Xserver/hw/nxagent/Screen.c
View file @
b7494f08
...
@@ -160,7 +160,6 @@ void nxagentPropagateArtsdProperties(ScreenPtr pScreen, char *port);
...
@@ -160,7 +160,6 @@ void nxagentPropagateArtsdProperties(ScreenPtr pScreen, char *port);
#endif
#endif
Window
nxagentIconWindow
=
None
;
Window
nxagentFullscreenWindow
=
None
;
Window
nxagentFullscreenWindow
=
None
;
#ifdef VIEWPORT_FRAME
#ifdef VIEWPORT_FRAME
...
@@ -291,34 +290,17 @@ void nxagentSetPixmapFormats(ScreenInfo *screenInfo)
...
@@ -291,34 +290,17 @@ void nxagentSetPixmapFormats(ScreenInfo *screenInfo)
void
nxagentMinimizeFromFullScreen
(
ScreenPtr
pScreen
)
void
nxagentMinimizeFromFullScreen
(
ScreenPtr
pScreen
)
{
{
XUnmapWindow
(
nxagentDisplay
,
nxagentFullscreenWindow
);
XUnmapWindow
(
nxagentDisplay
,
nxagentFullscreenWindow
);
if
(
nxagentIpaq
)
{
XMapWindow
(
nxagentDisplay
,
nxagentIconWindow
);
XIconifyWindow
(
nxagentDisplay
,
nxagentIconWindow
,
DefaultScreen
(
nxagentDisplay
));
}
else
{
XIconifyWindow
(
nxagentDisplay
,
nxagentIconWindow
,
DefaultScreen
(
nxagentDisplay
));
}
}
}
void
nxagentMaximizeToFullScreen
(
ScreenPtr
pScreen
)
void
nxagentMaximizeToFullScreen
(
ScreenPtr
pScreen
)
{
{
if
(
nxagentIpaq
)
if
(
nxagentIpaq
)
{
{
XUnmapWindow
(
nxagentDisplay
,
nxagentIconWindow
);
XMapWindow
(
nxagentDisplay
,
nxagentFullscreenWindow
);
XMapWindow
(
nxagentDisplay
,
nxagentFullscreenWindow
);
}
}
else
else
{
{
/*
/*
XUnmapWindow(nxagentDisplay, nxagentIconWindow);
*/
/*
FIXME: We'll chech for ReparentNotify and LeaveNotify events after XReparentWindow()
FIXME: We'll chech for ReparentNotify and LeaveNotify events after XReparentWindow()
in order to avoid the session window is iconified.
in order to avoid the session window is iconified.
We could avoid the sesssion window is iconified when a LeaveNotify event is received,
We could avoid the sesssion window is iconified when a LeaveNotify event is received,
...
@@ -352,100 +334,8 @@ FIXME: We'll chech for ReparentNotify and LeaveNotify events after XReparentWind
...
@@ -352,100 +334,8 @@ FIXME: We'll chech for ReparentNotify and LeaveNotify events after XReparentWind
XMapRaised
(
nxagentDisplay
,
nxagentFullscreenWindow
);
XMapRaised
(
nxagentDisplay
,
nxagentFullscreenWindow
);
XIconifyWindow
(
nxagentDisplay
,
nxagentIconWindow
,
DefaultScreen
(
nxagentDisplay
));
while
(
XCheckTypedWindowEvent
(
nxagentDisplay
,
nxagentFullscreenWindow
,
LeaveNotify
,
&
e
));
while
(
XCheckTypedWindowEvent
(
nxagentDisplay
,
nxagentFullscreenWindow
,
LeaveNotify
,
&
e
));
/*
XMapWindow(nxagentDisplay, nxagentIconWindow);
*/
}
}
Window
nxagentCreateIconWindow
()
{
XSetWindowAttributes
attributes
;
unsigned
long
valuemask
;
char
*
window_name
;
XTextProperty
windowName
;
XSizeHints
sizeHints
;
XWMHints
wmHints
;
Window
w
;
Mask
mask
;
/*
* Create icon window.
*/
attributes
.
override_redirect
=
False
;
attributes
.
colormap
=
DefaultColormap
(
nxagentDisplay
,
DefaultScreen
(
nxagentDisplay
));
attributes
.
background_pixmap
=
nxagentScreenSaverPixmap
;
valuemask
=
CWOverrideRedirect
|
CWBackPixmap
|
CWColormap
;
#ifdef TEST
fprintf
(
stderr
,
"nxagentCreateIconWindow: Going to create new icon window.
\n
"
);
#endif
w
=
XCreateWindow
(
nxagentDisplay
,
DefaultRootWindow
(
nxagentDisplay
),
0
,
0
,
1
,
1
,
0
,
DefaultDepth
(
nxagentDisplay
,
DefaultScreen
(
nxagentDisplay
)),
InputOutput
,
DefaultVisual
(
nxagentDisplay
,
DefaultScreen
(
nxagentDisplay
)),
valuemask
,
&
attributes
);
#ifdef TEST
fprintf
(
stderr
,
"nxagentCreateIconWindow: Created new icon window with id [%ld].
\n
"
,
nxagentIconWindow
);
#endif
/*
* Set hints to the window manager for the icon window.
*/
window_name
=
nxagentWindowName
;
XStringListToTextProperty
(
&
window_name
,
1
,
&
windowName
);
sizeHints
.
flags
=
PMinSize
|
PMaxSize
;
sizeHints
.
min_width
=
sizeHints
.
max_width
=
1
;
sizeHints
.
min_height
=
sizeHints
.
max_height
=
1
;
wmHints
.
flags
=
IconPixmapHint
|
IconMaskHint
;
wmHints
.
initial_state
=
IconicState
;
wmHints
.
icon_pixmap
=
nxagentIconPixmap
;
if
(
useXpmIcon
)
{
wmHints
.
icon_mask
=
nxagentIconShape
;
wmHints
.
flags
=
IconPixmapHint
|
IconMaskHint
;
}
else
{
wmHints
.
flags
=
StateHint
|
IconPixmapHint
;
}
XSetWMProperties
(
nxagentDisplay
,
w
,
&
windowName
,
&
windowName
,
NULL
,
0
,
&
sizeHints
,
&
wmHints
,
NULL
);
/*
* Enable events from the icon window.
*/
nxagentGetDefaultEventMask
(
&
mask
);
XSelectInput
(
nxagentDisplay
,
w
,
(
mask
&
~
(
KeyPressMask
|
KeyReleaseMask
))
|
StructureNotifyMask
);
/*
* Notify to client if user closes icon window.
*/
if
(
nxagentWMIsRunning
&&
!
nxagentOption
(
Rootless
))
{
XlibAtom
deleteWMAtom
=
nxagentAtoms
[
2
];
/* WM_DELETE_WINDOW */
XSetWMProtocols
(
nxagentDisplay
,
w
,
&
deleteWMAtom
,
1
);
}
}
return
w
;
}
}
Bool
nxagentMagicPixelZone
(
int
x
,
int
y
)
Bool
nxagentMagicPixelZone
(
int
x
,
int
y
)
...
@@ -977,6 +867,8 @@ Bool nxagentOpenScreen(int index, ScreenPtr pScreen,
...
@@ -977,6 +867,8 @@ Bool nxagentOpenScreen(int index, ScreenPtr pScreen,
nxagentChangeOption
(
Fullscreen
,
False
);
nxagentChangeOption
(
Fullscreen
,
False
);
nxagentFullscreenWindow
=
0
;
resetAgentPosition
=
True
;
resetAgentPosition
=
True
;
}
}
...
@@ -1382,8 +1274,6 @@ N/A
...
@@ -1382,8 +1274,6 @@ N/A
if
(
nxagentOption
(
Fullscreen
))
if
(
nxagentOption
(
Fullscreen
))
{
{
attributes
.
override_redirect
=
True
;
/*
/*
* We need to disable the host's screensaver or
* We need to disable the host's screensaver or
* it will otherwise grab the screen even if it
* it will otherwise grab the screen even if it
...
@@ -1609,8 +1499,7 @@ N/A
...
@@ -1609,8 +1499,7 @@ N/A
if
(
nxagentDoFullGeneration
==
1
||
if
(
nxagentDoFullGeneration
==
1
||
nxagentReconnectTrap
==
1
)
nxagentReconnectTrap
==
1
)
{
{
valuemask
=
CWBackPixel
|
CWEventMask
|
CWColormap
|
valuemask
=
CWBackPixel
|
CWEventMask
|
CWColormap
;
(
nxagentOption
(
Fullscreen
)
==
1
?
CWOverrideRedirect
:
0
);
attributes
.
background_pixel
=
nxagentBlackPixel
;
attributes
.
background_pixel
=
nxagentBlackPixel
;
...
@@ -1620,8 +1509,6 @@ N/A
...
@@ -1620,8 +1509,6 @@ N/A
if
(
nxagentOption
(
Fullscreen
)
==
1
)
if
(
nxagentOption
(
Fullscreen
)
==
1
)
{
{
attributes
.
override_redirect
=
True
;
if
(
nxagentReconnectTrap
)
if
(
nxagentReconnectTrap
)
{
{
/*
/*
...
@@ -1754,7 +1641,7 @@ N/A
...
@@ -1754,7 +1641,7 @@ N/A
sizeHints
.
width
=
nxagentOption
(
RootWidth
);
sizeHints
.
width
=
nxagentOption
(
RootWidth
);
sizeHints
.
height
=
nxagentOption
(
RootHeight
);
sizeHints
.
height
=
nxagentOption
(
RootHeight
);
if
(
nxagentOption
(
DesktopResize
)
==
1
)
if
(
nxagentOption
(
DesktopResize
)
==
1
||
nxagentOption
(
Fullscreen
)
==
1
)
{
{
sizeHints
.
max_width
=
WidthOfScreen
(
DefaultScreenOfDisplay
(
nxagentDisplay
));
sizeHints
.
max_width
=
WidthOfScreen
(
DefaultScreenOfDisplay
(
nxagentDisplay
));
sizeHints
.
max_height
=
HeightOfScreen
(
DefaultScreenOfDisplay
(
nxagentDisplay
));
sizeHints
.
max_height
=
HeightOfScreen
(
DefaultScreenOfDisplay
(
nxagentDisplay
));
...
@@ -1799,37 +1686,6 @@ N/A
...
@@ -1799,37 +1686,6 @@ N/A
XClearWindow
(
nxagentDisplay
,
nxagentDefaultWindows
[
pScreen
->
myNum
]);
XClearWindow
(
nxagentDisplay
,
nxagentDefaultWindows
[
pScreen
->
myNum
]);
if
(
nxagentOption
(
Fullscreen
))
{
valuemask
=
CWBackPixmap
|
CWColormap
|
CWOverrideRedirect
;
}
else
{
valuemask
=
CWBackPixmap
|
CWColormap
;
}
attributes
.
background_pixmap
=
nxagentScreenSaverPixmap
;
attributes
.
colormap
=
DefaultColormap
(
nxagentDisplay
,
DefaultScreen
(
nxagentDisplay
));
if
(
nxagentOption
(
Fullscreen
))
{
attributes
.
override_redirect
=
False
;
if
(
nxagentReconnectTrap
)
{
XGrabKeyboard
(
nxagentDisplay
,
nxagentFullscreenWindow
,
True
,
GrabModeAsync
,
GrabModeAsync
,
CurrentTime
);
}
}
if
(
nxagentOption
(
Fullscreen
))
{
nxagentIconWindow
=
nxagentCreateIconWindow
();
}
else
{
nxagentIconWindow
=
0
;
}
/*
/*
* When we don't have window manager we grab keyboard
* When we don't have window manager we grab keyboard
* to let nxagent get keyboard events.
* to let nxagent get keyboard events.
...
@@ -1880,13 +1736,6 @@ N/A
...
@@ -1880,13 +1736,6 @@ N/A
*/
*/
XSetWMProtocols
(
nxagentDisplay
,
nxagentDefaultWindows
[
pScreen
->
myNum
],
&
deleteWMatom
,
1
);
XSetWMProtocols
(
nxagentDisplay
,
nxagentDefaultWindows
[
pScreen
->
myNum
],
&
deleteWMatom
,
1
);
/*
if (nxagentOption(Fullscreen))
{
XSetWMProtocols(nxagentDisplay, nxagentIconWindow, &deleteWMatom, 1);
}
*/
}
}
else
else
{
{
...
@@ -2266,13 +2115,10 @@ FIXME: We should try to restore the previously
...
@@ -2266,13 +2115,10 @@ FIXME: We should try to restore the previously
if
(
nxagentOption
(
Fullscreen
))
if
(
nxagentOption
(
Fullscreen
))
{
{
nxagentChangeOption
(
Width
,
WidthOfScreen
(
DefaultScreenOfDisplay
(
nxagentDisplay
)));
nxagentChangeOption
(
RootX
,
(
nxagentOption
(
Width
)
-
nxagentChangeOption
(
Height
,
HeightOfScreen
(
DefaultScreenOfDisplay
(
nxagentDisplay
)));
nxagentOption
(
RootWidth
))
/
2
);
nxagentChangeOption
(
RootY
,
(
nxagentOption
(
Height
)
-
nxagentChangeOption
(
RootX
,
(
WidthOfScreen
(
DefaultScreenOfDisplay
(
nxagentDisplay
))
nxagentOption
(
RootHeight
))
/
2
);
-
nxagentOption
(
RootWidth
))
/
2
);
nxagentChangeOption
(
RootY
,
(
HeightOfScreen
(
DefaultScreenOfDisplay
(
nxagentDisplay
))
-
nxagentOption
(
RootHeight
))
/
2
);
}
}
else
else
{
{
...
@@ -2284,62 +2130,6 @@ FIXME: We should try to restore the previously
...
@@ -2284,62 +2130,6 @@ FIXME: We should try to restore the previously
nxagentChangeOption
(
ViewportYSpan
,
nxagentOption
(
Height
)
-
nxagentOption
(
RootHeight
));
nxagentChangeOption
(
ViewportYSpan
,
nxagentOption
(
Height
)
-
nxagentOption
(
RootHeight
));
/*
/*
* Change agent window size and size hints.
*/
sizeHints
.
flags
=
PPosition
|
PMinSize
|
PMaxSize
;
sizeHints
.
x
=
nxagentOption
(
X
);
sizeHints
.
y
=
nxagentOption
(
Y
);
sizeHints
.
min_width
=
MIN_NXAGENT_WIDTH
;
sizeHints
.
min_height
=
MIN_NXAGENT_HEIGHT
;
sizeHints
.
width
=
width
;
sizeHints
.
height
=
height
;
if
(
nxagentOption
(
DesktopResize
)
==
1
)
{
sizeHints
.
max_width
=
WidthOfScreen
(
DefaultScreenOfDisplay
(
nxagentDisplay
));
sizeHints
.
max_height
=
HeightOfScreen
(
DefaultScreenOfDisplay
(
nxagentDisplay
));
}
else
{
sizeHints
.
max_width
=
nxagentOption
(
RootWidth
);
sizeHints
.
max_height
=
nxagentOption
(
RootHeight
);
}
if
(
nxagentUserGeometry
.
flag
&
XValue
||
nxagentUserGeometry
.
flag
&
YValue
)
{
sizeHints
.
flags
|=
USPosition
;
}
if
(
nxagentUserGeometry
.
flag
&
WidthValue
||
nxagentUserGeometry
.
flag
&
HeightValue
)
{
sizeHints
.
flags
|=
USSize
;
}
XSetWMNormalHints
(
nxagentDisplay
,
nxagentDefaultWindows
[
pScreen
->
myNum
],
&
sizeHints
);
if
(
nxagentOption
(
Fullscreen
))
{
XResizeWindow
(
nxagentDisplay
,
nxagentDefaultWindows
[
pScreen
->
myNum
],
WidthOfScreen
(
DefaultScreenOfDisplay
(
nxagentDisplay
)),
HeightOfScreen
(
DefaultScreenOfDisplay
(
nxagentDisplay
)));
XResizeWindow
(
nxagentDisplay
,
nxagentInputWindows
[
pScreen
->
myNum
],
WidthOfScreen
(
DefaultScreenOfDisplay
(
nxagentDisplay
)),
HeightOfScreen
(
DefaultScreenOfDisplay
(
nxagentDisplay
)));
}
else
{
XResizeWindow
(
nxagentDisplay
,
nxagentDefaultWindows
[
pScreen
->
myNum
],
width
,
height
);
if
(
nxagentOption
(
Rootless
)
==
0
)
{
XResizeWindow
(
nxagentDisplay
,
nxagentInputWindows
[
pScreen
->
myNum
],
width
,
height
);
}
}
/*
* Set properties for the agent root window.
* Set properties for the agent root window.
*/
*/
...
@@ -2360,8 +2150,6 @@ FIXME: We should try to restore the previously
...
@@ -2360,8 +2150,6 @@ FIXME: We should try to restore the previously
(
*
pScreen
->
PositionWindow
)(
WindowTable
[
pScreen
->
myNum
],
0
,
0
);
(
*
pScreen
->
PositionWindow
)(
WindowTable
[
pScreen
->
myNum
],
0
,
0
);
pRootWinSize
=
&
WindowTable
[
pScreen
->
myNum
]
->
winSize
;
nxagentSetRootClip
(
pScreen
,
1
);
nxagentSetRootClip
(
pScreen
,
1
);
XMoveWindow
(
nxagentDisplay
,
nxagentWindow
(
WindowTable
[
0
]),
XMoveWindow
(
nxagentDisplay
,
nxagentWindow
(
WindowTable
[
0
]),
...
@@ -2369,6 +2157,12 @@ FIXME: We should try to restore the previously
...
@@ -2369,6 +2157,12 @@ FIXME: We should try to restore the previously
nxagentMoveViewport
(
pScreen
,
0
,
0
);
nxagentMoveViewport
(
pScreen
,
0
,
0
);
/*
* Update pointer bounds.
*/
ScreenRestructured
(
pScreen
);
#ifdef TEST
#ifdef TEST
nxagentPrintAgentGeometry
(
"After Resize Screen"
,
"nxagentResizeScreen:"
);
nxagentPrintAgentGeometry
(
"After Resize Screen"
,
"nxagentResizeScreen:"
);
#endif
#endif
...
...
nx-X11/programs/Xserver/hw/nxagent/Screen.h
View file @
b7494f08
...
@@ -47,7 +47,6 @@ extern ScreenPtr nxagentDefaultScreen;
...
@@ -47,7 +47,6 @@ extern ScreenPtr nxagentDefaultScreen;
extern
Pixmap
nxagentPixmapLogo
;
extern
Pixmap
nxagentPixmapLogo
;
extern
Window
nxagentIconWindow
;
extern
Window
nxagentFullscreenWindow
;
extern
Window
nxagentFullscreenWindow
;
extern
RegionRec
nxagentShadowUpdateRegion
;
extern
RegionRec
nxagentShadowUpdateRegion
;
...
@@ -89,8 +88,6 @@ void nxagentSetScreenSaverTime(void);
...
@@ -89,8 +88,6 @@ void nxagentSetScreenSaverTime(void);
void
nxagentMinimizeFromFullScreen
(
ScreenPtr
pScreen
);
void
nxagentMinimizeFromFullScreen
(
ScreenPtr
pScreen
);
void
nxagentMaximizeToFullScreen
(
ScreenPtr
pScreen
);
void
nxagentMaximizeToFullScreen
(
ScreenPtr
pScreen
);
Window
nxagentCreateIconWindow
(
void
);
Bool
nxagentMagicPixelZone
(
int
x
,
int
y
);
Bool
nxagentMagicPixelZone
(
int
x
,
int
y
);
Bool
nxagentResizeScreen
(
ScreenPtr
pScreen
,
int
width
,
int
height
,
Bool
nxagentResizeScreen
(
ScreenPtr
pScreen
,
int
width
,
int
height
,
...
...
nx-X11/programs/Xserver/hw/nxagent/Window.c
View file @
b7494f08
...
@@ -692,235 +692,87 @@ void nxagentRestackWindow(WindowPtr pWin, WindowPtr pOldNextSib)
...
@@ -692,235 +692,87 @@ void nxagentRestackWindow(WindowPtr pWin, WindowPtr pOldNextSib)
void
nxagentSwitchFullscreen
(
ScreenPtr
pScreen
,
Bool
switchOn
)
void
nxagentSwitchFullscreen
(
ScreenPtr
pScreen
,
Bool
switchOn
)
{
{
Window
w
;
XEvent
e
;
XSetWindowAttributes
attributes
;
XSizeHints
sizeHints
;
unsigned
long
valuemask
;
if
(
nxagentOption
(
Rootless
))
if
(
nxagentOption
(
Rootless
)
==
1
)
{
{
return
;
return
;
}
}
if
(
!
switchOn
)
if
(
switchOn
==
0
)
{
{
nxagentWMDetect
();
nxagentWMDetect
();
if
(
!
nxagentWMIsRunning
)
{
#ifdef WARNING
fprintf
(
stderr
,
"Warning: Can't switch to window mode, no window manager has been detected.
\n
"
);
#endif
return
;
}
}
w
=
nxagentDefaultWindows
[
pScreen
->
myNum
];
attributes
.
override_redirect
=
switchOn
;
valuemask
=
CWOverrideRedirect
;
XUnmapWindow
(
nxagentDisplay
,
w
);
XChangeWindowAttributes
(
nxagentDisplay
,
w
,
valuemask
,
&
attributes
);
if
(
switchOn
)
{
/*
/*
* Change to fullscreen mode.
* The smart scheduler could be stopped while
* waiting for the reply. In this case we need
* to yield explicitly to avoid to be stuck in
* the dispatch loop forever.
*/
*/
struct
timeval
timeout
;
isItTimeToYield
=
1
;
int
i
;
XEvent
e
;
/*
* Wait for window manager reparenting the default window.
*/
for
(
i
=
0
;
i
<
100
&&
nxagentWMIsRunning
;
i
++
)
if
(
nxagentWMIsRunning
==
0
)
{
{
#ifdef TEST
#ifdef WARNING
fprintf
(
stderr
,
"nxagentSwitchFullscreen: WARNING! Going to wait for the ReparentNotify event.
\n
"
);
fprintf
(
stderr
,
"Warning: Can't switch to window mode, no window manager "
"has been detected.
\n
"
);
#endif
#endif
if
(
XCheckTypedWindowEvent
(
nxagentDisplay
,
w
,
ReparentNotify
,
&
e
))
return
;
{
break
;
}
}
/*
* This should also flush
* the NX link for us.
*/
XSync
(
nxagentDisplay
,
0
);
timeout
.
tv_sec
=
0
;
timeout
.
tv_usec
=
50
*
1000
;
nxagentWaitEvents
(
nxagentDisplay
,
&
timeout
);
}
}
if
(
i
<
100
)
#ifdef TEST
{
fprintf
(
stderr
,
"nxagentSwitchFullscreen: Switching to %s mode.
\n
"
,
/*
switchOn
?
"fullscreen"
:
"windowed"
);
* The window manager has done with the reparent
#endif
* operation. We can resize and map the window.
*/
nxagentChangeOption
(
Fullscreen
,
True
);
/*
* Save the window-mode configuration.
*/
nxagentChangeOption
(
SavedX
,
nxagentOption
(
X
));
nxagentChangeOption
(
SavedY
,
nxagentOption
(
Y
));
nxagentChangeOption
(
SavedWidth
,
nxagentOption
(
Width
));
nxagentChangeOption
(
SavedHeight
,
nxagentOption
(
Height
));
nxagentChangeOption
(
SavedRootWidth
,
nxagentOption
(
RootWidth
));
nxagentChangeOption
(
SavedRootHeight
,
nxagentOption
(
RootHeight
));
/*
* Reconf the Default window.
*/
nxagentChangeOption
(
X
,
0
);
nxagentChangeOption
(
Y
,
0
);
nxagentChangeOption
(
Width
,
WidthOfScreen
(
DefaultScreenOfDisplay
(
nxagentDisplay
)));
nxagentChangeOption
(
Height
,
HeightOfScreen
(
DefaultScreenOfDisplay
(
nxagentDisplay
)));
/*
* Move the root window.
*/
nxagentChangeOption
(
RootX
,
(
nxagentOption
(
Width
)
-
nxagentOption
(
RootWidth
))
/
2
);
nxagentChangeOption
(
RootY
,
(
nxagentOption
(
Height
)
-
nxagentOption
(
RootHeight
))
/
2
);
nxagentChangeOption
(
ViewportXSpan
,
nxagentOption
(
Width
)
-
nxagentOption
(
RootWidth
));
nxagentChangeOption
(
ViewportYSpan
,
nxagentOption
(
Height
)
-
nxagentOption
(
RootHeight
));
XMoveResizeWindow
(
nxagentDisplay
,
w
,
nxagentOption
(
X
),
nxagentOption
(
Y
),
nxagentOption
(
Width
),
nxagentOption
(
Height
));
nxagentUpdateViewportFrame
(
0
,
0
,
nxagentOption
(
RootWidth
),
nxagentOption
(
RootHeight
));
XMoveWindow
(
nxagentDisplay
,
nxagentWindow
(
WindowTable
[
pScreen
->
myNum
]),
nxagentOption
(
RootX
),
nxagentOption
(
RootY
));
/*
* We disable the screensaver when changing
* mode to fullscreen. Is it really needed?
*/
XSetScreenSaver
(
nxagentDisplay
,
0
,
0
,
DefaultExposures
,
DefaultBlanking
);
if
(
nxagentIconWindow
==
None
)
{
nxagentIconWindow
=
nxagentCreateIconWindow
();
XMapWindow
(
nxagentDisplay
,
nxagentIconWindow
);
}
XMapRaised
(
nxagentDisplay
,
w
);
nxagentChangeOption
(
Fullscreen
,
switchOn
);
XSetInputFocus
(
nxagentDisplay
,
w
,
RevertToParent
,
CurrentTime
);
XCheckTypedWindowEvent
(
nxagentDisplay
,
w
,
LeaveNotify
,
&
e
);
nxagentFullscreenWindow
=
w
;
if
(
nxagentOption
(
DesktopResize
)
==
1
)
if
(
nxagentOption
(
DesktopResize
)
==
1
)
{
{
if
(
nxagentOption
(
Shadow
)
==
0
)
sizeHints
.
flags
=
PSize
;
if
(
switchOn
==
1
)
{
{
nxagentRRSetScreenConfig
(
pScreen
,
WidthOfScreen
(
DefaultScreenOfDisplay
(
nxagentDisplay
)),
sizeHints
.
width
=
HeightOfScreen
(
DefaultScreenOfDisplay
(
nxagentDisplay
)));
WidthOfScreen
(
DefaultScreenOfDisplay
(
nxagentDisplay
));
sizeHints
.
height
=
HeightOfScreen
(
DefaultScreenOfDisplay
(
nxagentDisplay
));
}
}
else
else
{
{
nxagentShadowAdaptToRatio
();
sizeHints
.
width
=
nxagentOption
(
RootWidth
);
sizeHints
.
height
=
nxagentOption
(
RootHeight
);
}
}
}
}
else
{
/*
* We have waited for a reparent event unsuccessfully.
* Something happened to the window manager.
*/
#ifdef WARNING
XSetWMNormalHints
(
nxagentDisplay
,
nxagentDefaultWindows
[
pScreen
->
myNum
],
fprintf
(
stderr
,
"nxagentSwitchFullscreen: WARNING! Expected ReparentNotify event missing.
\n
"
);
&
sizeHints
);
#endif
nxagentWMIsRunning
=
False
;
attributes
.
override_redirect
=
False
;
XChangeWindowAttributes
(
nxagentDisplay
,
w
,
valuemask
,
&
attributes
);
XMapWindow
(
nxagentDisplay
,
w
);
}
}
}
else
{
/*
* FIXME:
* It could be necessary:
* - To restore screensaver.
* - To set or reset nxagentForceBackingStore flag.
* - To grab keyboard.
* - To propagate device settings to the X server if no WM is running.
*/
/*
memset
(
&
e
,
0
,
sizeof
(
e
));
* Change to windowed mode.
*/
nxagentChangeOption
(
Fullscreen
,
False
);
e
.
xclient
.
type
=
ClientMessage
;
XDestroyWindow
(
nxagentDisplay
,
nxagentIconWindow
);
e
.
xclient
.
message_type
=
nxagentAtoms
[
13
];
/* _NET_WM_STATE */
nxagentIconWindow
=
nxagentFullscreenWindow
=
None
;
e
.
xclient
.
display
=
nxagentDisplay
;
e
.
xclient
.
window
=
nxagentDefaultWindows
[
pScreen
->
myNum
];
e
.
xclient
.
format
=
32
;
e
.
xclient
.
data
.
l
[
0
]
=
nxagentOption
(
Fullscreen
)
?
1
:
0
;
e
.
xclient
.
data
.
l
[
1
]
=
nxagentAtoms
[
14
];
/* _NET_WM_STATE_FULLSCREEN */
if
(
nxagentOption
(
DesktopResize
)
==
1
)
XSendEvent
(
nxagentDisplay
,
DefaultRootWindow
(
nxagentDisplay
),
False
,
{
SubstructureRedirectMask
,
&
e
);
nxagentChangeOption
(
RootWidth
,
nxagentOption
(
SavedRootWidth
));
nxagentChangeOption
(
RootHeight
,
nxagentOption
(
SavedRootHeight
));
if
(
nxagentOption
(
Shadow
)
==
0
)
{
nxagentRRSetScreenConfig
(
pScreen
,
nxagentOption
(
RootWidth
),
nxagentOption
(
RootHeight
));
}
}
if
(
nxagentOption
(
WMBorderWidth
)
>
0
&&
nxagentOption
(
WMTitleHeight
)
>
0
)
if
(
switchOn
==
1
)
{
{
nxagentChangeOption
(
X
,
nxagentOption
(
SavedX
)
-
nxagentFullscreenWindow
=
nxagentDefaultWindows
[
pScreen
->
myNum
];
nxagentOption
(
WMBorderWidth
));
nxagentChangeOption
(
Y
,
nxagentOption
(
SavedY
)
-
nxagentOption
(
WMTitleHeight
));
}
}
else
else
{
{
nxagentChangeOption
(
X
,
nxagentOption
(
SavedX
));
nxagentFullscreenWindow
=
None
;
nxagentChangeOption
(
Y
,
nxagentOption
(
SavedY
));
}
nxagentChangeOption
(
Width
,
nxagentOption
(
SavedWidth
));
nxagentChangeOption
(
Height
,
nxagentOption
(
SavedHeight
));
if
(
nxagentOption
(
Shadow
)
==
1
&&
nxagentOption
(
DesktopResize
)
==
1
)
{
nxagentShadowAdaptToRatio
();
}
}
XMoveResizeWindow
(
nxagentDisplay
,
w
,
nxagentOption
(
X
),
nxagentOption
(
Y
),
nxagentOption
(
Width
),
nxagentOption
(
Height
));
nxagentUpdateViewportFrame
(
0
,
0
,
nxagentOption
(
Width
),
nxagentOption
(
Height
));
XMoveWindow
(
nxagentDisplay
,
nxagentWindow
(
WindowTable
[
pScreen
->
myNum
]),
0
,
0
);
XMapWindow
(
nxagentDisplay
,
w
);
nxagentChangeOption
(
RootX
,
0
);
nxagentChangeOption
(
RootY
,
0
);
}
XMoveResizeWindow
(
nxagentDisplay
,
nxagentInputWindows
[
0
],
0
,
0
,
nxagentOption
(
Width
),
nxagentOption
(
Height
));
nxagentSetPrintGeometry
(
pScreen
->
myNum
);
}
}
#ifdef VIEWPORT_FRAME
#ifdef VIEWPORT_FRAME
...
@@ -2422,6 +2274,11 @@ void nxagentMapDefaultWindows()
...
@@ -2422,6 +2274,11 @@ void nxagentMapDefaultWindows()
#endif
#endif
XMapWindow
(
nxagentDisplay
,
nxagentDefaultWindows
[
pScreen
->
myNum
]);
XMapWindow
(
nxagentDisplay
,
nxagentDefaultWindows
[
pScreen
->
myNum
]);
if
(
nxagentOption
(
Fullscreen
)
==
1
&&
nxagentWMIsRunning
==
1
)
{
nxagentSwitchFullscreen
(
pScreen
,
1
);
}
}
}
/*
/*
...
@@ -2452,26 +2309,6 @@ void nxagentMapDefaultWindows()
...
@@ -2452,26 +2309,6 @@ void nxagentMapDefaultWindows()
}
}
/*
/*
* Map the icon window.
*/
if
(
nxagentIconWindow
!=
0
)
{
#ifdef TEST
fprintf
(
stderr
,
"nxagentMapDefaultWindows: Mapping icon window id [%ld].
\n
"
,
nxagentIconWindow
);
#endif
XMapWindow
(
nxagentDisplay
,
nxagentIconWindow
);
if
(
nxagentIpaq
!=
0
)
{
XIconifyWindow
(
nxagentDisplay
,
nxagentIconWindow
,
DefaultScreen
(
nxagentDisplay
));
}
}
/*
* Ensure that the fullscreen window gets the focus.
* Ensure that the fullscreen window gets the focus.
*/
*/
...
...
nx-X11/programs/Xserver/hw/nxagent/X/NXpicture.c
View file @
b7494f08
...
@@ -62,6 +62,7 @@
...
@@ -62,6 +62,7 @@
#include "Screen.h"
#include "Screen.h"
#include "Pixmaps.h"
#include "Pixmaps.h"
#include "Drawable.h"
#include "Drawable.h"
#include "Render.h"
#define PANIC
#define PANIC
#define WARNING
#define WARNING
...
@@ -1063,7 +1064,47 @@ static void initGradient(SourcePictPtr pGradient, int stopCount,
...
@@ -1063,7 +1064,47 @@ static void initGradient(SourcePictPtr pGradient, int stopCount,
static
PicturePtr
createSourcePicture
(
void
)
static
PicturePtr
createSourcePicture
(
void
)
{
{
PicturePtr
pPicture
;
PicturePtr
pPicture
;
pPicture
=
(
PicturePtr
)
xalloc
(
sizeof
(
PictureRec
));
extern
int
nxagentPicturePrivateIndex
;
unsigned
int
totalPictureSize
;
DevUnion
*
ppriv
;
char
*
privPictureRecAddr
;
int
i
;
/*
* Compute size of entire PictureRect, plus privates.
*/
totalPictureSize
=
sizeof
(
PictureRec
)
+
picturePrivateCount
*
sizeof
(
DevUnion
)
+
sizeof
(
nxagentPrivPictureRec
);
pPicture
=
(
PicturePtr
)
xalloc
(
totalPictureSize
);
if
(
pPicture
!=
NULL
)
{
ppriv
=
(
DevUnion
*
)
(
pPicture
+
1
);
for
(
i
=
0
;
i
<
picturePrivateCount
;
++
i
)
{
/*
* Other privates are inaccessible.
*/
ppriv
[
i
].
ptr
=
NULL
;
}
privPictureRecAddr
=
(
char
*
)
&
ppriv
[
picturePrivateCount
];
ppriv
[
nxagentPicturePrivateIndex
].
ptr
=
(
pointer
)
privPictureRecAddr
;
pPicture
->
devPrivates
=
ppriv
;
}
pPicture
->
pDrawable
=
0
;
pPicture
->
pDrawable
=
0
;
pPicture
->
pFormat
=
0
;
pPicture
->
pFormat
=
0
;
pPicture
->
pNext
=
0
;
pPicture
->
pNext
=
0
;
...
@@ -1697,6 +1738,10 @@ FreePicture (pointer value,
...
@@ -1697,6 +1738,10 @@ FreePicture (pointer value,
if
(
--
pPicture
->
refcnt
==
0
)
if
(
--
pPicture
->
refcnt
==
0
)
{
{
#ifdef NXAGENT_SERVER
nxagentDestroyPicture
(
pPicture
);
#endif
if
(
pPicture
->
transform
)
if
(
pPicture
->
transform
)
xfree
(
pPicture
->
transform
);
xfree
(
pPicture
->
transform
);
if
(
!
pPicture
->
pDrawable
)
{
if
(
!
pPicture
->
pDrawable
)
{
...
...
nx-X11/programs/Xserver/hw/nxagent/X/NXpicture.c.NX.original
View file @
b7494f08
...
@@ -62,6 +62,7 @@
...
@@ -62,6 +62,7 @@
#include "Screen.h"
#include "Screen.h"
#include "Pixmaps.h"
#include "Pixmaps.h"
#include "Drawable.h"
#include "Drawable.h"
#include "Render.h"
#define PANIC
#define PANIC
#define WARNING
#define WARNING
...
@@ -1063,7 +1064,47 @@ static void initGradient(SourcePictPtr pGradient, int stopCount,
...
@@ -1063,7 +1064,47 @@ static void initGradient(SourcePictPtr pGradient, int stopCount,
static PicturePtr createSourcePicture(void)
static PicturePtr createSourcePicture(void)
{
{
PicturePtr pPicture;
PicturePtr pPicture;
pPicture = (PicturePtr) xalloc(sizeof(PictureRec));
extern int nxagentPicturePrivateIndex;
unsigned int totalPictureSize;
DevUnion *ppriv;
char *privPictureRecAddr;
int i;
/*
* Compute size of entire PictureRect, plus privates.
*/
totalPictureSize = sizeof(PictureRec) +
picturePrivateCount * sizeof(DevUnion) +
sizeof(nxagentPrivPictureRec);
pPicture = (PicturePtr) xalloc(totalPictureSize);
if (pPicture != NULL)
{
ppriv = (DevUnion *) (pPicture + 1);
for (i = 0; i < picturePrivateCount; ++i)
{
/*
* Other privates are inaccessible.
*/
ppriv[i].ptr = NULL;
}
privPictureRecAddr = (char *) &ppriv[picturePrivateCount];
ppriv[nxagentPicturePrivateIndex].ptr = (pointer) privPictureRecAddr;
pPicture -> devPrivates = ppriv;
}
pPicture->pDrawable = 0;
pPicture->pDrawable = 0;
pPicture->pFormat = 0;
pPicture->pFormat = 0;
pPicture->pNext = 0;
pPicture->pNext = 0;
...
@@ -1697,6 +1738,10 @@ FreePicture (pointer value,
...
@@ -1697,6 +1738,10 @@ FreePicture (pointer value,
if (--pPicture->refcnt == 0)
if (--pPicture->refcnt == 0)
{
{
#ifdef NXAGENT_SERVER
nxagentDestroyPicture(pPicture);
#endif
if (pPicture->transform)
if (pPicture->transform)
xfree (pPicture->transform);
xfree (pPicture->transform);
if (!pPicture->pDrawable) {
if (!pPicture->pDrawable) {
...
...
nx-X11/programs/Xserver/hw/nxagent/X/NXrender.c
View file @
b7494f08
...
@@ -116,7 +116,6 @@ int nxagentCursorSaveRenderInfo(ScreenPtr, CursorPtr);
...
@@ -116,7 +116,6 @@ int nxagentCursorSaveRenderInfo(ScreenPtr, CursorPtr);
void
nxagentCursorPostSaveRenderInfo
(
CursorPtr
,
ScreenPtr
,
PicturePtr
,
int
,
int
);
void
nxagentCursorPostSaveRenderInfo
(
CursorPtr
,
ScreenPtr
,
PicturePtr
,
int
,
int
);
int
nxagentRenderRealizeCursor
(
ScreenPtr
,
CursorPtr
);
int
nxagentRenderRealizeCursor
(
ScreenPtr
,
CursorPtr
);
int
nxagentCreatePicture
(
PicturePtr
,
Mask
);
int
nxagentCreatePicture
(
PicturePtr
,
Mask
);
void
nxagentDestroyPicture
(
PicturePtr
pPicture
);
void
nxagentChangePicture
(
PicturePtr
,
Mask
);
void
nxagentChangePicture
(
PicturePtr
,
Mask
);
int
nxagentChangePictureClip
(
PicturePtr
,
int
,
int
,
xRectangle
*
,
int
,
int
);
int
nxagentChangePictureClip
(
PicturePtr
,
int
,
int
,
xRectangle
*
,
int
,
int
);
void
nxagentComposite
(
CARD8
,
PicturePtr
,
PicturePtr
,
PicturePtr
,
INT16
,
INT16
,
void
nxagentComposite
(
CARD8
,
PicturePtr
,
PicturePtr
,
PicturePtr
,
INT16
,
INT16
,
...
@@ -132,6 +131,28 @@ void nxagentSetPictureFilter(PicturePtr pPicture, char *filter, int name_size,
...
@@ -132,6 +131,28 @@ void nxagentSetPictureFilter(PicturePtr pPicture, char *filter, int name_size,
void
nxagentTrapezoids
(
CARD8
op
,
PicturePtr
pSrc
,
PicturePtr
pDst
,
PictFormatPtr
maskFormat
,
void
nxagentTrapezoids
(
CARD8
op
,
PicturePtr
pSrc
,
PicturePtr
pDst
,
PictFormatPtr
maskFormat
,
INT16
xSrc
,
INT16
ySrc
,
int
ntrap
,
xTrapezoid
*
traps
);
INT16
xSrc
,
INT16
ySrc
,
int
ntrap
,
xTrapezoid
*
traps
);
void
nxagentRenderCreateSolidFill
(
PicturePtr
pPicture
,
xRenderColor
*
color
);
void
nxagentRenderCreateLinearGradient
(
PicturePtr
pPicture
,
xPointFixed
*
p1
,
xPointFixed
*
p2
,
int
nStops
,
xFixed
*
stops
,
xRenderColor
*
colors
);
void
nxagentRenderCreateRadialGradient
(
PicturePtr
pPicture
,
xPointFixed
*
inner
,
xPointFixed
*
outer
,
xFixed
innerRadius
,
xFixed
outerRadius
,
int
nStops
,
xFixed
*
stops
,
xRenderColor
*
colors
);
void
nxagentRenderCreateConicalGradient
(
PicturePtr
pPicture
,
xPointFixed
*
center
,
xFixed
angle
,
int
nStops
,
xFixed
*
stops
,
xRenderColor
*
colors
);
/*
/*
* The void pointer is actually a XGlyphElt8.
* The void pointer is actually a XGlyphElt8.
*/
*/
...
@@ -823,8 +844,6 @@ ProcRenderFreePicture (ClientPtr client)
...
@@ -823,8 +844,6 @@ ProcRenderFreePicture (ClientPtr client)
VERIFY_PICTURE
(
pPicture
,
stuff
->
picture
,
client
,
SecurityDestroyAccess
,
VERIFY_PICTURE
(
pPicture
,
stuff
->
picture
,
client
,
SecurityDestroyAccess
,
RenderErrBase
+
BadPicture
);
RenderErrBase
+
BadPicture
);
nxagentDestroyPicture
(
pPicture
);
FreeResource
(
stuff
->
picture
,
RT_NONE
);
FreeResource
(
stuff
->
picture
,
RT_NONE
);
return
(
client
->
noClientException
);
return
(
client
->
noClientException
);
}
}
...
@@ -926,9 +945,16 @@ ProcRenderComposite (ClientPtr client)
...
@@ -926,9 +945,16 @@ ProcRenderComposite (ClientPtr client)
RenderErrBase
+
BadPicture
);
RenderErrBase
+
BadPicture
);
VERIFY_ALPHA
(
pMask
,
stuff
->
mask
,
client
,
SecurityReadAccess
,
VERIFY_ALPHA
(
pMask
,
stuff
->
mask
,
client
,
SecurityReadAccess
,
RenderErrBase
+
BadPicture
);
RenderErrBase
+
BadPicture
);
/*
FIXME: Imported change from newest version of Xorg. Changed pSrc to pDst.
if ((pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) ||
if ((pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) ||
(pMask && pMask->pDrawable && pSrc->pDrawable->pScreen != pMask->pDrawable->pScreen))
(pMask && pMask->pDrawable && pSrc->pDrawable->pScreen != pMask->pDrawable->pScreen))
return BadMatch;
return BadMatch;
*/
if
((
pSrc
->
pDrawable
&&
pSrc
->
pDrawable
->
pScreen
!=
pDst
->
pDrawable
->
pScreen
)
||
(
pMask
&&
pMask
->
pDrawable
&&
pDst
->
pDrawable
->
pScreen
!=
pMask
->
pDrawable
->
pScreen
))
return
BadMatch
;
ValidatePicture
(
pSrc
);
ValidatePicture
(
pSrc
);
if
(
pMask
)
if
(
pMask
)
...
@@ -2336,6 +2362,11 @@ static int ProcRenderCreateSolidFill(ClientPtr client)
...
@@ -2336,6 +2362,11 @@ static int ProcRenderCreateSolidFill(ClientPtr client)
pPicture
=
CreateSolidPicture
(
stuff
->
pid
,
&
stuff
->
color
,
&
error
);
pPicture
=
CreateSolidPicture
(
stuff
->
pid
,
&
stuff
->
color
,
&
error
);
if
(
!
pPicture
)
if
(
!
pPicture
)
return
error
;
return
error
;
/* AGENT SERVER */
nxagentRenderCreateSolidFill
(
pPicture
,
&
stuff
->
color
);
/* AGENT SERVER */
if
(
!
AddResource
(
stuff
->
pid
,
PictureType
,
(
pointer
)
pPicture
))
if
(
!
AddResource
(
stuff
->
pid
,
PictureType
,
(
pointer
)
pPicture
))
return
BadAlloc
;
return
BadAlloc
;
return
Success
;
return
Success
;
...
@@ -2367,6 +2398,12 @@ static int ProcRenderCreateLinearGradient (ClientPtr client)
...
@@ -2367,6 +2398,12 @@ static int ProcRenderCreateLinearGradient (ClientPtr client)
stuff
->
nStops
,
stops
,
colors
,
&
error
);
stuff
->
nStops
,
stops
,
colors
,
&
error
);
if
(
!
pPicture
)
if
(
!
pPicture
)
return
error
;
return
error
;
/* AGENT SERVER */
nxagentRenderCreateLinearGradient
(
pPicture
,
&
stuff
->
p1
,
&
stuff
->
p2
,
stuff
->
nStops
,
stops
,
colors
);
/* AGENT SERVER */
if
(
!
AddResource
(
stuff
->
pid
,
PictureType
,
(
pointer
)
pPicture
))
if
(
!
AddResource
(
stuff
->
pid
,
PictureType
,
(
pointer
)
pPicture
))
return
BadAlloc
;
return
BadAlloc
;
return
Success
;
return
Success
;
...
@@ -2397,6 +2434,14 @@ static int ProcRenderCreateRadialGradient (ClientPtr client)
...
@@ -2397,6 +2434,14 @@ static int ProcRenderCreateRadialGradient (ClientPtr client)
stuff
->
nStops
,
stops
,
colors
,
&
error
);
stuff
->
nStops
,
stops
,
colors
,
&
error
);
if
(
!
pPicture
)
if
(
!
pPicture
)
return
error
;
return
error
;
/* AGENT SERVER */
nxagentRenderCreateRadialGradient
(
pPicture
,
&
stuff
->
inner
,
&
stuff
->
outer
,
stuff
->
inner_radius
,
stuff
->
outer_radius
,
stuff
->
nStops
,
stops
,
colors
);
/* AGENT SERVER */
if
(
!
AddResource
(
stuff
->
pid
,
PictureType
,
(
pointer
)
pPicture
))
if
(
!
AddResource
(
stuff
->
pid
,
PictureType
,
(
pointer
)
pPicture
))
return
BadAlloc
;
return
BadAlloc
;
return
Success
;
return
Success
;
...
@@ -2426,6 +2471,13 @@ static int ProcRenderCreateConicalGradient (ClientPtr client)
...
@@ -2426,6 +2471,13 @@ static int ProcRenderCreateConicalGradient (ClientPtr client)
stuff
->
nStops
,
stops
,
colors
,
&
error
);
stuff
->
nStops
,
stops
,
colors
,
&
error
);
if
(
!
pPicture
)
if
(
!
pPicture
)
return
error
;
return
error
;
/* AGENT SERVER */
nxagentRenderCreateConicalGradient
(
pPicture
,
&
stuff
->
center
,
stuff
->
angle
,
stuff
->
nStops
,
stops
,
colors
);
/* AGENT SERVER */
if
(
!
AddResource
(
stuff
->
pid
,
PictureType
,
(
pointer
)
pPicture
))
if
(
!
AddResource
(
stuff
->
pid
,
PictureType
,
(
pointer
)
pPicture
))
return
BadAlloc
;
return
BadAlloc
;
return
Success
;
return
Success
;
...
...
nx-X11/programs/Xserver/hw/nxagent/X/NXrender.c.NX.original
View file @
b7494f08
...
@@ -116,7 +116,6 @@ int nxagentCursorSaveRenderInfo(ScreenPtr, CursorPtr);
...
@@ -116,7 +116,6 @@ int nxagentCursorSaveRenderInfo(ScreenPtr, CursorPtr);
void nxagentCursorPostSaveRenderInfo(CursorPtr, ScreenPtr, PicturePtr, int, int);
void nxagentCursorPostSaveRenderInfo(CursorPtr, ScreenPtr, PicturePtr, int, int);
int nxagentRenderRealizeCursor(ScreenPtr, CursorPtr);
int nxagentRenderRealizeCursor(ScreenPtr, CursorPtr);
int nxagentCreatePicture(PicturePtr, Mask);
int nxagentCreatePicture(PicturePtr, Mask);
void nxagentDestroyPicture(PicturePtr pPicture);
void nxagentChangePicture(PicturePtr, Mask);
void nxagentChangePicture(PicturePtr, Mask);
int nxagentChangePictureClip(PicturePtr, int, int, xRectangle *, int, int);
int nxagentChangePictureClip(PicturePtr, int, int, xRectangle *, int, int);
void nxagentComposite(CARD8, PicturePtr, PicturePtr, PicturePtr, INT16, INT16,
void nxagentComposite(CARD8, PicturePtr, PicturePtr, PicturePtr, INT16, INT16,
...
@@ -132,6 +131,28 @@ void nxagentSetPictureFilter(PicturePtr pPicture, char *filter, int name_size,
...
@@ -132,6 +131,28 @@ void nxagentSetPictureFilter(PicturePtr pPicture, char *filter, int name_size,
void nxagentTrapezoids(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat,
void nxagentTrapezoids(CARD8 op, PicturePtr pSrc, PicturePtr pDst, PictFormatPtr maskFormat,
INT16 xSrc, INT16 ySrc, int ntrap, xTrapezoid *traps);
INT16 xSrc, INT16 ySrc, int ntrap, xTrapezoid *traps);
void nxagentRenderCreateSolidFill(PicturePtr pPicture, xRenderColor *color);
void nxagentRenderCreateLinearGradient(PicturePtr pPicture, xPointFixed *p1,
xPointFixed *p2, int nStops,
xFixed *stops,
xRenderColor *colors);
void nxagentRenderCreateRadialGradient(PicturePtr pPicture, xPointFixed *inner,
xPointFixed *outer,
xFixed innerRadius,
xFixed outerRadius,
int nStops,
xFixed *stops,
xRenderColor *colors);
void nxagentRenderCreateConicalGradient(PicturePtr pPicture,
xPointFixed *center,
xFixed angle, int nStops,
xFixed *stops,
xRenderColor *colors);
/*
/*
* The void pointer is actually a XGlyphElt8.
* The void pointer is actually a XGlyphElt8.
*/
*/
...
@@ -823,8 +844,6 @@ ProcRenderFreePicture (ClientPtr client)
...
@@ -823,8 +844,6 @@ ProcRenderFreePicture (ClientPtr client)
VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityDestroyAccess,
VERIFY_PICTURE (pPicture, stuff->picture, client, SecurityDestroyAccess,
RenderErrBase + BadPicture);
RenderErrBase + BadPicture);
nxagentDestroyPicture(pPicture);
FreeResource (stuff->picture, RT_NONE);
FreeResource (stuff->picture, RT_NONE);
return(client->noClientException);
return(client->noClientException);
}
}
...
@@ -926,9 +945,16 @@ ProcRenderComposite (ClientPtr client)
...
@@ -926,9 +945,16 @@ ProcRenderComposite (ClientPtr client)
RenderErrBase + BadPicture);
RenderErrBase + BadPicture);
VERIFY_ALPHA (pMask, stuff->mask, client, SecurityReadAccess,
VERIFY_ALPHA (pMask, stuff->mask, client, SecurityReadAccess,
RenderErrBase + BadPicture);
RenderErrBase + BadPicture);
/*
FIXME: Imported change from newest version of Xorg. Changed pSrc to pDst.
if ((pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) ||
if ((pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) ||
(pMask && pMask->pDrawable && pSrc->pDrawable->pScreen != pMask->pDrawable->pScreen))
(pMask && pMask->pDrawable && pSrc->pDrawable->pScreen != pMask->pDrawable->pScreen))
return BadMatch;
return BadMatch;
*/
if ((pSrc->pDrawable && pSrc->pDrawable->pScreen != pDst->pDrawable->pScreen) ||
(pMask && pMask->pDrawable && pDst->pDrawable->pScreen != pMask->pDrawable->pScreen))
return BadMatch;
ValidatePicture (pSrc);
ValidatePicture (pSrc);
if (pMask)
if (pMask)
...
@@ -2336,6 +2362,11 @@ static int ProcRenderCreateSolidFill(ClientPtr client)
...
@@ -2336,6 +2362,11 @@ static int ProcRenderCreateSolidFill(ClientPtr client)
pPicture = CreateSolidPicture(stuff->pid, &stuff->color, &error);
pPicture = CreateSolidPicture(stuff->pid, &stuff->color, &error);
if (!pPicture)
if (!pPicture)
return error;
return error;
/* AGENT SERVER */
nxagentRenderCreateSolidFill(pPicture, &stuff -> color);
/* AGENT SERVER */
if (!AddResource (stuff->pid, PictureType, (pointer)pPicture))
if (!AddResource (stuff->pid, PictureType, (pointer)pPicture))
return BadAlloc;
return BadAlloc;
return Success;
return Success;
...
@@ -2367,6 +2398,12 @@ static int ProcRenderCreateLinearGradient (ClientPtr client)
...
@@ -2367,6 +2398,12 @@ static int ProcRenderCreateLinearGradient (ClientPtr client)
stuff->nStops, stops, colors, &error);
stuff->nStops, stops, colors, &error);
if (!pPicture)
if (!pPicture)
return error;
return error;
/* AGENT SERVER */
nxagentRenderCreateLinearGradient(pPicture, &stuff->p1, &stuff->p2,
stuff->nStops, stops, colors);
/* AGENT SERVER */
if (!AddResource (stuff->pid, PictureType, (pointer)pPicture))
if (!AddResource (stuff->pid, PictureType, (pointer)pPicture))
return BadAlloc;
return BadAlloc;
return Success;
return Success;
...
@@ -2397,6 +2434,14 @@ static int ProcRenderCreateRadialGradient (ClientPtr client)
...
@@ -2397,6 +2434,14 @@ static int ProcRenderCreateRadialGradient (ClientPtr client)
stuff->nStops, stops, colors, &error);
stuff->nStops, stops, colors, &error);
if (!pPicture)
if (!pPicture)
return error;
return error;
/* AGENT SERVER */
nxagentRenderCreateRadialGradient(pPicture, &stuff->inner, &stuff->outer,
stuff->inner_radius,
stuff->outer_radius,
stuff->nStops, stops, colors);
/* AGENT SERVER */
if (!AddResource (stuff->pid, PictureType, (pointer)pPicture))
if (!AddResource (stuff->pid, PictureType, (pointer)pPicture))
return BadAlloc;
return BadAlloc;
return Success;
return Success;
...
@@ -2426,6 +2471,13 @@ static int ProcRenderCreateConicalGradient (ClientPtr client)
...
@@ -2426,6 +2471,13 @@ static int ProcRenderCreateConicalGradient (ClientPtr client)
stuff->nStops, stops, colors, &error);
stuff->nStops, stops, colors, &error);
if (!pPicture)
if (!pPicture)
return error;
return error;
/* AGENT SERVER */
nxagentRenderCreateConicalGradient(pPicture, &stuff->center,
stuff->angle, stuff->nStops, stops,
colors);
/* AGENT SERVER */
if (!AddResource (stuff->pid, PictureType, (pointer)pPicture))
if (!AddResource (stuff->pid, PictureType, (pointer)pPicture))
return BadAlloc;
return BadAlloc;
return Success;
return Success;
...
...
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