aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2019-09-20 20:15:18 +0000
committerDaniel Eklöf <daniel@ekloef.se>2019-09-20 20:15:18 +0000
commit1a9ec997b30ad40079e60f26fefb126c32bcde1d (patch)
treea5e2a25b996a8d0f16a7ee64d4dcb844e06671f4
parentREADME: formatting (diff)
main: track output refresh rate
-rw-r--r--main.c9
-rw-r--r--terminal.h1
2 files changed, 8 insertions, 2 deletions
diff --git a/main.c b/main.c
index a0101601..1fd003ae 100644
--- a/main.c
+++ b/main.c
@@ -119,6 +119,11 @@ static void
output_mode(void *data, struct wl_output *wl_output, uint32_t flags,
int32_t width, int32_t height, int32_t refresh)
{
+ if ((flags & WL_OUTPUT_MODE_CURRENT) == 0)
+ return;
+
+ struct monitor *mon = data;
+ mon->refresh = (float)refresh / 1000;
}
static void
@@ -717,9 +722,9 @@ main(int argc, char *const *argv)
}
tll_foreach(term.wl.monitors, it) {
- LOG_INFO("%s: %dx%d+%dx%d (scale=%d)",
+ LOG_INFO("%s: %dx%d+%dx%d (scale=%d, refresh=%.2fHZ)",
it->item.name, it->item.width_px, it->item.height_px,
- it->item.x, it->item.y, it->item.scale);
+ it->item.x, it->item.y, it->item.scale, it->item.refresh);
}
/* Clipboard */
diff --git a/terminal.h b/terminal.h
index f435ab3b..72a41fcf 100644
--- a/terminal.h
+++ b/terminal.h
@@ -35,6 +35,7 @@ struct monitor {
int height_px;
int scale;
+ float refresh;
};
struct wayland {