[PATCH] qt3-win translatePaintEvent and wakeUp

Michal Mecinski <[email protected]> Mon, 16 Jan 2006 18:16:55 +0100
Newsgroups gmane.comp.kde.devel.cygwin
Message-ID <[email protected]>
Hello,

Here are two patches attached.

src/kernel/qapplication_win.cpp

Don't erase the widget's background in QETWidget::translatePaintEvent() if it 
has the WNoAutoErase flag set.

src/kernel/qeventloop_win.cpp
src/kernel/qeventloop_win_utils.cpp

Fixed QEventLoop::wakeUp() to wake the gui thread, not the current thread from 
which the function was called.

I also found a weird bug I wasn't able to fix. When a QGLWidget-derived widget 
is created as a tab of a QTabWidget, it's not visible. However it's displayed 
correctly when it's wrapped in another widget (for example a QHBox).

-- 
Regards,
Michal Mecinski (www.mimec.org)

_______________________________________________
kde-cygwin mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/kde-cygwin
application.patch (text/x-diff, 850 B)
Index: src/kernel/qapplication_win.cpp
===================================================================
RCS file: /cvsroot/qtwin/qt-3/src/kernel/Attic/qapplication_win.cpp,v
retrieving revision 1.1.2.30.2.102
diff -u -p -r1.1.2.30.2.102 qapplication_win.cpp
--- src/kernel/qapplication_win.cpp	27 Dec 2005 17:15:34 -0000	1.1.2.30.2.102
+++ src/kernel/qapplication_win.cpp	9 Jan 2006 18:07:50 -0000
@@ -2450,7 +2450,7 @@ bool QETWidget::translatePaintEvent( con
     qDebug( "painting region %d,%d-%d,%d", ps.rcPaint.top, ps.rcPaint.left, ps.rcPaint.bottom, ps.rcPaint.right );
     qDebug( "QETWidget::translatePaintEvent crect %d,%d-%d,%d", crect.left(), crect.top(), crect.right(), crect.bottom() );
 #endif
-    repaint( paintRegion );
+    repaint( paintRegion, !testWFlags( WNoAutoErase ) );
 
     EndPaint( winid, &ps );
     hdc = hdcOld;
eventloop.patch (text/x-diff, 1.6 KB)
Index: src/kernel/qeventloop_win.cpp
===================================================================
RCS file: /cvsroot/qtwin/qt-3/src/kernel/Attic/qeventloop_win.cpp,v
retrieving revision 1.1.2.10.2.25
diff -u -p -r1.1.2.10.2.25 qeventloop_win.cpp
--- src/kernel/qeventloop_win.cpp	13 Dec 2005 17:57:52 -0000	1.1.2.10.2.25
+++ src/kernel/qeventloop_win.cpp	9 Jan 2006 17:31:52 -0000
@@ -56,6 +56,8 @@ QSNDict sn_except;
 extern bool qt_is_gui_used;
 void qWinProcessConfigRequests();
 
+static DWORD qt_gui_thread_id;
+
 // from qeventloop_win_utils.cpp
 FILETIME *qt_wait_timer();
 void cleanupTimers();
@@ -183,6 +185,8 @@ static HWND qt_create_internal_window()
 
 void QEventLoop::init()
 {
+    qt_gui_thread_id = GetCurrentThreadId();
+
     qt_SocketWindow = qt_create_internal_window();
 
     sn_read.clear();
Index: src/kernel/qeventloop_win_utils.cpp
===================================================================
RCS file: /cvsroot/qtwin/qt-3/src/kernel/Attic/qeventloop_win_utils.cpp,v
retrieving revision 1.1.4.14
diff -u -p -r1.1.4.14 qeventloop_win_utils.cpp
--- src/kernel/qeventloop_win_utils.cpp	9 Jul 2005 10:16:16 -0000	1.1.4.14
+++ src/kernel/qeventloop_win_utils.cpp	9 Jan 2006 17:31:38 -0000
@@ -409,8 +409,8 @@ void QEventLoop::setSocketNotifierPendin
 void QEventLoop::wakeUp()
 {
     /* Idea from wxWidgets :) */
-    QT_WA( PostThreadMessageW( GetCurrentThreadId(), WM_NULL, 0, 0 );,
-           PostThreadMessageA( GetCurrentThreadId(), WM_NULL, 0, 0 ); )
+    QT_WA( PostThreadMessageW( qt_gui_thread_id, WM_NULL, 0, 0 );,
+           PostThreadMessageA( qt_gui_thread_id, WM_NULL, 0, 0 ); )
 }
 
 /*