From 424ab2966fa922f8cad1af1cca472c11dd60c2b6 Mon Sep 17 00:00:00 2001 From: oldosfan Date: Thu, 15 Sep 2022 02:11:02 +0000 Subject: [PATCH] Also initialize primary selection on startup * xdata.c (SelectSelectionInput): If PRIMARY has an owner, notice it as well. --- xdata.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/xdata.c b/xdata.c index e9aa089..84d8f57 100644 --- a/xdata.c +++ b/xdata.c @@ -1150,15 +1150,20 @@ SelectSelectionInput (Atom selection) { int mask; - /* If SELECTION already exists, announce it as well. Use - CurrentTime (even though the ICCCM says this is a bad idea); any - XFixeSeslectionNotify event that arrives later will clear up our - (bad) view of the selection change time. */ + /* If the selection already exists, announce it to Wayland clients + as well. Use CurrentTime (even though the ICCCM says this is a + bad idea); any XFixesSelectionNotify event that arrives later + will clear up our (incorrect) view of the selection change + time. */ if (selection == CLIPBOARD && XGetSelectionOwner (compositor.display, CLIPBOARD) != None) NoticeClipboardChanged (CurrentTime); + if (selection == XA_PRIMARY + && XGetSelectionOwner (compositor.display, XA_PRIMARY) != None) + NoticePrimaryChanged (CurrentTime); + mask = XFixesSetSelectionOwnerNotifyMask; mask |= XFixesSelectionWindowDestroyNotifyMask; mask |= XFixesSelectionClientCloseNotifyMask;