summaryrefslogtreecommitdiff
path: root/src/libsystemd-terminal/grdev.c
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2014-09-23 13:52:50 +0200
committerDavid Herrmann <dh.herrmann@gmail.com>2014-09-23 20:05:45 +0200
commit158c1e3e0c1e9dd8ebf1b93061e1c81805eac339 (patch)
treed4c98d10bee2e3d4b1d3203fe298a9b49188d883 /src/libsystemd-terminal/grdev.c
parenta908d213557cfbe874b7bd1ae3a1b0d3c05c29e9 (diff)
terminal: provide display dimensions to API users
Allow users to query the display dimensions of a grdev_display. This is required to properly resize the objects to be rendered.
Diffstat (limited to 'src/libsystemd-terminal/grdev.c')
-rw-r--r--src/libsystemd-terminal/grdev.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/libsystemd-terminal/grdev.c b/src/libsystemd-terminal/grdev.c
index fa1fc378c8..aaac06ec34 100644
--- a/src/libsystemd-terminal/grdev.c
+++ b/src/libsystemd-terminal/grdev.c
@@ -301,6 +301,18 @@ const char *grdev_display_get_name(grdev_display *display) {
return display->name;
}
+uint32_t grdev_display_get_width(grdev_display *display) {
+ assert_return(display, 0);
+
+ return display->width;
+}
+
+uint32_t grdev_display_get_height(grdev_display *display) {
+ assert_return(display, 0);
+
+ return display->height;
+}
+
bool grdev_display_is_enabled(grdev_display *display) {
return display && display->enabled;
}
@@ -572,6 +584,8 @@ static bool display_cache(grdev_display *display) {
}
display_cache_targets(display);
+ display->width = display->tile->cache_w;
+ display->height = display->tile->cache_h;
r = 0;