diff options
| author | Jason Rumney | 2007-09-14 23:28:37 +0000 |
|---|---|---|
| committer | Jason Rumney | 2007-09-14 23:28:37 +0000 |
| commit | b668cc18b59c232b319d38f613f095646c6029c4 (patch) | |
| tree | 43ddc049cdcb27d98a7c7470754a1d5da2867f4e /src | |
| parent | 5c2c9c79dc64e2a2074b1fe7690525e3a832fa1e (diff) | |
| download | emacs-b668cc18b59c232b319d38f613f095646c6029c4.tar.gz emacs-b668cc18b59c232b319d38f613f095646c6029c4.zip | |
(get_next_msg): Consolidate WM_PAINT messages.
Diffstat (limited to 'src')
| -rw-r--r-- | src/w32xfns.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/w32xfns.c b/src/w32xfns.c index 9d50676f921..8c87fde3ef9 100644 --- a/src/w32xfns.c +++ b/src/w32xfns.c | |||
| @@ -192,6 +192,47 @@ get_next_msg (lpmsg, bWait) | |||
| 192 | } | 192 | } |
| 193 | 193 | ||
| 194 | nQueue--; | 194 | nQueue--; |
| 195 | /* Consolidate WM_PAINT messages to optimise redrawing. */ | ||
| 196 | if (lpmsg->msg.message == WM_PAINT && nQueue) | ||
| 197 | { | ||
| 198 | int_msg * lpCur = lpHead; | ||
| 199 | int_msg * lpPrev = NULL; | ||
| 200 | int_msg * lpNext = NULL; | ||
| 201 | |||
| 202 | while (lpCur && nQueue) | ||
| 203 | { | ||
| 204 | lpNext = lpCur->lpNext; | ||
| 205 | if (lpCur->w32msg.msg.message == WM_PAINT) | ||
| 206 | { | ||
| 207 | /* Remove this message from the queue. */ | ||
| 208 | if (lpPrev) | ||
| 209 | lpPrev->lpNext = lpNext; | ||
| 210 | else | ||
| 211 | lpHead = lpNext; | ||
| 212 | |||
| 213 | if (lpCur == lpTail) | ||
| 214 | lpTail = lpPrev; | ||
| 215 | |||
| 216 | /* Adjust clip rectangle to cover both. */ | ||
| 217 | if (!UnionRect (&(lpmsg->rect), &(lpmsg->rect), | ||
| 218 | &(lpCur->w32msg.rect))) | ||
| 219 | { | ||
| 220 | SetRectEmpty(&(lpmsg->rect)); | ||
| 221 | } | ||
| 222 | |||
| 223 | myfree (lpCur); | ||
| 224 | |||
| 225 | nQueue--; | ||
| 226 | |||
| 227 | lpCur = lpNext; | ||
| 228 | } | ||
| 229 | else | ||
| 230 | { | ||
| 231 | lpPrev = lpCur; | ||
| 232 | lpCur = lpNext; | ||
| 233 | } | ||
| 234 | } | ||
| 235 | } | ||
| 195 | 236 | ||
| 196 | bRet = TRUE; | 237 | bRet = TRUE; |
| 197 | } | 238 | } |