Ticket #9293: 0009-Removed-unused-message-and-runner-and-related-code.patch

File 0009-Removed-unused-message-and-runner-and-related-code.patch, 3.9 KB (added by Ziusudra, 11 years ago)
  • src/apps/terminal/TermView.cpp

    From e201161fd46f3e9e83afd02a6eb854b0c85010a9 Mon Sep 17 00:00:00 2001
    From: Ziusudra <ziusudra@gmail.com>
    Date: Sun, 16 Dec 2012 16:35:34 -0700
    Subject: [PATCH 9/9] Removed unused message and runner and related code
    
     - kUpdateSigWinch was never sent, so it and fWinchRunner are not needed
     - Without those _UpdateSIGWINCH was only called in one place, so it and
       fFrameResized are no longer needed
    ---
     src/apps/terminal/TermView.cpp |   29 +----------------------------
     src/apps/terminal/TermView.h   |    7 +------
     2 files changed, 2 insertions(+), 34 deletions(-)
    
    diff --git a/src/apps/terminal/TermView.cpp b/src/apps/terminal/TermView.cpp
    index c71b160..b1621b5 100644
    a b static property_info sPropList[] = {  
    361361};
    362362
    363363
    364 static const uint32 kUpdateSigWinch = 'Rwin';
    365364static const uint32 kBlinkCursor = 'BlCr';
    366365static const uint32 kAutoScroll = 'AScr';
    367366
    TermView::_InitObject(const ShellParameters& shellParameters)  
    545544        | B_FULL_UPDATE_ON_RESIZE/* | B_INPUT_METHOD_AWARE*/);
    546545
    547546    fShell = NULL;
    548     fWinchRunner = NULL;
    549547    fCursorBlinkRunner = NULL;
    550548    fAutoScrollRunner = NULL;
    551549    fResizeRunner = NULL;
    TermView::_InitObject(const ShellParameters& shellParameters)  
    554552    fFontWidth = 0;
    555553    fFontHeight = 0;
    556554    fFontAscent = 0;
    557     fFrameResized = false;
    558555    fResizeViewDisableCount = 0;
    559556    fLastActivityTime = 0;
    560557    fCursorState = 0;
    TermView::SetTermSize(int rows, int columns)  
    847844            offset + rows + 2);
    848845    }
    849846
    850     fFrameResized = true;
    851     _UpdateSIGWINCH();
     847    fShell->UpdateWindowSize(fRows, fColumns);
    852848
    853849    return rect;
    854850}
    TermView::_UpdateScrollBarRange()  
    13051301}
    13061302
    13071303
    1308 //! Handler for SIGWINCH
    1309 void
    1310 TermView::_UpdateSIGWINCH()
    1311 {
    1312     if (fFrameResized) {
    1313         fShell->UpdateWindowSize(fRows, fColumns);
    1314         fFrameResized = false;
    1315     }
    1316 }
    1317 
    1318 
    13191304void
    13201305TermView::AttachedToWindow()
    13211306{
    TermView::AttachedToWindow()  
    13331318
    13341319    BMessenger thisMessenger(this);
    13351320
    1336     BMessage message(kUpdateSigWinch);
    1337     fWinchRunner = new (std::nothrow) BMessageRunner(thisMessenger,
    1338         &message, 500000);
    1339 
    13401321    {
    13411322        BAutolock _(fTextBuffer);
    13421323        fTextBuffer->SetListener(thisMessenger);
    TermView::DetachedFromWindow()  
    13521333{
    13531334    be_clipboard->StopWatching(BMessenger(this));
    13541335
    1355     delete fWinchRunner;
    1356     fWinchRunner = NULL;
    1357 
    13581336    delete fCursorBlinkRunner;
    13591337    fCursorBlinkRunner = NULL;
    13601338
    TermView::FrameResized(float width, float height)  
    17461724        fResizeViewDisableCount--;
    17471725
    17481726    SetTermSize(rows, columns);
    1749 
    1750     fFrameResized = true;
    17511727}
    17521728
    17531729
    TermView::MessageReceived(BMessage *msg)  
    19871963        case kBlinkCursor:
    19881964            _BlinkCursor();
    19891965            break;
    1990         case kUpdateSigWinch:
    1991             _UpdateSIGWINCH();
    1992             break;
    19931966        case kAutoScroll:
    19941967            _AutoScrollUpdate();
    19951968            break;
  • src/apps/terminal/TermView.h

    diff --git a/src/apps/terminal/TermView.h b/src/apps/terminal/TermView.h
    index 68272ee..2c7f749 100644
    a b public:  
    5959            bool                IsShellBusy() const;
    6060            bool                GetActiveProcessInfo(
    6161                                    ActiveProcessInfo& _info) const;
    62             bool            GetShellInfo(ShellInfo& _info) const;
     62            bool                GetShellInfo(ShellInfo& _info) const;
    6363
    6464            const char*         TerminalName() const;
    6565
    private:  
    197197            bool                _CheckSelectedRegion(int32 row,
    198198                                    int32 firstColumn, int32& lastColumn) const;
    199199
    200             void                _UpdateSIGWINCH();
    201 
    202200            void                _ScrollTo(float y, bool scrollGfx);
    203201            void                _ScrollToRange(TermPos start, TermPos end);
    204202
    private:  
    214212            Listener*           fListener;
    215213            Shell*              fShell;
    216214
    217             BMessageRunner*     fWinchRunner;
    218215            BMessageRunner*     fCursorBlinkRunner;
    219216            BMessageRunner*     fAutoScrollRunner;
    220217            BMessageRunner*     fResizeRunner;
    private:  
    228225            int                 fFontAscent;
    229226            struct escapement_delta fEscapement;
    230227
    231             // frame resized flag.
    232             bool                fFrameResized;
    233228            int32               fResizeViewDisableCount;
    234229
    235230            // Cursor Blinking, draw flag.