From b5793feb5128f3a484626b1f436351ca8854a677 Mon Sep 17 00:00:00 2001 From: ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> Date: Tue, 14 Feb 2023 12:42:36 +0100 Subject: Wayland doc: detail how to be compatible with macOS+XQuartz --- README.Wayland.txt | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/README.Wayland.txt b/README.Wayland.txt index 628b9162b..65a5c3a36 100644 --- a/README.Wayland.txt +++ b/README.Wayland.txt @@ -131,7 +131,7 @@ function or variable. The recommended way to prepare and use platform-specific code that would contain X11-specific and possibly Wayland-specific parts is as follows : -a) Organize platform-specific code as follows : +a) Organize platform-specific code as follows¹: #include @@ -156,6 +156,21 @@ function or variable, and that fl_wl_display() returns non-NULL before using any Wayland-specific function or variable. Make sure that fl_open_display() was called directly or indirectly before using any such symbol. +¹ To be also compatible with macOS+XQuartz, a slightly different organization is necessary: + #include + #if defined(FLTK_USE_X11) || defined(FLTK_USE_WAYLAND) + # ifdef FLTK_USE_X11 + *** X11-specific code which can run under Linux/Unix or under macOS+XQuartz *** + # endif + # ifdef FLTK_USE_WAYLAND + *** Wayland-specific code *** + # endif + #elif defined(__APPLE__) + *** macOS-specific code which doesn't run under XQuartz *** + #elif defined(_WIN32) + *** Windows-specific code *** + #endif + 3.3 Forcing an FLTK App to Always Use the X11 Backend ----------------------------------------------------- @@ -236,6 +251,3 @@ These packages are necessary to build the FLTK library and the sway compositor: git autoconf pkgconf xorg urwfonts gnome glew seatd sway dmenu-wayland dmenu evdev-proto Package installation command: sudo pkg install - -If FLTK is built using the configure/make procedure, include argument "--enable-localzlib" -in the "configure" command. -- cgit v1.2.3