diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2022-11-15 09:02:03 +0100 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2022-11-15 09:02:03 +0100 |
| commit | 1c448d6ff15decad382e2edf768a6f63177c73a8 (patch) | |
| tree | 1a01bac17f54cae3d6858b3888c7c9c433d72ada | |
| parent | d1054c5f6c7d5e6299ff1976d3b2856db5b6ce65 (diff) | |
Fix for "Wayland-only build is not compatible with Cairo option" (#544)
| -rw-r--r-- | cairo/Fl_Cairo.cxx | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/cairo/Fl_Cairo.cxx b/cairo/Fl_Cairo.cxx index 1e0790cd8..ea6e2e179 100644 --- a/cairo/Fl_Cairo.cxx +++ b/cairo/Fl_Cairo.cxx @@ -39,7 +39,11 @@ #elif defined(FLTK_USE_WAYLAND) // Wayland or hybrid # include "../src/drivers/Wayland/Fl_Wayland_Graphics_Driver.H" # include "../src/drivers/Wayland/Fl_Wayland_Window_Driver.H" -# include <cairo-xlib.h> +# if defined(FLTK_USE_X11) +# include <cairo-xlib.h> +# else + static void *fl_gc = NULL; +# endif #elif defined(FLTK_USE_X11) // X11 # include <cairo-xlib.h> #else @@ -135,6 +139,8 @@ cairo_t *Fl::cairo_make_current(Fl_Window *wi) { static cairo_surface_t *cairo_create_surface(void *gc, int W, int H) { #if defined(FLTK_USE_X11) return cairo_xlib_surface_create(fl_display, fl_window, fl_visual->visual, W, H); +#elif defined(FLTK_USE_WAYLAND) + return NULL; #elif defined(_WIN32) return cairo_win32_surface_create((HDC)gc); #elif defined(__APPLE__) @@ -151,7 +157,7 @@ static cairo_surface_t *cairo_create_surface(void *gc, int W, int H) { */ cairo_t *Fl::cairo_make_current(void *gc) { int W = 0, H = 0; -#if defined(FLTK_USE_X11) +#if defined(FLTK_USE_X11) || defined(FLTK_USE_WAYLAND) // FIXME X11 get W,H // gc will be the window handle here // # warning FIXME get W,H for cairo_make_current(void*) |
