diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2022-10-08 17:59:06 +0200 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2022-11-05 19:47:37 +0100 |
| commit | 4b945a3086011b6a59b5aef434cdbe8cda96c2de (patch) | |
| tree | 333de7fbb01ae280eb95728ad26ff1f366963054 /src/Fl.cxx | |
| parent | b426a3d7c07c9ffd53141ebd03dcd5e82ff4e52a (diff) | |
Wayland/X11 hybrid: use "bool fl_disable_wayland;" declaration.
Diffstat (limited to 'src/Fl.cxx')
| -rw-r--r-- | src/Fl.cxx | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/Fl.cxx b/src/Fl.cxx index 29f3f5839..30fe9a968 100644 --- a/src/Fl.cxx +++ b/src/Fl.cxx @@ -2111,14 +2111,19 @@ void fl_close_display() Fl::screen_driver()->close_display(); } -/** Prevent the FLTK library from using its wayland backend. - Call this early in your main(), before fl_open_display() runs, or any window is created, or the screen is accessed. - This function has no effect on non-Wayland platforms. +#ifdef FL_DOXYGEN +/** Prevent the FLTK library from using its Wayland backend and forces it to use its X11 backend. + Put this declaration somewhere in your code outside the body of any function : + \code + FL_EXPORT bool fl_disable_wayland = true; + \endcode + This declaration makes sure source code developed for FLTK 1.3, including X11-specific code, + will build and run with FLTK 1.4 and its Wayland platform with this single source code level change. + This declaration has no effect on non-Wayland platforms. + Don't put this declaration if you want the Wayland backend to be used when it's available. */ -void fl_disable_wayland() -{ - Fl::system_driver()->disable_wayland(); -} +FL_EXPORT bool fl_disable_wayland = true; +#endif // FL_DOXYGEN FL_EXPORT Window fl_xid_(const Fl_Window *w) { Fl_X *temp = Fl_X::i(w); |
