diff --git a/src/output.c b/src/output.c index 06f1af5..751db0f 100644 --- a/src/output.c +++ b/src/output.c @@ -29,7 +29,9 @@ const struct output output_x11 = { get_active_screen, x_is_idle, - have_fullscreen_window + have_fullscreen_window, + + x_get_scale, }; #ifdef ENABLE_WAYLAND @@ -49,7 +51,9 @@ const struct output output_wl = { wl_get_active_screen, wl_is_idle, - wl_have_fullscreen_window + wl_have_fullscreen_window, + + wl_get_scale, }; #endif diff --git a/src/output.h b/src/output.h index a6cf5e7..11f307d 100644 --- a/src/output.h +++ b/src/output.h @@ -44,6 +44,8 @@ struct output { bool (*is_idle)(void); bool (*have_fullscreen_window)(void); + + int (*get_scale)(void); }; /** diff --git a/src/wayland/wl.c b/src/wayland/wl.c index 4fae2f4..a10bc34 100644 --- a/src/wayland/wl.c +++ b/src/wayland/wl.c @@ -135,7 +135,6 @@ static void create_output( struct wl_output *wl_output, uint32_t global_name) { LOG_I("New output found - id %i", number); output->global_name = global_name; output->wl_output = wl_output; - // TODO: Fix this output->scale = 1; output->fullscreen = false; wl_list_insert(&ctx.outputs, &output->link); @@ -885,4 +884,12 @@ bool wl_have_fullscreen_window(void) { LOG_D("Fullscreen queried: %i", have_fullscreen); return have_fullscreen; } + +int wl_get_scale(void) { + struct dunst_output *output = get_configured_output(); + if (output) + return output->scale; + else + return 1; +} /* vim: set ft=c tabstop=8 shiftwidth=8 expandtab textwidth=0: */ diff --git a/src/wayland/wl.h b/src/wayland/wl.h index fe54e12..f4b3af9 100644 --- a/src/wayland/wl.h +++ b/src/wayland/wl.h @@ -23,5 +23,7 @@ const struct screen_info* wl_get_active_screen(void); bool wl_is_idle(void); bool wl_have_fullscreen_window(void); + +int wl_get_scale(void); #endif /* vim: set ft=c tabstop=8 shiftwidth=8 expandtab textwidth=0: */ diff --git a/src/x11/x.c b/src/x11/x.c index 8cdc0ab..971b57b 100644 --- a/src/x11/x.c +++ b/src/x11/x.c @@ -942,4 +942,8 @@ static void x_shortcut_init(struct keyboard_shortcut *ks) g_free(str_begin); } +int x_get_scale(void) { + return 1; +} + /* vim: set ft=c tabstop=8 shiftwidth=8 expandtab textwidth=0: */ diff --git a/src/x11/x.h b/src/x11/x.h index 28fb32c..4b0c3cf 100644 --- a/src/x11/x.h +++ b/src/x11/x.h @@ -51,5 +51,6 @@ void x_free(void); struct geometry x_parse_geometry(const char *geom_str); +int x_get_scale(void); #endif /* vim: set ft=c tabstop=8 shiftwidth=8 expandtab textwidth=0: */