diff options
author | Victor Berger <victor.berger@m4x.org> | 2015-08-21 18:48:08 +0200 |
---|---|---|
committer | Victor Berger <victor.berger@m4x.org> | 2015-08-21 18:48:08 +0200 |
commit | f3e67128dbc6a0a6cbb40c7e5a0bcedebeb478cd (patch) | |
tree | 395f75e9ca47d9ac5734b381988e58971932d425 /src/api/wayland | |
parent | bfc709fdd14775dfc04d9781e002e4949f01ea7c (diff) | |
download | glutin-f3e67128dbc6a0a6cbb40c7e5a0bcedebeb478cd.tar.gz glutin-f3e67128dbc6a0a6cbb40c7e5a0bcedebeb478cd.zip |
wayland: Resized event
Diffstat (limited to 'src/api/wayland')
-rw-r--r-- | src/api/wayland/context.rs | 9 | ||||
-rw-r--r-- | src/api/wayland/mod.rs | 7 |
2 files changed, 15 insertions, 1 deletions
diff --git a/src/api/wayland/context.rs b/src/api/wayland/context.rs index 9b6fce0..ad0977c 100644 --- a/src/api/wayland/context.rs +++ b/src/api/wayland/context.rs @@ -218,4 +218,11 @@ impl WaylandContext { p.lock().unwrap().remove_handled_surface(sid); } } -}
\ No newline at end of file + + pub fn push_event_for(&self, sid: SurfaceId, evt: Event) { + let mut guard = self.windows_event_queues.lock().unwrap(); + if let Some(queue) = guard.get(&sid) { + queue.lock().unwrap().push_back(evt); + } + } +} diff --git a/src/api/wayland/mod.rs b/src/api/wayland/mod.rs index ba1931b..0381f31 100644 --- a/src/api/wayland/mod.rs +++ b/src/api/wayland/mod.rs @@ -134,6 +134,13 @@ impl Window { if let Some(f) = self.resize_callback { f(w as u32, h as u32); } + if let Some(ref ctxt) = *WAYLAND_CONTEXT { + let mut window_guard = self.shell_window.lock().unwrap(); + ctxt.push_event_for( + window_guard.get_shell().get_wsurface().get_id(), + Event::Resized(w as u32, h as u32) + ); + } } b } |