aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2019-06-11 12:05:42 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2019-06-11 12:05:42 +0200
commita2523273485c6a3c9c598a2088bcea354815db81 (patch)
treedf997ac112a9335df5117d359d5185dd8236724a /nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
parent92f41213edf57332124df8e0b50ca73ff1a11773 (diff)
parent2da476a67e1580d4957755e0c6cc3df2321b038b (diff)
downloadnx-libs-a2523273485c6a3c9c598a2088bcea354815db81.tar.gz
nx-libs-a2523273485c6a3c9c598a2088bcea354815db81.tar.bz2
nx-libs-a2523273485c6a3c9c598a2088bcea354815db81.zip
Merge branch 'uli42-pr/various_small_things' into 3.6.x
Attributes GH PR #813: https://github.com/ArcticaProject/nx-libs/pull/813
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent/Clipboard.c')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Clipboard.c27
1 files changed, 20 insertions, 7 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
index 13cfd81e6..824c1dc47 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
@@ -305,7 +305,7 @@ void nxagentPrintClipboardStat(char *header)
fprintf(stderr, " lastClientSelection (Atom) [% 4d][%s]\n", lastClientSelection, NameForAtom(lastClientSelection));
fprintf(stderr, " lastClientTarget (Atom) [% 4d][%s]\n", lastClientTarget, NameForAtom(lastClientTarget));
fprintf(stderr, " lastClientTime (Time) [%u]\n", lastServerTime);
- fprintf(stderr, " lastClientReqTime (Time) [%u]\n", lastServerTime);
+ fprintf(stderr, " lastClientReqTime (Time) [%u]\n", lastServerReqTime);
fprintf(stderr, " lastClientPropertySize (unsigned long) [%lu]\n", lastClientPropertySize);
fprintf(stderr, " lastClientStage (ClientSelectionStage) [%d][%s]\n", lastClientStage, GetClientSelectionStageString(lastClientStage));
@@ -392,8 +392,6 @@ Bool nxagentValidServerTargets(Atom target)
void nxagentClearClipboard(ClientPtr pClient, WindowPtr pWindow)
{
- int i;
-
#ifdef DEBUG
fprintf(stderr, "%s: Called with client [%p] window [%p].\n", __func__,
(void *) pClient, (void *) pWindow);
@@ -405,7 +403,7 @@ void nxagentClearClipboard(ClientPtr pClient, WindowPtr pWindow)
* Only for PRIMARY and CLIPBOARD selections.
*/
- for (i = 0; i < nxagentMaxSelections; i++)
+ for (int i = 0; i < nxagentMaxSelections; i++)
{
if ((pClient != NULL && lastSelectionOwner[i].client == pClient) ||
(pWindow != NULL && lastSelectionOwner[i].windowPtr == pWindow))
@@ -1241,7 +1239,9 @@ void nxagentResetSelectionOwner(void)
{
XSetSelectionOwner(nxagentDisplay, lastSelectionOwner[i].selection, serverWindow, CurrentTime);
+ #ifdef DEBUG
fprintf(stderr, "%s: Reset clipboard state.\n", __func__);
+ #endif
lastSelectionOwner[i].client = NULL;
lastSelectionOwner[i].window = None;
@@ -1259,7 +1259,6 @@ void nxagentResetSelectionOwner(void)
void nxagentSetSelectionOwner(Selection *pSelection)
{
- int i;
#ifdef DEBUG
fprintf(stderr, "%s: Got called.\n", __func__);
#endif
@@ -1270,7 +1269,7 @@ void nxagentSetSelectionOwner(Selection *pSelection)
}
#ifdef DEBUG
- fprintf(stderr, "%s: Setting selection owner to window [0x%x].\n", __func__,
+ fprintf(stderr, "%s: Setting selection owner to serverwindow ([0x%x]).\n", __func__,
serverWindow);
#endif
@@ -1286,10 +1285,24 @@ void nxagentSetSelectionOwner(Selection *pSelection)
* Only for PRIMARY and CLIPBOARD selections.
*/
- for (i = 0; i < nxagentMaxSelections; i++)
+ for (int i = 0; i < nxagentMaxSelections; i++)
{
if (pSelection->selection == CurrentSelections[i].selection)
{
+ #ifdef DEBUG
+ fprintf(stderr, "%s: lastSelectionOwner.client [0x%x] -> [0x%x]\n", __func__, lastSelectionOwner[i].client, pSelection->client);
+ fprintf(stderr, "%s: lastSelectionOwner.window [0x%x] -> [0x%x]\n", __func__, lastSelectionOwner[i].window, pSelection->window);
+ fprintf(stderr, "%s: lastSelectionOwner.windowPtr [0x%x] -> [0x%x] [0x%x] (serverWindow: [0x%x])\n", __func__, lastSelectionOwner[i].windowPtr, pSelection->pWin, nxagentWindow(pSelection->pWin), serverWindow);
+ fprintf(stderr, "%s: lastSelectionOwner.lastTimeChanged [%d]\n", __func__, lastSelectionOwner[i].lastTimeChanged);
+ #endif
+
+ /*
+ * inform the real X server that our serverWindow is the
+ * clipboard owner. The real owner window (inside nxagent) is
+ * stored in lastSelectionOwner.window.
+ * lastSelectionOwner.windowPtr points to the struct that
+ * contains all information about the owner window
+ */
XSetSelectionOwner(nxagentDisplay, lastSelectionOwner[i].selection, serverWindow, CurrentTime);
lastSelectionOwner[i].client = pSelection->client;