summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2024-07-04 08:56:16 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2024-07-04 08:56:16 +0200
commit31b386930e5905d590ee2444643500e9495f1589 (patch)
treee5127819d6ed1d397bd5ff0445fd0fe7c284758e
parentfc910ae892b58afaac5a1d1181757fac28ccfb20 (diff)
New Wayland-specific function: int fl_wl_buffer_scale(Fl_Window *)
-rw-r--r--FL/wayland.H2
-rw-r--r--src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx5
2 files changed, 7 insertions, 0 deletions
diff --git a/FL/wayland.H b/FL/wayland.H
index 34098a9d5..71981d974 100644
--- a/FL/wayland.H
+++ b/FL/wayland.H
@@ -43,6 +43,8 @@ extern FL_EXPORT cairo_t *fl_wl_gc();
\endcode
*/
extern FL_EXPORT struct wl_compositor *fl_wl_compositor();
+/** Returns the current buffer scaling factor for \p window. */
+extern FL_EXPORT int fl_wl_buffer_scale(Fl_Window *window);
typedef void *EGLContext;
/** Returns the EGLContext corresponding to the given GLContext */
extern FL_EXPORT EGLContext fl_wl_glcontext(GLContext rc);
diff --git a/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx
index ffc97ceae..2c45df2c8 100644
--- a/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx
+++ b/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx
@@ -2090,6 +2090,11 @@ struct wl_compositor *fl_wl_compositor() {
}
+int fl_wl_buffer_scale(Fl_Window *window) {
+ return Fl_Wayland_Window_Driver::driver(window)->wld_scale();
+}
+
+
Fl_Wayland_Plugin *Fl_Wayland_Window_Driver::gl_plugin() {
static Fl_Wayland_Plugin *plugin = NULL;
if (!plugin) {