Apply Axe-Edit III mouse cursor patch

14.03.2022 Guitar
Apply Axe-Edit III mouse cursor patch

Axe-Edit III, the full-featured editor for the Axe-Fx III, could also be installed on Linux. This article addresses possible issues with the mouse cursor.

As described in the article Run Axe-Edit III on Linux, Axe-Edit III can very well be installed and run on Linux. In some cases useres might have noticed that it is unuseable due to the cursor disappearing whenever you want to change a pot somewhere [1].

Although [1] describes the process very well, I would like to supplement the installation of the patch with my experience and explain some steps in more detail.

What does the patch do?

In short, the patch disables the two internal functions responsible for the observable misbehavior. This occurs when AXE-Edit III wants to change the cursor to signal a different operating mode, e.g. when hover over a knob/pot.

How do we fix this?

We'll create a shared library containing harmless versions of the functions causing the problem. The compiled shared library will be pre-loaded using LD_PRELOAD in AXE-Edit's launcher. This allows overriding the bad functions with those of our patch.

What's the plan?

Applying the patch involves the following steps:

  1. Install required packages.
  2. Compiling the source code of the patch.
  3. Set up a launcher that loads the patch and starts Axe-Edit III.

1. Install required packages

Gcc compiler (build-essential package)

To compile the patch we need a compiler. The GNU Compiler Collection (GCC) is a collection of compilers and libraries for a variety of programming languages (e.g. C and C++). For example, the linux kernel was compiled with gcc.

Headers (x11proto-dev package)

The X11 extension protocols and auxiliary headers package provides development headers describing the wire protocol for the X11 core and extension protocols, and also provides a number of utility headers, used to abstract OS-specific functions [2]. The package is required as it contains the C function declarations for the two functions XDefineCursor and XUndefineCursor we want to change. To install the packages on a debian based system execute:


sudo apt update
sudo apt-get install build-essential x11proto-dev

2. Compiling the source code of the patch

The source code used is quite simple:

axeedit_cursor_patch.c

#include <X11/X.h>
int XDefineCursor(void* d, Window w, Cursor c) {
  return 0;
}

int XUndefineCursor(void *display, Window w) {
  return 0;
}

The code simply says: If either function is called, just do nothing. Just return a 0, signaling to the caller that everything is fine. To be able to compile the code, create a file named axeedit_cursor_patch.c and copy the source code into it. Now we're set to call the compiler and compile the code into a shared library (lib-axeedit-cursor-patch.so) with the following call:

gcc -rdynamic -shared -m32 axeedit_cursor_patch.c -o lib-axeedit-cursor-patch.so

The -rdynamic option allows unresolved symbols in a shared library to be matched with symbols in the parent application.

3. Set up a launcher that loads the patch and starts Axe-Edit III

Now we're able to modify our launcher presented in Run Axe-Edit III on Linux as follows:

Axe-Edit III.desktop

...
Exec=env LD_PRELOAD=path/to//lib-axeedit-cursor-patch.so ⤦
        ⤥WINEPREFIX=...

...
Exec=env LD_PRELOAD=path/to/lib-axeedit-cursor-patch.so WINEPREFIX=...

References

  1. Jean-Michaël Celerier, Axe-Edit III on linux, Reddit, Oct. 23, 2018. Accessed on Mar. 14, 2022. [Online]. Available: https://www.reddit.com/r/AxeFx/comments/9qrsi3/axeedit_iii_on_linux/
  2. Debian, Package: x11proto-dev (2021.5-1), Debian.org, Mar. 14, 2022. Accessed on Mar. 14, 2022. [Online]. Available: https://packages.debian.org/en/sid/x11proto-dev

Did you like the content? If you want to do something good for me, you can pour a little coffee into my empty pot.
Just click the PayPal.Me-Button* below. Thank you very much!

*For more information on our PayPal.Me link, see Impressum & Datenschutz