FLTK logo

[fltk.coredev] Towards a Wayland platform for the FLTK library ?

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.coredev  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Towards a Wayland platform for the FLTK library ? Manolo Jun 06, 2021  
  I'd like to invite fellow FLTK developpers to discuss the possibility of
adding a Wayland platform to the FLTK library.

My proposal is in branch "wayland" of https://github.com/ManoloFLTK/fltk
See file README.Wayland.txt therein for installation instructions, including
a short list of required Debian packages.
That software should hopefully install on any Wayland-running Linux system.
It's been tested on Debian and Ubuntu.
At this time, the wayland branch is not complete but quite advanced :
all test/ and examples/ apps build and run.

Users can run xwininfo in a terminal, click on any FLTK window using this new code,
and conclude that such windows are not X11-based, in contrast to what happens with
FLTK programs for the X11 platform.

The "wayland" branch doesn't require any change to the platform-independent FLTK
code. It's expected that any FLTK app should link and mostly run as a Wayland client
program. `fltk-config --cxxflags --ldflags` can be used in makefiles as usual.
Nevertheless, X11-specific code delimited by
#if !defined(__APPLE__) && !defined(_WIN32)
... X11-specific code ...
#endif
will choke at compile-time because it will expose X11-specific function calls. Such
source code should be changed to
#if !defined(__APPLE__) && !defined(WIN32) && !defined(__WAYLAND__)
... X11-specific code ...
#endif

OpenGL and GLUT are supported as for other FLTK platforms. OpenGL3 is supported too,
but a minor source code change is required after the glewInit() call :
  GLenum err = glewInit(); // defines pters to functions of OpenGL V 1.2 and above
#ifdef __WAYLAND__
  if (err == GLEW_ERROR_NO_GLX_DISPLAY) err = GLEW_OK;
#endif
That's because glewInit() returns an error code value in the Wayland context.

The Wayland protocol accomodates either client-based or server-based window
decoration. The Gnome Wayland implementation does not contain server-based
window decoration and instead expects each client program to decorate its windows.
For that reason, the FLTK library is extended in my proposal by a library, libdecor,
(see https://gitlab.gnome.org/jadahl/libdecoration) which produces window decoration
for each FLTK client program. That library is governed by the MIT license which
allows unrestricted use, even in a commercial setting, but asks for a copy of the
license to be included in any copy of the software.

I believe it's too early at this point for you, fellow developers, to send "this
doesn't work" messages, but expect messages about attempts to install the new branch
and to build full-size FLTK apps, and about the opportunity of a Wayland FLTK platform.

Manolo

--
You received this message because you are subscribed to the Google Groups "fltk.coredev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkcoredev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkcoredev/0c7fd733-9f7c-455a-89bf-ed5b55326160n%40googlegroups.com.

Attachment: 2platforms.png
Description: PNG image

Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.