diff options
author | tomaka <pierre.krieger1708@gmail.com> | 2015-08-16 16:58:18 +0200 |
---|---|---|
committer | tomaka <pierre.krieger1708@gmail.com> | 2015-08-16 16:58:18 +0200 |
commit | 6ba15de7db4d5266db816be5e38e5d401a3da1ec (patch) | |
tree | db1e3b8306e4cce9dba5fc7b3fb00bb2c18c4251 /src/api/wayland/context.rs | |
parent | c5d11ebca2159cbd6e67b018997a2587d202f0ce (diff) | |
parent | f7f52c21a02bdd26889093427adb9659b5bcf8dc (diff) | |
download | glutin-6ba15de7db4d5266db816be5e38e5d401a3da1ec.tar.gz glutin-6ba15de7db4d5266db816be5e38e5d401a3da1ec.zip |
Merge pull request #571 from vberger/master
Add decorations to wayland windows
Diffstat (limited to 'src/api/wayland/context.rs')
-rw-r--r-- | src/api/wayland/context.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/api/wayland/context.rs b/src/api/wayland/context.rs index 1af6311..6d7df86 100644 --- a/src/api/wayland/context.rs +++ b/src/api/wayland/context.rs @@ -25,7 +25,7 @@ pub struct WaylandContext { pub compositor: Compositor, pub shell: Shell, pub seat: Seat, - pub pointer: Option<Pointer<WSurface>>, + pointer: Option<Mutex<Pointer<WSurface>>>, keyboard: Option<AnyKeyboard>, windows_event_queues: Arc<Mutex<HashMap<SurfaceId, Arc<Mutex<VecDeque<Event>>>>>>, current_pointer_surface: Arc<Mutex<Option<SurfaceId>>>, @@ -196,7 +196,7 @@ impl WaylandContext { compositor: compositor, shell: shell, seat: seat, - pointer: pointer, + pointer: pointer.map(|p| Mutex::new(p)), keyboard: keyboard, windows_event_queues: windows_event_queues, current_pointer_surface: current_pointer_surface, @@ -207,9 +207,15 @@ impl WaylandContext { pub fn register_surface(&self, sid: SurfaceId, queue: Arc<Mutex<VecDeque<Event>>>) { self.windows_event_queues.lock().unwrap().insert(sid, queue); + if let Some(ref p) = self.pointer { + p.lock().unwrap().add_handled_surface(sid); + } } pub fn deregister_surface(&self, sid: SurfaceId) { self.windows_event_queues.lock().unwrap().remove(&sid); + if let Some(ref p) = self.pointer { + p.lock().unwrap().remove_handled_surface(sid); + } } }
\ No newline at end of file |