]>
Commit | Line | Data |
---|---|---|
08c7dce5 AM |
1 | diff -ur qt-everywhere-opensource-src-4.6.3/src/gui/kernel/qguieventdispatcher_glib.cpp qt-everywhere-opensource-src-4.6.3-glib_eventloop_nullcheck/src/gui/kernel/qguieventdispatcher_glib.cpp |
2 | --- qt-everywhere-opensource-src-4.6.3/src/gui/kernel/qguieventdispatcher_glib.cpp 2010-06-02 04:03:15.000000000 +0200 | |
3 | +++ qt-everywhere-opensource-src-4.6.3-glib_eventloop_nullcheck/src/gui/kernel/qguieventdispatcher_glib.cpp 2010-12-08 22:22:38.000000000 +0100 | |
4 | @@ -76,7 +76,7 @@ | |
5 | GX11EventSource *source = reinterpret_cast<GX11EventSource *>(s); | |
6 | return (XEventsQueued(X11->display, QueuedAfterFlush) | |
7 | || (!(source->flags & QEventLoop::ExcludeUserInputEvents) | |
8 | - && !source->d->queuedUserInputEvents.isEmpty())); | |
9 | + && source->d && !source->d->queuedUserInputEvents.isEmpty())); | |
10 | } | |
11 | ||
12 | static gboolean x11EventSourceCheck(GSource *s) | |
13 | @@ -84,7 +84,7 @@ | |
14 | GX11EventSource *source = reinterpret_cast<GX11EventSource *>(s); | |
15 | return (XEventsQueued(X11->display, QueuedAfterFlush) | |
16 | || (!(source->flags & QEventLoop::ExcludeUserInputEvents) | |
17 | - && !source->d->queuedUserInputEvents.isEmpty())); | |
18 | + && source->d && !source->d->queuedUserInputEvents.isEmpty())); | |
19 | } | |
20 | ||
21 | static gboolean x11EventSourceDispatch(GSource *s, GSourceFunc callback, gpointer user_data) | |
22 | @@ -95,7 +95,7 @@ | |
23 | do { | |
24 | XEvent event; | |
25 | if (!(source->flags & QEventLoop::ExcludeUserInputEvents) | |
26 | - && !source->d->queuedUserInputEvents.isEmpty()) { | |
27 | + && source->d && !source->d->queuedUserInputEvents.isEmpty()) { | |
28 | // process a pending user input event | |
29 | event = source->d->queuedUserInputEvents.takeFirst(); | |
30 | } else if (XEventsQueued(X11->display, QueuedAlready)) { | |
31 | @@ -112,7 +112,8 @@ | |
32 | case XKeyRelease: | |
33 | case EnterNotify: | |
34 | case LeaveNotify: | |
35 | - source->d->queuedUserInputEvents.append(event); | |
36 | + if (source->d) | |
37 | + source->d->queuedUserInputEvents.append(event); | |
38 | continue; | |
39 | ||
40 | case ClientMessage: | |
41 | @@ -127,7 +128,8 @@ | |
42 | break; | |
43 | } | |
44 | } | |
45 | - source->d->queuedUserInputEvents.append(event); | |
46 | + if (source->d) | |
47 | + source->d->queuedUserInputEvents.append(event); | |
48 | continue; | |
49 | ||
50 | default: | |
51 | @@ -140,7 +142,7 @@ | |
52 | } | |
53 | ||
54 | // send through event filter | |
55 | - if (source->q->filterEvent(&event)) | |
56 | + if (source->q && source->q->filterEvent(&event)) | |
57 | continue; | |
58 | ||
59 | if (qApp->x11ProcessEvent(&event) == 1) | |
60 | @@ -152,7 +154,8 @@ | |
61 | ||
62 | out: | |
63 | ||
64 | - source->d->runTimersOnceWithNormalPriority(); | |
65 | + if (source->d) | |
66 | + source->d->runTimersOnceWithNormalPriority(); | |
67 | ||
68 | if (callback) | |
69 | callback(user_data); |