mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-20 05:33:47 -04:00
main: track output refresh rate
This commit is contained in:
parent
dd26fa099b
commit
1a9ec997b3
2 changed files with 8 additions and 2 deletions
9
main.c
9
main.c
|
|
@ -119,6 +119,11 @@ static void
|
||||||
output_mode(void *data, struct wl_output *wl_output, uint32_t flags,
|
output_mode(void *data, struct wl_output *wl_output, uint32_t flags,
|
||||||
int32_t width, int32_t height, int32_t refresh)
|
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
|
static void
|
||||||
|
|
@ -717,9 +722,9 @@ main(int argc, char *const *argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
tll_foreach(term.wl.monitors, it) {
|
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.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 */
|
/* Clipboard */
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@ struct monitor {
|
||||||
int height_px;
|
int height_px;
|
||||||
|
|
||||||
int scale;
|
int scale;
|
||||||
|
float refresh;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct wayland {
|
struct wayland {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue