]> code.delx.au - gnu-emacs/blobdiff - src/nsterm.m
* gtkutil.c: Include xsettings.h for Ftool_bar_get_system_style.
[gnu-emacs] / src / nsterm.m
index 8f3233f9fde51148ce6cc887079337c8896e7de4..7bc82e9610495254f02e6399d7898c2b61c1e1c9 100644 (file)
@@ -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);
         }
@@ -4208,8 +4173,6 @@ ns_term_shutdown (int sig)
   ns_send_appdefined (-2);
 }
 
-extern void update_window_cursor (struct window *w, int on);
-
 - (void)fd_handler: (NSTimer *) fdEntry
 /* --------------------------------------------------------------------------
      Check data waiting on file descriptors and terminate if so