From 9b694fcc547f664ed0fecdd5c84c067d7d3e7f14 Mon Sep 17 00:00:00 2001 From: trimental Date: Mon, 24 Sep 2018 00:21:47 +0800 Subject: 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. --- src/main.rs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/main.rs') 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> { // 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> { 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. -- cgit v1.2.3-54-g00ecf