mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 21:21:32 +00:00
Make primary-selection unknown when not supported
This lfun will not appear in menus anymore in macOS and Windows. Part of bug #12436.
This commit is contained in:
parent
b0983e1c5a
commit
2311f42f41
@ -3417,7 +3417,7 @@ void LyXAction::init()
|
||||
/*!
|
||||
* \var lyx::FuncCode lyx::LFUN_PRIMARY_SELECTION_PASTE
|
||||
* \li Action: Pastes the currently selected text.
|
||||
* \li Notion: Primary selection mechanism is linux-only thing.
|
||||
* \li Notion: Primary selection mechanism is X11/Wayland-only thing.
|
||||
* \li Syntax: primary-selection-paste [<ARG>]
|
||||
* \li Params: <ARG>: "paragraph" will cause pasting as one paragraph, i.e. "Join lines".
|
||||
* \endvar
|
||||
|
@ -3437,6 +3437,7 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd,
|
||||
break;
|
||||
|
||||
case LFUN_PRIMARY_SELECTION_PASTE:
|
||||
status.setUnknown(!theSelection().supported());
|
||||
enable = cur.selection() || !theSelection().empty();
|
||||
break;
|
||||
|
||||
|
@ -27,6 +27,11 @@ class Selection
|
||||
public:
|
||||
virtual ~Selection() {}
|
||||
|
||||
/**
|
||||
* Returns true if the underlying system supports mouse selection
|
||||
* (basically X11 and Wayland).
|
||||
*/
|
||||
virtual bool supported() const = 0;
|
||||
/**
|
||||
* Tell the window system whether we set or cleared our selection.
|
||||
* This is a noop on systems that don't have a selection.
|
||||
|
@ -34,6 +34,7 @@ public:
|
||||
/** Selection overloaded methods
|
||||
*/
|
||||
//@{
|
||||
bool supported() const override { return selection_supported_; }
|
||||
void haveSelection(bool own) override;
|
||||
docstring const get() const override;
|
||||
void put(docstring const & str) override;
|
||||
|
Loading…
Reference in New Issue
Block a user