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) ...@@ -1622,14 +1622,8 @@ void nxagentSetSelectionOwner(Selection *pSelection)
} }
#endif #endif
/* int i = nxagentFindCurrentSelectionIndex(pSelection->selection);
* Only for PRIMARY and CLIPBOARD selections. if (i < NumCurrentSelections)
*/
for (int i = 0; i < nxagentMaxSelections; i++)
{
/* FIXME: using CurrentSelections with the index limited my MaxSelections looks wrong */
if (pSelection->selection == CurrentSelections[i].selection)
{ {
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "%s: lastSelectionOwner.client [%p] index [%d] -> [%p] index [%d]\n", __func__, fprintf(stderr, "%s: lastSelectionOwner.client [%p] index [%d] -> [%p] index [%d]\n", __func__,
...@@ -1658,7 +1652,6 @@ void nxagentSetSelectionOwner(Selection *pSelection) ...@@ -1658,7 +1652,6 @@ void nxagentSetSelectionOwner(Selection *pSelection)
*/ */
nxagentStoreSelectionOwner(i, pSelection); nxagentStoreSelectionOwner(i, pSelection);
} }
}
lastClientWindowPtr = NULL; lastClientWindowPtr = NULL;
SetClientSelectionStage(None); 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