PATCH: The mouse wheel doesn't work on Windows 95

Harold L Hunt II huntharo@msu.edu
Thu Jun 5 12:34:00 GMT 2003


Interesting.


Thanks for contributing,

Harold

uribarri_u@tsm.es wrote:
> --- xc/programs/Xserver/hw/xwin/winwndproc.c.orig     2003-02-12 16:01:38.000000000 +0100
> +++ xc/programs/Xserver/hw/xwin/winwndproc.c    2003-06-05 12:54:36.000000000 +0200
> @@ -58,6 +58,8 @@
>    static Bool                s_fCursor = TRUE;
>    static Bool                s_fTracking = FALSE;
>    static unsigned long       s_ulServerGeneration = 0;
> +  static UINT                s_wheel_message = WM_NULL;
> +  static Bool                s_wheel_message_defined = FALSE;
>    int                        iScanCode;
>    int                        i;
> 
> @@ -87,6 +89,41 @@
>        s_hwndLastPrivates = NULL;
>      }
> 
> +  /* Init s_wheel_message */
> +  if ( !s_wheel_message_defined )
> +    {
> +      OSVERSIONINFO osvi;
> +
> +      /* Gets the operating system version */
> +      ZeroMemory (&osvi, sizeof (osvi));
> +      osvi.dwOSVersionInfoSize = sizeof (osvi);
> +      GetVersionEx (&osvi);
> +
> +      /*
> +       * If we're running an OS version that doesn't support WM_MOUSEWHEEL,
> +       * find out what message number we should be using instead.
> +       */
> +      if (osvi.dwMajorVersion < 4 ||
> +           (osvi.dwMajorVersion == 4 && osvi.dwPlatformId != VER_PLATFORM_WIN32_NT))
> +        {
> +          s_wheel_message = RegisterWindowMessage ("MSWHEEL_ROLLMSG");
> +          if (s_wheel_message == WM_NULL)
> +            ErrorF ("Error registering MSWHEEL_ROLLMSG window message.");
> +        }
> +      s_wheel_message_defined=TRUE;
> +    }
> +
> +  if (message == s_wheel_message && message != WM_NULL)
> +    {
> +      if (s_pScreenPriv != NULL && !s_pScreenInfo->fIgnoreInput)
> +        {
> +#if CYGDEBUG
> +          ErrorF ("winWindowProc - MSWHEEL_ROLLMSG\n");
> +#endif
> +          winMouseWheel (s_pScreen, wParam);
> +        }
> +    }
> +
>    /* Branch on message type */
>    switch (message)
>      {
> 



More information about the Cygwin-xfree mailing list