Commit 3fb41cc
committed
Fix flashing during window resizing.
The root cause of flashing/flickering was that on each resize event,
AppKit called drawRect: on the MMCoreTextView, expecting it to fill an
empty, newly-sized buffer with content. It has nothing to draw, so the
view would show up as black until the BatchDrawMsgID reply arrived from
the backend and triggered another draw. (The MMCoreTextView was
display:ed twice for each resize).
This change does three things:
1. Implements -[MMCoreTextView setFrameSize:] to begin an
NSAnimationContext grouping before calling super, which postpones
display:/drawRect: until the grouping ends, and ends the grouping in
performBatchDrawWithData:.
2. Makes *all* resize messages sent to the backend synchronous, with a
1s timeout. This seems bad, but actually helps avoid spamming the
backend with resize events, since the app only generates resize
events as fast as we handle them (i.e. if we take time to process one
resize, then the next resize event will have the current size of the
window, potentially skipping a bunch in the middle that the backend
never would have had time to handle).
3. Gets rid of some hacks resolved by 1 and 2, like MKVimController
delaying the call to -[MMWindowController presentWindow:].1 parent 98496b9 commit 3fb41cc
File tree
5 files changed
+18
-46
lines changed- src/MacVim
5 files changed
+18
-46
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
96 | 97 | | |
97 | 98 | | |
98 | 99 | | |
| 100 | + | |
99 | 101 | | |
100 | 102 | | |
101 | 103 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
446 | 446 | | |
447 | 447 | | |
448 | 448 | | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
449 | 457 | | |
450 | 458 | | |
451 | 459 | | |
| |||
650 | 658 | | |
651 | 659 | | |
652 | 660 | | |
653 | | - | |
654 | | - | |
655 | | - | |
656 | | - | |
657 | | - | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
658 | 665 | | |
659 | 666 | | |
660 | 667 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
554 | 554 | | |
555 | 555 | | |
556 | 556 | | |
557 | | - | |
558 | | - | |
559 | | - | |
560 | | - | |
561 | | - | |
562 | | - | |
563 | | - | |
564 | | - | |
565 | | - | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
566 | 560 | | |
567 | 561 | | |
568 | 562 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
909 | 909 | | |
910 | 910 | | |
911 | 911 | | |
912 | | - | |
| 912 | + | |
913 | 913 | | |
914 | 914 | | |
915 | 915 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
697 | 697 | | |
698 | 698 | | |
699 | 699 | | |
700 | | - | |
701 | | - | |
702 | | - | |
703 | | - | |
704 | | - | |
705 | | - | |
706 | | - | |
707 | | - | |
708 | | - | |
709 | | - | |
710 | | - | |
711 | | - | |
712 | | - | |
713 | | - | |
714 | | - | |
715 | | - | |
716 | | - | |
717 | | - | |
718 | | - | |
719 | | - | |
720 | | - | |
721 | | - | |
722 | | - | |
723 | | - | |
724 | | - | |
725 | | - | |
726 | | - | |
727 | | - | |
728 | | - | |
729 | | - | |
730 | | - | |
731 | 700 | | |
732 | 701 | | |
733 | 702 | | |
| |||
0 commit comments