File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,16 @@ class SurfaceScrollView: NSView {
4848 // We stack the surface view and scroll view as subviews of this view
4949 addSubview ( surfaceView)
5050 addSubview ( scrollView)
51+
52+ // In principle, surfaceView should have been a subview of
53+ // scrollView.contentView; however, we have to make it a direct subview
54+ // of this view to allow it to overlap with the scrollbar and draw a
55+ // background behind it, rather than being tiled next to it like the
56+ // contentView. However, we need events to propagate as if we had the
57+ // usual hierarchy, otherwise mouse scroll events wouldn't be passed
58+ // onto the terminal, so we wouldn't have scrolling in TUIs.
59+ nextResponder = scrollView
60+ scrollView. contentView. nextResponder = surfaceView
5161
5262 // Apply initial scrollbar settings
5363 synchronizeAppearance ( )
@@ -227,5 +237,8 @@ class SurfaceScrollView: NSView {
227237 // move the scrollbar.
228238 lastSentRow = Int ( scrollbar. offset)
229239 }
240+
241+ // Always update our scrolled view with the latest dimensions
242+ scrollView. reflectScrolledClipView ( scrollView. contentView)
230243 }
231244}
You can’t perform that action at this time.
0 commit comments