From kde-commits Fri Feb 04 20:25:22 2005 From: Esben Mose Hansen Date: Fri, 04 Feb 2005 20:25:22 +0000 To: kde-commits Subject: kdebase/klipper Message-Id: <20050204202522.8D0C41D017 () office ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=110754936508903 CVS commit by esben: This is a workaround for a (x)emacs bug. The problem is that XEmacs freezes if asked to copy >=262041 bytes. Thats just under 256, so I suspect a char[256*1024] inside XEmacs. To make matters worse, XEmacs always respond none to the XConvertSelection with Atom("TIMESTAMP"). Which causes Klipper to poll XEmacs every 1000ms, each time causing QT to wait for 5s before timing out. In other words, Klipper is out for the count until the user presses ctrl-G This fix request the TARGETS property instead, which seem better supported. M +5 -5 clipboardpoll.cpp 1.12 M +2 -2 clipboardpoll.h 1.7 --- kdebase/klipper/clipboardpoll.cpp #1.11:1.12 @@ -61,5 +61,5 @@ ClipboardPoll::ClipboardPoll( QWidget* p "_QT_CLIPBOARD_SENTINEL", "CLIPBOARD", - "TIMESTAMP", + "TARGETS", "KLIPPER_SELECTION_TIMESTAMP", "KLIPPER_CLIPBOARD_TIMESTAMP" }; @@ -69,5 +69,5 @@ ClipboardPoll::ClipboardPoll( QWidget* p clipboard.sentinel_atom = atoms[ 1 ]; xa_clipboard = atoms[ 2 ]; - xa_timestamp = atoms[ 3 ]; + xa_targets = atoms[ 3 ]; selection.timestamp_atom = atoms[ 4 ]; clipboard.timestamp_atom = atoms[ 5 ]; @@ -80,5 +80,5 @@ ClipboardPoll::ClipboardPoll( QWidget* p #endif clipboard.last_owner = XGetSelectionOwner( qt_xdisplay(), xa_clipboard ); -#ifdef NOISY_KLIPPER +#ifdef NOISY_KLIPPER_ kdDebug() << "(2) Setting last_owner for =" << "clipboard" << ":" << clipboard.last_owner << endl; #endif @@ -197,5 +197,5 @@ bool ClipboardPoll::checkTimestamp( Sele } XDeleteProperty( qt_xdisplay(), winId(), data.timestamp_atom ); - XConvertSelection( qt_xdisplay(), data.atom, xa_timestamp, data.timestamp_atom, winId(), qt_x_time ); + XConvertSelection( qt_xdisplay(), data.atom, xa_targets, data.timestamp_atom, winId(), qt_x_time ); data.waiting_for_timestamp = true; data.waiting_x_time = qt_x_time; @@ -249,5 +249,5 @@ bool ClipboardPoll::changedTimestamp( Se if( timestamp != data.last_change || timestamp == CurrentTime ) { -#ifdef NOISY_KLIPPER +#ifdef NOISY_KLIPPER_ kdDebug() << "TIMESTAMP CHANGE:" << ( data.atom == XA_PRIMARY ) << endl; #endif --- kdebase/klipper/clipboardpoll.h #1.6:1.7 @@ -57,5 +57,5 @@ class ClipboardPoll SelectionData clipboard; Atom xa_clipboard; - Atom xa_timestamp; + Atom xa_targets; };