@@ -177,7 +177,8 @@ def __init__(self, figure=None, master=None, resize_callback=None):
177
177
self ._tkcanvas .create_image (w // 2 , h // 2 , image = self ._tkphoto )
178
178
self ._resize_callback = resize_callback
179
179
self ._tkcanvas .bind ("<Configure>" , self .resize )
180
- self ._tkcanvas .bind ("<Map>" , self ._update_device_pixel_ratio )
180
+ if sys .platform == 'win32' :
181
+ self ._tkcanvas .bind ("<Map>" , self ._update_device_pixel_ratio )
181
182
self ._tkcanvas .bind ("<Key>" , self .key_press )
182
183
self ._tkcanvas .bind ("<Motion>" , self .motion_notify_event )
183
184
self ._tkcanvas .bind ("<Enter>" , self .enter_notify_event )
@@ -212,7 +213,7 @@ def filter_destroy(event):
212
213
self ._tkcanvas .focus_set ()
213
214
214
215
def _update_device_pixel_ratio (self , event = None ):
215
- # Tk gives scaling with respect to 72 DPI, but most (all?) screens are
216
+ # Tk gives scaling with respect to 72 DPI, but Windows screens are
216
217
# scaled vs 96 dpi, and pixel ratio settings are given in whole
217
218
# percentages, so round to 2 digits.
218
219
ratio = round (self ._tkcanvas .tk .call ('tk' , 'scaling' ) / (96 / 72 ), 2 )
0 commit comments