Fix X11 build against FLTK 1.4.5 (explicit platform/X11 includes)#95
Fix X11 build against FLTK 1.4.5 (explicit platform/X11 includes)#95wbniv wants to merge 2 commits into
Conversation
main-window, modal-dialog and option-dialogs use fl_display, fl_xid, Pixmap and XA_CARDINAL under #ifndef _WIN32 but only included <X11/xpm.h>. These resolved transitively on FLTK <= 1.4.4 but not on FLTK 1.4.5's cleaned-up headers, so the X11 build fails with 'fl_display'/'XA_CARDINAL' not declared. Add the includes to the shared utils.h. Built on Ubuntu 26.04, GCC 15, FLTK 1.4.5.
main-window, modal-dialog and option-dialogs use fl_display, fl_xid, Pixmap and XA_CARDINAL, which are declared in FL/x11.H. On FLTK <= 1.4.4 these came in transitively; FLTK 1.4.5 cleaned up its headers. Add an explicit include guarded by FLTK_USE_X11 (defined in fl_config.h, already pulled in via FL/fl_types.h) so the fix works for both X11-only and hybrid Wayland+X11 builds. FL/x11.H itself includes X11/Xlib.h, X11/Xutil.h, and X11/Xatom.h, so no separate X11 includes are needed. Built on Ubuntu 26.04, GCC 15, FLTK 1.4.5 X11-only and Wayland+X11.
|
more changes required for WAYLAND and/or X |
|
Closing this — the fix is already in upstream master. The exact same change ( This PR was derived independently while packaging Tilemap Studio for Foundry Linux and happens to be the same single-line fix. No need to merge it. For anyone packaging |
…tches 0001-x11-platform-includes: sent upstream as Rangi42/tilemap-studio#95. 0002-cstring-in-preferences: already fixed in upstream master (244378b); carried until next release. Bump to 4.0.1-2foundry1. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Problem
Building the Linux (X11) target against FLTK 1.4.5 fails:
main-window.{cpp,h},modal-dialog.cppandoption-dialogs.cppusefl_display,fl_xid,PixmapandXA_CARDINALunder#ifndef _WIN32, but only<X11/xpm.h>isincluded. The missing includes were introduced in
ea112f0
("Save and restore maximized window state in Linux (Xlib)") in 2021 — they were masked by
FLTK ≤ 1.4.4, which leaked these symbols transitively. FLTK 1.4.5 cleaned up its platform headers and stopped
leaking them, so the omission now causes a hard build failure.
Fix
Add the X11 / FLTK-platform includes to the shared
src/utils.h(guarded#ifndef _WIN32),so every translation unit that needs them gets them.
Build environment
Ubuntu 26.04, GCC 15, FLTK 1.4.5 built X11-only (
FLTK_BACKEND_WAYLAND=0). Found whilepackaging Tilemap Studio for Foundry Linux.