summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorLéo Lam <leo@innovatetechnologi.es>2016-07-15 23:59:05 +0200
committerLéo Lam <leo@innovatetechnologi.es>2016-09-07 15:15:09 +0200
commite8cb4119b861d7d76f051f45bf2ebf5689d1c8f2 (patch)
tree26b4685e261e10ee4ce20e36ae1c319f6b0a7360 /Source/Core
parentb2dcbbf884f99d5eb4bff72e45da87f6067d2f2a (diff)
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.
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/DolphinWX/AuiToolBar.h22
-rw-r--r--Source/Core/DolphinWX/Debugger/BreakpointWindow.cpp8
-rw-r--r--Source/Core/DolphinWX/Debugger/CodeWindow.cpp7
-rw-r--r--Source/Core/DolphinWX/Debugger/CodeWindow.h4
-rw-r--r--Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp4
-rw-r--r--Source/Core/DolphinWX/Debugger/DSPDebugWindow.h4
-rw-r--r--Source/Core/DolphinWX/Debugger/WatchWindow.cpp8
7 files changed, 40 insertions, 17 deletions
diff --git a/Source/Core/DolphinWX/AuiToolBar.h b/Source/Core/DolphinWX/AuiToolBar.h
new file mode 100644
index 0000000000..baf12a0b9c
--- /dev/null
+++ b/Source/Core/DolphinWX/AuiToolBar.h
@@ -0,0 +1,22 @@
+// 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);
+ }
+};
diff --git a/Source/Core/DolphinWX/Debugger/BreakpointWindow.cpp b/Source/Core/DolphinWX/Debugger/BreakpointWindow.cpp
index 8469e1ed02..dd2936a904 100644
--- a/Source/Core/DolphinWX/Debugger/BreakpointWindow.cpp
+++ b/Source/Core/DolphinWX/Debugger/BreakpointWindow.cpp
@@ -4,7 +4,6 @@
// clang-format off
#include <wx/bitmap.h>
-#include <wx/aui/auibar.h>
#include <wx/aui/framemanager.h>
#include <wx/image.h>
#include <wx/listbase.h>
@@ -23,14 +22,15 @@
#include "DolphinWX/Debugger/BreakpointWindow.h"
#include "DolphinWX/Debugger/CodeWindow.h"
#include "DolphinWX/Debugger/MemoryCheckDlg.h"
+#include "DolphinWX/AuiToolBar.h"
#include "DolphinWX/WxUtils.h"
-class CBreakPointBar : public wxAuiToolBar
+class CBreakPointBar : public DolphinAuiToolBar
{
public:
CBreakPointBar(CBreakPointWindow* parent, const wxWindowID id)
- : wxAuiToolBar(parent, id, wxDefaultPosition, wxDefaultSize,
- wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_TEXT)
+ : DolphinAuiToolBar(parent, id, wxDefaultPosition, wxDefaultSize,
+ wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_TEXT)
{
SetToolBitmapSize(wxSize(24, 24));
diff --git a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp
index beda6a442b..8e0b2f80d9 100644
--- a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp
+++ b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp
@@ -8,7 +8,6 @@
// clang-format off
#include <wx/bitmap.h>
-#include <wx/aui/auibar.h>
#include <wx/image.h>
#include <wx/listbox.h>
#include <wx/menu.h>
@@ -19,6 +18,7 @@
#include <wx/textdlg.h>
#include <wx/thread.h>
#include <wx/toolbar.h>
+#include <wx/aui/auibar.h>
#include <wx/aui/dockart.h>
// clang-format on
@@ -45,6 +45,7 @@
#include "DolphinWX/Debugger/JitWindow.h"
#include "DolphinWX/Debugger/RegisterWindow.h"
#include "DolphinWX/Debugger/WatchWindow.h"
+#include "DolphinWX/AuiToolBar.h"
#include "DolphinWX/Frame.h"
#include "DolphinWX/Globals.h"
#include "DolphinWX/WxUtils.h"
@@ -74,8 +75,8 @@ CCodeWindow::CCodeWindow(const SConfig& _LocalCoreStartupParameter, CFrame* pare
callers = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, nullptr, wxLB_SORT);
callers->Bind(wxEVT_LISTBOX, &CCodeWindow::OnCallersListChange, this);
- m_aui_toolbar = new wxAuiToolBar(this, wxID_ANY, wxDefaultPosition, wxDefaultSize,
- wxAUI_TB_HORIZONTAL | wxAUI_TB_PLAIN_BACKGROUND);
+ m_aui_toolbar = new DolphinAuiToolBar(this, wxID_ANY, wxDefaultPosition, wxDefaultSize,
+ wxAUI_TB_HORIZONTAL | wxAUI_TB_PLAIN_BACKGROUND);
wxSearchCtrl* const address_searchctrl = new wxSearchCtrl(m_aui_toolbar, IDM_ADDRBOX);
address_searchctrl->Bind(wxEVT_TEXT, &CCodeWindow::OnAddrBoxChange, this);
diff --git a/Source/Core/DolphinWX/Debugger/CodeWindow.h b/Source/Core/DolphinWX/Debugger/CodeWindow.h
index 25d1b4fa30..5788d7d062 100644
--- a/Source/Core/DolphinWX/Debugger/CodeWindow.h
+++ b/Source/Core/DolphinWX/Debugger/CodeWindow.h
@@ -23,7 +23,7 @@ class DSPDebuggerLLE;
class GFXDebuggerPanel;
struct SConfig;
-class wxAuiToolBar;
+class DolphinAuiToolBar;
class wxListBox;
class wxMenu;
class wxMenuBar;
@@ -125,5 +125,5 @@ private:
Common::Event sync_event;
wxAuiManager m_aui_manager;
- wxAuiToolBar* m_aui_toolbar;
+ DolphinAuiToolBar* m_aui_toolbar;
};
diff --git a/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp b/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp
index 7b4909a4e8..c3d2aef98c 100644
--- a/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp
+++ b/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp
@@ -4,7 +4,6 @@
#include <cstdio>
#include <wx/artprov.h>
-#include <wx/aui/auibar.h>
#include <wx/aui/auibook.h>
#include <wx/aui/framemanager.h>
#include <wx/listbox.h>
@@ -20,6 +19,7 @@
#include "Core/HW/DSPLLE/DSPDebugInterface.h"
#include "Core/HW/DSPLLE/DSPSymbols.h"
#include "Core/Host.h"
+#include "DolphinWX/AuiToolBar.h"
#include "DolphinWX/Debugger/CodeView.h"
#include "DolphinWX/Debugger/DSPDebugWindow.h"
#include "DolphinWX/Debugger/DSPRegisterView.h"
@@ -42,7 +42,7 @@ DSPDebuggerLLE::DSPDebuggerLLE(wxWindow* parent, wxWindowID id)
m_mgr.SetFlags(wxAUI_MGR_DEFAULT | wxAUI_MGR_LIVE_RESIZE);
m_Toolbar =
- new wxAuiToolBar(this, ID_TOOLBAR, wxDefaultPosition, wxDefaultSize, wxAUI_TB_HORZ_TEXT);
+ new DolphinAuiToolBar(this, ID_TOOLBAR, wxDefaultPosition, wxDefaultSize, wxAUI_TB_HORZ_TEXT);
m_Toolbar->AddTool(ID_RUNTOOL, _("Pause"),
wxArtProvider::GetBitmap(wxART_TICK_MARK, wxART_OTHER, wxSize(10, 10)));
m_Toolbar->AddTool(ID_STEPTOOL, _("Step"),
diff --git a/Source/Core/DolphinWX/Debugger/DSPDebugWindow.h b/Source/Core/DolphinWX/Debugger/DSPDebugWindow.h
index 7f1215bfb7..51519f010c 100644
--- a/Source/Core/DolphinWX/Debugger/DSPDebugWindow.h
+++ b/Source/Core/DolphinWX/Debugger/DSPDebugWindow.h
@@ -14,7 +14,7 @@ class DSPRegisterView;
class CCodeView;
class CMemoryView;
class wxAuiNotebook;
-class wxAuiToolBar;
+class DolphinAuiToolBar;
class wxListBox;
class DSPDebuggerLLE : public wxPanel
@@ -45,7 +45,7 @@ private:
// GUI items
wxAuiManager m_mgr;
- wxAuiToolBar* m_Toolbar;
+ DolphinAuiToolBar* m_Toolbar;
CCodeView* m_CodeView;
CMemoryView* m_MemView;
DSPRegisterView* m_Regs;
diff --git a/Source/Core/DolphinWX/Debugger/WatchWindow.cpp b/Source/Core/DolphinWX/Debugger/WatchWindow.cpp
index ce92d7e656..f43190a5d3 100644
--- a/Source/Core/DolphinWX/Debugger/WatchWindow.cpp
+++ b/Source/Core/DolphinWX/Debugger/WatchWindow.cpp
@@ -6,7 +6,6 @@
// clang-format off
#include <wx/bitmap.h>
-#include <wx/aui/auibar.h>
#include <wx/panel.h>
// clang-format on
@@ -16,14 +15,15 @@
#include "Core/PowerPC/PowerPC.h"
#include "DolphinWX/Debugger/WatchView.h"
#include "DolphinWX/Debugger/WatchWindow.h"
+#include "DolphinWX/AuiToolBar.h"
#include "DolphinWX/WxUtils.h"
-class CWatchToolbar : public wxAuiToolBar
+class CWatchToolbar : public DolphinAuiToolBar
{
public:
CWatchToolbar(CWatchWindow* parent, const wxWindowID id)
- : wxAuiToolBar(parent, id, wxDefaultPosition, wxDefaultSize,
- wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_TEXT)
+ : DolphinAuiToolBar(parent, id, wxDefaultPosition, wxDefaultSize,
+ wxAUI_TB_DEFAULT_STYLE | wxAUI_TB_TEXT)
{
SetToolBitmapSize(wxSize(16, 16));