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
770f468c
Unverified
Commit
770f468c
authored
Feb 03, 2021
by
Mike Gabriel
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'uli42-pr/windowfixes' into 3.6.x
Attributes GH PR #994:
https://github.com/ArcticaProject/nx-libs/pull/994
parents
e5746df8
cbd9875e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
74 additions
and
116 deletions
+74
-116
property.c
nx-X11/programs/Xserver/dix/property.c
+4
-2
Events.c
nx-X11/programs/Xserver/hw/nxagent/Events.c
+0
-2
NXproperty.c
nx-X11/programs/Xserver/hw/nxagent/NXproperty.c
+55
-98
Window.c
nx-X11/programs/Xserver/hw/nxagent/Window.c
+15
-12
Windows.h
nx-X11/programs/Xserver/hw/nxagent/Windows.h
+0
-2
No files found.
nx-X11/programs/Xserver/dix/property.c
View file @
770f468c
...
...
@@ -661,9 +661,12 @@ ProcListProperties(ClientPtr client)
return
(
client
->
noClientException
);
}
#ifndef NXAGENT_SERVER
int
#ifdef NXAGENT_SERVER
xorg_ProcDeleteProperty
(
register
ClientPtr
client
)
#else
ProcDeleteProperty
(
register
ClientPtr
client
)
#endif
{
WindowPtr
pWin
;
REQUEST
(
xDeletePropertyReq
);
...
...
@@ -699,4 +702,3 @@ ProcDeleteProperty(register ClientPtr client)
else
return
(
result
);
}
#endif
nx-X11/programs/Xserver/hw/nxagent/Events.c
View file @
770f468c
...
...
@@ -2067,8 +2067,6 @@ FIXME: Don't enqueue the KeyRelease event if the key was not already
if
(
nxagentOption
(
Fullscreen
))
{
nxagentVisibility
=
VisibilityUnobscured
;
nxagentVisibilityStop
=
False
;
nxagentVisibilityTimeout
=
GetTimeInMillis
()
+
2000
;
}
/*
...
...
nx-X11/programs/Xserver/hw/nxagent/NXproperty.c
View file @
770f468c
...
...
@@ -180,11 +180,8 @@ ProcChangeProperty(ClientPtr client)
#ifdef NXAGENT_SERVER
/* prevent clients from changing the NX_AGENT_VERSION property */
{
Atom
prop
=
MakeAtom
(
"NX_AGENT_VERSION"
,
strlen
(
"NX_AGENT_VERSION"
),
True
);
if
(
stuff
->
property
==
prop
)
return
client
->
noClientException
;
}
if
(
stuff
->
property
==
MakeAtom
(
"NX_AGENT_VERSION"
,
strlen
(
"NX_AGENT_VERSION"
),
True
))
return
client
->
noClientException
;
#endif
err
=
ChangeWindowProperty
(
pWin
,
stuff
->
property
,
stuff
->
type
,
(
int
)
format
,
...
...
@@ -211,28 +208,6 @@ ProcChangeProperty(ClientPtr client)
}
}
int
ChangeWindowProperty
(
WindowPtr
pWin
,
Atom
property
,
Atom
type
,
int
format
,
int
mode
,
unsigned
long
len
,
void
*
value
,
Bool
sendevent
)
{
int
sizeInBytes
=
format
>>
3
;
int
totalSize
=
len
*
sizeInBytes
;
int
copySize
=
nxagentOption
(
CopyBufferSize
);
if
(
copySize
!=
COPY_UNLIMITED
&&
property
==
clientCutProperty
)
{
if
(
totalSize
>
copySize
)
{
totalSize
=
copySize
;
totalSize
=
totalSize
-
(
totalSize
%
sizeInBytes
);
len
=
totalSize
/
sizeInBytes
;
}
}
return
xorg_ChangeWindowProperty
(
pWin
,
property
,
type
,
format
,
mode
,
len
,
value
,
sendevent
);
}
/*****************
* GetProperty
* If type Any is specified, returns the property from the specified
...
...
@@ -446,29 +421,35 @@ ProcGetProperty(ClientPtr client)
return
(
client
->
noClientException
);
}
#ifdef NXAGENT_CLIPBOARD
/* GetWindowProperty clipboard use only */
/* FIXME: that's wrong, it is also called in Window.c and Events.c */
/* FIXME: should be moved to a different file, is not derived from
dix */
int
GetWindowProperty
(
pWin
,
property
,
longOffset
,
longLength
,
delete
,
type
,
actualType
,
format
,
nItems
,
bytesAfter
,
propData
)
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
;
ProcDeleteProperty
(
register
ClientPtr
client
)
{
PropertyPtr
pProp
,
prevProp
;
unsigned
long
n
,
len
,
ind
;
REQUEST
(
xDeletePropertyReq
);
REQUEST_SIZE_MATCH
(
xDeletePropertyReq
);
/* prevent clients from deleting the NX_AGENT_VERSION property */
if
(
stuff
->
property
==
MakeAtom
(
"NX_AGENT_VERSION"
,
strlen
(
"NX_AGENT_VERSION"
),
True
))
return
client
->
noClientException
;
return
xorg_ProcDeleteProperty
(
client
);
}
/* ---------------------------------------------------------------------- */
/*
* GetWindowProperty is the internal implementation of the
* XGetWindowProperty() Xlib call. It is called from
* Clipboard.c, Window.c and Events.c
*
* FIXME: should be moved to a different file, is not derived from
* dix
*/
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
)
{
if
(
!
pWin
)
{
#ifdef DEBUG
...
...
@@ -482,18 +463,19 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete,
#ifdef DEBUG
fprintf
(
stderr
,
"%s: invalid atom [%d]
\n
"
,
__func__
,
property
);
#endif
return
(
BadAtom
)
;
return
BadAtom
;
}
if
((
type
!=
AnyPropertyType
)
&&
!
ValidAtom
(
type
))
{
#ifdef DEBUG
fprintf
(
stderr
,
"%s: invalid type [%d]
\n
"
,
__func__
,
type
);
#endif
return
(
BadAtom
)
;
return
BadAtom
;
}
pProp
=
wUserProps
(
pWin
);
prevProp
=
(
PropertyPtr
)
NULL
;
PropertyPtr
pProp
=
wUserProps
(
pWin
);
PropertyPtr
prevProp
=
(
PropertyPtr
)
NULL
;
while
(
pProp
)
{
...
...
@@ -508,7 +490,7 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete,
#ifdef DEBUG
fprintf
(
stderr
,
"%s: property not found [%d]
\n
"
,
__func__
,
property
);
#endif
return
(
BadAtom
)
;
return
BadAtom
;
}
/* If the request type and actual type don't match. Return the
...
...
@@ -522,14 +504,14 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete,
*
format
=
pProp
->
format
;
*
nItems
=
0
;
*
actualType
=
pProp
->
type
;
return
(
Success
)
;
return
Success
;
}
/*
* Return type, format, value to client
*/
n
=
(
pProp
->
format
/
8
)
*
pProp
->
size
;
/* size (bytes) of prop */
ind
=
longOffset
<<
2
;
unsigned
long
n
=
(
pProp
->
format
/
8
)
*
pProp
->
size
;
/* size (bytes) of prop */
unsigned
long
ind
=
longOffset
<<
2
;
/* byte offset */
/* If longOffset is invalid such that it causes "len" to
be negative, it's a value error. */
...
...
@@ -542,7 +524,8 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete,
return
BadValue
;
}
len
=
min
(
n
-
ind
,
4
*
longLength
);
/* minimum of prop size and requested size */
unsigned
long
len
=
min
(
n
-
ind
,
4
*
longLength
);
*
bytesAfter
=
n
-
(
ind
+
len
);
*
format
=
pProp
->
format
;
...
...
@@ -566,7 +549,7 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete,
}
if
(
delete
&&
(
*
bytesAfter
==
0
))
{
/* delete the
P
roperty */
{
/* delete the
p
roperty */
if
(
prevProp
==
(
PropertyPtr
)
NULL
)
/* takes care of head */
{
if
(
!
(
pWin
->
optional
->
userProps
=
pProp
->
next
))
...
...
@@ -577,53 +560,27 @@ GetWindowProperty(pWin, property, longOffset, longLength, delete,
free
(
pProp
->
data
);
free
(
pProp
);
}
return
(
Success
)
;
return
Success
;
}
#endif
int
ProcDeleteProperty
(
register
ClientPtr
client
)
ChangeWindowProperty
(
WindowPtr
pWin
,
Atom
property
,
Atom
type
,
int
format
,
int
mode
,
unsigned
long
len
,
void
*
value
,
Bool
sendevent
)
{
WindowPtr
pWin
;
REQUEST
(
xDeletePropertyReq
);
int
result
;
REQUEST_SIZE_MATCH
(
xDeletePropertyReq
);
UpdateCurrentTime
();
pWin
=
(
WindowPtr
)
SecurityLookupWindow
(
stuff
->
window
,
client
,
DixWriteAccess
);
if
(
!
pWin
)
return
(
BadWindow
);
if
(
!
ValidAtom
(
stuff
->
property
))
{
client
->
errorValue
=
stuff
->
property
;
return
(
BadAtom
);
}
#ifdef XCSECURITY
switch
(
SecurityCheckPropertyAccess
(
client
,
pWin
,
stuff
->
property
,
DixDestroyAccess
))
{
case
SecurityErrorOperation
:
client
->
errorValue
=
stuff
->
property
;
return
BadAtom
;;
case
SecurityIgnoreOperation
:
return
Success
;
}
#endif
int
sizeInBytes
=
format
>>
3
;
int
totalSize
=
len
*
sizeInBytes
;
int
copySize
=
nxagentOption
(
CopyBufferSize
);
#ifdef NXAGENT_SERVER
/* prevent clients from deleting the NX_AGENT_VERSION property */
if
(
copySize
!=
COPY_UNLIMITED
&&
property
==
clientCutProperty
)
{
Atom
prop
=
MakeAtom
(
"NX_AGENT_VERSION"
,
strlen
(
"NX_AGENT_VERSION"
),
True
);
if
(
stuff
->
property
==
prop
)
return
client
->
noClientException
;
if
(
totalSize
>
copySize
)
{
totalSize
=
copySize
;
totalSize
=
totalSize
-
(
totalSize
%
sizeInBytes
);
len
=
totalSize
/
sizeInBytes
;
}
}
#endif
result
=
DeleteProperty
(
pWin
,
stuff
->
property
);
if
(
client
->
noClientException
!=
Success
)
return
(
client
->
noClientException
);
else
return
(
result
);
return
xorg_ChangeWindowProperty
(
pWin
,
property
,
type
,
format
,
mode
,
len
,
value
,
sendevent
);
}
nx-X11/programs/Xserver/hw/nxagent/Window.c
View file @
770f468c
...
...
@@ -80,8 +80,6 @@ int nxagentWindowPrivateIndex;
*/
int
nxagentVisibility
=
VisibilityUnobscured
;
unsigned
long
nxagentVisibilityTimeout
=
0
;
Bool
nxagentVisibilityStop
=
False
;
ConfiguredWindowStruct
*
nxagentConfiguredWindowList
;
StaticResizedWindowStruct
*
nxagentStaticResizedWindowList
;
...
...
@@ -3089,10 +3087,15 @@ static void nxagentReconnectWindow(void * param0, XID param1, void * data_buffer
#endif
/* FIXME: use XAllocSizeHints() */
/* FIXME: all this copying is only done because the first
element of the XSizeHints struct is a long which is of
different size on 32bit vs. 64bit platforms. We should
rewrite this to better readable and probably more robust
code */
#ifdef _XSERVER64
data64
=
(
unsigned
char
*
)
malloc
(
sizeof
(
XSizeHints
)
+
4
);
if
(
data64
)
{
if
(
data64
)
{
for
(
int
i
=
0
;
i
<
4
;
i
++
)
{
*
(
data64
+
i
)
=
*
(
data
+
i
);
...
...
@@ -3106,18 +3109,18 @@ static void nxagentReconnectWindow(void * param0, XID param1, void * data_buffer
}
XSizeHints
*
props
=
(
XSizeHints
*
)
data64
;
#else
XSizeHints
*
props
=
(
XSizeHints
*
)
data
;
#endif
/* _XSERVER64 */
hints
=
*
props
;
}
else
{
}
else
{
#ifdef WARNING
fprintf
(
stderr
,
"%s: Failed to alloc memory for XSizeHints
\n
"
,
__func__
);
#endif
}
}
#else
XSizeHints
*
props
=
(
XSizeHints
*
)
data
;
hints
=
*
props
;
#endif
/* _XSERVER64 */
}
else
{
...
...
nx-X11/programs/Xserver/hw/nxagent/Windows.h
View file @
770f468c
...
...
@@ -256,8 +256,6 @@ void nxagentConfigureWindow(WindowPtr pWin, unsigned int mask);
*/
extern
int
nxagentVisibility
;
extern
unsigned
long
nxagentVisibilityTimeout
;
extern
Bool
nxagentVisibilityStop
;
/*
* Return the pointer to the window given the remote id. It tries to
...
...
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