void refreshFileMonitor();
/// Notify or clear of external modification
- void fileExternallyModified(bool exists) const;
-
- /// Block notifications of external modifications
- FileMonitorBlocker blockFileMonitor() { return file_monitor_->block(); }
+ void fileExternallyModified(bool exists);
/// has been externally modified? Can be reset by the user.
mutable bool externally_modified_;
// Should probably be moved to somewhere else: BufferView? GuiView?
bool Buffer::save() const
{
- FileMonitorBlocker block = d->blockFileMonitor();
docstring const file = makeDisplayPath(absFileName(), 20);
d->filename.refresh();
}
-void Buffer::Impl::fileExternallyModified(bool const exists) const
+void Buffer::Impl::fileExternallyModified(bool const exists)
{
- // prevent false positives, because FileMonitorBlocker is not enough on
- // OSX.
+ // ignore notifications after our own saving operations
if (checksum_ == filename.checksum()) {
LYXERR(Debug::FILES, "External modification but "
"checksum unchanged: " << filename);
// location, then the externally modified warning will appear then.
if (exists)
externally_modified_ = true;
- if (wa_)
+ // Update external modification notification.
+ // Dirty buffers must be visible at all times.
+ if (wa_ && wa_->unhide(owner_))
wa_->updateTitles();
+ else
+ // Unable to unhide the buffer (e.g. no GUI or not current View)
+ lyx_clean = true;
}