Skip to content

Fix window shuttering during initial loading by preventing short-lived windows #655

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Copilot
Copy link

@Copilot Copilot AI commented Jul 23, 2025

This PR eliminates the system-wide window shuttering/flickering that occurs during application startup by preventing short-lived windows from appearing on screen.

Problem

During application startup, users experienced visual disruption from windows that would briefly appear and then immediately disappear:

  1. FlightControllerInfoWindow - Would show UI, download parameters, then auto-close
  2. ComponentEditorWindow - When skipped, would appear for 10ms then destroy itself
  3. This created a poor user experience with flickering windows during launch

Solution

FlightControllerInfoWindow Changes

  • Added optional show_window=False parameter to constructor (backward compatible)
  • Added _download_flight_controller_parameters_no_window() method for background operations
  • Modified main startup flow to download FC parameters without showing window

Before:

fciw = FlightControllerInfoWindow(state.flight_controller)  # Shows window briefly
state.param_default_values = fciw.get_param_default_values()

After:

fciw = FlightControllerInfoWindow(state.flight_controller, show_window=False)  # No window
state.param_default_values = fciw.get_param_default_values()

Component Editor Skip Logic

  • Moved skip condition check before window creation
  • Return early instead of creating window just to destroy it 10ms later

Before:

# Create window first, then destroy it immediately
component_editor_window = create_and_configure_component_editor(...)
if should_skip_editor:
    component_editor_window.root.after(10, component_editor_window.root.destroy)
component_editor_window.root.mainloop()

After:

# Check skip condition first, avoid window creation entirely
if should_skip_editor:
    return  # No window creation at all
component_editor_window = create_and_configure_component_editor(...)
component_editor_window.root.mainloop()

Testing

  • Updated tests to verify new show_window=False parameter functionality
  • Added test for background parameter download without window display
  • Updated component editor tests to verify window creation is bypassed when skipping
  • All changes are backward compatible

Impact

User Experience: Eliminated window flickering during application startup
Performance: Reduced unnecessary GUI overhead during background operations
Maintainability: Clear separation between UI and business logic
Compatibility: Existing code continues to work unchanged

Fixes #652.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • esm.ubuntu.com
    • Triggering command: /usr/lib/apt/methods/https (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits July 23, 2025 10:50
Co-authored-by: amilcarlucas <24453563+amilcarlucas@users.noreply.github.com>
Co-authored-by: amilcarlucas <24453563+amilcarlucas@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] systemwide window shuttering during initial loading Fix window shuttering during initial loading by preventing short-lived windows Jul 23, 2025
@Copilot Copilot AI requested a review from amilcarlucas July 23, 2025 10:57
Copilot finished work on behalf of amilcarlucas July 23, 2025 10:57
Copy link
Contributor

github-actions bot commented Jul 23, 2025

Test Results

    2 files      2 suites   1m 35s ⏱️
1 584 tests 1 583 ✅ 1 💤 0 ❌
3 168 runs  3 166 ✅ 2 💤 0 ❌

Results for commit db8d1a5.

♻️ This comment has been updated with latest results.

Copy link
Contributor

github-actions bot commented Jul 23, 2025

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
7673 5928 77% 73% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
ardupilot_methodic_configurator/main.py 87% 🟢
ardupilot_methodic_configurator/frontend_tkinter_flightcontroller_info.py 88% 🟢
TOTAL 88% 🟢

updated for commit: db8d1a5 by action🐍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

systemwide window shuttering during initial loading
2 participants