Gecko:Notes for mouse driver developers on Widnows: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(Blanked the page)
 
Line 1: Line 1:
This document is informative.


= Post/Send [http://msdn.microsoft.com/en-us/library/ms645617%28VS.85%29.aspx <code>WM_MOUSEWHEEL</code>] and [http://msdn.microsoft.com/en-us/library/ms645614%28VS.85%29.aspx <code>WM_MOUSEHWHEEL</code>] messages =
Gecko supports both '''<code>WM_MOUSEWHEEL</code>''' and '''<code>WM_MOUSEHWHEEL</code>''' messages, so, all mouse drivers and utilities should post (or send) them to Gecko's window.
Be aware, Gecko 1.9.3 and later (Firefox 3.7 and later) is going to support <code>WM_VSCROLL</code> and <code>WM_HSCROLL</code> messages too, however, do '''not''' post/send these messages for the wheel action.  Gecko handles these messages in different path with <code>WM_MOUSEWHEEL</code> and <code>WM_MOUSEHWHEEL</code> because Gecko thinks that the messages are used only for scrolling.  To put it concretely, <code>WM_MOUSEWHEEL</code> and <code>WM_MOUSEHWHEEL</code> messages cause [https://developer.mozilla.org/en/Gecko-Specific_DOM_Events#DOMMouseScroll <code>DOMMouseScroll</code> event] on the web pages, so, web application developers can handle the wheel actions and they can prevent scrolling.  However, <code>WM_VSCROLL</code> and <code>WM_HSCROLL</code> don't cause the DOM event, it only scrolls a scrollable area. So, the scrolling by these messages are same as the scrolling by scrollbar operation. I.e., web developers cannot know whether the scrolling is caused by scrollbar operation or mouse wheel action.
= Post/Send the messages to focused Gecko's window =
Please post/send the messages to '''focused''' Gecko's window rather than the window under the mouse cursor.  Gecko honors the mouse cursor position when Gecko chose a scrolling target (detail of the rule is documented in [[Gecko:Mouse_Wheel_Scrolling]]).  So, Gecko redirects the messages to a window under the cursor automatically.
Note that Gecko doesn't redirect the messages to a plug-in window even if it's under the mouse cursor (Gecko 1.9.3 and later).  The reason is that Gecko manages mouse wheel transaction (documented in [[Gecko:Mouse_Wheel_Scrolling]]). The user may want to scroll the parent scrollable area of plug-in. For example, a plug-in window may come under the mouse cursor by scrolling its parent scrollable area, then, Gecko tries to keep scrolling the parent scrollable area rather than the plug-in's content. So, if some mouse drivers/utilities post/send messages to a plug-in window directly, it causes breaking this feature.
= Please use wheel messages to unknown window =
Gecko 1.9.2 and later (Firefox 3.6 and later) create following class name windows. Note that this could be changed in future version.
* <code>MozillaHiddenWindowClass</code>
* <code>MozillaUIWindowClass</code>
* <code>MozillaContentWindowClass</code>
* <code>MozillaContentFrameWindowClass</code>
* <code>MozillaWindowClass</code>
* <code>MozillaDialogClass</code>
* <code>MozillaDropShadowWindowClass</code>
You can assume that if focused window class name is one of them, you can post/send <code>WM_MOUSEWHEEL</code> and <code>WM_MOUSEHWHEEL</code> messages without any hacks.
Unfortunately, Gecko window structure was changed at Firefox 3.6. Then, we confirmed that some mouse drivers/utilities become that they don't post/send the messages. The messages are standard mouse wheel events on Windows applications. I can understand that some old applications don't support them by historical reasons. The mouse drivers/utilities developers can use hacky way for them, however, it's bad if you assume that all unknown windows are so.

Latest revision as of 07:53, 31 March 2010