mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Prevent multiple redundant repaint messages from filling up the event queue leading to browser hangs under certain race conditions. b=565323 r=josh
This commit is contained in:
parent
59f7614d8b
commit
7a627faaff
@ -147,6 +147,7 @@ extern "C" long TSMProcessRawKeyEvent(EventRef carbonEvent);
|
||||
// rects that were invalidated during a draw, so have pending drawing
|
||||
NSMutableArray* mPendingDirtyRects;
|
||||
BOOL mPendingFullDisplay;
|
||||
BOOL mPendingDisplay;
|
||||
|
||||
// Holds our drag service across multiple drag calls. The reference to the
|
||||
// service is obtained when the mouse enters the view and is released when
|
||||
|
@ -2191,6 +2191,7 @@ NSEvent* gLastDragMouseDownEvent = nil;
|
||||
mKeyDownHandled = PR_FALSE;
|
||||
mKeyPressHandled = NO;
|
||||
mKeyPressSent = NO;
|
||||
mPendingDisplay = NO;
|
||||
|
||||
// initialization for NSTextInput
|
||||
mMarkedRange.location = NSNotFound;
|
||||
@ -2349,7 +2350,10 @@ NSEvent* gLastDragMouseDownEvent = nil;
|
||||
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
|
||||
|
||||
mPendingFullDisplay = YES;
|
||||
[self performSelector:@selector(processPendingRedraws) withObject:nil afterDelay:0];
|
||||
if (!mPendingDisplay) {
|
||||
[self performSelector:@selector(processPendingRedraws) withObject:nil afterDelay:0];
|
||||
mPendingDisplay = YES;
|
||||
}
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
@ -2361,7 +2365,10 @@ NSEvent* gLastDragMouseDownEvent = nil;
|
||||
if (!mPendingDirtyRects)
|
||||
mPendingDirtyRects = [[NSMutableArray alloc] initWithCapacity:1];
|
||||
[mPendingDirtyRects addObject:[NSValue valueWithRect:invalidRect]];
|
||||
[self performSelector:@selector(processPendingRedraws) withObject:nil afterDelay:0];
|
||||
if (!mPendingDisplay) {
|
||||
[self performSelector:@selector(processPendingRedraws) withObject:nil afterDelay:0];
|
||||
mPendingDisplay = YES;
|
||||
}
|
||||
|
||||
NS_OBJC_END_TRY_ABORT_BLOCK;
|
||||
}
|
||||
@ -2374,13 +2381,14 @@ NSEvent* gLastDragMouseDownEvent = nil;
|
||||
if (mPendingFullDisplay) {
|
||||
[self setNeedsDisplay:YES];
|
||||
}
|
||||
else {
|
||||
else if (mPendingDirtyRects) {
|
||||
unsigned int count = [mPendingDirtyRects count];
|
||||
for (unsigned int i = 0; i < count; ++i) {
|
||||
[self setNeedsDisplayInRect:[[mPendingDirtyRects objectAtIndex:i] rectValue]];
|
||||
}
|
||||
}
|
||||
mPendingFullDisplay = NO;
|
||||
mPendingDisplay = NO;
|
||||
[mPendingDirtyRects release];
|
||||
mPendingDirtyRects = nil;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user