From 0eed2a7c98afafc461dd42a93986bb2f898d262e Mon Sep 17 00:00:00 2001 From: Ryan Leavengood Date: Thu, 2 Aug 2012 23:16:18 -0400 Subject: [PATCH] Fix flickering menus, especially menu bars. Figured out by Stephan originally and only hacked in WebPositive, I knew something about WebPositive was different because it did not flicker when everything else did. Since we fully draw the menus there is no need to have app_server fill in the background with the view color. That is what was causing the flickering. Should fix #484, #532 and #4335. Thanks diver for confirming the patch against those tickets. --- src/kits/interface/Menu.cpp | 2 +- src/kits/interface/MenuBar.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/kits/interface/Menu.cpp b/src/kits/interface/Menu.cpp index c8692063d9..6905c15605 100644 --- a/src/kits/interface/Menu.cpp +++ b/src/kits/interface/Menu.cpp @@ -1439,7 +1439,7 @@ BMenu::_InitData(BMessage* archive) fLayoutData->lastResizingMode = ResizingMode(); SetLowColor(sMenuInfo.background_color); - SetViewColor(sMenuInfo.background_color); + SetViewColor(B_TRANSPARENT_COLOR); fTriggerEnabled = sMenuInfo.triggers_always_shown; diff --git a/src/kits/interface/MenuBar.cpp b/src/kits/interface/MenuBar.cpp index dfe13b494a..b29f9d5ef5 100644 --- a/src/kits/interface/MenuBar.cpp +++ b/src/kits/interface/MenuBar.cpp @@ -47,8 +47,8 @@ struct menubar_data { BMenuBar::BMenuBar(BRect frame, const char* title, uint32 resizeMask, menu_layout layout, bool resizeToFit) : - BMenu(frame, title, resizeMask, B_WILL_DRAW | B_FRAME_EVENTS, layout, - resizeToFit), + BMenu(frame, title, resizeMask, B_WILL_DRAW | B_FRAME_EVENTS + | B_FULL_UPDATE_ON_RESIZE, layout, resizeToFit), fBorder(B_BORDER_FRAME), fTrackingPID(-1), fPrevFocusToken(-1),