diff --git a/Externals/wxWidgets3/src/gtk/window.cpp b/Externals/wxWidgets3/src/gtk/window.cpp index 711a930d5ef1..087a0a8d0466 100644 --- a/Externals/wxWidgets3/src/gtk/window.cpp +++ b/Externals/wxWidgets3/src/gtk/window.cpp @@ -3072,9 +3072,7 @@ void wxWindowGTK::DoSetClientSize( int width, int height ) const wxSize size = GetSize(); const wxSize clientSize = GetClientSize(); - // XXX: Dolphin: This is an internal call, it should never trigger the SetSize path in derived classes. - // This fixes wxAuiToolbar setting itself to 21 pixels wide regardless of content. - wxWindowGTK::DoSetSize(wxDefaultCoord, wxDefaultCoord, width + (size.x - clientSize.x), height + (size.y - clientSize.y), wxSIZE_USE_EXISTING); + SetSize(width + (size.x - clientSize.x), height + (size.y - clientSize.y)); } void wxWindowGTK::DoGetClientSize( int *width, int *height ) const diff --git a/Source/Core/DolphinWX/AuiToolBar.h b/Source/Core/DolphinWX/AuiToolBar.h new file mode 100644 index 000000000000..baf12a0b9ced --- /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 +#include + +// 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 8469e1ed026f..dd2936a9041c 100644 --- a/Source/Core/DolphinWX/Debugger/BreakpointWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/BreakpointWindow.cpp @@ -4,7 +4,6 @@ // clang-format off #include -#include #include #include #include @@ -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 66e87cf9dc5c..46a06533b244 100644 --- a/Source/Core/DolphinWX/Debugger/CodeWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/CodeWindow.cpp @@ -8,7 +8,6 @@ // clang-format off #include -#include #include #include #include @@ -44,6 +43,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" @@ -73,8 +73,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 25d1b4fa3071..5788d7d0628b 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 @@ class CCodeWindow : public wxPanel 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 7b4909a4e87e..c3d2aef98c62 100644 --- a/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/DSPDebugWindow.cpp @@ -4,7 +4,6 @@ #include #include -#include #include #include #include @@ -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 7f1215bfb791..51519f010c3c 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 @@ class DSPDebuggerLLE : public wxPanel // 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 ce92d7e6563d..f43190a5d3eb 100644 --- a/Source/Core/DolphinWX/Debugger/WatchWindow.cpp +++ b/Source/Core/DolphinWX/Debugger/WatchWindow.cpp @@ -6,7 +6,6 @@ // clang-format off #include -#include #include // 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));