aboutsummaryrefslogtreecommitdiff
path: root/alacritty/src/display/window.rs
diff options
context:
space:
mode:
authorKirill Chibisov <contact@kchibisov.com>2022-06-29 22:01:32 +0300
committerGitHub <noreply@github.com>2022-06-29 22:01:32 +0300
commit28e3fc7c64a7f375ad843145a0a8f78e31bff05e (patch)
tree788ef51735457f14376d1723417ac4d5fcf80cf8 /alacritty/src/display/window.rs
parent75b0005619f6e6d3e5e0ba775083b16cd46dac30 (diff)
downloadr-alacritty-28e3fc7c64a7f375ad843145a0a8f78e31bff05e.tar.gz
r-alacritty-28e3fc7c64a7f375ad843145a0a8f78e31bff05e.tar.bz2
r-alacritty-28e3fc7c64a7f375ad843145a0a8f78e31bff05e.zip
Fix resize on Wayland when creating new window
When we have currently active context when asking EGL on Wayland to create new context it'll lock the backing buffer of surface using that context. So making it non-current before-hand to prevent it. Follow-up to 90552e3.
Diffstat (limited to 'alacritty/src/display/window.rs')
-rw-r--r--alacritty/src/display/window.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/alacritty/src/display/window.rs b/alacritty/src/display/window.rs
index 2e8ed085..ad89738d 100644
--- a/alacritty/src/display/window.rs
+++ b/alacritty/src/display/window.rs
@@ -495,6 +495,16 @@ impl Window {
self.windowed_context.resize(size);
}
+ pub fn make_not_current(&mut self) {
+ if self.windowed_context.is_current() {
+ self.windowed_context.replace_with(|context| unsafe {
+ // We do ensure that context is current before any rendering operation due to multi
+ // window support, so we don't need extra "type aid" from glutin here.
+ context.make_not_current().expect("context swap").treat_as_current()
+ });
+ }
+ }
+
pub fn make_current(&mut self) {
if !self.windowed_context.is_current() {
self.windowed_context