#68 IDEA popups don't place the cursor correctly

v1.0 (example)
closed-fixed
nobody
None
5
2014-05-21
2013-12-02
Arnout Engelen
No

For example when opening the SVN update/commit popup, the mouse cursor is placed way to the right.

This is with 2 monitors side-by-side - it almost seems like the cursor is placed on the wrong screen or something...

Discussion

  • Arnout Engelen
    Arnout Engelen
    2013-12-04

    Works now... I wonder what triggered this.

    Might have something to do with the fact that my 'primary' monitor was the rightmost of my 2 monitors instead of the leftmost at the time, but even when I switch that I can't quickly reproduce the issue...

     
  • Arnout Engelen
    Arnout Engelen
    2013-12-15

    I wonder if this is because we're not setting _NET_DESKTOP_VIEWPORT - but to set that correctly we have to figure out how to map EMWH desktops to our workspaces.

     
  • Arnout Engelen
    Arnout Engelen
    2013-12-16

    OK, it doesn't seem to be quite as 'simple' as this - I'm having a hard time reproducing this consistently. After a while the problem goes away, and so far I haven't been able to bring it back on purpose yet, despite enabling/disabling desktops and suspend/unsuspending the machine...

     
  • Arnout Engelen
    Arnout Engelen
    2014-05-01

    Seems to be fairly consistent now :). Might be related to http://youtrack.jetbrains.com/issue/IDEA-106048.

    Note that both dialog placement and cursor warping is off. When the IDEA window is on the left screen, the pointer is warped to the location of the corresponding button, but on the right screen - indeed with xtrace I see a warp event with an 'x' value that is a screenwidth too high.

    The dialog placement can be reproduced using simple AWT and Swing applications. The cursor warping can't, but is likely due to the same root cause.

    This is with java7 from Oracle.

     
  • Arnout Engelen
    Arnout Engelen
    2014-05-21

    This problem only exist when you enable 'automatically position mouse cursor on default button' in File->Settings->Appearance

    Looks like the interesting code is in com.intellij.openapi.ui.impl.DialogWrapperPeerImpl

    private void moveMousePointerOnButton(final JButton button) {
    Application application = ApplicationManager.getApplication();
    if (application != null && application.hasComponent(UISettings.class)) {
    if (button != null && UISettings.getInstance().MOVE_MOUSE_ON_DEFAULT_BUTTON) {
    Point p = button.getLocationOnScreen();
    Rectangle r = button.getBounds();
    try {
    Robot robot = new Robot();
    robot.mouseMove(p.x + r.width / 2, p.y + r.height / 2);
    }
    catch (AWTException e) {
    LOG.warn(e);
    }
    }
    }
    }

    The problem appears to be button.getLocationOnScreen() returns the location relative to the top-left corner of the virtual screen (i.e. of the leftmost monitor). In previous versions of the JRE (at least up to oracle 1.8.0_05), robot.mouseMove would add the with of the screen to the 'x' parameter, moving it too far to the right. However, openjdk from mercurial as of today leaves the 'x' parameter untouched.

     
  • Arnout Engelen
    Arnout Engelen
    2014-05-21

    • status: open --> closed-fixed