Skip to content

Commit

Permalink
Merge branch 'master' into winit-0.29
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk committed Dec 18, 2023
2 parents d63deb7 + 8503a85 commit 1c14bd9
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ These are the official egui integrations:
### 3rd party integrations

* [`amethyst_egui`](https://github.com/jgraef/amethyst_egui) for [the Amethyst game engine](https://amethyst.rs/).
* [`egui-ash`](https://github.com/MatchaChoco010/egui-ash) for [`ash`](https://github.com/ash-rs/ash) (a very lightweight wrapper around Vulkan).
* [`bevy_egui`](https://github.com/mvlabat/bevy_egui) for [the Bevy game engine](https://bevyengine.org/).
* [`egui_glfw_gl`](https://github.com/cohaereo/egui_glfw_gl) for [GLFW](https://crates.io/crates/glfw).
* [`egui_glium`](https://github.com/fayalalebrun/egui_glium) for compiling native apps with [Glium](https://github.com/glium/glium).
Expand Down
16 changes: 12 additions & 4 deletions crates/eframe/src/native/glow_integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -540,12 +540,16 @@ impl GlowWinitRunning {
(raw_input, viewport_ui_cb)
};

{
let clear_color = self
.app
.clear_color(&self.integration.egui_ctx.style().visuals);

let has_many_viewports = self.glutin.borrow().viewports.len() > 1;
let clear_before_update = !has_many_viewports; // HACK: for some reason, an early clear doesn't "take" on Mac with multiple viewports.

if clear_before_update {
// clear before we call update, so users can paint between clear-color and egui windows:

let clear_color = self
.app
.clear_color(&self.integration.egui_ctx.style().visuals);
let mut glutin = self.glutin.borrow_mut();
let GlutinWindowContext {
viewports,
Expand Down Expand Up @@ -616,6 +620,10 @@ impl GlowWinitRunning {

let screen_size_in_pixels: [u32; 2] = window.inner_size().into();

if !clear_before_update {
painter.clear(screen_size_in_pixels, clear_color);
}

painter.paint_and_update_textures(
screen_size_in_pixels,
pixels_per_point,
Expand Down
1 change: 1 addition & 0 deletions crates/egui/src/data/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1309,6 +1309,7 @@ fn test_key_from_name() {
/// Can be used with [`crate::InputState::consume_shortcut`]
/// and [`crate::Context::format_shortcut`].
#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
pub struct KeyboardShortcut {
pub modifiers: Modifiers,
pub key: Key,
Expand Down

0 comments on commit 1c14bd9

Please sign in to comment.