OpenFunscripter / OFS

A tool to create funscripts
GNU General Public License v3.0
90 stars 38 forks source link

Using binded extension shortcut key causes UI redraw #28

Closed trassshhub closed 2 years ago

trassshhub commented 2 years ago

If an extension window is embedded into the player pane, using any extension binded keys will cause the UI to redraw. The player will redraw first before the extension pane gets redraw causing a flashing glitch.

This does not happen if the bindable function is call within the extension pane UI.

OpenFunscripter commented 2 years ago

The keybindings are always executed on another thread in order to not block the main UI. When executing code from within the extension UI it is not executed on another thread and can potentially freeze OFS entirely for the execution duration.

While the keybinding is executing on another thread I can't call gui() on the Lua extension which causes the extension window to not be drawn at all for a couple of frames and then after the binding finishes the perceived redraw of the extension UI happens.

Now that the explanation is out the way: I don't know if this is fixable (my research hasn't gone very deep yet). The fix isn't easy and this is rather low priority for me. So don't get your hopes up but feel free to keep this issue open. 😅

OpenFunscripter commented 2 years ago

In version 2.0.0 this isn't happening anymore since bindings don't get executed on another thread anymore.