Skip to content

Commit

Permalink
Merge pull request #4180 from BOINC/mac_fix_high_CPU_SimpleView
Browse files Browse the repository at this point in the history
Mac: Fix high CPU use by Simple View when run on MacOS 10.14 and later
  • Loading branch information
davidpanderson committed Feb 12, 2021
2 parents f41459a + 1bb24be commit 9becb35
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions clientgui/mac/MacBitmapComboBox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

#include "stdwx.h"
#include "MacBitmapComboBox.h"
#include "mac_util.h"

#define POPUPBUTTONCONTROLHEIGHT 40

Expand Down Expand Up @@ -275,7 +276,7 @@ void CBOINCBitmapComboBox::OnPaint(wxPaintEvent& event) {
wxBrush oldBrush = myDC.GetBrush();
int oldMode = myDC.GetBackgroundMode();

myDC.SetPen(*wxMEDIUM_GREY_PEN);
myDC.SetPen(*wxLIGHT_GREY_PEN);
myDC.SetBrush(*wxWHITE_BRUSH);
myDC.SetBackgroundMode(wxSOLID);

Expand All @@ -287,8 +288,10 @@ void CBOINCBitmapComboBox::OnPaint(wxPaintEvent& event) {
myDC.SetPen(oldPen);
myDC.SetBrush(oldBrush);

CDrawLargeBitmapEvent newEvent(wxEVT_DRAW_LARGEBITMAP, this);
AddPendingEvent(newEvent);
if (compareOSVersionTo(10, 14) < 0) {
CDrawLargeBitmapEvent newEvent(wxEVT_DRAW_LARGEBITMAP, this);
AddPendingEvent(newEvent);
}
}


Expand Down

0 comments on commit 9becb35

Please sign in to comment.