[webkit-help] handleMousePressEvent always returns FALSE

Luka Napotnik luka.napotnik at gmail.com
Thu Aug 27 05:27:03 PDT 2009


Thanks for the answer. The code is a bit complicated to create a
simple test case so I'll try to describe as good as possible.

I added a webkit_web_view_press_xy() function to the Gtk+ WebView API
that accepts X,Y coordinates and calls the mentioned functions.

After a few tests I noticed that mouse clicks (OnClick event) on DIV
elements are not processed. If I have a DIV element with, say an image
and I set the DIV OnClick event it will process the click only if I
click on the image inside the DIV. But clicking on the DIV itself will
ignore the click. If I want to create an action when clicking on the
DIV I have to use OnMouseDown.

Any ideas why only mousedown events are working for DIV?


2009/8/27 tonikitoo (Antonio Gomes) <tonikitoo at gmail.com>:
> luka, your problem report is good.
> but maybe it could be even easier to get help/answers if you provided
> a simple/small test case and webkit/gtk program that could help on
> fast reproducing your problem, maybe file a bug in bugs.webkit.org
> (webkit gtk component)  attach them .. (?)
> or maybe also put some printf's on handleMouseReleaseEvent to see
> where it bails out (if it does) to not return the exteced value.
> On Wed, Aug 26, 2009 at 2:16 AM, Luka Napotnik<luka.napotnik at gmail.com> wrote:
>> Hello.
>> I trigger a mouse event with handleMousePressEvent() and then
>> handleMouseReleaseEvent() to simulate a click on the page in the Gtk+
>> port of WebKit.
>> Exampler usage:
>> --------------------------------------
>> gboolean click1, click2;
>> click1 = frame->eventHandler()->handleMousePressEvent(PlatformMouseEvent(
>>       IntPoint(x, y), IntPoint(0,0), LeftButton, MouseEventPressed, 1,
>>        false, false, false, false, GDK_CURRENT_TIME));
>> click2 = frame->eventHandler()->handleMouseReleaseEvent(PlatformMouseEvent(
>>        IntPoint(x, y), IntPoint(0,0), LeftButton, MouseEventReleased, 1,
>>        false, false, false, false, GDK_CURRENT_TIME));
>> --------------------------------------
>> where x and y are my click coordinates. I set a valid coordinate to a
>> html div element that will change when clicked. The problem is that
>> handleMousePressEvent always returns FALSE event when I successfully
>> click on the element and I see the changes. What could cause
>> handleMousePressEvent() to fail. Is there some argument that I didn't
>> set up correctly?
>> Greets,
>> Luka
>> _______________________________________________
>> webkit-help mailing list
>> webkit-help at lists.webkit.org
>> http://lists.webkit.org/mailman/listinfo.cgi/webkit-help
> --
> --Antonio Gomes

More information about the webkit-help mailing list