@@ -175,7 +175,8 @@ def __init__(self, figure=None, master=None):
175175 master = self ._tkcanvas , width = w , height = h )
176176 self ._tkcanvas .create_image (w // 2 , h // 2 , image = self ._tkphoto )
177177 self ._tkcanvas .bind ("<Configure>" , self .resize )
178- self ._tkcanvas .bind ("<Map>" , self ._update_device_pixel_ratio )
178+ if sys .platform == 'win32' :
179+ self ._tkcanvas .bind ("<Map>" , self ._update_device_pixel_ratio )
179180 self ._tkcanvas .bind ("<Key>" , self .key_press )
180181 self ._tkcanvas .bind ("<Motion>" , self .motion_notify_event )
181182 self ._tkcanvas .bind ("<Enter>" , self .enter_notify_event )
@@ -212,7 +213,7 @@ def filter_destroy(event):
212213 self ._rubberband_rect = None
213214
214215 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
216217 # scaled vs 96 dpi, and pixel ratio settings are given in whole
217218 # percentages, so round to 2 digits.
218219 ratio = round (self ._tkcanvas .tk .call ('tk' , 'scaling' ) / (96 / 72 ), 2 )
0 commit comments