Migrate from GitHub to SourceForge with this tool. Check out all of SourceForge's recent improvements.
Close

#1635 Crash when using TrackPoint middle-button scrolling

Branch_+_Trunk
closed-fixed
None
5
2008-01-05
2008-01-04
No

Version 2.7.7.1 and 2.6.12.0

WinMerge crashes when using IBM TrackPoint middle-button scrolling on diff pane.

Please see the attached screenshot. It shows the crash was caused in CSplitterWnd::OnVScroll().

I think that it is strange that the OnVScroll event occurs when trying to scroll on diff pane. Because the diff pane doesn't have a vertical scroll bar.

I don't know whether the following fix is correct but it prevents the crash by not calling CSplitterWnd::OnVScroll() when a window doesn't have a vertical scroll bar.

Index: Common/SplitterWndEx.cpp

===================================================================

--- Common/SplitterWndEx.cpp (revision 4854)

+++ Common/SplitterWndEx.cpp (working copy)

@@ -114,13 +114,14 @@

// scroll bar)
if (pScrollBar == NULL)
return;
- // maintain original synchronization functionality (all panes left from the scrollbar)
- CSplitterWnd::OnVScroll(nSBCode, nPos, pScrollBar);

// only sync if shared vertical bars
if\(\(GetScrollStyle\(\)&WS\_VSCROLL\) == 0\)
    return;

+ // maintain original synchronization functionality (all panes left from the scrollbar)
+ CSplitterWnd::OnVScroll(nSBCode, nPos, pScrollBar);
+
// enhance with proportional vertical scroll synchronization
ASSERT(pScrollBar != NULL);
int curRow = ::GetDlgCtrlID(pScrollBar->m_hWnd) - AFX_IDW_VSCROLL_FIRST;

Discussion

  • Kimmo Varis

    Kimmo Varis - 2008-01-04

    Logged In: YES
    user_id=631874
    Originator: NO

    Diff-pane is quite a weird pane. And unfortunately don't have vertical scroll-bars, it really would need them (RFE #969444 Diff pane should have vertical scrollbars).

    But until we have them, this patch looks good and needed. And please apply to 2.6 branch also, crashes are always bad.

     
  • Takashi Sawanaka

    Logged In: YES
    user_id=954028
    Originator: YES

    Committed to SVN trunk (rev. 4856) and 2.6 bransh (rev. 4857)

     
  • Takashi Sawanaka

    • assigned_to: nobody --> sdottaka
    • status: open --> closed-fixed
     

Log in to post a comment.