Hi! I’m new to JUCE and am working on a project for the Raspberry Pi (I have an Rpi 3) using Erpiam by forum user @gbevin. I got everything to cross-compile just fine (eventually since everything is built from source) both using the demo JUCE progam that comes with Erpiam as well as switching that out for my own custom JUCE program.
The problem I am having is that the mouse cursor is not showing up when I run either program on the actual Rpi. The mouse is working because I can see buttons get highlighted when I mouse over them (with my invisible cursor) and I can also click buttons and whatnot. The cursor actually does eventually show up if I mouse over a component that changes the cursor. For example, the demo JUCE program for Erpiam (called erpiam-main) has a large TextEditor component. If I mouse over that the cursor changes to an I-Beam and shows up and after that it stays visible, changing to the standard X cursor if I mouse off of the TextEditor.
Changing cursors in my custom JUCE program either in sub-components or the main window component using “setMouseCursor()” would also never work initially. The cursor would just stay the default cursor for my desktop environment on my PC and an invisible cursor on the Rpi. Eventually, by looking at the erpiam-main code, I was able to determine that by not calling “setResizable(true, true)” in the MainWindow constructor, this caused the cursor changes to start working. This was the case when running my JUCE program both on my PC (Linux) and on the Rpi. It seems like this might be a bug in JUCE, though I have that workaround since I don’t even want my window to be resizable anyway.
However, regardless of what I do, the cursor is never visible on the Rpi when either JUCE program first starts. I have tried a multitude of things including:
-
Setting the cursor explicitly via the “-fc left_ptr” option to the X command in the script that starts it.
-
Setting the cursor explicitly using the “xsetroot” command after starting X
-
Ensuring that the cursor is not being hidden anywhere like with the “-nocursor” argument when starting X, and it’s also not set to hidden in main Erpiam package option “Hide X11 Cursor” in the “make menuconfig”.
-
In my custom JUCE program in the MainComponent constructor I set the cursor to something else with setMouseCursor. I also tried setting up a timer to change the cursor to something else a few seconds after the program starts (the MainComponent cursor).
Nothing seems to work and the cursor never becomes visible unless I mouse over a Component that has a different cursor set. This isn’t a total show stopper and there might be other hacks I can try, but currently it is very annoying to have to wiggle the mouse around until it happens to go over the right Component when the JUCE program first starts on the Rpi. Oh, I also noticed that if I start xterm at boot instead of a JUCE program then the cursor shows up right away. So I’m not sure whether this is an erpiam/buildroot/TinyX issue or a JUCE issue but it just seems that there is no discernible reason why the cursor should be hidden when the program first starts up.
Has anyone else had this issue or have an idea of things to try? I’m not sure what else to try other than some hacks to work around the issue, but I figured I make a post in the hopes of fixing it the right way first. Thanks!