picoe / Eto

Cross platform GUI framework for desktop and mobile applications in .NET
Other
3.66k stars 333 forks source link

Control's MouseMove event not triggered when any mouse button is pressed (happening in Gtk) #1730

Open Karl255 opened 4 years ago

Karl255 commented 4 years ago

Expected Behavior

MouseMove event gets triggered when mouse is moved (this happens in Windows/WPF)

Actual Behavior

MouseMove event gets triggered only when mouse is moved and no mouse buttons are being held (this happens in Linux/Gtk3)

Steps to Reproduce the Problem

  1. Add an event handler that does something on a control that inherits from Control (such as ImageView)
  2. Build, then run on Linux
  3. Move mouse -> event gets triggered
  4. Start holding some mouse button and then move mouse -> event doesn't get triggered

Code that Demonstrates the Problem

Code from my small test program EtoPaint. On Windows, pixels get placed when you hold left click and move the mouse, but on Linux nothing happens.

Specifications

cwensley commented 4 years ago

One thing that would work here is you need to handle MouseDown first to get these messages, usually.

For example,

myControl.MouseDown += (sender, e) => e.Handled = true;

This means that you want to capture the mouse and prevent and system-supplied functionality.