Skip to content

Expose mouse pos #348

@stuartnelson3

Description

@stuartnelson3

I'm currently in the process of un-forking glutin in servo. The last issue preventing this is that WindowEvent::MouseInput and WindowEvent::MouseWheel do not provide the mouse's current position.

Since mouse moved events are only received when the window is focused, this makes it possible for a the window to lose focus, the user can move the mouse, and then the window regains focus with its last known mouse position being incorrect. For an application that depends on knowing the mouse position to handle mouse events in different ways, this results in incorrect behavior.

I have two ideas on how to fix this:

  1. Expose the mouse position information on WindowEvent::{MouseInput, MouseWheel}, or
  2. Expose the mouse position information on WindowEvent::Focus (I'll admit this option feels a bit weird, but it could also work).

Do either of these sound like potential options? I would be happy to implement this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions