|
@@ -4,12 +4,11 @@ use ui::x11;
|
|
|
use xcb;
|
|
|
|
|
|
use std::sync::Arc;
|
|
|
-use std::sync::mpsc;
|
|
|
|
|
|
const CLIENT_MESSAGE: u8 = xcb::CLIENT_MESSAGE | 0x80; // 0x80 flag for client messages
|
|
|
|
|
|
pub struct Tray {
|
|
|
- tx: mpsc::Sender<widget::WidgetMessage>,
|
|
|
+ tx: widget::MessageSender,
|
|
|
conn: Arc<x11::Connection>,
|
|
|
window: xcb::Window,
|
|
|
children: Vec<xcb::Window>,
|
|
@@ -17,7 +16,7 @@ pub struct Tray {
|
|
|
}
|
|
|
|
|
|
impl Tray {
|
|
|
- pub fn new(tx: mpsc::Sender<widget::WidgetMessage>, conn: Arc<x11::Connection>, window: xcb::Window) -> Tray {
|
|
|
+ pub fn new(tx: widget::MessageSender, conn: Arc<x11::Connection>, window: xcb::Window) -> Tray {
|
|
|
Tray {
|
|
|
conn: conn,
|
|
|
tx: tx,
|
|
@@ -67,7 +66,7 @@ impl Tray {
|
|
|
}
|
|
|
|
|
|
fn relayout(&self) {
|
|
|
- self.tx.send(widget::WidgetMessage::Relayout).expect("Failed to send relayout");
|
|
|
+ self.tx.send(widget::Message::Relayout).expect("Failed to send relayout");
|
|
|
}
|
|
|
|
|
|
pub fn force_size(&self, window: xcb::Window, dimensions: Option<(u16, u16)>) {
|
|
@@ -101,9 +100,9 @@ impl widget::Widget for Tray {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- fn handle_event(&mut self, event: &widget::WidgetMessage) -> bool {
|
|
|
+ fn handle_event(&mut self, event: &widget::Message) -> bool {
|
|
|
match event {
|
|
|
- &widget::WidgetMessage::XcbEvent(ref event) =>
|
|
|
+ &widget::Message::XcbEvent(ref event) =>
|
|
|
match event.response_type() {
|
|
|
xcb::PROPERTY_NOTIFY if self.timestamp == 0 => {
|
|
|
let event: &xcb::PropertyNotifyEvent = unsafe { xcb::cast_event(&event) };
|