Files
DanS cd5a9f3736 DragonX compatibility: crash fixes, reorg detection, server failover, sync perf
- Fix Rust FFI panics with catch_unwind wrappers and safe CString handling
- Handle poisoned mutex/RwLock from prior panics instead of crashing
- Add stuck sync detection (10s stall threshold) and chain reorg user prompt
- Add "Skip Verification" button to seed phrase wizard
- Update payment URIs from hush: to drgx:
- Update branding strings throughout UI
- Add all 6 lite servers (lite, lite1-5.dragonx.is) with random selection
- Add server connectivity probing to skip unreachable servers
- Reuse Tokio runtime across block fetch batches to reduce sync overhead
- Update Cargo.lock dependencies
2026-03-21 03:43:23 -05:00

1.4 KiB

Windows Specific Implementations

Setting the foreground window

In the instanceStarted() example in the README we demonstrated how an application can bring it's primary instance window whenever a second copy of the application is started.

On Windows the ability to bring the application windows to the foreground is restricted, see AllowSetForegroundWindow() for more details.

The background process (the primary instance) can bring its windows to the foreground if it is allowed by the current foreground process (the secondary instance). To bypass this SingleApplication must be initialized with the allowSecondary parameter set to true and the options parameter must include Mode::SecondaryNotification, See SingleApplication::Mode for more details.

Here is an example:

if( app.isSecondary() ) {
    // This API requires LIBS += User32.lib to be added to the project
    AllowSetForegroundWindow( DWORD( app.primaryPid() ) );
}

if( app.isPrimary() ) {
    QObject::connect(
        &app,
        &SingleApplication::instanceStarted,
        this,
        &App::instanceStarted
    );
}
void App::instanceStarted() {
    QApplication::setActiveWindow( [window/widget to set to the foreground] );
}