/[emacs]/emacs/src/macterm.c
ViewVC logotype

Diff of /emacs/src/macterm.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3.2.15 by miles, Tue Jul 6 10:17:21 2004 UTC revision 1.3.2.16 by miles, Tue Jul 6 10:23:40 2004 UTC
# Line 7018  mac_get_emulated_btn ( UInt32 modifiers Line 7018  mac_get_emulated_btn ( UInt32 modifiers
7018    int result = 0;    int result = 0;
7019    if (!NILP (Vmac_emulate_three_button_mouse)) {    if (!NILP (Vmac_emulate_three_button_mouse)) {
7020      int cmdIs3 = !EQ (Vmac_emulate_three_button_mouse, Qreverse);      int cmdIs3 = !EQ (Vmac_emulate_three_button_mouse, Qreverse);
7021      if (modifiers & controlKey)      if (modifiers & cmdKey)
7022        result = cmdIs3 ? 2 : 1;        result = cmdIs3 ? 2 : 1;
7023      else if (modifiers & optionKey)      else if (modifiers & optionKey)
7024        result = cmdIs3 ? 1 : 2;        result = cmdIs3 ? 1 : 2;
# Line 7038  mac_event_to_emacs_modifiers (EventRef e Line 7038  mac_event_to_emacs_modifiers (EventRef e
7038    if (!NILP (Vmac_emulate_three_button_mouse) &&    if (!NILP (Vmac_emulate_three_button_mouse) &&
7039        GetEventClass(eventRef) == kEventClassMouse)        GetEventClass(eventRef) == kEventClassMouse)
7040      {      {
7041        mods &= ~(optionKey & cmdKey);        mods &= ~(optionKey | cmdKey);
7042      }      }
7043    return mac_to_emacs_modifiers (mods);    return mac_to_emacs_modifiers (mods);
7044  }  }
# Line 7237  is_emacs_window (WindowPtr win) Line 7237  is_emacs_window (WindowPtr win)
7237  }  }
7238    
7239  static void  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  
7240  do_app_resume ()  do_app_resume ()
7241  {  {
7242    WindowPtr wp;    WindowPtr wp;
# Line 8084  XTread_socket (sd, expected, hold_quit) Line 8050  XTread_socket (sd, expected, hold_quit)
8050        if (!mac_convert_event_ref (eventRef, &er))        if (!mac_convert_event_ref (eventRef, &er))
8051          switch (GetEventClass (eventRef))          switch (GetEventClass (eventRef))
8052            {            {
8053              case kEventClassWindow:
8054                if (GetEventKind (eventRef) == kEventWindowBoundsChanged)
8055                  {
8056                    WindowPtr window_ptr;
8057                    GetEventParameter(eventRef, kEventParamDirectObject,
8058                                      typeWindowRef, NULL, sizeof(WindowPtr),
8059                                      NULL, &window_ptr);
8060                    f = mac_window_to_frame (window_ptr);
8061                    if (f && !f->async_iconified)
8062                      {
8063                        int x, y;
8064                        
8065                        x_real_positions (f, &x, &y);
8066                        f->left_pos = x;
8067                        f->top_pos = y;
8068                      }
8069                    SendEventToEventTarget (eventRef, toolbox_dispatcher);
8070                  }
8071                break;
8072            case kEventClassMouse:            case kEventClassMouse:
8073              if (GetEventKind (eventRef) == kEventMouseWheelMoved)              if (GetEventKind (eventRef) == kEventMouseWheelMoved)
8074                {                {
# Line 8135  XTread_socket (sd, expected, hold_quit) Line 8120  XTread_socket (sd, expected, hold_quit)
8120              SInt16 part_code;              SInt16 part_code;
8121              int tool_bar_p = 0;              int tool_bar_p = 0;
8122    
8123    #if USE_CARBON_EVENTS
8124                /* This is needed to send mouse events like aqua window
8125                   buttons to the correct handler.  */
8126                if (SendEventToEventTarget (eventRef, toolbox_dispatcher)
8127                    != eventNotHandledErr)
8128                  break;
8129    #endif
8130    
8131              if (dpyinfo->grabbed && last_mouse_frame              if (dpyinfo->grabbed && last_mouse_frame
8132                  && FRAME_LIVE_P (last_mouse_frame))                  && FRAME_LIVE_P (last_mouse_frame))
8133                {                {
# Line 8150  XTread_socket (sd, expected, hold_quit) Line 8143  XTread_socket (sd, expected, hold_quit)
8143                      window_ptr = FrontWindow ();                      window_ptr = FrontWindow ();
8144                    }                    }
8145    
 #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;  
   
8146                  if (!is_emacs_window (window_ptr))                  if (!is_emacs_window (window_ptr))
8147                    break;                    break;
8148  #endif  
8149                  part_code = FindWindow (er.where, &window_ptr);                  part_code = FindWindow (er.where, &window_ptr);
8150                }                }
8151    
# Line 8306  XTread_socket (sd, expected, hold_quit) Line 8292  XTread_socket (sd, expected, hold_quit)
8292  #else /* not TARGET_API_MAC_CARBON */  #else /* not TARGET_API_MAC_CARBON */
8293                  DragWindow (window_ptr, er.where, &qd.screenBits.bounds);                  DragWindow (window_ptr, er.where, &qd.screenBits.bounds);
8294  #endif /* not TARGET_API_MAC_CARBON */  #endif /* not TARGET_API_MAC_CARBON */
8295                    /* Update the frame parameters.  */
8296                    {
8297                      struct frame *f = mac_window_to_frame (window_ptr);
8298                      if (f && !f->async_iconified)
8299                        {
8300                          int x, y;
8301                          
8302                          x_real_positions (f, &x, &y);
8303                          f->left_pos = x;
8304                          f->top_pos = y;
8305                        }
8306                    }
8307                  break;                  break;
8308    
8309                case inGoAway:                case inGoAway:
# Line 8393  XTread_socket (sd, expected, hold_quit) Line 8391  XTread_socket (sd, expected, hold_quit)
8391                  break;                  break;
8392                }                }
8393    
8394                if (!is_emacs_window (window_ptr))
8395                  break;
8396                
8397                f = mac_window_to_frame (window_ptr);
8398    
8399              if ((er.modifiers & activeFlag) != 0)              if ((er.modifiers & activeFlag) != 0)
8400                {                {
8401                    /* A window has been activated */
8402                  Point mouse_loc = er.where;                  Point mouse_loc = er.where;
8403    
8404                  do_window_activate (window_ptr);                  x_new_focus_frame (dpyinfo, f);
8405                    activate_scroll_bars (f);
8406    
8407                  SetPortWindowPort (window_ptr);                  SetPortWindowPort (window_ptr);
8408                  GlobalToLocal (&mouse_loc);                  GlobalToLocal (&mouse_loc);
8409                  /* activateEvt counts as mouse movement,                  /* Window-activated event counts as mouse movement,
8410                     so update things that depend on mouse position.  */                     so update things that depend on mouse position.  */
8411                  note_mouse_movement (mac_window_to_frame (window_ptr),                  note_mouse_movement (mac_window_to_frame (window_ptr),
8412                                       &mouse_loc);                                       &mouse_loc);
8413                }                }
8414              else              else
8415                {                {
8416                  do_window_deactivate (window_ptr);                  /* A window has been deactivated */
8417                    dpyinfo->grabbed = 0;
8418    
8419                    if (f == dpyinfo->x_focus_frame)
8420                      {
8421                        x_new_focus_frame (dpyinfo, 0);
8422                        deactivate_scroll_bars (f);
8423                      }
8424    
8425    
                 f = mac_window_to_frame (window_ptr);  
8426                  if (f == dpyinfo->mouse_face_mouse_frame)                  if (f == dpyinfo->mouse_face_mouse_frame)
8427                    {                    {
8428                      /* If we move outside the frame, then we're                      /* If we move outside the frame, then we're

Legend:
Removed from v.1.3.2.15  
changed lines
  Added in v.1.3.2.16

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26