summaryrefslogtreecommitdiffstats
path: root/src/kernel/qeventloop_x11_glib.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/qeventloop_x11_glib.cpp')
-rw-r--r--src/kernel/qeventloop_x11_glib.cpp74
1 files changed, 40 insertions, 34 deletions
diff --git a/src/kernel/qeventloop_x11_glib.cpp b/src/kernel/qeventloop_x11_glib.cpp
index bb702b821..1e457b51f 100644
--- a/src/kernel/qeventloop_x11_glib.cpp
+++ b/src/kernel/qeventloop_x11_glib.cpp
@@ -54,6 +54,8 @@
#include <glib.h>
+// #define DEBUG_QT_GLIBMAINLOOP 1
+
// TQt-GSource Structure and Callbacks
typedef struct {
@@ -249,7 +251,7 @@ bool TQEventLoop::processEvents( ProcessEventsFlags flags )
d->pev_flags = flags;
- rval = g_main_context_iteration(NULL, flags & WaitForMore ? TRUE : FALSE);
+ rval = g_main_context_iteration(NULL, flags & WaitForMore ? TRUE : FALSE);
d->pev_flags = save_flags;
@@ -288,38 +290,38 @@ bool TQEventLoop::processX11Events()
XNextEvent( TQPaintDevice::x11AppDisplay(), &event );
if ( flags & ExcludeUserInput ) {
- switch ( event.type ) {
- case ButtonPress:
- case ButtonRelease:
- case MotionNotify:
- case XKeyPress:
- case XKeyRelease:
- case EnterNotify:
- case LeaveNotify:
- continue;
-
- case ClientMessage:
- {
- // from qapplication_x11.cpp
- extern Atom tqt_wm_protocols;
- extern Atom tqt_wm_take_focus;
- extern Atom qt_qt_scrolldone;
-
- // only keep the wm_take_focus and
- // qt_qt_scrolldone protocols, discard all
- // other client messages
- if ( event.xclient.format != 32 )
+ switch ( event.type ) {
+ case ButtonPress:
+ case ButtonRelease:
+ case MotionNotify:
+ case XKeyPress:
+ case XKeyRelease:
+ case EnterNotify:
+ case LeaveNotify:
continue;
-
- if ( event.xclient.message_type == tqt_wm_protocols ||
- (Atom) event.xclient.data.l[0] == tqt_wm_take_focus )
- break;
- if ( event.xclient.message_type == qt_qt_scrolldone )
- break;
+
+ case ClientMessage:
+ {
+ // from qapplication_x11.cpp
+ extern Atom tqt_wm_protocols;
+ extern Atom tqt_wm_take_focus;
+ extern Atom qt_qt_scrolldone;
+
+ // only keep the wm_take_focus and
+ // qt_qt_scrolldone protocols, discard all
+ // other client messages
+ if ( event.xclient.format != 32 )
+ continue;
+
+ if ( event.xclient.message_type == tqt_wm_protocols ||
+ (Atom) event.xclient.data.l[0] == tqt_wm_take_focus )
+ break;
+ if ( event.xclient.message_type == qt_qt_scrolldone )
+ break;
+ }
+
+ default: break;
}
-
- default: break;
- }
}
nevents++;
@@ -333,7 +335,7 @@ bool TQEventLoop::processX11Events()
if ( d->shortcut ) {
return FALSE;
}
-
+
TQApplication::sendPostedEvents();
const uint exclude_all = ExcludeSocketNotifiers | 0x08;
@@ -595,12 +597,16 @@ bool TQEventLoop::gsourceDispatch(GSource *gs) {
// color approx. optimization - only on X11
qt_reset_color_avail();
+#if defined(QT_THREAD_SUPPORT)
+ locker.mutex()->unlock();
+#endif
processX11Events();
}
-
+ else {
#if defined(QT_THREAD_SUPPORT)
- locker.mutex()->unlock();
+ locker.mutex()->unlock();
#endif
+ }
if (d->singletoolkit) {
return TRUE; // Eat the event