summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2010-02-18 02:21:15 -0500
committerChong Yidong <cyd@stupidchicken.com>2010-02-18 02:21:15 -0500
commitddb2d8e23516c5d2df644e72030ebf073aa3ebc0 (patch)
tree91a78558285dbf775e03dc83fffe0d7d12f5e90f /src
parent2a4f8d3d5707e6b768af02c1b970c4a7a2c3eaae (diff)
downloademacs-ddb2d8e23516c5d2df644e72030ebf073aa3ebc0.tar.gz
* nsterm.m (ns_ring_bell): Revert last change (Bug#5569).
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog4
-rw-r--r--src/nsterm.m65
2 files changed, 19 insertions, 50 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 22647f3977d..7321b63ed07 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,7 @@
+2010-02-18 Chong Yidong <cyd@stupidchicken.com>
+
+ * nsterm.m (ns_ring_bell): Revert last change (Bug#5569).
+
2010-02-18 Glenn Morris <rgm@gnu.org>
* callint.c (Finteractive): Doc fix.
diff --git a/src/nsterm.m b/src/nsterm.m
index 8f3233f9fde..a4d06f82d97 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -808,58 +808,23 @@ ns_ring_bell ()
view = FRAME_NS_VIEW (frame);
if (view != nil)
{
- /* Get the bounds of our NSView */
- NSRect viewBounds = [view bounds];
-
- /* Height of each line to flash. */
- int flash_height = FRAME_LINE_HEIGHT (frame);
- int width = FRAME_PIXEL_WIDTH (frame)
- - NS_SCROLL_BAR_WIDTH (frame);
-
- /* Get the GraphicsContext */
- CGContextRef ctxt = [[NSGraphicsContext currentContext] graphicsPort];
- CGRect lowerLine, upperLine;
- lowerLine =
- CGRectMake(viewBounds.origin.x, viewBounds.origin.y,
- width + NS_SCROLL_BAR_WIDTH(frame),
- flash_height + FRAME_INTERNAL_BORDER_WIDTH (frame));
- upperLine =
- CGRectMake(viewBounds.origin.x,
- viewBounds.origin.y + viewBounds.size.height
- - (flash_height + FRAME_INTERNAL_BORDER_WIDTH (frame)),
- width,
- flash_height + FRAME_INTERNAL_BORDER_WIDTH (frame));
-
- /* Invert the colors using a difference blend. */
- CGContextSetBlendMode(ctxt, kCGBlendModeDifference);
- CGContextSetGrayFillColor(ctxt, 1, 1);
-
- /* If window is tall, flash top and bottom line. */
- if (viewBounds.size.height > 3 * FRAME_LINE_HEIGHT (frame))
- {
- CGContextFillRect(ctxt, upperLine);
- CGContextFillRect(ctxt, lowerLine);
- }
- else
- /* If it is short, flash it all. */
- CGContextFillRect(ctxt, NSRectToCGRect([view bounds]));
-
- /* Bounce Dock icon. Maybe we can allow some configuration here. */
- [NSApp requestUserAttention: NSInformationalRequest];
-
+ NSRect r, surr;
+ NSPoint dim = NSMakePoint (128, 128);
+
+ r = [view bounds];
+ r.origin.x += (r.size.width - dim.x) / 2;
+ r.origin.y += (r.size.height - dim.y) / 2;
+ r.size.width = dim.x;
+ r.size.height = dim.y;
+ surr = NSInsetRect (r, -2, -2);
+ ns_focus (frame, &surr, 1);
+ [[view window] cacheImageInRect: [view convertRect: surr toView:nil]];
+ [ns_lookup_indexed_color (NS_FACE_FOREGROUND
+ (FRAME_DEFAULT_FACE (frame)), frame) set];
+ NSRectFill (r);
[[view window] flushWindow];
ns_timeout (150000);
-
- /* If window is tall, flash top and bottom line. */
- if (viewBounds.size.height > 3 * FRAME_LINE_HEIGHT (frame))
- {
- CGContextFillRect(ctxt, upperLine);
- CGContextFillRect(ctxt, lowerLine);
- }
- else
- /* If it is short, flash it all. */
- CGContextFillRect(ctxt, NSRectToCGRect([view bounds]));
-
+ [[view window] restoreCachedImage];
[[view window] flushWindow];
ns_unfocus (frame);
}