obhq / obliteration

Experimental free and open-source PlayStation 4 kernel
https://obliteration.net
Apache License 2.0
641 stars 18 forks source link

Refactors event handler #1118

Closed SuchAFuriousDeath closed 1 week ago

SuchAFuriousDeath commented 1 week ago

I guess VmmEventHandle will have to wrap an impl FnMut(VmmEvent) + Clone closure? Or something like that.

ultimaweapon commented 1 week ago

I guess VmmEventHandle will have to wrap an impl FnMut(VmmEvent) + Clone closure?

Should be Arc<dyn Fn(...)> instead.

SuchAFuriousDeath commented 1 week ago

I guess VmmEventHandle will have to wrap an impl FnMut(VmmEvent) + Clone closure?

Should be Arc<dyn Fn(...)> instead.

Close enough :sweat_smile:

ultimaweapon commented 1 week ago

I don't think global models are a good idea. Why do we need it? It should be passing to the main window and downstream to all of its children instead.

SuchAFuriousDeath commented 1 week ago

I don't think global models are a good idea. Why do we need it? It should be passing to the main window and downstream to all of its children instead.

When launching in debug, there is no main window (and the screen isn't its child anyway). Maybe that's the fix that needs fixing here :thinking:

SuchAFuriousDeath commented 1 week ago

I don't think global models are a good idea. Why do we need it? It should be passing to the main window and downstream to all of its children instead.

When launching in debug, there is no main window (and the screen isn't its child anyway). Maybe that's the fix that needs fixing here 🤔

But that's actually not the real problem. The real 'problem' is that I don't like having to pass the devices and profiles through several elements down to where we actually need them. If they're global, we can just directly access them right where we need them (in the ComboBoxes)

ultimaweapon commented 1 week ago

I don't think global models are a good idea. Why do we need it? It should be passing to the main window and downstream to all of its children instead.

When launching in debug, there is no main window (and the screen isn't its child anyway). Maybe that's the fix that needs fixing here 🤔

But that's actually not the real problem. The real 'problem' is that I don't like having to pass the devices and profiles through several elements down to where we actually need them. If they're global, we can just directly access them right where we need them (in the ComboBoxes)

What you don't like here are actually a good practice.

SuchAFuriousDeath commented 1 week ago

I don't think global models are a good idea. Why do we need it? It should be passing to the main window and downstream to all of its children instead.

When launching in debug, there is no main window (and the screen isn't its child anyway). Maybe that's the fix that needs fixing here 🤔

But that's actually not the real problem. The real 'problem' is that I don't like having to pass the devices and profiles through several elements down to where we actually need them. If they're global, we can just directly access them right where we need them (in the ComboBoxes)

What you don't like here are actually a good practice.

Oops :D