Commit 2b59a199 authored by Ulrich Sibiller's avatar Ulrich Sibiller Committed by Mike Gabriel

Clipboard.c: simplify nxagentSetSelectionOwner

We do not need to loop over all selections. We have a helper for that.
parent 15ef7087
......@@ -1622,14 +1622,8 @@ void nxagentSetSelectionOwner(Selection *pSelection)
}
#endif
/*
* Only for PRIMARY and CLIPBOARD selections.
*/
for (int i = 0; i < nxagentMaxSelections; i++)
{
/* FIXME: using CurrentSelections with the index limited my MaxSelections looks wrong */
if (pSelection->selection == CurrentSelections[i].selection)
int i = nxagentFindCurrentSelectionIndex(pSelection->selection);
if (i < NumCurrentSelections)
{
#ifdef DEBUG
fprintf(stderr, "%s: lastSelectionOwner.client [%p] index [%d] -> [%p] index [%d]\n", __func__,
......@@ -1658,7 +1652,6 @@ void nxagentSetSelectionOwner(Selection *pSelection)
*/
nxagentStoreSelectionOwner(i, pSelection);
}
}
lastClientWindowPtr = NULL;
SetClientSelectionStage(None);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment