mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-03 08:28:25 +00:00
Fix bug #6606: Crash when reverting a document with a not available document class.
If the document class is not available, we now issue a warning for the user. This triggers a focusInEvent of the WorkArea and the cursor is issued to start blinking. However, when reverting a document the cursor is probably invalid and there has been no chance yet to fix it as we are still reading the file. The solution is to not show the cursor when the view is still busy. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34590 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
acbfa35458
commit
8bbd8bc44c
@ -1011,8 +1011,15 @@ bool GuiView::focusNextPrevChild(bool /*next*/)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool GuiView::busy()
|
||||||
|
{
|
||||||
|
return busy_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void GuiView::setBusy(bool busy)
|
void GuiView::setBusy(bool busy)
|
||||||
{
|
{
|
||||||
|
busy_ = busy;
|
||||||
if (d.current_work_area_) {
|
if (d.current_work_area_) {
|
||||||
d.current_work_area_->setUpdatesEnabled(!busy);
|
d.current_work_area_->setUpdatesEnabled(!busy);
|
||||||
if (busy)
|
if (busy)
|
||||||
|
@ -73,7 +73,10 @@ public:
|
|||||||
|
|
||||||
int id() const { return id_; }
|
int id() const { return id_; }
|
||||||
|
|
||||||
|
///
|
||||||
void setBusy(bool);
|
void setBusy(bool);
|
||||||
|
/// are we busy ?
|
||||||
|
bool busy();
|
||||||
|
|
||||||
/// \name Generic accessor functions
|
/// \name Generic accessor functions
|
||||||
//@{
|
//@{
|
||||||
@ -402,6 +405,8 @@ private:
|
|||||||
|
|
||||||
/// flag to avoid two concurrent close events.
|
/// flag to avoid two concurrent close events.
|
||||||
bool closing_;
|
bool closing_;
|
||||||
|
/// if the view is busy the cursor shouldn't blink for instance.
|
||||||
|
bool busy_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace frontend
|
} // namespace frontend
|
||||||
|
@ -391,6 +391,10 @@ void GuiWorkArea::stopBlinkingCursor()
|
|||||||
|
|
||||||
void GuiWorkArea::startBlinkingCursor()
|
void GuiWorkArea::startBlinkingCursor()
|
||||||
{
|
{
|
||||||
|
// do not show the cursor if the view is busy
|
||||||
|
if (view().busy())
|
||||||
|
return;
|
||||||
|
|
||||||
Point p;
|
Point p;
|
||||||
int h = 0;
|
int h = 0;
|
||||||
buffer_view_->cursorPosAndHeight(p, h);
|
buffer_view_->cursorPosAndHeight(p, h);
|
||||||
|
Loading…
Reference in New Issue
Block a user