aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authortrimental <timmins.s.lucas@gmail.com>2018-09-24 00:21:47 +0800
committerChristian Duerr <chrisduerr@users.noreply.github.com>2018-09-23 16:21:47 +0000
commit9b694fcc547f664ed0fecdd5c84c067d7d3e7f14 (patch)
treedd27cbd90aabdabff648b8196db5221a99182d12 /src/main.rs
parentcee35b309de129f16d4c9df80172e43f5320c82a (diff)
downloadalacritty-9b694fcc547f664ed0fecdd5c84c067d7d3e7f14.tar.gz
alacritty-9b694fcc547f664ed0fecdd5c84c067d7d3e7f14.zip
Fix mesa rendering outside window borders on wayland
The mesa workaround has lead to some issues with rendering on Wayland. To resolve this problem, the mesa workaround has been restructured in a way which still allows clearing the screen before rendering without killing performance with the mesa driver. The performance is identical to the master brach and there have been no recorded regressions.
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/main.rs b/src/main.rs
index 0888c9b5..03a372df 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -173,7 +173,7 @@ fn run(mut config: Config, options: &cli::Options) -> Result<(), Box<Error>> {
// Main display loop
loop {
// Process input and window events
- let mut terminal = processor.process_events(&terminal, display.window());
+ let mut terminal_lock = processor.process_events(&terminal, display.window());
// Handle config reloads
if let Some(new_config) = config_monitor
@@ -183,22 +183,23 @@ fn run(mut config: Config, options: &cli::Options) -> Result<(), Box<Error>> {
config = new_config.update_dynamic_title(options);
display.update_config(&config);
processor.update_config(&config);
- terminal.update_config(&config);
- terminal.dirty = true;
+ terminal_lock.update_config(&config);
+ terminal_lock.dirty = true;
}
// Maybe draw the terminal
- if terminal.needs_draw() {
+ if terminal_lock.needs_draw() {
// Try to update the position of the input method editor
- display.update_ime_position(&terminal);
+ display.update_ime_position(&terminal_lock);
// Handle pending resize events
//
// The second argument is a list of types that want to be notified
// of display size changes.
- display.handle_resize(&mut terminal, &config, &mut [&mut pty, &mut processor]);
+ display.handle_resize(&mut terminal_lock, &config, &mut [&mut pty, &mut processor]);
+ drop(terminal_lock);
// Draw the current state of the terminal
- display.draw(terminal, &config);
+ display.draw(&terminal, &config);
}
// Begin shutdown if the flag was raised.