wayland: implement scaling
This involves many subsystems:
- config:
- allow setting the connector scale
- allow setting the cursor size
- cursors:
- load server cursors for all requested sizes and scales
- wl_surface:
- track the output the surface belongs to
- send wl_surface.enter/leave
- wl_output:
- implement wl_output.scale
- text:
- pre-render texts for all used scales
- renderer:
- properly align scale textures and rectangles
- wp_fractional_scale:
- new interface for fractional scaling
This commit is contained in:
parent
16aec8f87e
commit
e52a60b3b6
41 changed files with 1417 additions and 364 deletions
|
|
@ -359,6 +359,10 @@ impl Client {
|
|||
size
|
||||
}
|
||||
|
||||
pub fn set_cursor_size(&self, seat: Seat, size: i32) {
|
||||
self.send(&ClientMessage::SetCursorSize { seat, size })
|
||||
}
|
||||
|
||||
pub fn set_size(&self, sized: Resizable, size: i32) {
|
||||
self.send(&ClientMessage::SetSize { sized, size })
|
||||
}
|
||||
|
|
@ -459,6 +463,16 @@ impl Client {
|
|||
connected
|
||||
}
|
||||
|
||||
pub fn connector_set_scale(&self, connector: Connector, scale: f64) {
|
||||
self.send(&ClientMessage::ConnectorSetScale { connector, scale });
|
||||
}
|
||||
|
||||
pub fn connector_get_scale(&self, connector: Connector) -> f64 {
|
||||
let res = self.send_with_response(&ClientMessage::ConnectorGetScale { connector });
|
||||
get_response!(res, 1.0, ConnectorGetScale { scale });
|
||||
scale
|
||||
}
|
||||
|
||||
pub fn connector_type(&self, connector: Connector) -> ConnectorType {
|
||||
let res = self.send_with_response(&ClientMessage::ConnectorType { connector });
|
||||
get_response!(res, CON_UNKNOWN, ConnectorType { ty });
|
||||
|
|
@ -483,6 +497,12 @@ impl Client {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn connector_size(&self, connector: Connector) -> (i32, i32) {
|
||||
let res = self.send_with_response(&ClientMessage::ConnectorSize { connector });
|
||||
get_response!(res, (0, 0), ConnectorSize { width, height });
|
||||
(width, height)
|
||||
}
|
||||
|
||||
pub fn drm_devices(&self) -> Vec<DrmDevice> {
|
||||
let res = self.send_with_response(&ClientMessage::GetDrmDevices);
|
||||
get_response!(res, vec![], GetDrmDevices { devices });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue