|
|
@@ -381,11 +381,26 @@ impl WindowManager { |
| 381 |
381 |
self.floating_windows.remove(&focused); |
| 382 |
382 |
self.apply_layout()?; |
| 383 |
383 |
} else { |
| 384 |
|
- self.floating_windows.insert(focused); |
|
384 |
+ let float_width = (self.screen.width_in_pixels / 2) as u32; |
|
385 |
+ let float_height = (self.screen.height_in_pixels / 2) as u32; |
|
386 |
+ |
|
387 |
+ let border_width = self.config.border_width; |
|
388 |
+ |
|
389 |
+ let center_width = ((self.screen.width_in_pixels - float_width as u16)/2) as i32; |
|
390 |
+ let center_height = ((self.screen.height_in_pixels - float_height as u16)/2) as i32; |
|
391 |
+ |
| 385 |
392 |
self.connection.configure_window( |
| 386 |
393 |
focused, |
| 387 |
|
- &ConfigureWindowAux::new().stack_mode(StackMode::ABOVE), |
|
394 |
+ &ConfigureWindowAux::new() |
|
395 |
+ .x(center_width) |
|
396 |
+ .y(center_height) |
|
397 |
+ .width(float_width) |
|
398 |
+ .height(float_height) |
|
399 |
+ .border_width(border_width) |
|
400 |
+ .stack_mode(StackMode::ABOVE), |
| 388 |
401 |
)?; |
|
402 |
+ |
|
403 |
+ self.floating_windows.insert(focused); |
| 389 |
404 |
self.apply_layout()?; |
| 390 |
405 |
self.connection.flush()?; |
| 391 |
406 |
} |