Skip to content

v2.0.0 GTK4 Compatibility

Choose a tag to compare

@5cript 5cript released this 07 Feb 14:46
· 124 commits to main since this release
4342062

What's Changed

BREAKING CHANGE:

  • Window positioning and self positioning functions are knowingly broken in newer versions using webkitgtk-6.0+ and GTK4. Applications are not supposed to self position under Wayland, that is the compositors job.

Full Changelog: v1.3.1...v2.0.0

Also adds support for Startup sync via RPC:

Nui::RpcClient::awaitRpcAvailable(
[](bool timeout)
{
    if (timeout)
    {
        // Show load failure in dom body:
        dom = std::make_unique<Nui::Dom::Dom>();
        dom->setBody(
            Nui::Elements::body{}(Nui::Elements::div{
                Nui::Attributes::style = "color: red; font-size: 20px; text-align: center; margin-top: 20px;"
            }("Failed to load application: RPC initialization timed out. Restart the application."))
        );
        return;
    }

    dom->setBody(Nui::Elements::body{}(Nui::Elements::div{
        Nui::Attributes::style = "color: lime font-size: 20px; text-align: center; margin-top: 20px;"
    }("Ready"));
},
std::chrono::seconds(10)

Backend:

MyClass::MyClass()
    : window_{
        Nui::WindowOptions{
            .title = "NuiScp"s,
            .debug = true,
            .customSchemes = {createFolderMapping(programDir_, "nui")},
            .onRpcAliveMessage = [this]() {
                // Register RPCs here:
                myApi.registerRpc();

                hub_.markRpcAsInitialized();
            }
        },
    }
{}