- /**
- * Is the selection empty?
- * Only used on systems that don't support a real selection to
- * reflect the status of the internal selection of LyX.
- * This is needed to emulate the X selection as far as possible.
- */
- bool empty_;
+ // Direct call clipboard()->text(QClipboard::Selection) inside onDataChanged causes
+ // selection to be obtained. Now imagine the some LyX instance A, when making selection -
+ // each change triggers onDataChange in all others instances for each mouse
+ // or keyboard move. This in turn causes many calls of requestSelection in A
+ // which interferes with the selecting itself. As a result middle button pasting
+ // for more instances don't work and debugging is a hell. So we just schedule
+ // obtaining of selection on the time empty() is actually called.
+ mutable bool schedule_check_;
+ bool const selection_supported_;