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
7d068370
Commit
7d068370
authored
Aug 04, 2019
by
Ulrich Sibiller
Committed by
Mike Gabriel
Sep 29, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clipboard.c: introduce SendSelectionNotifyEventToClient helper
parent
c233eec5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
62 deletions
+32
-62
Clipboard.c
nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
+32
-62
No files found.
nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
View file @
7d068370
...
...
@@ -406,6 +406,27 @@ int SendEventToClient(ClientPtr client, xEvent *pEvents)
return
TryClientEvents
(
client
,
pEvents
,
1
,
NoEventMask
,
NoEventMask
,
NullGrab
);
}
int
SendSelectionNotifyEventToClient
(
ClientPtr
client
,
Time
time
,
Window
requestor
,
Atom
selection
,
Atom
target
,
Atom
property
)
{
#ifdef DEBUG
fprintf
(
stderr
,
"%s: Sending event to client [%d].
\n
"
,
__func__
,
client
->
index
);
#endif
xEvent
x
=
{
0
};
x
.
u
.
u
.
type
=
SelectionNotify
;
x
.
u
.
selectionNotify
.
time
=
time
;
x
.
u
.
selectionNotify
.
requestor
=
requestor
;
x
.
u
.
selectionNotify
.
selection
=
selection
;
x
.
u
.
selectionNotify
.
target
=
target
;
x
.
u
.
selectionNotify
.
property
=
property
;
return
SendEventToClient
(
client
,
&
x
);
}
Bool
nxagentValidServerTargets
(
Atom
target
)
{
if
(
target
==
XA_STRING
)
...
...
@@ -726,26 +747,12 @@ void nxagentSendSelectionNotify(Atom property)
return
;
}
xEvent
x
;
#ifdef DEBUG
fprintf
(
stderr
,
"%s: Sending event to client [%d].
\n
"
,
__func__
,
lastClientClientPtr
->
index
);
#endif
memset
(
&
x
,
0
,
sizeof
(
xEvent
));
x
.
u
.
u
.
type
=
SelectionNotify
;
x
.
u
.
selectionNotify
.
time
=
lastClientTime
;
x
.
u
.
selectionNotify
.
requestor
=
lastClientRequestor
;
x
.
u
.
selectionNotify
.
selection
=
lastClientSelection
;
x
.
u
.
selectionNotify
.
target
=
lastClientTarget
;
x
.
u
.
selectionNotify
.
property
=
property
;
SendEventToClient
(
lastClientClientPtr
,
&
x
);
return
;
SendSelectionNotifyEventToClient
(
lastClientClientPtr
,
lastClientTime
,
lastClientRequestor
,
lastClientSelection
,
lastClientTarget
,
property
);
}
/*
...
...
@@ -1392,8 +1399,6 @@ FIXME
void
nxagentNotifyConvertFailure
(
ClientPtr
client
,
Window
requestor
,
Atom
selection
,
Atom
target
,
Time
time
)
{
xEvent
x
;
/*
FIXME: Why this pointer can be not a valid
client pointer?
...
...
@@ -1407,15 +1412,7 @@ FIXME: Why this pointer can be not a valid
return
;
}
memset
(
&
x
,
0
,
sizeof
(
xEvent
));
x
.
u
.
u
.
type
=
SelectionNotify
;
x
.
u
.
selectionNotify
.
time
=
time
;
x
.
u
.
selectionNotify
.
requestor
=
requestor
;
x
.
u
.
selectionNotify
.
selection
=
selection
;
x
.
u
.
selectionNotify
.
target
=
target
;
x
.
u
.
selectionNotify
.
property
=
None
;
SendEventToClient
(
client
,
&
x
);
SendSelectionNotifyEventToClient
(
client
,
time
,
requestor
,
selection
,
target
,
None
);
}
int
nxagentConvertSelection
(
ClientPtr
client
,
WindowPtr
pWin
,
Atom
selection
,
...
...
@@ -1496,7 +1493,6 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection,
if
(
target
==
clientTARGETS
)
{
Atom
xa_STRING
[
4
];
xEvent
x
;
/* --- Order changed by dimbor (prevent sending COMPOUND_TEXT to client --- */
xa_STRING
[
0
]
=
XA_STRING
;
...
...
@@ -1512,15 +1508,7 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection,
4
,
&
xa_STRING
,
1
);
memset
(
&
x
,
0
,
sizeof
(
xEvent
));
x
.
u
.
u
.
type
=
SelectionNotify
;
x
.
u
.
selectionNotify
.
time
=
time
;
x
.
u
.
selectionNotify
.
requestor
=
requestor
;
x
.
u
.
selectionNotify
.
selection
=
selection
;
x
.
u
.
selectionNotify
.
target
=
target
;
x
.
u
.
selectionNotify
.
property
=
property
;
SendEventToClient
(
client
,
&
x
);
SendSelectionNotifyEventToClient
(
client
,
time
,
requestor
,
selection
,
target
,
property
);
return
1
;
}
...
...
@@ -1534,7 +1522,6 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection,
if
(
i
<
NumCurrentSelections
)
{
xEvent
x
;
ChangeWindowProperty
(
pWin
,
property
,
target
,
...
...
@@ -1544,18 +1531,9 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection,
(
unsigned
char
*
)
&
lastSelectionOwner
[
i
].
lastTimeChanged
,
1
);
memset
(
&
x
,
0
,
sizeof
(
xEvent
));
x
.
u
.
u
.
type
=
SelectionNotify
;
x
.
u
.
selectionNotify
.
time
=
time
;
x
.
u
.
selectionNotify
.
requestor
=
requestor
;
x
.
u
.
selectionNotify
.
selection
=
selection
;
x
.
u
.
selectionNotify
.
target
=
target
;
x
.
u
.
selectionNotify
.
property
=
property
;
SendEventToClient
(
client
,
&
x
);
SendSelectionNotifyEventToClient
(
client
,
time
,
requestor
,
selection
,
target
,
property
);
return
1
;
}
}
...
...
@@ -1625,21 +1603,13 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection,
}
else
{
xEvent
x
;
#ifdef DEBUG
fprintf
(
stderr
,
"%s: Xserver generates a SelectionNotify event "
"to the requestor with property None.
\n
"
,
__func__
);
#endif
memset
(
&
x
,
0
,
sizeof
(
xEvent
));
x
.
u
.
u
.
type
=
SelectionNotify
;
x
.
u
.
selectionNotify
.
time
=
time
;
x
.
u
.
selectionNotify
.
requestor
=
requestor
;
x
.
u
.
selectionNotify
.
selection
=
selection
;
x
.
u
.
selectionNotify
.
target
=
target
;
x
.
u
.
selectionNotify
.
property
=
None
;
SendEventToClient
(
client
,
&
x
);
SendSelectionNotifyEventToClient
(
client
,
time
,
requestor
,
selection
,
target
,
None
);
return
1
;
}
return
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment