dolphin/Source/Core/DolphinWX/AuiToolBar.h
Léo Lam e8cb4119b8 Drop Dolphin-specific patch to wxWindows
This removes a Dolphin-specific patch to the wxWidgets3 code
for the following reasons:

* Calling wxWindowGTK::DoSetSize on a top-level window can end up
  calling wxTopLevelWindowGTK::DoMoveWindow, which triggers an assert
  because it is not supposed to be called for a top-level wxWindow.

* We should not be patching the wxWidgets code because that means the
  toolbars will still be broken if someone builds without using the
  WX that is in our Externals.

Instead, we now use a derived class for wxAuiToolBar and override
DoSetSize() to remove the problematic behaviour to get the same effect
(fixing toolbars) but without changing Externals code and without
causing asserts and other issues.
2016-09-07 15:15:09 +02:00

23 lines
723 B
C++

// Copyright 2016 Dolphin Emulator Project
// Licensed under GPLv2+
// Refer to the license.txt file included.
#include <wx/aui/auibar.h>
#include <wx/window.h>
// This fixes wxAuiToolBar setting itself to 21 pixels wide regardless of content
// because of a wxWidgets issue as described here: https://dolp.in/pr4013#issuecomment-233096214
// It overrides DoSetSize() to remove the clamping in the original WX code
// which is causing display issues on Linux and OS X.
class DolphinAuiToolBar : public wxAuiToolBar
{
public:
using wxAuiToolBar::wxAuiToolBar;
protected:
void DoSetSize(int x, int y, int width, int height, int size_flags) override
{
wxWindow::DoSetSize(x, y, width, height, size_flags);
}
};