mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-16 13:02:49 +00:00
Fix another selection bug
* src/frontends/qt4/GuiApplication.C (GuiApplication::x11EventFilter): Only send or clear the selection if the X event specified the primary selection. Previously this was also done if the event specified the clipboard. We must ignore that, because the clipboard is completele handled by qt. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16526 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
e7a6fa7b2b
commit
e2da99d6a9
@ -46,6 +46,7 @@
|
|||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|
||||||
#ifdef Q_WS_X11
|
#ifdef Q_WS_X11
|
||||||
|
#include <X11/Xatom.h>
|
||||||
#include <X11/Xlib.h>
|
#include <X11/Xlib.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -278,16 +279,20 @@ bool GuiApplication::x11EventFilter(XEvent * xev)
|
|||||||
|
|
||||||
switch (xev->type) {
|
switch (xev->type) {
|
||||||
case SelectionRequest: {
|
case SelectionRequest: {
|
||||||
|
if (xev->xselectionrequest.selection != XA_PRIMARY)
|
||||||
|
break;
|
||||||
lyxerr[Debug::GUI] << "X requested selection." << endl;
|
lyxerr[Debug::GUI] << "X requested selection." << endl;
|
||||||
BufferView * bv = currentView()->view();
|
BufferView * bv = currentView()->view();
|
||||||
if (bv) {
|
if (bv) {
|
||||||
lyx::docstring const sel = bv->requestSelection();
|
docstring const sel = bv->requestSelection();
|
||||||
if (!sel.empty())
|
if (!sel.empty())
|
||||||
selection_.put(sel);
|
selection_.put(sel);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SelectionClear: {
|
case SelectionClear: {
|
||||||
|
if (xev->xselectionclear.selection != XA_PRIMARY)
|
||||||
|
break;
|
||||||
lyxerr[Debug::GUI] << "Lost selection." << endl;
|
lyxerr[Debug::GUI] << "Lost selection." << endl;
|
||||||
BufferView * bv = currentView()->view();
|
BufferView * bv = currentView()->view();
|
||||||
if (bv)
|
if (bv)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user