]> code.delx.au - gnu-emacs/commitdiff
[TARGET_API_MAC_CARBON] (mac_post_mouse_moved_event):
authorYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
Thu, 12 Apr 2007 08:12:00 +0000 (08:12 +0000)
committerYAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
Thu, 12 Apr 2007 08:12:00 +0000 (08:12 +0000)
Use GetGlobalMouse instead of GetMouse and LocalToGlobal.
(mac_initialize_display_info) [MAC_OSX]: Use CGRectZero.
(mac_initialize_display_info) [!MAC_OSX]: dpyinfo->height and
dpyinfo->width are those of whole screen.

src/ChangeLog
src/macterm.c

index cfe86dabd967190e62a418a38106bdf7f881f524..44e4f8732230d6c903c54a0014224d808e330970 100644 (file)
@@ -1,3 +1,14 @@
+2007-04-12  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
+
+       * mac.c (xrm_get_preference_database, Fmac_get_preference)
+       [TARGET_API_MAC_CARBON]: Use CFPreferencesAppSynchronize.
+
+       * macterm.c [TARGET_API_MAC_CARBON] (mac_post_mouse_moved_event):
+       Use GetGlobalMouse instead of GetMouse and LocalToGlobal.
+       (mac_initialize_display_info) [MAC_OSX]: Use CGRectZero.
+       (mac_initialize_display_info) [!MAC_OSX]: dpyinfo->height and
+       dpyinfo->width are those of whole screen.
+
 2007-04-10  Chong Yidong  <cyd@stupidchicken.com>
 
        * xdisp.c (note_mode_line_or_margin_highlight): Don't decrement
index e377d3524769e45b32077d0ec5a9f2f3fead5adf..9d190a3e4f68e59c1ca8e504febd3925b703a666 100644 (file)
@@ -10533,8 +10533,7 @@ mac_post_mouse_moved_event ()
     {
       Point mouse_pos;
 
-      GetMouse (&mouse_pos);
-      LocalToGlobal (&mouse_pos);
+      GetGlobalMouse (&mouse_pos);
       err = SetEventParameter (event, kEventParamMouseLocation, typeQDPoint,
                               sizeof (Point), &mouse_pos);
     }
@@ -11554,7 +11553,7 @@ mac_initialize_display_info ()
       }
     if (err == noErr)
       {
-       CGRect bounds = CGRectMake (0, 0, 0, 0);
+       CGRect bounds = CGRectZero;
 
        while (ndisps-- > 0)
          bounds = CGRectUnion (bounds, CGDisplayBounds (displays[ndisps]));
@@ -11569,15 +11568,21 @@ mac_initialize_display_info ()
   }
 #else
   {
-    GDHandle main_device_handle = LMGetMainDevice();
+    GDHandle gdh = GetMainDevice ();
+    Rect rect = (**gdh).gdRect;
 
-    dpyinfo->color_p = TestDeviceAttribute (main_device_handle, gdDevType);
+    dpyinfo->color_p = TestDeviceAttribute (gdh, gdDevType);
     for (dpyinfo->n_planes = 32; dpyinfo->n_planes > 0; dpyinfo->n_planes >>= 1)
-      if (HasDepth (main_device_handle, dpyinfo->n_planes,
-                   gdDevType, dpyinfo->color_p))
+      if (HasDepth (gdh, dpyinfo->n_planes, gdDevType, dpyinfo->color_p))
        break;
-    dpyinfo->height = (**main_device_handle).gdRect.bottom;
-    dpyinfo->width = (**main_device_handle).gdRect.right;
+
+    for (gdh = GetDeviceList (); gdh; gdh = GetNextDevice (gdh))
+      if (TestDeviceAttribute (gdh, screenDevice)
+         && TestDeviceAttribute (gdh, screenActive))
+       UnionRect (&rect, &(**gdh).gdRect, &rect);
+
+    dpyinfo->height = rect.bottom - rect.top;
+    dpyinfo->width = rect.right - rect.left;
   }
 #endif
   dpyinfo->grabbed = 0;