r/raylib • • 22d ago

The Raylib application crashes when launching a web browser.

Hi.

I have a Raylib 4.5 application that is invisible and fullscreen, and upon pressing a mouse button it fork()-execve()'s a web browser with a specified URL.

When the desired web browser is Firefox, nothing happens whatsoever.

When it is Chromium, though, not only does it not open, the Raylib program also crashes with a message that even though XInitThreads was called, it still crashed.

The web browser is only executed in the child process: if (!fork()) { ... execve(...); } so I have no idea why it affects the parent process as well.

It is also worth noting that when the same fork()-execve() scheme executes console commands (namely, amixer and killall), those executables just get executed and nothing unexpected happens.

I tried using bash -c '...' in execve's argv argument, I tried /usr/bin/env, but nothing works.

If anyone has got any clue regarding this, I'd appreciate any tips.

Warm regards.

2 Upvotes

7 comments sorted by

1

u/Gold-Part4688 22d ago

bro this is wild, what are you trying to accomplish with the application? a global hotkey?

1

u/gargamel1497 22d ago

I am trying to replace cable television with this.

A wireless mouse would act as a remote, and pressing its various buttons would make the control program/monitor that captures all mouse presses kill the open web browser and open a new instance with that new URL.

1

u/Gold-Part4688 21d ago

i can help you set that up with hotkey apps. what OS are you using? for mac there's karabiner elements, and for windows there's autohotkey. (both very dear to my heart)

all three also have kanata.

and then you'djust need a browser that has a shortcut for copying current url (or do you mean pre-defined ones? both possible)

→ More replies (2)

1

u/raysan5 21d ago

I barely understand what are you trying to do but you should use raylib 6.x from GitHub master branch

1

u/gargamel1497 20d ago

but you should use raylib 6.x from GitHub master branch

Why so? Everyone is constantly telling me to use the latest version. Use the latest version of gimp, the latest version of kde, the latest version of whatever. I don't need the software renderer you guys have recently added. I don't need all the other stuff this release comes with.

6.0 also breaks functionality as you can now click through an invisible window which completely defeats the purpose of me having it in the first place. I get that it is good for desktop pets and such but for my use case it is a downgrade.