* 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
This commit is contained in:
Georg Baum 2007-01-04 15:36:29 +00:00
parent f04eabb1cd
commit 2f66789cc8

View File

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