On Dec 31 2008, 3:24 pm, Drew <[email protected]> wrote:
> I'm attempting to get the mousewheel working for my embedding browser.
> Here's where I'm stuck.
>
> If I set the focus on an element in a page (drop-down, textbox, or
> press tab to an element) I receive WM_MOUSEWHEEL events in my message
> handler. I pass these on
>
> However, if I click on the background of a webpage I send a mouse down
> event to Mozilla (that's all). This obviously causes any element in
> the page to lose it's focus and I no longer receive WM_MOUSEWHEEL
> events to my message handler.
>
> I've tried calling nsIWebBrowserFocus::Activate on the mouse up event,
> but this doesn't fix it. Does anyone have any other suggestions?
>
> Thanks
I've narrowed down the problem a little so I thought I would repost
with some more information and see if anyone has a clue.
I forgot to mention that I'm working in the 1.8 branch of the Mozilla
code.
I noticed I shouldn't have to handle the WM_MOUSEWHEEL messages, so I
removed my code that does that. Mozilla handles these messages
automatically.
I noticed the problem with my scrolling occurs in the DoScrollText()
method of the nsEventStateManager object. There is a call to
GetFocusedContent on line 1830 that fails when nothing has the focus.
nsCOMPtr<nsIContent> targetContent = aTargetFrame->GetContent();
if (!targetContent)
GetFocusedContent(getter_AddRefs(targetContent));
if (!targetContent) return NS_OK;
When I click on the background, no object has the focus. Does anyone
know how I can simulate something to have the focus so that I can
still scroll a page when clicking on just the background?
I've looked at nsWebBrowser::SetFocusAtFirstElement() but that just
returns NS_OK.
_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding