Skip to content

Commit

Permalink
fix(core): force redraw on WindowEvent::Occluded(false)
Browse files Browse the repository at this point in the history
  • Loading branch information
zihadmahiuddin authored and rchangelog[bot] committed Feb 6, 2025
1 parent 29fa3e5 commit d6df0f4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ Please only add new entries below the [Unreleased](#unreleased---releasedate) he
## [@Unreleased] - @ReleaseDate

### Features
- **core**: Add the ability to force redraw a frame. (#pr @zihadmahiuddin)
- **core**: Add the ability to force redraw a frame. (#697 @zihadmahiuddin)

### Fixed
- **core**: Fix window staying empty after switching workspace (e.g. in i3wm) by doing a force redraw. (#697 @zihadmahiuddin)

## [0.4.0-alpha.26] - 2025-02-05

Expand Down
7 changes: 7 additions & 0 deletions ribir/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,13 @@ impl App {
loop_handle.exit();
}
}
WindowEvent::Occluded(false) => {
// this is triggered before the app re-enters view
// for example, in something like i3 window manager,
// when you switch back to the workspace that the app is in
// in such cases, we need to re-enter the view otherwise the window stays empty
wnd.draw_frame(true);
}
WindowEvent::RedrawRequested => {
AppCtx::frame_ticks().clone().next(Instant::now());

Expand Down

0 comments on commit d6df0f4

Please sign in to comment.