13 | 13 |
fn main() -> Result<(), failure::Error> {
|
14 | 14 |
// set up the display and the window
|
15 | 15 |
let mut d = Display::create()?;
|
16 | |
let size = Size {
|
17 | |
wd: d.get_width(),
|
18 | |
// TODO: this should be a function of font size
|
19 | |
ht: 36,
|
20 | |
};
|
21 | 16 |
let mut ws = Vec::new();
|
22 | 17 |
for (x_off, wd) in d.get_widths()? {
|
23 | |
let size = Size { wd, ht: 36 };
|
| 18 |
let size = Size { wd, ht: 36, xo: x_off, yo: 0 };
|
24 | 19 |
let mut w = Window::create(&d, size)?;
|
25 | 20 |
// set some window-manager properties: this is a dock
|
26 | 21 |
w.change_property("_NET_WM_WINDOW_TYPE", &["_NET_WM_WINDOW_TYPE_DOCK"])?;
|
|
84 | 79 |
// do an initial pass at drawing the bar!
|
85 | 80 |
draw(&ctx, &layout, &input, w.size())?;
|
86 | 81 |
|
87 | |
ctxs.push((ctx, layout));
|
| 82 |
ctxs.push((ctx, layout, w.size()));
|
88 | 83 |
}
|
89 | 84 |
|
90 | 85 |
|
|
120 | 115 |
if input.len() == 0 {
|
121 | 116 |
break;
|
122 | 117 |
}
|
123 | |
for (ctx, layout) in ctxs.iter() {
|
124 | |
draw(&ctx, &layout, &input, size)?;
|
| 118 |
for (ctx, layout, sz) in ctxs.iter() {
|
| 119 |
draw(&ctx, &layout, &input, *sz)?;
|
125 | 120 |
}
|
126 | 121 |
}
|
127 | 122 |
|
|
136 | 131 |
}
|
137 | 132 |
}
|
138 | 133 |
|
139 | |
for (ctx, layout) in ctxs.iter() {
|
| 134 |
for (ctx, layout, sz) in ctxs.iter() {
|
140 | 135 |
// otherwise, draw the thing!
|
141 | |
draw(&ctx, &layout, &input, size)?;
|
| 136 |
draw(&ctx, &layout, &input, *sz)?;
|
142 | 137 |
}
|
143 | 138 |
}
|
144 | 139 |
|