Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make the event loop accessible in App #113

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

jhickner
Copy link

@jhickner jhickner commented Nov 15, 2024

If an app needs to run a child process (in my case I wanted to open $EDITOR to edit a file), we need to be able to stop and restart the event loop.

This PR adds a loop field to the vxfw.App struct, so the loop is accessible.
This allows, e.g.

self.loop.?.stop();
editor.edit("file.txt");
try self.loop.?.start();

Without this you can still run a child process and open an editor, but it's unresponsive to commands as they're being consumed by EventLoop's ttyRun thread.

@rockorager
Copy link
Owner

I've been hesitant to expose the loop directly invxfw. I'd like to let the widgets be usable from other loops, so I've been trying to keep anything like this as a Command that can be added to the CommandList ArrayList passed into the event handlers.

What do you think about adding a suspend and start command into vxfw.Command?

rockorager and others added 3 commits November 25, 2024 10:38
Don't require that surfaces explicitly declare mouse handling. We either
pass an event to the eventHandler or we don't. Along with this, we
remove all native widget passthrough events (IE we never pass an event
to a child). Native widgets which don't handle events also set
eventHandler to null, which prevents any null pointer issues also
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants