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
6f071341
Commit
6f071341
authored
Aug 05, 2019
by
Ulrich Sibiller
Committed by
Mike Gabriel
Sep 29, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clipboard.c: use designated initializers where appropriate
parent
1af01db3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
41 deletions
+24
-41
Clipboard.c
nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
+24
-41
No files found.
nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
View file @
6f071341
...
@@ -574,8 +574,7 @@ void nxagentClearSelection(XEvent *X)
...
@@ -574,8 +574,7 @@ void nxagentClearSelection(XEvent *X)
{
{
if
(
lastSelectionOwner
[
i
].
client
!=
NULL
)
if
(
lastSelectionOwner
[
i
].
client
!=
NULL
)
{
{
xEvent
x
;
xEvent
x
=
{
0
};
memset
(
&
x
,
0
,
sizeof
(
xEvent
));
x
.
u
.
u
.
type
=
SelectionClear
;
x
.
u
.
u
.
type
=
SelectionClear
;
x
.
u
.
selectionClear
.
time
=
GetTimeInMillis
();
x
.
u
.
selectionClear
.
time
=
GetTimeInMillis
();
x
.
u
.
selectionClear
.
window
=
lastSelectionOwner
[
i
].
window
;
x
.
u
.
selectionClear
.
window
=
lastSelectionOwner
[
i
].
window
;
...
@@ -606,9 +605,9 @@ void nxagentReplyRequestSelection(XEvent *X, Bool success)
...
@@ -606,9 +605,9 @@ void nxagentReplyRequestSelection(XEvent *X, Bool success)
XSelectionEvent
eventSelection
=
{
XSelectionEvent
eventSelection
=
{
.
requestor
=
X
->
xselectionrequest
.
requestor
,
.
requestor
=
X
->
xselectionrequest
.
requestor
,
.
selection
=
X
->
xselectionrequest
.
selection
,
.
selection
=
X
->
xselectionrequest
.
selection
,
.
target
=
X
->
xselectionrequest
.
target
,
.
target
=
X
->
xselectionrequest
.
target
,
.
time
=
X
->
xselectionrequest
.
time
,
.
time
=
X
->
xselectionrequest
.
time
,
.
property
=
X
->
xselectionrequest
.
property
.
property
=
X
->
xselectionrequest
.
property
};
};
if
(
!
success
)
if
(
!
success
)
...
@@ -722,8 +721,6 @@ FIXME: Do we need this?
...
@@ -722,8 +721,6 @@ FIXME: Do we need this?
if
(
lastSelectionOwner
[
i
].
client
!=
NULL
&&
if
(
lastSelectionOwner
[
i
].
client
!=
NULL
&&
nxagentOption
(
Clipboard
)
!=
ClipboardClient
)
nxagentOption
(
Clipboard
)
!=
ClipboardClient
)
{
{
xEvent
x
;
lastServerProperty
=
X
->
xselectionrequest
.
property
;
lastServerProperty
=
X
->
xselectionrequest
.
property
;
lastServerRequestor
=
X
->
xselectionrequest
.
requestor
;
lastServerRequestor
=
X
->
xselectionrequest
.
requestor
;
lastServerTarget
=
X
->
xselectionrequest
.
target
;
lastServerTarget
=
X
->
xselectionrequest
.
target
;
...
@@ -734,7 +731,7 @@ FIXME: Do we need this?
...
@@ -734,7 +731,7 @@ FIXME: Do we need this?
lastServerTime
=
X
->
xselectionrequest
.
time
;
lastServerTime
=
X
->
xselectionrequest
.
time
;
memset
(
&
x
,
0
,
sizeof
(
xEvent
))
;
xEvent
x
=
{
0
}
;
x
.
u
.
u
.
type
=
SelectionRequest
;
x
.
u
.
u
.
type
=
SelectionRequest
;
x
.
u
.
selectionRequest
.
time
=
GetTimeInMillis
();
x
.
u
.
selectionRequest
.
time
=
GetTimeInMillis
();
x
.
u
.
selectionRequest
.
owner
=
lastSelectionOwner
[
i
].
window
;
x
.
u
.
selectionRequest
.
owner
=
lastSelectionOwner
[
i
].
window
;
...
@@ -1080,8 +1077,6 @@ void nxagentCollectPropertyEvent(int resource)
...
@@ -1080,8 +1077,6 @@ void nxagentCollectPropertyEvent(int resource)
void
nxagentNotifySelection
(
XEvent
*
X
)
void
nxagentNotifySelection
(
XEvent
*
X
)
{
{
XSelectionEvent
eventSelection
;
#ifdef DEBUG
#ifdef DEBUG
fprintf
(
stderr
,
"%s: Got called.
\n
"
,
__func__
);
fprintf
(
stderr
,
"%s: Got called.
\n
"
,
__func__
);
#endif
#endif
...
@@ -1199,23 +1194,15 @@ void nxagentNotifySelection(XEvent *X)
...
@@ -1199,23 +1194,15 @@ void nxagentNotifySelection(XEvent *X)
}
}
memset
(
&
eventSelection
,
0
,
sizeof
(
XSelectionEvent
));
XSelectionEvent
eventSelection
=
{
eventSelection
.
requestor
=
lastServerRequestor
;
.
requestor
=
lastServerRequestor
,
.
selection
=
X
->
xselection
.
selection
,
eventSelection
.
selection
=
X
->
xselection
.
selection
;
/* .target = X->xselection.target, */
.
target
=
lastServerTarget
,
/*
.
property
=
lastServerProperty
,
* eventSelection.target = X->xselection.target;
.
time
=
lastServerTime
,
*/
/* .time = CurrentTime */
};
eventSelection
.
target
=
lastServerTarget
;
eventSelection
.
property
=
lastServerProperty
;
eventSelection
.
time
=
lastServerTime
;
/*
* eventSelection.time = CurrentTime;
* eventSelection.time = lastServerTime;
*/
SendSelectionNotifyEventToServer
(
&
eventSelection
);
SendSelectionNotifyEventToServer
(
&
eventSelection
);
...
@@ -1646,14 +1633,18 @@ int nxagentSendNotify(xEvent *event)
...
@@ -1646,14 +1633,18 @@ int nxagentSendNotify(xEvent *event)
if
(
event
->
u
.
selectionNotify
.
property
==
clientCutProperty
)
if
(
event
->
u
.
selectionNotify
.
property
==
clientCutProperty
)
{
{
XSelectionEvent
x
;
/*
/*
* Setup selection notify event to real server.
* Setup selection notify event to real server.
*/
*/
memset
(
&
x
,
0
,
sizeof
(
XSelectionEvent
));
XSelectionEvent
eventSelection
=
{
x
.
requestor
=
serverWindow
;
.
requestor
=
serverWindow
,
.
selection
=
event
->
u
.
selectionNotify
.
selection
,
.
target
=
event
->
u
.
selectionNotify
.
target
,
.
property
=
event
->
u
.
selectionNotify
.
property
,
.
time
=
CurrentTime
,
};
/*
/*
* On real server, the right CLIPBOARD atom is
* On real server, the right CLIPBOARD atom is
...
@@ -1662,22 +1653,14 @@ int nxagentSendNotify(xEvent *event)
...
@@ -1662,22 +1653,14 @@ int nxagentSendNotify(xEvent *event)
if
(
event
->
u
.
selectionNotify
.
selection
==
MakeAtom
(
"CLIPBOARD"
,
9
,
0
))
if
(
event
->
u
.
selectionNotify
.
selection
==
MakeAtom
(
"CLIPBOARD"
,
9
,
0
))
{
{
x
.
selection
=
lastSelectionOwner
[
nxagentClipboardSelection
].
selection
;
eventSelection
.
selection
=
lastSelectionOwner
[
nxagentClipboardSelection
].
selection
;
}
}
else
{
x
.
selection
=
event
->
u
.
selectionNotify
.
selection
;
}
x
.
target
=
event
->
u
.
selectionNotify
.
target
;
x
.
property
=
event
->
u
.
selectionNotify
.
property
;
x
.
time
=
CurrentTime
;
#ifdef DEBUG
#ifdef DEBUG
fprintf
(
stderr
,
"%s: Propagating clientCutProperty to requestor [%p].
\n
"
,
__func__
,
(
void
*
)
x
.
requestor
);
fprintf
(
stderr
,
"%s: Propagating clientCutProperty to requestor [%p].
\n
"
,
__func__
,
(
void
*
)
eventSelection
.
requestor
);
#endif
#endif
SendSelectionNotifyEventToServer
(
&
x
);
SendSelectionNotifyEventToServer
(
&
eventSelection
);
return
1
;
return
1
;
}
}
...
...
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