--- emacs-23.0.0_NS-9.0rc3/src/nsfns.m	2007-11-18 22:45:33.000000000 +0300
+++ emacs/src/nsfns.m	2007-12-03 10:33:08.000000000 +0300
@@ -2378,6 +2370,31 @@
   return make_number ((int) [ns_get_screen(display) frame].size.height);
 }
 
+DEFUN ("x-display-usable-bounds", Fns_display_usable_bounds, Sns_display_usable_bounds,
+       0, 1, 0,
+       "Returns a list of integers in form (left top width height) describing the \
+usable screen area excluding reserved areas such as the Mac menu and doc, or \
+the Windows task bar.\n                        \
+The optional argument DISPLAY specifies which display to ask about.\n\
+DISPLAY should be either a frame, a display name (a string), or terminal ID.\n\
+If omitted or nil, that stands for the selected frame's display.")
+     (display)
+     Lisp_Object display;
+{
+  int top;
+  NSRect vScreen;
+
+  check_ns();
+  vScreen = [ns_get_screen(display) visibleFrame];
+  top = vScreen.origin.y == 0.0 ?
+    (int) [ns_get_screen(display) frame].size.height - vScreen.size.height : 0;
+
+  return list4 (make_number ((int) vScreen.origin.x),
+                make_number (top),
+                make_number ((int) vScreen.size.width),
+                make_number ((int) vScreen.size.height));
+}
+
 
 DEFUN ("x-display-planes", Fx_display_planes, Sns_display_planes,
        0, 1, 0,
@@ -2611,6 +2628,7 @@
   defsubr (&Sns_server_version);
   defsubr (&Sns_display_pixel_width);
   defsubr (&Sns_display_pixel_height);
+  defsubr (&Sns_display_usable_bounds);
   defsubr (&Sns_display_mm_width);
   defsubr (&Sns_display_mm_height);
   defsubr (&Sns_display_screens);
