From 2f66789cc8cbc4ad80d3af2bd0129b435e7f97f2 Mon Sep 17 00:00:00 2001 From: Georg Baum Date: Thu, 4 Jan 2007 15:36:29 +0000 Subject: [PATCH] * src/frontends/qt4/GuiApplication.C (GuiApplication::x11EventFilter): Small optimization: Do not request the current BufferView if it is not used git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16506 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiApplication.C | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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