config: add resize action
This commit is contained in:
parent
15c157b7a6
commit
a1905ab971
14 changed files with 344 additions and 264 deletions
|
|
@ -826,6 +826,16 @@ impl ConfigClient {
|
|||
self.send(&ClientMessage::WindowClose { window });
|
||||
}
|
||||
|
||||
pub fn resize_window(&self, window: Window, dx1: i32, dy1: i32, dx2: i32, dy2: i32) {
|
||||
self.send(&ClientMessage::WindowResize {
|
||||
window,
|
||||
dx1,
|
||||
dy1,
|
||||
dx2,
|
||||
dy2,
|
||||
});
|
||||
}
|
||||
|
||||
pub fn focus_seat_parent(&self, seat: Seat) {
|
||||
self.send(&ClientMessage::FocusSeatParent { seat });
|
||||
}
|
||||
|
|
|
|||
|
|
@ -864,6 +864,13 @@ pub enum ClientMessage<'a> {
|
|||
CleanLogsOlderThan {
|
||||
time: SystemTime,
|
||||
},
|
||||
WindowResize {
|
||||
window: Window,
|
||||
dx1: i32,
|
||||
dy1: i32,
|
||||
dx2: i32,
|
||||
dy2: i32,
|
||||
},
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug)]
|
||||
|
|
|
|||
|
|
@ -650,6 +650,11 @@ impl Seat {
|
|||
pub fn warp_mouse_to_focus(self) {
|
||||
get!().seat_warp_mouse_to_focus(self)
|
||||
}
|
||||
|
||||
/// Resizes the focused window.
|
||||
pub fn resize(self, dx1: i32, dy1: i32, dx2: i32, dy2: i32) {
|
||||
self.window().resize(dx1, dy1, dx2, dy2);
|
||||
}
|
||||
}
|
||||
|
||||
/// A focus-follows-mouse mode.
|
||||
|
|
|
|||
|
|
@ -236,6 +236,11 @@ impl Window {
|
|||
pub fn toggle_float_pinned(self) {
|
||||
self.set_float_pinned(!self.float_pinned());
|
||||
}
|
||||
|
||||
/// Resizes the window.
|
||||
pub fn resize(self, dx1: i32, dy1: i32, dx2: i32, dy2: i32) {
|
||||
get!().resize_window(self, dx1, dy1, dx2, dy2);
|
||||
}
|
||||
}
|
||||
|
||||
/// A window matcher.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue