Skip to content

Commit

Permalink
2109: add patch to fix wxWidgets return key bug on macOS (TrenchBroom…
Browse files Browse the repository at this point in the history
…#2113)

* 2109: add patch to fix wxWidgets return key bug on macOS

* 2109: fix patch extension
  • Loading branch information
ericwa authored Mar 27, 2018
1 parent 3f81863 commit 87aa1b8
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 2 deletions.
14 changes: 13 additions & 1 deletion Build.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,16 @@ Compiling and linking TrenchBroom requires a working OpenGL installation. [This
- Some more detailed (possibly outdated) information about building TrenchBroom on Linux: http://andyp123.blogspot.de/2013/03/running-trenchbroom-quake-editor-on.html
### wxWidgets
- Currently you must download and build wxWidgets yourself.
- Currently you must download, patch, and build wxWidgets yourself.
- Get the latest sources of wxWidgets 3.1 from [wxwidgets.org](http://www.wxwidgets.org) and unpack them.
- Move the unpacked directory someplace where you want to keep it.
- Open a terminal and change into the wxwidgets directory.
- Apply the patches in `TrenchBroom/patches/wxWidgets` as follows:
```
patch -p0 < <path_to_trenchbroom_directory>/patches/wxWidgets/*.patch
```
- Create two directories: `build-release` and `build-debug` (don't rename those!)
- Change into `wxwidgets/build-release`
- Run
Expand Down Expand Up @@ -163,6 +169,12 @@ Compiling and linking TrenchBroom requires a working OpenGL installation. [This
- Get the latest sources of wxWidgets 3.1 from [wxwidgets.org](http://www.wxwidgets.org) and unpack them.
- Move the unpacked directory someplace where you want to keep it.
- Open a terminal and change into the wxwidgets directory.
- Apply the patches in `TrenchBroom/patches/wxWidgets` as follows:
```
patch -p0 < <path_to_trenchbroom_directory>/patches/wxWidgets/*.patch
```
- Create two directories: `build-release` and `build-debug` (don't rename those!)
- Change into `wxwidgets/build-release`
- Run
Expand Down
18 changes: 18 additions & 0 deletions patches/wxWidgets/textctrl_osx_return.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
diff --git src/osx/textctrl_osx.cpp src/osx/textctrl_osx.cpp
index 1ef8afa420..452d4272cf 100644
--- src/osx/textctrl_osx.cpp
+++ src/osx/textctrl_osx.cpp
@@ -342,6 +342,13 @@ void wxTextCtrl::OnDropFiles(wxDropFilesEvent& event)

void wxTextCtrl::OnKeyDown(wxKeyEvent& event)
{
+ int key = event.GetKeyCode();
+ if ( key == WXK_RETURN || key == WXK_NUMPAD_ENTER ) {
+ // HACK: Forward these keys to the OnChar handler
+ OnChar(event);
+ return;
+ }
+
if ( event.GetModifiers() == wxMOD_CONTROL )
{
switch( event.GetKeyCode() )
2 changes: 1 addition & 1 deletion travis-macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ wget https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.1/wxWidgets-3
if [[ "8d98975eb9f81036261c0643755b98e4bb5ab776" != $(openssl sha1 wxWidgets-3.1.1.7z | cut -f2 -d' ') ]] ; then exit 1 ; fi
7z x -o"wxWidgets" -y wxWidgets-3.1.1.7z > /dev/null
cd wxWidgets || exit 1
#patch -p0 < ../patches/wxWidgets/*.patch || exit 1
patch -p0 < ../patches/wxWidgets/*.patch || exit 1
mkdir build-release
cd build-release
../configure --quiet --with-osx_cocoa --disable-shared --disable-mediactrl --with-opengl --with-macosx-version-min=10.9 --with-cxx=14 --prefix=$(pwd)/install --disable-precomp-headers --with-libpng=builtin --without-libtiff --with-libjpeg=builtin && make -j2 && make install
Expand Down

0 comments on commit 87aa1b8

Please sign in to comment.