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

Skip to content

Commit 90d17a3

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 75ecd40 commit 90d17a3

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
@@ -93,7 +93,6 @@ class FigureCanvasGTK3(Gtk.DrawingArea, FigureCanvasBase):
9393
| Gdk.EventMask.ENTER_NOTIFY_MASK
9494
| Gdk.EventMask.LEAVE_NOTIFY_MASK
9595
| Gdk.EventMask.POINTER_MOTION_MASK
96-
| Gdk.EventMask.POINTER_MOTION_HINT_MASK
9796
| Gdk.EventMask.SCROLL_MASK)
9897

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

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

0 commit comments

Comments
 (0)