Skip to content
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

(rustbasic) In Progress : Testing... #4182

Closed
wants to merge 321 commits into from
Closed

Conversation

rustbasic
Copy link
Contributor

@rustbasic rustbasic commented Mar 17, 2024

In Progress : Testing...

Don't close, please.

Issues :

Pull Requests :

This will continue to be updated :

  1. It may not be merged, so use it for reference only.
  2. It is always in a usable state, maintaining a state with few bugs.
  3. Anyone is free to maintain or improve a portion of this, and Pull Request it.

Based on examples/test_viewports and examples/multiple_viewports, all fixed to work properly.
wgpu only tested examples/test_viewports, so additional testing on your part is needed.

@rustbasic rustbasic changed the title Patch22 Fix: Viewport Normal operation & Shaking when Resize Mar 17, 2024
Copy link
Owner

@emilk emilk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very exciting if this indeed closes this many issues!

Comment on lines 289 to 294

let viewport_id = egui_ctx.viewport_id();
// TODO : Do not recall until the next repaint.
// 1000 millis / 60 fps = 16.67 millis
self.egui_ctx
.request_repaint_after_for(std::time::Duration::from_millis(8), viewport_id);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this will just cause a hot repaint loop

Suggested change
let viewport_id = egui_ctx.viewport_id();
// TODO : Do not recall until the next repaint.
// 1000 millis / 60 fps = 16.67 millis
self.egui_ctx
.request_repaint_after_for(std::time::Duration::from_millis(8), viewport_id);

)
}
} else {
let visuals = &ui.style().visuals.widgets.inactive;
epaint::RectShape::stroke(
frame_rect,
visuals.rounding,
visuals.bg_stroke, // TODO(emilk): we want to show something here, or a text-edit field doesn't "pop".
ui.visuals().widgets.unhovered.bg_stroke, // TODO(emilk): we want to show something here, or a text-edit field doesn't "pop".
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove unrelated commits

Comment on lines 949 to 958
/*
// Deprecated
if cfg!(target_os = "windows") {
// It's tempting to do this, but it leads to a deadlock on Mac when running
// `cargo run -p custom_window_frame`.
// See https://github.com/emilk/egui/issues/3494
viewport_info.maximized = Some(window.is_maximized());
viewport_info.minimized = Some(window.is_minimized().unwrap_or(false));
viewport_info.maximized = Some(window.is_maximized());
}
*/
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove dead code


update_info.minimized = match cfg!(target_os = "windows") {
true => Some(window.is_minimized().unwrap_or(false)),
false => window.is_minimized(),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As the comment above says, this leads to deadlock on Mac

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As the comment above says, this leads to deadlock on Mac

Okay, I was curious about the results.

Comment on lines 109 to 111
ViewportExit(WindowId),

Exit(WindowId),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs docstrings

@@ -227,6 +240,7 @@ fn run_and_return(
})
.ok();
}
*/
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove dead code

@emilk
Copy link
Owner

emilk commented May 27, 2024

this PR is too big

@emilk emilk closed this May 27, 2024
@rustbasic rustbasic changed the title Fix: Viewport Normal operation & Shaking when Resize In Progress : Testing... May 30, 2024
@rustbasic rustbasic changed the title In Progress : Testing... (rustbasic) In Progress : Testing... May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment