diff --git a/src/frontends/qt4/GuiApplication.C b/src/frontends/qt4/GuiApplication.C index b2d6c6dabd..3d46f0f2ab 100644 --- a/src/frontends/qt4/GuiApplication.C +++ b/src/frontends/qt4/GuiApplication.C @@ -276,23 +276,25 @@ bool GuiApplication::x11EventFilter(XEvent * xev) if (!currentView()) return false; - BufferView * bv = currentView()->view(); - switch (xev->type) { - case SelectionRequest: + case SelectionRequest: { lyxerr[Debug::GUI] << "X requested selection." << endl; + BufferView * bv = currentView()->view(); if (bv) { lyx::docstring const sel = bv->requestSelection(); if (!sel.empty()) selection_.put(sel); } break; - case SelectionClear: + } + case SelectionClear: { lyxerr[Debug::GUI] << "Lost selection." << endl; + BufferView * bv = currentView()->view(); if (bv) bv->clearSelection(); break; } + } return false; } #endif