From e6176ffc020b888f49a1326e2e8bcec5a6b4901a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20L=C3=BCbking?= Date: Sun, 17 May 2015 22:13:25 +0200 Subject: [PATCH] fix CM reselection only return early if we cannot create a selectionwatcher, otherwise the claiming code turns unreachable after the creation of cm_selection BUG: 347813 REVIEW: 123826 --- composite.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/composite.cpp b/composite.cpp index a62ab3033d..bafa9613d3 100644 --- a/composite.cpp +++ b/composite.cpp @@ -289,10 +289,11 @@ void Compositor::claimCompositorSelection() sprintf(selection_name, "_NET_WM_CM_S%d", Application::x11ScreenNumber()); cm_selection = new CompositorSelectionOwner(selection_name); connect(cm_selection, SIGNAL(lostOwnership()), SLOT(finish())); - } else { - // no X11 yet - return; } + + if (!cm_selection) // no X11 yet + return; + if (!cm_selection->owning) { cm_selection->claim(true); // force claiming cm_selection->owning = true;