diff options
Diffstat (limited to 'unix/tx')
-rw-r--r-- | unix/tx/TXWindow.cxx | 13 | ||||
-rw-r--r-- | unix/tx/TXWindow.h | 3 |
2 files changed, 10 insertions, 6 deletions
diff --git a/unix/tx/TXWindow.cxx b/unix/tx/TXWindow.cxx index 343b9c28..b6a29d67 100644 --- a/unix/tx/TXWindow.cxx +++ b/unix/tx/TXWindow.cxx @@ -36,7 +36,7 @@ std::list<TXWindow*> windows; Atom wmProtocols, wmDeleteWindow, wmTakeFocus; Atom xaTIMESTAMP, xaTARGETS, xaSELECTION_TIME, xaSELECTION_STRING; -Atom xaCLIPBOARD; +Atom xaCLIPBOARD, xaUTF8_STRING, xaINCR; unsigned long TXWindow::black, TXWindow::white; unsigned long TXWindow::defaultFg, TXWindow::defaultBg; unsigned long TXWindow::lightBg, TXWindow::darkBg; @@ -65,6 +65,8 @@ void TXWindow::init(Display* dpy, const char* defaultWindowClass_) xaSELECTION_TIME = XInternAtom(dpy, "SELECTION_TIME", False); xaSELECTION_STRING = XInternAtom(dpy, "SELECTION_STRING", False); xaCLIPBOARD = XInternAtom(dpy, "CLIPBOARD", False); + xaUTF8_STRING = XInternAtom(dpy, "UTF8_STRING", False); + xaINCR = XInternAtom(dpy, "INCR", False); XColor cols[6]; cols[0].red = cols[0].green = cols[0].blue = 0x0000; cols[1].red = cols[1].green = cols[1].blue = 0xbbbb; @@ -464,17 +466,18 @@ void TXWindow::handleXEvent(XEvent* ev) } else { se.property = ev->xselectionrequest.property; if (se.target == xaTARGETS) { - Atom targets[2]; + Atom targets[3]; targets[0] = xaTIMESTAMP; targets[1] = XA_STRING; + targets[2] = xaUTF8_STRING; XChangeProperty(dpy, se.requestor, se.property, XA_ATOM, 32, - PropModeReplace, (unsigned char*)targets, 2); + PropModeReplace, (unsigned char*)targets, 3); } else if (se.target == xaTIMESTAMP) { Time t = selectionOwnTime[se.selection]; XChangeProperty(dpy, se.requestor, se.property, XA_INTEGER, 32, PropModeReplace, (unsigned char*)&t, 1); - } else if (se.target == XA_STRING) { - if (!selectionRequest(se.requestor, se.selection, se.property)) + } else if (se.target == XA_STRING || se.target == xaUTF8_STRING) { + if (!selectionRequest(se.requestor, se.selection, se.target, se.property)) se.property = None; } else { se.property = None; diff --git a/unix/tx/TXWindow.h b/unix/tx/TXWindow.h index 9f2a30cb..3141011b 100644 --- a/unix/tx/TXWindow.h +++ b/unix/tx/TXWindow.h @@ -157,6 +157,7 @@ public: // returning true if successful, false otherwise. virtual bool selectionRequest(Window /*requestor*/, Atom /*selection*/, + Atom /*target*/, Atom /*property*/) { return false;} // Static methods @@ -226,6 +227,6 @@ private: extern Atom wmProtocols, wmDeleteWindow, wmTakeFocus; extern Atom xaTIMESTAMP, xaTARGETS, xaSELECTION_TIME, xaSELECTION_STRING; -extern Atom xaCLIPBOARD; +extern Atom xaCLIPBOARD, xaUTF8_STRING, xaINCR; #endif |