Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c72d331

Browse files
committed
gtk3: Remove POINTER_MOTION_HINT_MASK usage entirely
It is deprecated since GTK 3.8, and event compression occurs in other ways which don't seem relevant to us.
1 parent b61dcd0 commit c72d331

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

lib/matplotlib/backends/backend_gtk3.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ class FigureCanvasGTK3(Gtk.DrawingArea, FigureCanvasBase):
9494
| Gdk.EventMask.ENTER_NOTIFY_MASK
9595
| Gdk.EventMask.LEAVE_NOTIFY_MASK
9696
| Gdk.EventMask.POINTER_MOTION_MASK
97-
| Gdk.EventMask.POINTER_MOTION_HINT_MASK
9897
| Gdk.EventMask.SCROLL_MASK)
9998

10099
def __init__(self, figure=None):
@@ -185,14 +184,7 @@ def key_release_event(self, widget, event):
185184
return True # stop event propagation
186185

187186
def motion_notify_event(self, widget, event):
188-
if event.is_hint:
189-
t, x, y, state = event.window.get_device_position(event.device)
190-
# flipy so y=0 is bottom of canvas
191-
x *= self.device_pixel_ratio
192-
y = (self.get_allocation().height - y) * self.device_pixel_ratio
193-
else:
194-
x, y = self._mouse_event_coords(event)
195-
187+
x, y = self._mouse_event_coords(event)
196188
FigureCanvasBase.motion_notify_event(self, x, y, guiEvent=event)
197189
return False # finish event propagation?
198190

0 commit comments

Comments
 (0)