[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: x-display-list on the Mac
From: |
YAMAMOTO Mitsuharu |
Subject: |
Re: x-display-list on the Mac |
Date: |
Sat, 24 Mar 2007 19:21:19 +0900 |
User-agent: |
Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (Shijō) APEL/10.6 Emacs/22.0.96 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI) |
>>>>> On Sat, 24 Mar 2007 10:10:38 +0100, Jan Djärv <address@hidden> said:
>> The concept of "screen" in X11 is different from what you are
>> thinking about. One window cannot span multiple "screen"s. I
>> guess you are thinking about a "framebuffer" in Xinerama extension.
> The build he had done was --without-x.
I meant that we should not assign a different meaning to "screen" in
the Carbon port while there is a counterpart in X11.
>> No. Because there is no Xinerama support in the X11 version, Emacs
>> doesn't have a concept to distinguish multiple framebuffers yet.
> Right, but if you have one X11 screen on two monitors, it should
> return the total width. This seems to not be the case when
> compiling for native OSX.
OK, how about this? x-display-mm-{width,height} are changed so as to
keep the dpi values of the main display.
YAMAMOTO Mitsuharu
address@hidden
Index: src/macfns.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/macfns.c,v
retrieving revision 1.104
diff -c -p -r1.104 macfns.c
*** src/macfns.c 11 Mar 2007 06:19:29 -0000 1.104
--- src/macfns.c 24 Mar 2007 10:10:05 -0000
*************** If omitted or nil, that stands for the s
*** 3113,3124 ****
#endif
{
CGSize size;
BLOCK_INPUT;
size = CGDisplayScreenSize (kCGDirectMainDisplay);
UNBLOCK_INPUT;
! return make_number ((int) (size.height + .5f));
}
#if MAC_OS_X_VERSION_MIN_REQUIRED == 1020
else
--- 3113,3126 ----
#endif
{
CGSize size;
+ size_t height;
BLOCK_INPUT;
size = CGDisplayScreenSize (kCGDirectMainDisplay);
+ height = CGDisplayPixelsHigh (kCGDirectMainDisplay);
UNBLOCK_INPUT;
! return make_number ((int) (size.height * dpyinfo->height / height +
.5f));
}
#if MAC_OS_X_VERSION_MIN_REQUIRED == 1020
else
*************** If omitted or nil, that stands for the s
*** 3149,3160 ****
#endif
{
CGSize size;
BLOCK_INPUT;
size = CGDisplayScreenSize (kCGDirectMainDisplay);
UNBLOCK_INPUT;
! return make_number ((int) (size.width + .5f));
}
#if MAC_OS_X_VERSION_MIN_REQUIRED == 1020
else
--- 3151,3164 ----
#endif
{
CGSize size;
+ size_t width;
BLOCK_INPUT;
size = CGDisplayScreenSize (kCGDirectMainDisplay);
+ width = CGDisplayPixelsWide (kCGDirectMainDisplay);
UNBLOCK_INPUT;
! return make_number ((int) (size.width * dpyinfo->width / width + .5f));
}
#if MAC_OS_X_VERSION_MIN_REQUIRED == 1020
else
Index: src/macterm.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/macterm.c,v
retrieving revision 1.211
diff -c -p -r1.211 macterm.c
*** src/macterm.c 18 Mar 2007 08:06:38 -0000 1.211
--- src/macterm.c 24 Mar 2007 10:10:06 -0000
*************** mac_initialize_display_info ()
*** 11538,11545 ****
but this may not be what is actually used. Mac OSX can do better. */
dpyinfo->color_p = CGDisplaySamplesPerPixel (kCGDirectMainDisplay) > 1;
dpyinfo->n_planes = CGDisplayBitsPerPixel (kCGDirectMainDisplay);
! dpyinfo->height = CGDisplayPixelsHigh (kCGDirectMainDisplay);
! dpyinfo->width = CGDisplayPixelsWide (kCGDirectMainDisplay);
#else
{
GDHandle main_device_handle = LMGetMainDevice();
--- 11538,11569 ----
but this may not be what is actually used. Mac OSX can do better. */
dpyinfo->color_p = CGDisplaySamplesPerPixel (kCGDirectMainDisplay) > 1;
dpyinfo->n_planes = CGDisplayBitsPerPixel (kCGDirectMainDisplay);
! {
! CGDisplayErr err;
! CGDisplayCount ndisps, i;
! CGDirectDisplayID *displays;
!
! err = CGGetActiveDisplayList (0, NULL, &ndisps);
! if (err == noErr)
! {
! displays = alloca (sizeof (CGDirectDisplayID) * ndisps);
! err = CGGetActiveDisplayList (ndisps, displays, &ndisps);
! }
! if (err == noErr)
! {
! CGRect rect = CGRectMake (0, 0, 0, 0);
!
! for (i = 0; i < ndisps; i++)
! rect = CGRectUnion (rect, CGDisplayBounds (displays[i]));
! dpyinfo->height = CGRectGetHeight (rect);
! dpyinfo->width = CGRectGetWidth (rect);
! }
! else
! {
! dpyinfo->height = CGDisplayPixelsHigh (kCGDirectMainDisplay);
! dpyinfo->width = CGDisplayPixelsWide (kCGDirectMainDisplay);
! }
! }
#else
{
GDHandle main_device_handle = LMGetMainDevice();