Commit 10e1b6fd authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧 Committed by Nate Graham

xwl: No need to delete the source immediately

Prefer replacing then deleting the selection to the other way around.
This way less events need to be reported and the clipboard manager
doesn't get confused.

(cherry picked from commit 4150c1f0)
parent 7bfb9add
......@@ -167,9 +167,11 @@ void Selection::registerXfixes()
void Selection::setWlSource(WlSource *source)
{
delete m_waylandSource;
if (m_waylandSource) {
m_waylandSource->deleteLater();
m_waylandSource = nullptr;
}
delete m_xSource;
m_waylandSource = nullptr;
m_xSource = nullptr;
if (source) {
m_waylandSource = source;
......@@ -179,10 +181,7 @@ void Selection::setWlSource(WlSource *source)
void Selection::createX11Source(xcb_xfixes_selection_notify_event_t *event)
{
delete m_waylandSource;
delete m_xSource;
m_waylandSource = nullptr;
m_xSource = nullptr;
setWlSource(nullptr);
if (!event || event->owner == XCB_WINDOW_NONE) {
return;
}
......
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