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 @@ -431,6 +431,17 @@ def _get_toolbar(self):
431
431
return toolbar
432
432
433
433
def resize (self , width , height ):
434
+ max_size = 1_400_000 # the measured max on xorg 1.20.8 was 1_409_023
435
+
436
+ if (width > max_size or height > max_size ) and sys .platform == 'linux' :
437
+ raise ValueError (
438
+ 'You have requested to resize the '
439
+ f'Tk window to ({ width } , { height } ), one of which '
440
+ f'is bigger than { max_size } . At larger sizes xorg will '
441
+ 'either exit with an error on newer versions (~1.20) or '
442
+ 'cause corruption on older version (~1.19). We '
443
+ 'do not expect a window over a million pixel wide or tall '
444
+ 'to be intended behavior.' )
434
445
self .canvas ._tkcanvas .configure (width = width , height = height )
435
446
436
447
def show (self ):
You can’t perform that action at this time.
0 commit comments