emilk / emilk/egui

ViewportCommand::Visible(false) doesn't appear to do anything

Open
#4,089 4 comments 1 reaction 0 assignees View on GitHub
bug
Dominant language
Rust
Stars
30.6k
Forks
2.1k
Avg merge
1d 9h
Merged PRs (30d)
72

Description

**Describe the bug**
Ref: https://github.com/emilk/egui/discussions/3885, couldn't find a similar issue

I'm porting my app from `0.23` and ever since viewports were introduced I've been unable to hide the app's window while keeping the thread running.

I have tried adding `ctx.send_viewport_cmd(ViewportCommand::Visible(false));` to the top level of the `update` method itself to see if anything would happen, but neither that nor triggering it sporadically/via some other method seems to do anything aside from printing the "processing" log.

I'm using NixOS which *may* have something to do with it, but the same app packaged the exact same way works when on `0.23` just fine via `frame.set_visible()`.

The code used for testing in both versions is
- `23`: https://github.com/4JX/L5P-Keyboard-RGB/tree/main/app
- `26`: https://github.com/4JX/L5P-Keyboard-RGB/tree/egui-update/app
- `26-minimal`: https://github.com/4JX/L5P-Keyboard-RGB/tree/egui-update-minimal/app

**Expected behavior**
The app window is hidden while the program keeps running, as it did previously.

**Screenshots**
![Screenshot from 2024-02-22 19-18-49](https://github.com/emilk/egui/assets/79868816/9bb836b0-fa3c-4879-a3f9-cf3d1d48e792)

**Desktop (please complete the following information):**
- OS: Nixos 24.05, 6.5.13, x86_64
- Version 23/26

Contributor guide

Open the contributing guide

Research direction

Start with the linked 26-minimal app and the update method where ctx.send_viewport_cmd(ViewportCommand::Visible(false)) is called. Compare its behavior with frame.set_visible() in the linked 0.23 app, focusing on the NixOS environment. Done means the viewport becomes hidden while the application thread continues running.

Written by the indexing model from the issue text.

Assessment

Tech stack
nixos, rust
Domain
desktop, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.