New Wayland-specific function: int fl_wl_buffer_scale(Fl_Window *)

This commit is contained in:
ManoloFLTK 2024-07-04 08:56:16 +02:00
parent fc910ae892
commit 31b386930e
2 changed files with 7 additions and 0 deletions

View File

@ -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);

View File

@ -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) {