Ticket #12480: Patch-12480.patch

File Patch-12480.patch, 1.9 KB (added by looncraz, 8 years ago)
  • src/apps/deskbar/ExpandoMenuBar.cpp

    From 94ebb7194156d95339d0314e0e445ae59d439337 Mon Sep 17 00:00:00 2001
    From: looncraz <looncraz@looncraz.net>
    Date: Tue, 12 Jul 2016 22:55:55 +0000
    Subject: [PATCH] Expand already running applications when Deskbar starts
    
    Fixes #12480
    
    Another way to solvethis would be to ensure that TExpandoMenuBar was subscribed
    to TBarApp's notifications before TExpandoMenuBar::AttachedToWindow() returns, but
    creates other problems that this solution does not have.
    ---
     src/apps/deskbar/ExpandoMenuBar.cpp | 7 +++++++
     src/apps/deskbar/ExpandoMenuBar.h   | 1 +
     2 files changed, 8 insertions(+)
    
    diff --git a/src/apps/deskbar/ExpandoMenuBar.cpp b/src/apps/deskbar/ExpandoMenuBar.cpp
    index b4c01b1..cebdaa6 100644
    a b TExpandoMenuBar::TExpandoMenuBar(TBarView* barView, bool vertical)  
    9292    fBarView(barView),
    9393    fVertical(vertical),
    9494    fOverflow(false),
     95    fFirstBuild(true),
    9596    fDeskbarMenuWidth(kMinMenuItemWidth),
    9697    fPreviousDragTargetItem(NULL),
    9798    fLastMousedOverItem(NULL),
    TExpandoMenuBar::BuildItems()  
    506507                AddItem(item, 0);
    507508            } else
    508509                AddItem(item);
     510
     511            if (fFirstBuild && fVertical && settings->expandNewTeams)
     512                item->ToggleExpandState(true);
     513
    509514        } else {
    510515            // existing team, update info and add it
    511516            TTeamMenuItem* item = iter->second;
    TExpandoMenuBar::BuildItems()  
    551556        // weird value - we just override it again
    552557        ResizeTo(itemWidth, 0);
    553558    }
     559
     560    fFirstBuild = false;
    554561}
    555562
    556563
  • src/apps/deskbar/ExpandoMenuBar.h

    diff --git a/src/apps/deskbar/ExpandoMenuBar.h b/src/apps/deskbar/ExpandoMenuBar.h
    index 468e3c6..5f338c5 100644
    a b private:  
    114114            TBarView*       fBarView;
    115115            bool            fVertical : 1;
    116116            bool            fOverflow : 1;
     117            bool            fFirstBuild : 1;
    117118
    118119            float           fDeskbarMenuWidth;
    119120            TTeamMenuItem*  fPreviousDragTargetItem;