mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-02 14:01:10 +00:00
* 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:
parent
f04eabb1cd
commit
2f66789cc8
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user