From 16c047b08ab1f844f9590efb0d5212d6e9924daf Mon Sep 17 00:00:00 2001 From: Dustin Date: Sun, 22 Oct 2017 14:34:31 -0400 Subject: [PATCH] Change cursor from pointer to text (#778) It seems that (as a rule) terminal emulators use the text mouse cursor rather than the pointer that is used now. This commit changes the cursor to using winit's built-in configuration function. --- src/window.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/window.rs b/src/window.rs index a50daf87..34a9c780 100644 --- a/src/window.rs +++ b/src/window.rs @@ -16,7 +16,7 @@ use std::fmt::{self, Display}; use std::ops::Deref; use gl; -use glutin::{self, EventsLoop, WindowBuilder, Event, CursorState, ControlFlow, ContextBuilder}; +use glutin::{self, EventsLoop, WindowBuilder, Event, MouseCursor, CursorState, ControlFlow, ContextBuilder}; use glutin::GlContext; /// Window errors @@ -195,6 +195,9 @@ impl Window { .with_vsync(true); let window = ::glutin::GlWindow::new(window, context, &event_loop)?; + // Text cursor + window.set_cursor(MouseCursor::Text); + // Set OpenGL symbol loader gl::load_with(|symbol| window.get_proc_address(symbol) as *const _);