aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Duerr <contact@christianduerr.com>2018-01-29 23:01:46 +0100
committerChristian Duerr <contact@christianduerr.com>2018-02-16 22:41:56 +0100
commitb86c1ff9edbbc0fe28d77b4a247a1cb7ff596183 (patch)
tree0ff6937d8fea8c4e29ab489078065e06f0195b51
parentc14128e9dcaf74ec5286edcfd31fdf1f8a9738cf (diff)
downloadalacritty-b86c1ff9edbbc0fe28d77b4a247a1cb7ff596183.tar.gz
alacritty-b86c1ff9edbbc0fe28d77b4a247a1cb7ff596183.zip
Switch viewport before rendering rectangles
To make sure it is possible to draw over the complete window, the viewport is removed before rendering rectangles now. This makes the visual bell behave properly and flash over the padding of the terminal too, instead of just flashing the grid. However when rendering a rectangle now, the padding has to be taken into consideration.
-rw-r--r--src/renderer/mod.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/renderer/mod.rs b/src/renderer/mod.rs
index d08095f7..7c3328f9 100644
--- a/src/renderer/mod.rs
+++ b/src/renderer/mod.rs
@@ -675,6 +675,9 @@ impl QuadRenderer {
// Swap program
gl::UseProgram(self.rect_program.id);
+ // Remove padding from viewport
+ gl::Viewport(0, 0, props.width as i32, props.height as i32);
+
// Change blending strategy
gl::BlendFunc(gl::SRC_ALPHA, gl::ONE_MINUS_SRC_ALPHA);
@@ -707,6 +710,13 @@ impl QuadRenderer {
gl::BindBuffer(gl::ARRAY_BUFFER, 0);
gl::BindVertexArray(0);
+ // Add padding to viewport again
+ let x_pad = config.padding().x as i32;
+ let y_pad = config.padding().y as i32;
+ let width = props.width as i32;
+ let height = props.height as i32;
+ gl::Viewport(x_pad, y_pad, width - 2 * y_pad, height - 2 * y_pad);
+
// Disable program
gl::UseProgram(0);
}