emacs-pretest-bug
[Top][All Lists]
Advanced

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

Re: OS X: mouse wheel on powerbooks broken, Option modifier


From: YAMAMOTO Mitsuharu
Subject: Re: OS X: mouse wheel on powerbooks broken, Option modifier
Date: Sat, 11 Jun 2005 12:13:07 +0900
User-agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.6 (Marutamachi) APEL/10.6 Emacs/21.4 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI)

>>>>> On Fri, 10 Jun 2005 15:17:19 +0100, David Reitter <address@hidden> said:

>> Could you try the following patch?

> Doesn't work. Same problem. Mouse wheel works, two-finger-scrolling
> doesn't.

What about the option modifier problem?  The previously posted patch
was not for the two finger scrolling problem.

> OK, I checked that. It looks like we're not getting
> kEventMouseWheelMoved, but some (int) 11.  That is not defined in
> CarbonEvents.h

Thanks.

> I have no idea why I'm getting this. Other Carbon scroll away
> happily.

I guess it is dealt with the standard event handler for scroll bar
controls or something like that.

> And while you're at it, may I suggest checking
> kEventParamMouseWheelAxis (only do something if it is
> kEventMouseWheelAxisY), and also kEventParamWindowPartCode to make
> sure that the mouse event does not go to the wrong frame. Emacs
> should scroll whatever window the mouse is over when the wheel is
> activated. If that's too difficult, at least scroll the first (or
> selected) window in the frame that the mouse was over...

Does the following patch work?

                                     YAMAMOTO Mitsuharu
                                address@hidden

Index: src/macterm.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/macterm.c,v
retrieving revision 1.117
diff -c -r1.117 macterm.c
*** src/macterm.c       6 Jun 2005 20:23:56 -0000       1.117
--- src/macterm.c       11 Jun 2005 02:58:05 -0000
***************
*** 8881,8902 ****
              }
            break;
          case kEventClassMouse:
!           if (GetEventKind (eventRef) == kEventMouseWheelMoved)
              {
                SInt32 delta;
                Point point;
                struct frame *f = mac_focus_frame (dpyinfo);
                WindowPtr window_ptr;
  
! #if 0
!               if (dpyinfo->x_focus_frame == NULL)
                  {
!                   /* Beep if wheel move occurs when all the frames
!                      are invisible.  */
!                   SysBeep(1);
                    break;
                  }
! #endif
  
                GetEventParameter(eventRef, kEventParamMouseWheelDelta,
                                  typeSInt32, NULL, sizeof (SInt32),
--- 8881,8912 ----
              }
            break;
          case kEventClassMouse:
!           if (GetEventKind (eventRef) == kEventMouseWheelMoved
!               /* two finger scrolling on the trackpad */
!               || GetEventKind (eventRef) == kEventMouseWheelMoved + 1)
              {
                SInt32 delta;
                Point point;
                struct frame *f = mac_focus_frame (dpyinfo);
                WindowPtr window_ptr;
+               EventMouseWheelAxis axis;
  
!               GetEventParameter(eventRef, kEventParamWindowRef,
!                                 typeWindowRef, NULL, sizeof (WindowRef),
!                                 NULL, &window_ptr);
!               if (!is_emacs_window (window_ptr))
                  {
!                   SendEventToEventTarget (eventRef, toolbox_dispatcher);
                    break;
                  }
!               if (f != mac_window_to_frame (window_ptr))
!                 break;
! 
!               GetEventParameter(eventRef, kEventParamMouseWheelAxis,
!                                 typeMouseWheelAxis, NULL,
!                                 sizeof (EventMouseWheelAxis), NULL, &axis);
!               if (axis != kEventMouseWheelAxisY)
!                 break;
  
                GetEventParameter(eventRef, kEventParamMouseWheelDelta,
                                  typeSInt32, NULL, sizeof (SInt32),
***************
*** 8909,8921 ****
                inev.modifiers = (mac_event_to_emacs_modifiers (eventRef)
                                  | ((delta < 0) ? down_modifier
                                     : up_modifier));
-               window_ptr = FRAME_MAC_WINDOW (f);
                SetPortWindowPort (window_ptr);
                GlobalToLocal (&point);
                XSETINT (inev.x, point.h);
                XSETINT (inev.y, point.v);
!               XSETFRAME (inev.frame_or_window,
!                          mac_window_to_frame (window_ptr));
                inev.timestamp = EventTimeToTicks (GetEventTime 
(eventRef))*(1000/60);
              }
            else
--- 8919,8929 ----
                inev.modifiers = (mac_event_to_emacs_modifiers (eventRef)
                                  | ((delta < 0) ? down_modifier
                                     : up_modifier));
                SetPortWindowPort (window_ptr);
                GlobalToLocal (&point);
                XSETINT (inev.x, point.h);
                XSETINT (inev.y, point.v);
!               XSETFRAME (inev.frame_or_window, f);
                inev.timestamp = EventTimeToTicks (GetEventTime 
(eventRef))*(1000/60);
              }
            else




reply via email to

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