Improve performance on windows

I noticed that things were feeling laggy in general and when I
added some debugging prints I noticed that we were getting a
continuous stream of CursorMoved events with the same coordinates
while the window had focus.

This diff short circuits mouse processing in that situation and
makes things feel a bit more snappy.
This commit is contained in:
Wez Furlong committed 2019-05-18 19:15:04 -07:00
1 parent 5d8860f3dd
commit c207142bcf
1 file changed
+7
+7
View File
@@ -296,6 +296,13 @@ impl GliumTerminalWindow {
position: PhysicalPosition,
modifiers: glium::glutin::ModifiersState,
) -> Result<(), Error> {
// On Windows, I've observed that we receive a continuous stream of
// CursorMoved events with the same coordinates. Let's avoid
// doing any real work in that situation.
if position == self.last_mouse_coords {
return Ok(());
}
let mux = Mux::get().unwrap();
let tab = match mux.get_active_tab_for_window(self.get_mux_window_id()) {
Some(tab) => tab,