File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -460,6 +460,17 @@ def _get_toolmanager(self):
460460 return toolmanager
461461
462462 def resize (self , width , height ):
463+ max_size = 1_400_000 # the measured max on xorg 1.20.8 was 1_409_023
464+
465+ if (width > max_size or height > max_size ) and sys .platform == 'linux' :
466+ raise ValueError (
467+ 'You have requested to resize the '
468+ f'Tk window to ({ width } , { height } ), one of which '
469+ f'is bigger than { max_size } . At larger sizes xorg will '
470+ 'either exit with an error on newer versions (~1.20) or '
471+ 'cause corruption on older version (~1.19). We '
472+ 'do not expect a window over a million pixel wide or tall '
473+ 'to be intended behavior.' )
463474 self .canvas ._tkcanvas .configure (width = width , height = height )
464475
465476 def show (self ):
You can’t perform that action at this time.
0 commit comments