Hi,
I'm wondering if we can get a function `winmgr-display-available-pixel- 
bounds' which would display the bounds of the main display (or in  
fact, any display, if that's now possible)?

This function would use NSScreen to get the available screen area  
without the menu and without the Dock.

Knowing this is necessary whenever you want to position frames  
correctly. NOthing is more annoying than a frame that pops up  
underneath the Dock.

For reference, I'm showing the relevant patch for Carbon below.

Many thanks
- David



Index: src/macfns.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/macfns.c,v
retrieving revision 1.63
diff -c -r1.63 macfns.c
*** src/macfns.c        4 Jul 2005 16:06:33 -0000       1.63
--- src/macfns.c        17 Jul 2005 20:28:16 -0000
***************
*** 3028,3033 ****
--- 3029,3064 ----
     return make_number ((int) (dpyinfo->width * 25.4 / dpyinfo->resx));
   }

+
+
+ DEFUN ("mac-display-available-pixel-bounds",  
Fmac_display_available_pixel_bounds,  
Smac_display_available_pixel_bounds, 0, 0, 0,
+        doc: /* Get the available bounds of the main display in pixels,
+ excluding the Dock. Return a 4 element list with the bounds
+ in the form of (left top right bottom). */)
+   (void)
+ {
+   Rect rect;
+   Lisp_Object rv = Qnil;
+   GDHandle main_device_handle = LMGetMainDevice();
+   BLOCK_INPUT;
+   if (main_device_handle &&
+       GetAvailableWindowPositioningBounds(main_device_handle, &rect)
+       == noErr) {
+
+   rv =
+     Fcons( make_number (rect.left),
+          Fcons( make_number (rect.top),
+                 Fcons( make_number (rect.right),
+                        Fcons( make_number (rect.bottom), Qnil))));
+   }
+   UNBLOCK_INPUT;
+   return rv;
+
+ }
+
+
+
+
   DEFUN ("x-display-backing-store", Fx_display_backing_store,
          Sx_display_backing_store, 0, 1, 0,
          doc: /* Returns an indication of whether display DISPLAY  
does backing store.
***************
*** 4530,4535 ****
--- 4776,4783 ----
     defsubr (&Sx_synchronize);
     defsubr (&Sx_focus_frame);

+   defsubr (&Smac_display_available_pixel_bounds);
+
     /* Setting callback functions for fontset handler.  */
     get_font_info_func = x_get_font_info;
  
  

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
_______________________________________________
Emacs-app-dev- mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emacs-app-dev-

Reply via email to