diff --git a/Cargo.lock b/Cargo.lock index 9bd553f..6a92e62 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,6 +4,7 @@ version = "0.1.0" dependencies = [ "cairo-rs 0.0.8 (registry+https://github.com/rust-lang/crates.io-index)", "gdk 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "gdk-sys 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "glib 0.0.8 (registry+https://github.com/rust-lang/crates.io-index)", "glib-sys 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "gtk 0.0.7 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/Cargo.toml b/Cargo.toml index 9529f20..1614005 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,6 +9,7 @@ cairo-rs = "0.0.8" glib = "0.0.8" glib-sys = "0.3" gdk = "0.3" +gdk-sys = "0.3" #neovim-lib = "0.1" rmp = "0.7" phf = "0.7" diff --git a/src/main.rs b/src/main.rs index 4b5346f..5e0a2bb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,6 @@ extern crate gtk; extern crate gdk; +extern crate gdk_sys; extern crate glib; extern crate glib_sys; extern crate cairo; diff --git a/src/ui.rs b/src/ui.rs index 57bd3a5..d401ab1 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -13,6 +13,7 @@ use gtk; use gtk::prelude::*; use gtk::{Window, WindowType, DrawingArea, Grid, ToolButton, ButtonBox, Orientation, Image}; use gdk::{Event, EventKey, EventConfigure, EventButton, EventMotion, EventType}; +use gdk_sys; use glib; use glib_sys; use neovim_lib::{Neovim, NeovimApi}; @@ -113,6 +114,7 @@ impl Ui { grid.attach(&self.drawing_area, 0, 1, 1, 1); + self.drawing_area.set_events(gdk_sys::GDK_BUTTON_PRESS_MASK.bits() as i32); self.drawing_area.connect_button_press_event(gtk_button_press); self.drawing_area.connect_button_release_event(gtk_button_release); self.drawing_area.connect_motion_notify_event(gtk_motion_notify);