emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/macterm.c [lexbind]


From: Miles Bader
Subject: [Emacs-diffs] Changes to emacs/src/macterm.c [lexbind]
Date: Tue, 06 Jul 2004 06:58:56 -0400

Index: emacs/src/macterm.c
diff -c emacs/src/macterm.c:1.3.2.15 emacs/src/macterm.c:1.3.2.16
*** emacs/src/macterm.c:1.3.2.15        Tue Jul  6 10:17:21 2004
--- emacs/src/macterm.c Tue Jul  6 10:23:40 2004
***************
*** 7018,7024 ****
    int result = 0;
    if (!NILP (Vmac_emulate_three_button_mouse)) {
      int cmdIs3 = !EQ (Vmac_emulate_three_button_mouse, Qreverse);
!     if (modifiers & controlKey)
        result = cmdIs3 ? 2 : 1;
      else if (modifiers & optionKey)
        result = cmdIs3 ? 1 : 2;
--- 7018,7024 ----
    int result = 0;
    if (!NILP (Vmac_emulate_three_button_mouse)) {
      int cmdIs3 = !EQ (Vmac_emulate_three_button_mouse, Qreverse);
!     if (modifiers & cmdKey)
        result = cmdIs3 ? 2 : 1;
      else if (modifiers & optionKey)
        result = cmdIs3 ? 1 : 2;
***************
*** 7038,7044 ****
    if (!NILP (Vmac_emulate_three_button_mouse) &&
        GetEventClass(eventRef) == kEventClassMouse)
      {
!       mods &= ~(optionKey & cmdKey);
      }
    return mac_to_emacs_modifiers (mods);
  }
--- 7038,7044 ----
    if (!NILP (Vmac_emulate_three_button_mouse) &&
        GetEventClass(eventRef) == kEventClassMouse)
      {
!       mods &= ~(optionKey | cmdKey);
      }
    return mac_to_emacs_modifiers (mods);
  }
***************
*** 7237,7276 ****
  }
  
  static void
- do_window_activate (WindowPtr win)
- {
-   struct frame *f;
- 
-   if (is_emacs_window (win))
-     {
-       f = mac_window_to_frame (win);
- 
-       if (f)
-       {
-         x_new_focus_frame (FRAME_MAC_DISPLAY_INFO (f), f);
-         activate_scroll_bars (f);
-       }
-     }
- }
- 
- static void
- do_window_deactivate (WindowPtr win)
- {
-   struct frame *f;
- 
-   if (is_emacs_window (win))
-     {
-       f = mac_window_to_frame (win);
- 
-       if (f == FRAME_MAC_DISPLAY_INFO (f)->x_focus_frame)
-       {
-         x_new_focus_frame (FRAME_MAC_DISPLAY_INFO (f), 0);
-         deactivate_scroll_bars (f);
-       }
-     }
- }
- 
- static void
  do_app_resume ()
  {
    WindowPtr wp;
--- 7237,7242 ----
***************
*** 8084,8089 ****
--- 8050,8074 ----
        if (!mac_convert_event_ref (eventRef, &er))
        switch (GetEventClass (eventRef))
          {
+         case kEventClassWindow:
+           if (GetEventKind (eventRef) == kEventWindowBoundsChanged) 
+             {
+               WindowPtr window_ptr;
+               GetEventParameter(eventRef, kEventParamDirectObject,
+                                 typeWindowRef, NULL, sizeof(WindowPtr),
+                                 NULL, &window_ptr);
+               f = mac_window_to_frame (window_ptr);
+               if (f && !f->async_iconified)
+                 {
+                   int x, y;
+                   
+                   x_real_positions (f, &x, &y);
+                   f->left_pos = x;
+                   f->top_pos = y;
+                 }
+               SendEventToEventTarget (eventRef, toolbox_dispatcher);
+             }
+           break;
          case kEventClassMouse:
            if (GetEventKind (eventRef) == kEventMouseWheelMoved)
              {
***************
*** 8135,8140 ****
--- 8120,8133 ----
            SInt16 part_code;
            int tool_bar_p = 0;
  
+ #if USE_CARBON_EVENTS
+           /* This is needed to send mouse events like aqua window
+              buttons to the correct handler.  */
+           if (SendEventToEventTarget (eventRef, toolbox_dispatcher)
+               != eventNotHandledErr)
+             break;
+ #endif
+ 
            if (dpyinfo->grabbed && last_mouse_frame
                && FRAME_LIVE_P (last_mouse_frame))
              {
***************
*** 8150,8165 ****
                    window_ptr = FrontWindow ();
                  }
  
- #if USE_CARBON_EVENTS
-               /* This is needed to send mouse events like aqua
-                  window buttons to the correct handler.  */
-               if (SendEventToEventTarget (eventRef, toolbox_dispatcher)
-                   != eventNotHandledErr)
-                 break;
- 
                if (!is_emacs_window (window_ptr))
                  break;
! #endif
                part_code = FindWindow (er.where, &window_ptr);
              }
  
--- 8143,8151 ----
                    window_ptr = FrontWindow ();
                  }
  
                if (!is_emacs_window (window_ptr))
                  break;
! 
                part_code = FindWindow (er.where, &window_ptr);
              }
  
***************
*** 8306,8311 ****
--- 8292,8309 ----
  #else /* not TARGET_API_MAC_CARBON */
                DragWindow (window_ptr, er.where, &qd.screenBits.bounds);
  #endif /* not TARGET_API_MAC_CARBON */
+               /* Update the frame parameters.  */
+               {
+                 struct frame *f = mac_window_to_frame (window_ptr);
+                 if (f && !f->async_iconified)
+                   {
+                     int x, y;
+                     
+                     x_real_positions (f, &x, &y);
+                     f->left_pos = x;
+                     f->top_pos = y;
+                   }
+               }
                break;
  
              case inGoAway:
***************
*** 8393,8416 ****
                break;
              }
  
            if ((er.modifiers & activeFlag) != 0)
              {
                Point mouse_loc = er.where;
  
!               do_window_activate (window_ptr);
  
                SetPortWindowPort (window_ptr);
                GlobalToLocal (&mouse_loc);
!               /* activateEvt counts as mouse movement,
                   so update things that depend on mouse position.  */
                note_mouse_movement (mac_window_to_frame (window_ptr),
                                     &mouse_loc);
              }
            else
              {
!               do_window_deactivate (window_ptr);
  
-               f = mac_window_to_frame (window_ptr);
                if (f == dpyinfo->mouse_face_mouse_frame)
                  {
                    /* If we move outside the frame, then we're
--- 8391,8428 ----
                break;
              }
  
+           if (!is_emacs_window (window_ptr))
+             break;
+           
+           f = mac_window_to_frame (window_ptr);
+ 
            if ((er.modifiers & activeFlag) != 0)
              {
+               /* A window has been activated */
                Point mouse_loc = er.where;
  
!               x_new_focus_frame (dpyinfo, f);
!               activate_scroll_bars (f);
  
                SetPortWindowPort (window_ptr);
                GlobalToLocal (&mouse_loc);
!               /* Window-activated event counts as mouse movement,
                   so update things that depend on mouse position.  */
                note_mouse_movement (mac_window_to_frame (window_ptr),
                                     &mouse_loc);
              }
            else
              {
!               /* A window has been deactivated */
!               dpyinfo->grabbed = 0;
! 
!               if (f == dpyinfo->x_focus_frame)
!                 {
!                   x_new_focus_frame (dpyinfo, 0);
!                   deactivate_scroll_bars (f);
!                 }
! 
  
                if (f == dpyinfo->mouse_face_mouse_frame)
                  {
                    /* If we move outside the frame, then we're




reply via email to

[Prev in Thread] Current Thread [Next in Thread]