* 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())
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