x11-libs/qt: delete old extraversions, rebase to current portage ebuilds.
[gentoo-soor-overlay.git] / x11-libs / qt / files / qt-3.3.4-qclipboard-hack.patch
blob74c60fb25588c6be07f59eff771c4f7320b9ddc2
1 qt-bugs@ issue : none, probably even won't be
2 bugs.kde.org number : 80072
3 applied: no
4 author: Lubos Lunak <l.lunak@kde.org>
6 A crude hack for KDE #80072. No good idea how to fix it properly yet :(.
8 --- src/kernel/qclipboard_x11.cpp.sav 2004-04-30 12:00:06.000000000 +0200
9 +++ src/kernel/qclipboard_x11.cpp 2004-05-09 21:18:10.269264304 +0200
10 @@ -109,6 +109,7 @@ static int pending_timer_id = 0;
11 static bool pending_clipboard_changed = FALSE;
12 static bool pending_selection_changed = FALSE;
14 +Q_EXPORT bool qt_qclipboard_bailout_hack = false;
16 // event capture mechanism for qt_xclb_wait_for_event
17 static bool waiting_for_data = FALSE;
18 @@ -453,6 +454,15 @@ static int qt_xclb_event_filter(XEvent *
19 return 0;
22 +static bool selection_request_pending = false;
24 +static Bool check_selection_request_pending( Display*, XEvent* e, XPointer )
25 + {
26 + if( e->type == SelectionRequest && e->xselectionrequest.owner == owner->winId())
27 + selection_request_pending = true;
28 + return False;
29 + }
31 bool qt_xclb_wait_for_event( Display *dpy, Window win, int type, XEvent *event,
32 int timeout )
34 @@ -504,6 +514,14 @@ bool qt_xclb_wait_for_event( Display *dp
35 do {
36 if ( XCheckTypedWindowEvent(dpy,win,type,event) )
37 return TRUE;
38 + if( qt_qclipboard_bailout_hack ) {
39 + XEvent dummy;
40 + selection_request_pending = false;
41 + if ( owner != NULL )
42 + XCheckIfEvent(dpy,&dummy,check_selection_request_pending,NULL);
43 + if( selection_request_pending )
44 + return TRUE;
45 + }
47 now = QTime::currentTime();
48 if ( started > now ) // crossed midnight