- LYXERR(Debug::ACTION, "GuiSelection::empty: " << text_selection_empty_);
-
- return text_selection_empty_;
+ // Cache which is to speed up selection-status read
+ // (4 calls when open Edit menu).
+ static bool text_selection_empty;
+ if (schedule_check_) {
+ text_selection_empty = qApp->clipboard()->
+ text(QClipboard::Selection).isEmpty();
+ schedule_check_ = false;
+ }
+
+ LYXERR(Debug::SELECTION, "GuiSelection::filled: " << !text_selection_empty);
+ return text_selection_empty;