Skip to content

Show Chat Dialog correctly above main window if raised from config file - #3995

Draft
ann0see wants to merge 1 commit into
mainfrom
ios/fix-chat-startup-z-order
Draft

ann0see wants to merge 1 commit into
mainfrom
ios/fix-chat-startup-z-order

Conversation

@ann0see

@ann0see ann0see commented Nov 15, 2026 •

Copy link
Copy Markdown
Member

Short description of changes

Bring the windows restored from the settings forward once the main window is shown, so the chat window no longer ends up behind it. Otherwise the checkbox is checked, but the window does not show up. The user would have needed to retap the LED to make it show up.

CClientDlg shows the settings and chat windows from its constructor (when winvisset / winvischat are set), i.e. before the main window exists. On iOS there is no window manager, so the main window is presented in front of them; the chat is invisible and unreachable until the Chat check box is toggled off and on.

main() now calls CClientDlg::RaiseRestoredWindows() right after ClientDlg.show(), which raises the settings and chat windows if they were restored. The ordering is explicit: the main window is up, then the windows that were open before it are brought forward. No timer, no extra event loop pass.

The call is guarded with #if defined( Q_OS_IOS ), because this was only observed on iOS. It is possible that desktop platforms have the same ordering problem, since the main window is activated after the restored dialogs there as well; that remains to be tested, so the behaviour on Windows, Linux and macOS is deliberately left unchanged for now.

An earlier attempt that raised the chat window from CClientDlg::showEvent() was dropped: showEvent is delivered before the platform window is presented, so the raise had no effect unless it was deferred with a zero timer, which depends on timing rather than order.

CHANGELOG: iOS: Fixed the chat window being hidden behind the main window on startup

Context: Fixes an issue?

Fixes #3994 (first item). Also relevant to #3383.

The same ordering problem applied to the settings window when winvisset is set, so that is handled too.

Does this change need documentation? What needs to be documented and how?

No.

Status of this Pull Request

Working implementation.

What is missing until this pull request can be merged?

  • Tested on the iPad Pro 11-inch simulator (iOS 27.2) with Qt 6.11.1, on top of Only compile the iOS app delegate for Qt 5 #3988, because main does not launch on iOS with Qt 6 without it. Without Only compile the iOS app delegate for Qt 5 #3988 the app dies at startup with EXC_BREAKPOINT in ___UIApplicationEvaluateRuntimeIssueForNoSceneLifecycleAdoption_block_invoke, so this could not be tested on plain main.

    Case Result
    winvischat=1 chat window restored, in front of the main window (previously behind it)
    winvisset=1 settings window restored, in front
    both 0 neither window is restored
    toggle the Chat check box afterwards window appears and closes as before
    background and return no window is raised unexpectedly
    crash reports none
  • Not tested on a physical device, and not on Windows/Linux/macOS. The call is unconditional, but on those platforms the main window is activated the same way, so the behaviour should be unchanged or slightly more correct.

  • The chat window can only be closed from its own menu, so the "was shown" flag is only stored on quit via closeEvent(). That is untouched here; recovering the chat state after the app is killed is part of the settings persistence item in AI bug findings for iOS #3994.

🤖 Used AI: DeepSeek V4.1 Flash, OpenCode

@ann0see ann0see added the AI AI generated or potentially AI generated label Nov 15, 2026
@ann0see ann0see mentioned this pull request Nov 15, 2026
6 of 16 tasks
@coderabbitai

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

On iOS, startup now raises visible settings and chat dialogs after showing the client dialog. Other platforms do not call the new helper.

Changes: iOS window stacking

Layer / File(s) Summary
Raise restored dialogs
src/clientdlg.h, src/clientdlg.cpp, src/main.cpp
CClientDlg declares and implements an iOS-only helper. The helper raises and activates visible settings dialogs and raises visible chat dialogs. iOS startup calls it after showing the client dialog.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix · Severity of issue fixed: Medium

Possibly related PRs

  • jamulussoftware/jamulus#3989: Both PRs change iOS chat-window display and stacking behavior. #3989 changes how ShowChatWindow() displays the chat window; this PR raises it after the client dialog is shown.

Suggested reviewers: softins, pljones

Merge Risk: Minimal · up to 6c061

On iOS, restored settings and chat windows should now appear in front of the main window at startup. Other platforms are unaffected, and no merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Linked Issues check Passed Directly linked issue #3994 lists as a blocker that a chat window set to open at startup (winvischat=1) is hidden behind the main window on iOS. The cause named in the issue is the chat being shown fr…
Out of Scope Changes check Passed The supplied summary shows changes in three files only: src/clientdlg.h (one iOS-guarded declaration), src/clientdlg.cpp (+18 lines, iOS-guarded helper), and src/main.cpp (+5 lines, iOS-guarded call).…
Description check Passed The description follows the template. It explains the change, includes a CHANGELOG entry, links the fixed issue (#3994) with context, and states that no documentation is needed. It also gives the stat…
Title check Passed The title names the main change: the chat dialog raised above the main window when it is restored from the config file. The changeset adds CClientDlg::RaiseRestoredWindows, called from main() after sh…
Full details: Linked Issues check

Explanation

Directly linked issue #3994 lists as a blocker that a chat window set to open at startup (winvischat=1) is hidden behind the main window on iOS. The cause named in the issue is the chat being shown from the CClientDlg constructor before the main window exists. The current head changes this ordering. Per the supplied AI-generated summary, src/main.cpp calls CClientDlg::RaiseRestoredWindows() after ClientDlg.show() on iOS. The helper, declared in src/clientdlg.h and implemented in src/clientdlg.cpp under Q_OS_IOS, raises and activates ClientSettingsDlg when visible and raises ChatDlg when visible. This addresses the in-scope objective. The PR description reports simulator verification for winvischat=1 and winvisset=1 cases. Other #3994 items (settings persistence #3996, keyboard and layout issues, document picker #3997, File > Exit #3998, dark mode #3999/#4000, accessibility labels) are not objectives of this PR. Limitation: the repository diff and file reads for the changed blobs were unavailable or truncated. The verdict relies on the supplied summary and PR description, not on direct review of the RaiseRestoredWindows body. The previous assessment described a superseded showEvent() approach and was not reused for this head.

Full details: Out of Scope Changes check

Explanation

The supplied summary shows changes in three files only: src/clientdlg.h (one iOS-guarded declaration), src/clientdlg.cpp (+18 lines, iOS-guarded helper), and src/main.cpp (+5 lines, iOS-guarded call). All changes implement the startup window-ordering objective of #3994. The settings-window raise uses the same ordering mechanism and is described in the PR as part of this fix. No unrelated changes appear in the summary. Limitation: the full diff could not be read, so this verdict relies on the supplied summary and PR description.

Full details: Description check

Explanation

The description follows the template. It explains the change, includes a CHANGELOG entry, links the fixed issue (#3994) with context, and states that no documentation is needed. It also gives the status and remaining work. The checklist is not ticked and the AUTOBUILD note is absent, but these are non-critical. The author also noted that testing covered only the iOS simulator, with no physical device or desktop testing.

Full details: Title check

Explanation

The title names the main change: the chat dialog raised above the main window when it is restored from the config file. The changeset adds CClientDlg::RaiseRestoredWindows, called from main() after show() on iOS, which raises the restored chat and settings windows. The title focuses on the chat window and omits the settings window and the iOS-only guard, which is a partial omission but not a mismatch.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: QUIET
  • Plan: Advanced
  • Run ID: 39e11136-2e93-4336-aea9-7499eb395c2b
Commits

Reviewing files that changed from the base of the PR and between cf887a1 and 6c06108.

Files selected for processing: 3

  • src/clientdlg.cpp
  • src/clientdlg.h
  • src/main.cpp

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review.

@ann0see
ann0see marked this pull request as draft November 15, 2026 17:22
@ann0see
ann0see force-pushed the ios/fix-chat-startup-z-order branch from cf887a1 to 708bd96 Compare November 15, 2026 17:24
@ann0see ann0see changed the title Raise the chat window after the main window is shown on iOS Raise the windows restored from the settings after the main window is shown Nov 15, 2026
@ann0see
ann0see force-pushed the ios/fix-chat-startup-z-order branch 2 times, most recently from 8adbd23 to 31e8788 Compare November 15, 2026 17:29
@ann0see

ann0see commented Nov 15, 2026

Copy link
Copy Markdown
Member Author

Scope note on the guard: the same ordering problem might exist on desktop too. There the main window is also activated after the windows restored in the constructor, so a restored chat or settings window could end up behind it in the same way. I could only test iOS, so the call is guarded with Q_OS_IOS and the behaviour on Windows, Linux and macOS is left unchanged for now. If someone reproduces it on a desktop platform, the guard can simply be dropped.

🤖 Used AI: DeepSeek V4.1 Flash, OpenCode

@ann0see ann0see added Mobile UI Issues with the UI on mobile platforms iOS iOS runtime issue labels Nov 15, 2026
Comment thread src/clientdlg.h Resolved
Comment thread src/clientdlg.cpp Resolved
@ann0see
ann0see force-pushed the ios/fix-chat-startup-z-order branch from 31e8788 to 7138e27 Compare November 15, 2026 21:03
… shown

The settings and chat windows that were open when the application was quit are
shown in the CClientDlg constructor, i.e. before the main window exists. On iOS,
which has no window manager, the main window is then presented in front of them
and the chat is unreachable until the Chat check box is toggled.

Bring the restored windows forward once the main window is shown. The call is
guarded to iOS so that the behaviour on the other platforms is unchanged.
@ann0see
ann0see force-pushed the ios/fix-chat-startup-z-order branch from 7138e27 to 6c06108 Compare November 15, 2026 21:04
@ann0see ann0see changed the title Raise the windows restored from the settings after the main window is shown Raise the windows restored from the settings after the main window is shown to show chat dialog correctly on iOS Nov 15, 2026
@ann0see ann0see removed the Mobile UI Issues with the UI on mobile platforms label Nov 15, 2026
@ann0see ann0see changed the title Raise the windows restored from the settings after the main window is shown to show chat dialog correctly on iOS Show Chat Dialog correctly above main window if raised in settings Nov 15, 2026
@ann0see ann0see changed the title Show Chat Dialog correctly above main window if raised in settings Show Chat Dialog correctly above main window if raised from config file Nov 15, 2026
@ann0see

ann0see commented Nov 15, 2026

Copy link
Copy Markdown
Member Author

I believe this issue might have indeed occurred on macOS also. CC: @mcfnord @softins?

Sometimes the Chat LED lights up but the chat window is nowhere to be found. Maybe some of you can reproduce this on macOS?

@pljones

pljones commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

The proper fix would be to store relative Z-index along with position of each window, maybe, then display the created windows in the correct order. Currently it's a bit hit and miss where they appear on Windows and Linux.

@mcfnord

mcfnord commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

🤖 AI: On desktop Linux the ordering bug reproduces only without a window manager, and dropping the Q_OS_IOS guard fixes it there. Qt 6.11.1 xcb, main at 2442abc, ini with winvischat=1 and no saved positions: on bare Xvfb the chat dialog opens wholly behind the main window in 6 of 6 launches (Chat LED lit, no chat visible); with #3995's raise unguarded it opens on top in 6 of 6. Under openbox the chat is already on top and active on main in 6 of 6, so the unguarded call changes nothing there. GNOME/KDE window managers, Windows and macOS were not tested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AI AI generated or potentially AI generated iOS iOS runtime issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AI bug findings for iOS

3 participants