aboutsummaryrefslogtreecommitdiffstats
path: root/src/api/wayland/context.rs
diff options
context:
space:
mode:
authorVictor Berger <victor.berger@m4x.org>2015-08-16 14:12:21 +0200
committerVictor Berger <victor.berger@m4x.org>2015-08-16 14:12:21 +0200
commit1cea6a65a44dee4d0bd85a35f8ac531017c4951f (patch)
treed2b999e296fea8bb3faa9b678fc93cd0a0399c4d /src/api/wayland/context.rs
parentc5d11ebca2159cbd6e67b018997a2587d202f0ce (diff)
downloadglutin-1cea6a65a44dee4d0bd85a35f8ac531017c4951f.tar.gz
glutin-1cea6a65a44dee4d0bd85a35f8ac531017c4951f.zip
Update wayland backend to draw decorations.
Integrate with wayland-window crate to draw decorations allowing resize & move of the window. Leaving the wayland backend as disabled until full usability is ensured.
Diffstat (limited to 'src/api/wayland/context.rs')
-rw-r--r--src/api/wayland/context.rs10
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