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
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>
5
6 A crude hack for KDE #80072. No good idea how to fix it properly yet :(.
7
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;
13  
14 +Q_EXPORT bool qt_qclipboard_bailout_hack = false;
15  
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;
20  }
21  
22 +static bool selection_request_pending = false;
23 +
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 +    }
30 +
31  bool qt_xclb_wait_for_event( Display *dpy, Window win, int type, XEvent *event,
32                              int timeout )
33  {
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 +        }
46  
47         now = QTime::currentTime();
48         if ( started > now )                    // crossed midnight