Inappropriate mouse event coordinates in the WebKit of HTMLLoader/StageWebView

Hi,
We have a desktp application which incorporates an HTMLRichTextEditor (implemented in HTML/JS and loaded into AIR).
We have run into a big problem with text selection though. It seems that the both the HTMLLoader and the StageWebView are passing wrong mouse coordinates to the WebKit when the cursor is outside of the component.
I've created a sample application which uses mx:HTML (which is a wrapper of the HTMLLoader) and a WebView class (a wrapper aroun StageWebView reference to which is given here).
The application is located here in Dropbox. The source code of the app is here.
The app was built with Flex 4.6 and ran in AIR 3.7
The sample app has a WebView which loads loremipsum and HTML loading some dummy local HTML page. The HTML page uses the JS->AIR bridge to report the mouseevents to a function in AIR. In the snapshot below the selection was started from the first row and then slowly continued to the left. As soon as it reaches the green area the selection changes unexpectably. As it can be seen in the bottom right -> the WebKit has received a mouse event with incorrect coordinates. The reported mouse coordinates seem to be the mouse coordinates within the green component and the selection behaves like that. If the mouse is moved to the blue - the selection changes again (according to the coordinates in the blue area).
The component which uses the StageWebView behaves in absolutely the same way.
I'd assume that I have to post a bug but I decided to post here at first.
I've tried a few workarounds in order to stop and ongoing selection or to change it's behaviour but none of them with any relevant success. Even disabling mouse children for the entire application has no effect on the selection once it's started.
Any help and/or comments would be much appreciated.
Thanks !

Thank you for the heads up.  Do you know if this is a recent change in behavior with AIR (ie. does this occur in previous versions)?  Regardless, could you please open a new bug report on this over at bugbase.adobe.com? 
Once added, please post back with the URL so that others affected can add their comments and votes and I can follow up internally.
 

Similar Messages

  • Firefox mouse event not behaving the same on PC and Mac computers

    I use the FCKEditor and having a very strange problem. When I click on the FCKEditor's editing area, the keyboard gets disabled untill I click the mouse somewhere outside of the editing window. The problem only happen on Firefox (3.6.10) on Mac computer (Snowleopard 10.6.4). Doing exactly the same steps on PC works without any problem.
    What I want to know:
    - Is it possible that the Firefox on Mac is different than the PC in handling mouse events? Or some other areas?

    Sounds more that Firefox is treating that editor area as read-only.
    Start Firefox in [[Safe Mode]] to check if one of your add-ons is causing your problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    See [[Troubleshooting extensions and themes]] and [[Troubleshooting plugins]]

  • X Y Mouse Click Coordinates in the Request Map?

    I have a mapping application that layers several images with a clickable top layer. When I wrap the top image in a command link I don't get the x and y coordinates of the mouse click in the request map. So I've had to use a regular command button with an image property. This works fine but doesn't allow me to use partial page rendering to limit the refresh of particular images in the stack. Can the x,y coordinate of the mouse click be returned with straight ADF?
    (I"ve included the code for retreiving the x and y coordinates under the jspx code)
    <af:panelGroup type="vertical">
    <af:objectImage source="#{backing_collect2.activeSource}"/>
    <af:objectImage source="#{backing_collect2.baseSource}"
    inlineStyle="position:absolute;left:0px;top:0px"
    binding="#{backing_collect2.baseImage}"/>
    <af:objectImage source="#{backing_collect2.allPointSource}"
    inlineStyle="position:absolute;left:0px;top:0px"
    binding="#{backing_collect2.allPointImage}"/>
    <af:objectImage source="#{backing_collect2.userPointSource}"
    inlineStyle="position:absolute;left:0px;top:0px"
    binding="#{backing_collect2.userPointImage}"/>
    <af:objectImage source="#{backing_collect2.activePointSource}"
    inlineStyle="position:absolute;left:0px;top:0px"
    binding="#{backing_collect2.activePointImage}"/>
    This following fails to return x and y in the request Map, imageMapType="server"
    attr on objectImage does not help
    <af:commandLink actionListener="#{backing_collect2.processClick}"
    action="#{backing_collect2.collectAction}"
    inlineStyle="position:absolute;left:0px;top:0px">
    <af:objectImage source="#{backing_collect2.activeSource}"
    inlineStyle="position:absolute;left:0px;top:0px"/>
    </af:commandLink>
    I have to use the following regular command button to get x, y click coordinates in the request map. But using this component makes its impossible to use partial page rendering to limit refreshes of the images above.
    <h:commandButton image="#{backing_collect2.activeSource}"
    binding="#{backing_collect2.activeLayer}"
    actionListener="#{backing_collect2.processClick}"
    action="#{backing_collect2.collectAction}"
    style="position:absolute;left:0px;top:0px"/>
    </af:panelGroup>
    // Code to get x and y from the request map
    visit.setLastClickPoint(visit.getClickPoint());
    FacesContext fc = FacesContext.getCurrentInstance();
    String clientId = actionEvent.getComponent().getClientId(fc);
    java.util.Map requestParams = fc.getExternalContext().getRequestParameterMap();
    String xString =(String) requestParams.get((String)clientId + ".x");
    String yString =(String) requestParams.get((String)clientId + ".y");
    int xMouse = (new Integer(xString)).intValue();
    int yMouse = (new Integer(yString)).intValue();

    Should have added that I'm using EA14

  • How do you map a mouse events coordinate​s to the coordinate​s of a chart or graph?

    I'm using LabView 6.1 on Win XP Pro. I'm trying to highlight points on a graph picked (by using a mouse click) by a user. The mouse click event returns x,y in pixels relative to the upper left corner. I know the upper left corner of my control. I also know the width and height of the plotting area within the control, but I don't know the position of the plotting area within the control. Without that piece of info, I can't do the mapping.

    Hi,
    You May Want to do this a bit Differently but achieve the same Goal i.e. the user Picks Points on a Graph and you highlight these points and Draw A graph or impart some other functionality.
    Here is an idea -
    1. Let the User Position the Cursor on the Point they want. To aid the user you can make the cursor legend visible which shows the X and Y Axis values for the cursor. To accuartely Position the User can use the the 4 Buttons that are a part of the Cursor Legend.
    2. Put a Button next to the graph saying "Select this Point"
    3. After Positioning the Cursor when the user Clicks this Button you use the "Cursor Position" Property of the graph to extract the value of the cursor.
    4. Next you may want to add this Point to Cluster Array which displays
    the Points on the Graph. If this Array is Empty and you add this one Element to the Graph then this Point will be Visible. The User may now reposition to another Point and Repeat the Process.
    5. To aid the user you may want to Provide " Delete last Point" and "Clear All" Buttons. The Functionality is to Delete Last Element in array or Clear all Elements in the Array.
    The Structure of this whole routine probably is Event Structure(to trap Button Clicks "Select", "Delete" etc) Inside a Case Structure (State Machine to Perform the Operations User Clicked) All Inside a While Loop.
    This is a Short Description of how this Functionality can be Built. To Automatically Extract Cursor position from the Graph and then try to Map it to Coordiante Axis For a Point is More Involved and a Little Convoluted.
    Why not keep it simple? IF anything is unclear, I will be glad to explain or post an example (Only if time permits!!)
    Good Luck
    Mache
    Good Luck!
    Mache

  • Trying to create a surface  with multiple images with mouse events

    novice programmer (for a applet program)
    hi trying to create a surface i.e jpanel, canvas, that allows multiple images to be created.
    Each object is to contain a image(icon) and a name associated with that particular image. Then each image+label has a mouse event that allows the item to be dragged around the screen.
    I have tried creating own class that contains a image and string but I having problems.
    I know i can create a labels with icons but having major problems adding mouse events to allow each newly created label object to moved by the users mouse?
    if any one has any tips of how to acheive this it would be much appreciated. Thanks in advance.
    fraser.

    This should set you on the right track:- import java.awt.*;
        import java.awt.event.*;
        import javax.swing.*;
        public class DragTwoSquares extends JApplet implements MouseListener, MouseMotionListener {  
           int x1, y1;   // Coords of top-left corner of the red square.
           int x2, y2;   // Coords of top-left corner of the blue square.
           /* Some variables used during dragging */
           boolean dragging;      // Set to true when a drag is in progress.
           boolean dragRedSquare; // True if red square is being dragged, false                              //    if blue square is being dragged.                            
           int offsetX, offsetY;  // Offset of mouse-click coordinates from
                                  //   top-left corner of the square that was                           //   clicked.
           JPanel drawSurface;    // This is the panel on which the actual
                                  // drawing is done.  It is used as the
                                  // content pane of the applet.  It actually                      // belongs to an anonymous class which is
                                  // defined in place in the init() method.
            public void init() {
                 // Initialize the applet by putting the squares in a
                 // starting position and creating the drawing surface
                 // and installing it as the content pane of the applet.
              x1 = 10;  // Set up initial positions of the squares.
              y1 = 10;
              x2 = 50;
              y2 = 10;
              drawSurface = new JPanel() {
                        // This anonymous inner class defines the drawing
                        // surface for the applet.
                    public void paintComponent(Graphics g) {
                           // Draw the two squares and a black frame
                           // around the panel.
                       super.paintComponent(g);  // Fill with background color.
                       g.setColor(Color.red);
                       g.fillRect(x1, y1, 30, 30);
                       g.setColor(Color.blue);
                       g.fillRect(x2, y2, 30, 30);
                       g.setColor(Color.black);
                       g.drawRect(0,0,getSize().width-1,getSize().height-1);
              drawSurface.setBackground(Color.white);
              drawSurface.addMouseListener(this);
              drawSurface.addMouseMotionListener(this);
              setContentPane(drawSurface);
           } // end init();
           public void mousePressed(MouseEvent evt) {
                  // Respond when the user presses the mouse on the panel.
                  // Check which square the user clicked, if any, and start
                  // dragging that square.
              if (dragging)  // Exit if a drag is already in progress.
                 return;           
              int x = evt.getX();  // Location where user clicked.
              int y = evt.getY();        
              if (x >= x2 && x < x2+30 && y >= y2 && y < y2+30) {
                     // It's the blue square (which should be checked first,
                     // since it's in front of the red square.)
                 dragging = true;
                 dragRedSquare = false;
                 offsetX = x - x2;  // Distance from corner of square to (x,y).
                 offsetY = y - y2;
              else if (x >= x1 && x < x1+30 && y >= y1 && y < y1+30) {
                     // It's the red square.
                 dragging = true;
                 dragRedSquare = true;
                 offsetX = x - x1;  // Distance from corner of square to (x,y).
                 offsetY = y - y1;
           public void mouseReleased(MouseEvent evt) {
                  // Dragging stops when user releases the mouse button.
               dragging = false;
           public void mouseDragged(MouseEvent evt) {
                   // Respond when the user drags the mouse.  If a square is
                   // not being dragged, then exit. Otherwise, change the position
                   // of the square that is being dragged to match the position
                   // of the mouse.  Note that the corner of the square is placed
                   // in the same position with respect to the mouse that it had
                   // when the user started dragging it.
               if (dragging == false)
                 return;
               int x = evt.getX();
               int y = evt.getY();
               if (dragRedSquare) {  // Move the red square.
                  x1 = x - offsetX;
                  y1 = y - offsetY;
               else {   // Move the blue square.
                  x2 = x - offsetX;
                  y2 = y - offsetY;
               drawSurface.repaint();
           public void mouseMoved(MouseEvent evt) { }
           public void mouseClicked(MouseEvent evt) { }
           public void mouseEntered(MouseEvent evt) { }
           public void mouseExited(MouseEvent evt) { }  
        } // end class

  • Mouse Events are slow

    Hello everyone,
    I'm currently working on an standard as3 (1024x768) app that
    is running inside a chromeless Air window to take advantage of the
    transparency.
    All my tests where done using windows XP professional and AIR
    1.0 (the same problem existed in beta3).
    The issue I'm having is related with Mouse Events. Somehow
    the events take a lot of time to reach the swf file when the user
    clicks inside the transparent window.
    It's natural that the app runs slower inside a transparent
    window (the framerate drops) but I wasn't expecting the clicks to
    suffer from such delay (it takes sometimes 2-5sec).
    The app is very CPU intensive and the transparencies make it
    worse. Something inside the AIR framework is not dispatching the
    events properly.
    I say this because I tried using the virtualMouse class from
    senocular together with a socket to simulate the mouse clicks and
    that did the trick.
    In conclusion:
    Something in the AIR framework for windows XP is messing up
    the dispatch of the Mouse events when the app is under heavy cpu
    usage inside a chromeless window. I click on the window and it
    takes 1-2sec to receive the click event.
    However when I dispatch the MouseEvent.CLICK myself using
    the virtual mouse class the application immediately receives the
    event.
    I know this is a strange bug and not many people will have
    this problem, but I would like to know from someone with knowledge
    of the runtime why this could be happening.
    Thank you
    Tiago Bilou

    Hello everyone,
    I'm currently working on an standard as3 (1024x768) app that
    is running inside a chromeless Air window to take advantage of the
    transparency.
    All my tests where done using windows XP professional and AIR
    1.0 (the same problem existed in beta3).
    The issue I'm having is related with Mouse Events. Somehow
    the events take a lot of time to reach the swf file when the user
    clicks inside the transparent window.
    It's natural that the app runs slower inside a transparent
    window (the framerate drops) but I wasn't expecting the clicks to
    suffer from such delay (it takes sometimes 2-5sec).
    The app is very CPU intensive and the transparencies make it
    worse. Something inside the AIR framework is not dispatching the
    events properly.
    I say this because I tried using the virtualMouse class from
    senocular together with a socket to simulate the mouse clicks and
    that did the trick.
    In conclusion:
    Something in the AIR framework for windows XP is messing up
    the dispatch of the Mouse events when the app is under heavy cpu
    usage inside a chromeless window. I click on the window and it
    takes 1-2sec to receive the click event.
    However when I dispatch the MouseEvent.CLICK myself using
    the virtual mouse class the application immediately receives the
    event.
    I know this is a strange bug and not many people will have
    this problem, but I would like to know from someone with knowledge
    of the runtime why this could be happening.
    Thank you
    Tiago Bilou

  • Mouse events during Thread.sleep

    hi.
    I have an applet .
    I have a alghoritm simulator.
    Everytime I find a solution I call the method Thread.sleep .
    I want to pause the application and I create a JToggleButton Pause .
    When I press the Pause during sleep mouse event are managed at the end of alghoritm.
    How can I manage mouse events during sleep?

    All UI events (such as mouse events) occur on the event dispatch thread (EDT).
    That means if you sleep on the EDT, you lock up the UI. For this reason, you shouldn't be sleeping on the EDT.
    I'm not sure what your sleep is trying to do but you need to manage your threads a little more carefully. For instance, any time consuming process which is invoked as a result of a UI event needs to be fired on a new thread to prevent the UI freezing. The fun starts when you have to update the UI as a result of that process, because you should then hook back onto the EDT to avoid the risk of deadlock.
    Some utility classes are provided, such as SwingUtilities, and other example code is provided on Sun's site, such as SwingWorker - but if you do much UI work you'll probably end up with your own core set of threading tools and so on to make life easier.

  • Handling mouse events anywhere

    Hi,
    We have built an application with a Swing GUI and for automation and testing we would like to record all keyboard and mouse events to be able to play them afterwards.
    The keyboard events can be recorded easily with a KeyboardFocusManager but for the mouse events I still need a solution.
    The GUI consists of a JFrame containing several JPanels. When I add a MouseListener on the JFrame, its mousePressed and mouseReleased events are not called everytime I click somewhere on the frame. For example, when I click on a button inside one of the JPanels, the mouse event methods of the frame are not executed.
    Can somebody tell me how I can easily capture all mouse events in the GUI without adding MouseListeners in every JPanel??
    Thanks in advance...

    I know how to use the Robot class, that's not really the issue.
    What we are doing actually is writing keyboard and mouse events into a file.
    Afterwards we use the Robot class to playback the events in the file. This is no problem, I just don't know how I can easily intercept ALL mouse events in the GUI without adding mouseListeners in each component in the GUI.

  • Allowing Mouse Events to "Fall Through" When Window Activated

    I'm implementing a "tool pallette" in my application (much like tools in an application like Photoshop) and I want the user to be able to immediately click on options on this pallete without having to make the window active. Since Swing doesn't have an explicit "Pallete" window that would give this to me for free, I'm assuming I need to subclass JDialog to make this happen.
    Even if window activation still must happen, it's crucial that the user only needs to click once to press the button on an inactive window.
    I know I can detect WindowEvents like WINDOW_ACTIVATED by simply adding my own window listener, but I don't know how I'd go about having mouse events "fall through" the window listeners and cause the appropriate action on the underlying component. It's almost as if I need to tell the window itself to listen for nothing.
    I thought glass planes may be the answer, but that doesn't seem to be what's preventing the intial click in an inactive window from falling through to the underlying component.
    Any thoughts, comments, or experiences regarding this are greatly appreciated!

    Such a simple solution to such a perplexing problem. You are absolutely right. It turns out I was experience a bug in my particular L&F. Trying this with the Windows L&F proves that simply changing from JWindow to a non-modal JDialog works. Now I'll have to go about getting the bug fixed in the MacOSX (Aqua) L&F so I have equivalent behavior across all our supported platforms.
    Thanks for the quick response.

  • Mouse Events "Falling Through" During Window Activation

    I'm implementing a "tool pallette" in my application (much like tools in an application like Photoshop) and I want the user to be able to immediately click on options on this pallete without having to make the window active. Since Swing doesn't have an explicit "Pallete" window that would give this to me for free, I'm assuming I need to subclass JDialog to make this happen.
    Even if window activation still must happen, it's crucial that the user only needs to click once to press the button on an inactive window.
    I know I can detect WindowEvents like WINDOW_ACTIVATED by simply adding my own window listener, but I don't know how I'd go about having mouse events "fall through" the window listeners and cause the appropriate action on the underlying component. It's almost as if I need to tell the window itself to listen for nothing.
    I thought glass planes may be the answer, but that doesn't seem to be what's preventing the intial click in an inactive window from falling through to the underlying component.
    Any thoughts, comments, or experiences regarding this are greatly appreciated!

    The solution to this problem was posted in the Swing forum. Turns out to be a simple difference of JWindow and JDialog, but a difference I wasn't seeing under all L&Fs (i.e., Windows L&F handles JDialog properly, MacOSX (Aqua) L&F seems to treat it like any other window... I've filed a bug with them).

  • Accepting a mouse event within button's border

    Ive created a custom round button, which is made of GIF images. The images have transparent background's created using Photoshop, so that they appear round. I was wondering if there is a way of accepting a mouse event, for example a click, from only within the actual button's border. It currently accepts mouse events from within the transparent background as well as the actual button's border. Any ideas?

    I believe you have to override the contains(...) method of your component. The article for the Tech Tips Archive gives an example:
    http://developer.java.sun.com/developer/TechTips/1999/tt0826.html

  • Mouse Events on iOS Touch Devices

    I've noticed that mouse events like CLICK and MOUSE_DOWN work on the iPhone and iTouch devices.  Is there a down side to using Mouse events instead of the Gesture and touch events?
    -dis

    I used before mouseClick until I had to make two options with one finger.
    Play song one a click
    Sync song with finger move over component.
    This was archived with this.
    private function tapBegin(evt:TouchEvent):void {
                   _isTab = true;
                   if ( !isIconLabelItemRenderer(evt.target) ) {
                        return;
                   _touchTarget = evt.target as IconLabelItemRenderer;
              private function tapMove(evt:TouchEvent):void {
                   _isTab = false;
                   if ( !isIconLabelItemRenderer(evt.target) ) {
                        _touchTarget = null;
                        return;
                   if ( !_touchTarget ) {
                        return;
                   if ( _touchTarget.data.identifier != evt.target.data.identifier ) {
                        _touchTarget = null;
                        return;
              private function tapEnd(evt:TouchEvent):void {
                   if ( !_touchTarget ) {
                        return;
                   if ( _isTab ) {
                        Player.add(_touchTarget.data);
                        Logger.m(evt.type + " : " + "click");
                   } else {
                        DownloadManager.add(_touchTarget.data);
                        Logger.m(evt.type + " : " + "slide");

  • Capturing global mouse events ?

    Is it possible to capture mouse event generated outside the application as well, as if the java app is running and the user opens a explorer and clicks at something, how can i capture that action ?

    not with pure Java. JNI with native code

  • Intercepting alien mouse events?

    Hello,
    My problem is the following:
    Let's say I have a Frame with two buttons on them, A and B.
    Usually events for B are handled with listeners inside B:
    A.addKeyListener(new java.awt.event.KeyAdapter() {
    public void keyPressed(java.awt.event.KeyEvent evt) {
    // do stuff
    public void keyReleased(java.awt.event.KeyEvent evt) {
    //do stuff
    Ok now I would like to be able for A to intercept all key events! (mouse events would follow the same principle).
    Any idea? I think A should register its interests in ALL key events somewhere but i don't know where and how.

    nm i found a way
    getToolkit().addAWTEventListener(
    new AWTEventListener() {
    public void eventDispatched(AWTEvent e) {
    //MouseEvent me = (MouseEvent)e;
    switch(e.getID()) {
    case MouseEvent.MOUSE_RELEASED:
    System.out.println("released:id="+e.getID());break;
    case MouseEvent.MOUSE_PRESSED:
    System.out.println("pressed:id="+e.getID()); break;
    case MouseEvent.MOUSE_CLICKED:
    System.out.println("clicked:id="+e.getID());break;
    case MouseEvent.MOUSE_EXITED:
    System.out.println("exited:id="+e.getID());break;
    case MouseEvent.MOUSE_ENTERED:
    System.out.println("entered:id="+e.getID());break;
    case MouseEvent.MOUSE_DRAGGED:
    System.out.println("dragged:id="+e.getID());break;
    default:
    System.out.println("other");
    AWTEvent.MOUSE_EVENT_MASK
    getToolkit().addAWTEventListener(
    new AWTEventListener() {
    public void eventDispatched(AWTEvent e) {
    //MouseEvent me = (MouseEvent)e;
    switch(e.getID()) {
    case MouseEvent.MOUSE_DRAGGED:
    System.out.println("dragged:id="+e.getID());break;
    case MouseEvent.MOUSE_MOVED:
    System.out.println("moved:id="+e.getID());break;
    default:
    System.out.println("other");
    AWTEvent.MOUSE_MOTION_EVENT_MASK
    }

  • Mouse wheel event coordinates issue in LV2013

    I realized some unexpected behavior when using the mouse wheel event of an XYGraph:
    The event contains the mouse coordinates which should be relative to the origin of the pane according to the LabVIEW help (see Mouse Wheel (Control Event)). In my case these coordinates are shifted. At the same time, the coordinates returned by the Mouse Move and Mouse Down events are correct. I think the Mouse Move, Mouse Down and Mouse Wheel Event coords should all be the same, i.e. relative to the owning pane's origin? The graph is in a window divided by splitters. I am using LabVIEW 2013 Professional Development System.

    Hi maxicon,
    I tried to reproduce your described behavior - It works as expected (see the attached VI).
    Please try to reproduce the issue again with the attached VI.
    1. Move the mouse and see coords changing.
    2. Operate the mouse wheel and see the coords are the same.
    P.S. Zero-coordinates are marked in the frontpanel:
    Kind regards,
    Heinz
    Attachments:
    Mouse Wheel Coords.vi ‏10 KB

Maybe you are looking for

  • Time Machine won't backup second external hard drive

    I am trying to store my iTunes music library on an external hard drive because I have run out of space on my hard drive. I have moved my folder to the external drive, but before I delete the folder from my computer I want to make sure my Time Machine

  • What is the Keyboard Shortcut to make a COPYRIGHT Symbol on the iPad?

    What is the Keyboard Shortcut to make a COPYRIGHT Symbol on the iPad?

  • Vendor manual clearing

    Hello, I have a vendor open invoice which was processed through MIRO, and it is now open for clearing. When I go to F-44 for manual claering I can see the line item.. can anyone sufggest the steps to clear this invoice through f-44..like what we need

  • Partial Submit

    Hi, I want to do form partial submit without using any command link or button. i want to refresh 1 field. how to do that? I'm using Jdeveloper 10.1.3.1.0 ADF BC. Thanks and Regards, Sudha.

  • Firefox display website in other language but I want English

    There are a lot of store websites that has different languages. I am Chinese but I set up my firefox in English and that's the only language but whenever I go to a website it will automatically go to the Chinese website.