From 249e4321c67e9c3d9a4b6b0ee4ea80ef9ea7f63b Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Mon, 5 Aug 2019 17:54:55 +0200 Subject: Clipboard.c: introduce nxagentInitSelectionOwner --- nx-X11/programs/Xserver/hw/nxagent/Clipboard.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'nx-X11') diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c index 7d6b9ae2b..9ec160650 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c @@ -1678,6 +1678,15 @@ WindowPtr nxagentGetClipboardWindow(Atom property) } } +void nxagentInitSelectionOwner(SelectionOwner *owner, Atom selection) +{ + owner->selection = selection; + owner->client = NullClient; + owner->window = screenInfo.screens[0]->root->drawable.id; + owner->windowPtr = NULL; + owner->lastTimeChanged = GetTimeInMillis(); +} + int nxagentInitClipboard(WindowPtr pWin) { Window iWindow = nxagentWindow(pWin); @@ -1697,17 +1706,8 @@ int nxagentInitClipboard(WindowPtr pWin) serverTIMESTAMP = nxagentAtoms[11]; /* TIMESTAMP */ - lastSelectionOwner[nxagentPrimarySelection].selection = XA_PRIMARY; - lastSelectionOwner[nxagentPrimarySelection].client = NullClient; - lastSelectionOwner[nxagentPrimarySelection].window = screenInfo.screens[0]->root->drawable.id; - lastSelectionOwner[nxagentPrimarySelection].windowPtr = NULL; - lastSelectionOwner[nxagentPrimarySelection].lastTimeChanged = GetTimeInMillis(); - - lastSelectionOwner[nxagentClipboardSelection].selection = nxagentAtoms[10]; /* CLIPBOARD */ - lastSelectionOwner[nxagentClipboardSelection].client = NullClient; - lastSelectionOwner[nxagentClipboardSelection].window = screenInfo.screens[0]->root->drawable.id; - lastSelectionOwner[nxagentClipboardSelection].windowPtr = NULL; - lastSelectionOwner[nxagentClipboardSelection].lastTimeChanged = GetTimeInMillis(); + nxagentInitSelectionOwner(&lastSelectionOwner[nxagentPrimarySelection], XA_PRIMARY); + nxagentInitSelectionOwner(&lastSelectionOwner[nxagentClipboardSelection], nxagentAtoms[10]); /* CLIPBOARD */ #ifdef NXAGENT_TIMESTAMP { -- cgit v1.2.3