]> pilppa.org Git - familiar-h63xx-build.git/blob - org.handhelds.familiar/packages/qte/qte-2.3.10/suspend-resume-hooks.patch
OE tree imported from monotone branch org.openembedded.oz354fam083 at revision 8b12e3...
[familiar-h63xx-build.git] / org.handhelds.familiar / packages / qte / qte-2.3.10 / suspend-resume-hooks.patch
1 Suspend/Resume hooks for QScreen and usage from QApplication
2 Manuel Teira <manuel.teira@telefonica.net>
3
4 #
5 # Patch managed by http://www.holgerschurig.de/patcher.html
6 #
7
8 --- qt-2.3.10/src/kernel/qgfx_qws.h~suspend-resume-hooks
9 +++ qt-2.3.10/src/kernel/qgfx_qws.h
10 @@ -192,6 +192,8 @@
11      virtual int pixmapLinestepAlignment() { return 64; }
12  
13      virtual void sync() {}
14 +    virtual void prepareToSuspend() {}
15 +    virtual void prepareToResume() {}
16      virtual bool onCard(unsigned char *) const;
17      virtual bool onCard(unsigned char *, ulong& out_offset) const;
18  
19 --- qt-2.3.10/src/kernel/qapplication_qws.cpp~suspend-resume-hooks
20 +++ qt-2.3.10/src/kernel/qapplication_qws.cpp
21 @@ -480,6 +480,7 @@
22      int region_offset_window;
23  #ifndef QT_NO_COP
24      QWSQCopMessageEvent *qcop_response;
25 +    bool manageAPMMessage( QWSQCopMessageEvent *e );
26  #endif
27      QWSEvent* current_event;
28      QValueList<int> unused_identifiers;
29 @@ -840,7 +841,7 @@
30             QWSQCopMessageEvent *pe = (QWSQCopMessageEvent*)e;
31             if ( pe->simpleData.is_response ) {
32                 qcop_response = pe;
33 -           } else {
34 +           } else if ( !manageAPMMessage( pe ) ) {
35                 queue.append(e);
36             }
37  #endif
38 @@ -851,6 +852,26 @@
39      }
40  }
41  
42 +#ifndef QT_NO_COP
43 +bool QWSDisplayData::manageAPMMessage( QWSQCopMessageEvent *e )
44 +{
45 +    if ( e->channel.data() != QCString( "QPE/System" ) ) {
46 +       return FALSE;
47 +    }
48 +    if ( e->message.data() == QCString( "aboutToSuspend()" ) ) {
49 +       if ( qt_screen ) qt_screen->prepareToSuspend();
50 +       delete e;
51 +       return TRUE;
52 +    }
53 +    if ( e->message.data() == QCString( "returnFromSuspend()" ) ) {
54 +       if ( qt_screen ) qt_screen->prepareToResume();
55 +       delete e;
56 +       return TRUE;
57 +    }
58 +    return FALSE;
59 +}
60 +#endif
61 +
62  void QWSDisplayData::offsetPendingExpose( int window, const QPoint &offset )
63  {
64      if ( offset.isNull() )