diff --git a/CMake/options.cmake b/CMake/options.cmake
index 08b521450a..97c92afd2e 100644
--- a/CMake/options.cmake
+++ b/CMake/options.cmake
@@ -287,7 +287,9 @@ if(UNIX)
if(FLTK_BACKEND_WAYLAND)
set(FLTK_USE_WAYLAND 1)
- include(FindX11)
+ if(FLTK_BACKEND_X11)
+ include(FindX11)
+ endif()
if(FLTK_BACKEND_X11 AND X11_FOUND)
set(FLTK_USE_X11 1) # build a hybrid Wayland/X11 library
else()
@@ -295,11 +297,11 @@ if(UNIX)
endif()
unset(FLTK_GRAPHICS_CAIRO CACHE)
set(FLTK_GRAPHICS_CAIRO TRUE CACHE BOOL "all drawing to X11 windows uses Cairo")
- option(FLTK_USE_SYSTEM_LIBDECOR "use libdecor from the system" ON)
+ option(FLTK_USE_SYSTEM_LIBDECOR "use libdecor from the system" OFF)
set(USE_SYSTEM_LIBDECOR 1)
unset(FLTK_USE_XRENDER CACHE)
unset(FLTK_USE_XINERAMA CACHE)
- # unset(FLTK_USE_XFT CACHE)
+ unset(FLTK_USE_XFT CACHE)
unset(FLTK_USE_XCURSOR CACHE)
unset(FLTK_USE_XFIXES CACHE)
if(X11_FOUND)
@@ -331,9 +333,9 @@ if(UNIX)
unset(FLTK_USE_PANGO CACHE)
set(FLTK_USE_PANGO TRUE CACHE BOOL "use lib Pango")
if(FLTK_USE_SYSTEM_LIBDECOR)
- pkg_check_modules(SYSTEM_LIBDECOR libdecor-0>=0.2.0 QUIET)
+ pkg_check_modules(SYSTEM_LIBDECOR libdecor-0>0.2.2 QUIET)
if(NOT SYSTEM_LIBDECOR_FOUND)
- message(STATUS "Warning: system libdecor doesn't satisfy version >= 0.2.0,")
+ message(STATUS "Warning: system libdecor doesn't satisfy version > 0.2.2,")
message(STATUS " using bundled libdecor library instead.")
set(USE_SYSTEM_LIBDECOR 0)
else()
@@ -804,7 +806,7 @@ if(FLTK_GRAPHICS_CAIRO)
set(FLTK_USE_PANGO TRUE CACHE BOOL "use lib Pango")
endif(FLTK_GRAPHICS_CAIRO)
-if(FLTK_USE_PANGO OR FLTK_GRAPHICS_CAIRO) # implies to use PANGOXFT
+if(FLTK_USE_X11 AND (FLTK_USE_PANGO OR FLTK_GRAPHICS_CAIRO)) # implies to use PANGOXFT
set(USE_PANGOXFT true)
endif()
@@ -866,11 +868,11 @@ if((X11_Xft_FOUND OR NOT USE_PANGOXFT) AND FLTK_USE_PANGO)
list(REMOVE_DUPLICATES FLTK_LDLIBS)
# *FIXME* Libraries should not be added explicitly if possible
- if(FLTK_BACKEND_WAYLAND)
+ if(FLTK_BACKEND_WAYLAND AND FLTK_USE_LIBDECOR_GTK AND NOT USE_SYSTEM_LIBDECOR)
list(APPEND FLTK_LDLIBS -lgtk-3 -lgdk-3 -lgio-2.0)
- if(FLTK_BACKEND_X11)
- list(APPEND FLTK_LDLIBS -lX11)
- endif()
+ endif()
+ if(FLTK_BACKEND_X11)
+ list(APPEND FLTK_LDLIBS -lX11)
endif()
list(REMOVE_DUPLICATES FLTK_LDLIBS)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7ac4e112d8..68ae7e9743 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -311,15 +311,19 @@ endif()
if(UNIX AND NOT (APPLE AND NOT FLTK_BACKEND_X11))
if(FLTK_BACKEND_WAYLAND)
- message(STATUS "Use Wayland : Yes (if available at run-time)")
+ if(FLTK_BACKEND_X11)
+ message(STATUS "Use Wayland : Yes (can also run as X11 client)")
+ else()
+ message(STATUS "Use Wayland : Yes (cannot run as X11 client)")
+ endif(FLTK_BACKEND_X11)
if(USE_SYSTEM_LIBDECOR)
message(STATUS "Use system libdecor : Yes")
else()
message(STATUS "Use system libdecor : No")
- endif()
+ endif(USE_SYSTEM_LIBDECOR)
else()
message(STATUS "Use Wayland : No (therefore, X11 is used)")
- endif()
+ endif(FLTK_BACKEND_WAYLAND)
if(FLTK_USE_CAIRO)
message(STATUS "All drawing uses Cairo : Yes")
diff --git a/FL/Fl_Terminal.H b/FL/Fl_Terminal.H
index ff1cb55c0e..36dbf36733 100644
--- a/FL/Fl_Terminal.H
+++ b/FL/Fl_Terminal.H
@@ -944,9 +944,10 @@ protected:
private:
bool is_hist_ring_row(int grow) const;
bool is_disp_ring_row(int grow) const;
-protected:
+public:
int selection_text_len(void) const;
const char* selection_text(void) const;
+protected:
void clear_mouse_selection(void);
bool selection_extend(int X,int Y);
void select_word(int grow, int gcol);
diff --git a/FL/fl_attr.h b/FL/fl_attr.h
index 66e59c681a..52b3507540 100644
--- a/FL/fl_attr.h
+++ b/FL/fl_attr.h
@@ -146,7 +146,7 @@
// -- nothing yet --
-#endif // __clang__
+#endif /* __clang__ */
/*
@@ -162,19 +162,19 @@
#define __fl_attr(x) __attribute__ (x)
#endif
-#if FL_GCC_VERSION > 40500 // gcc 4.5.0
+#if FL_GCC_VERSION > 40500 /* gcc 4.5.0 */
#ifndef FL_DEPRECATED
#define FL_DEPRECATED(msg, func) func __attribute__((deprecated(msg)))
#endif
-#endif // gcc 4.5.0
+#endif /* gcc 4.5.0 */
-#if FL_GCC_VERSION > 30100 // gcc 3.1.0
+#if FL_GCC_VERSION > 30100 /* gcc 3.1.0 */
#ifndef FL_DEPRECATED
#define FL_DEPRECATED(msg, func) func __attribute__((deprecated))
#endif
-#endif // gcc 3.1.0
+#endif /* gcc 3.1.0 */
-#endif // __GNUC__
+#endif /* __GNUC__ */
/*
diff --git a/FL/platform_types.h b/FL/platform_types.h
index 71c412abb8..c6c00974b0 100644
--- a/FL/platform_types.h
+++ b/FL/platform_types.h
@@ -138,7 +138,7 @@ extern FL_EXPORT int fl_control_modifier();
#endif /* FL_PLATFORM_TYPES_H */
-// This is currently the same for all platforms, but may change in the future
+/* This is currently the same for all platforms but may change in the future */
struct Fl_Timestamp_t {
time_t sec;
int usec;
diff --git a/README.CMake.txt b/README.CMake.txt
index a568310522..a915b3b23a 100644
--- a/README.CMake.txt
+++ b/README.CMake.txt
@@ -282,12 +282,12 @@ FLTK_USE_PTHREADS - default ON except on Windows.
This option is ignored (switched OFF internally) on Windows except
when using Cygwin.
-FLTK_USE_SYSTEM_LIBDECOR - default ON (Wayland only)
+FLTK_USE_SYSTEM_LIBDECOR - default OFF (Wayland only)
This option makes FLTK use package libdecor-0-dev to draw window titlebars
- under Wayland. When OFF or when this package has a version < 0.2.0, FLTK
+ under Wayland. When OFF or when this package has a version ≤ 0.2.2, FLTK
uses its bundled copy of libdecor to draw window titlebars.
- As of november 2023, version 0.2.0 of package libdecor-0-dev is available
- only in testing distributions.
+ As of early 2024, no version > 0.2.2 of package libdecor-0-dev is available
+ yet.
FLTK_USE_SYSTEM_LIBJPEG - default ON (macOS and Windows: OFF)
FLTK_USE_SYSTEM_LIBPNG - default ON (macOS and Windows: OFF)
diff --git a/README.Unix.txt b/README.Unix.txt
index cab1008b20..41db419fa9 100644
--- a/README.Unix.txt
+++ b/README.Unix.txt
@@ -20,7 +20,7 @@ README.Unix.txt - Building FLTK on Unix/Linux Systems
3 How to Build FLTK Using GCC
3.1 Downloading and Unpacking
3.2 Configuration and Build Systems
- 3.3 Configuring FLTK with autoconf and configure
+ 3.3 Configuring FLTK with autoconf and configure (deprecated)
3.4 Building FLTK
3.5 Testing FLTK
3.6 Installing FLTK
@@ -32,6 +32,13 @@ README.Unix.txt - Building FLTK on Unix/Linux Systems
[*] TODO: we still need to write these chapters
+-------------------------------------------------------------------
+ Note: usage of autotools, configure, and the included Makefiles
+ to build the FLTK library is deprecated since FLTK 1.4 and will
+ be removed in the next minor version (1.5).
+ Please consider using CMake instead.
+-------------------------------------------------------------------
+
1 Introduction
=================
@@ -298,23 +305,38 @@ The following paragraphs describe the "classic" build system with autoconf,
configure, and make that has been used to build FLTK up to version 1.3.x
and can still be used with FLTK 1.4.x.
-However, the FLTK team recommend using CMake which is the preferred build
-system since FLTK 1.4.0 used for all platforms (including Windows). CMake
-is used instead of autoconf and configure to create the build system of your
-choice, for instance Makefiles, Ninja build files, Visual Studio projects, etc.
+However, the FLTK team recommend to use CMake which is the preferred build
+system generator since FLTK 1.4 used for all platforms (including Windows).
+CMake can be used to create the build system of your choice, for instance
+Makefiles, Ninja build files, Xcode or Visual Studio IDE projects etc..
+
+-------------------------------------------------------------------
+ Note: usage of autotools, configure, and the included Makefiles
+ to build the FLTK library is deprecated since FLTK 1.4 and will
+ be removed in the next minor version (1.5).
+ Please consider using CMake instead.
+-------------------------------------------------------------------
Please see README.CMake.txt for how to build FLTK and your application
programs using CMake. You can stop reading here if you do this.
-You can, of course, build FLTK with CMake and your own application(s) with
-your existing and well-known build system.
+You can, of course, build FLTK with CMake and your own application(s)
+with your existing and well-known build system.
+
+If you like the "classic" build system more, continue reading the
+following chapters but please be aware that configure support will
+be removed in FLTK 1.5.
-If you like the "classic" build system more, continue reading the following
-chapters ...
+ 3.3 Configuring FLTK with autoconf and configure (deprecated)
+----------------------------------------------------------------
- 3.3 Configuring FLTK with autoconf and configure
----------------------------------------------------
+-------------------------------------------------------------------
+ Note: usage of autotools, configure, and the included Makefiles
+ to build the FLTK library is deprecated since FLTK 1.4 and will
+ be removed in the next minor version (1.5).
+ Please consider using CMake instead.
+-------------------------------------------------------------------
If you got FLTK via git then you need one extra step. Otherwise skip
over this part. Stay in your FLTK source-code directory and type:
diff --git a/README.Wayland.txt b/README.Wayland.txt
index f01147f5d6..dc4c24c36e 100644
--- a/README.Wayland.txt
+++ b/README.Wayland.txt
@@ -116,7 +116,7 @@ On Linux and FreeBSD systems equipped with the adequate software packages
hybrid library. On systems lacking all or part of Wayland-required packages,
the default building procedure produces a X11-based library.
-Use "-D FLTK_OPTION_USE_WAYLAND=OFF" with CMake or "configure --disable-wayland"
+Use "-D FLTK_BACKEND_WAYLAND=OFF" with CMake or "configure --disable-wayland"
to build FLTK for the X11 library when the default would build for Wayland.
CMake option FLTK_BACKEND_X11=OFF or configure argument "--disable-x11" can
@@ -126,8 +126,8 @@ cross-compiling for systems that lack X11 headers and libraries.
The FLTK Wayland platform uses a library called libdecor which handles window decorations
(i.e., titlebars, shade). On very recent Linux distributions (e.g., Debian trixie)
libdecor is available as Linux packages (libdecor-0-dev and libdecor-0-plugin-1-gtk).
-FLTK requires version 0.2.0 of these packages or more.
-In other situations, FLTK uses a copy of libdecor bundled in the FLTK source code.
+FLTK requires a version > 0.2.2 of these packages that's not yet available.
+Therefore, FLTK uses a copy of libdecor bundled in the FLTK source code.
FLTK equipped with libdecor supports both the client-side decoration mode (CSD) and the
server-side decoration mode (SSD) as determined by the active Wayland compositor.
Mutter (gnome's Wayland compositor) and Weston use CSD mode, KWin and Sway use SSD mode.
@@ -185,7 +185,7 @@ in section 2.1 of file README.Unix.txt :
- libwayland-dev
- wayland-protocols
- libxkbcommon-dev
-- libxinerama-dev
+- libxinerama-dev <== except if option FLTK_BACKEND_X11=off is used
- libdbus-1-dev <== recommended to query current cursor theme
- libglew-dev <== necessary to use OpenGL version 3 or above
- cmake <== if you plan to build with CMake
@@ -194,9 +194,6 @@ in section 2.1 of file README.Unix.txt :
These packages allow to run FLTK apps under the Gnome-Wayland desktop:
- gnome-core
- libgtk-3-dev <== highly recommended, gives windows a Gnome-style titlebar
-- libdecor-0-dev and libdecor-0-plugin-1-gtk in versions ≥ 0.2.0
- <== Recommended if available for the Linux version in use,
- <== FLTK uses a bundled copy of these packages otherwise.
These packages allow to run FLTK apps under the KDE/Plasma-Wayland desktop:
- kde-plasma-desktop
@@ -221,7 +218,6 @@ package groups listed in section 2.2 of file README.Unix.txt :
- mesa-libGLU-devel
- dbus-devel <== recommended to query current cursor theme
- gtk3-devel <== highly recommended, gives windows a GTK-style titlebar
-- libdecor-0.2.0 <== recommended, present in Fedora Rawhide, not in Fedora 39
- glew-devel <== necessary to use OpenGL version 3 or above
- cmake <== if you plan to build with CMake
- cmake-gui <== if you plan to use the GUI of CMake
diff --git a/configure.ac b/configure.ac
index fe9b7aeb6e..6b64110b07 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1074,7 +1074,7 @@ AS_CASE([$host_os_gui], [cygwin* | mingw*], [
BUILD="WAYLANDX11"
graphics="Wayland or X11 with cairo"
])
- AS_IF([$PKGCONFIG --exists 'libdecor-0 >= 0.2.0'],
+ AS_IF([$PKGCONFIG --exists 'libdecor-0 > 0.2.2'],
[
plugin_dir="$($PKGCONFIG --variable=libdir libdecor-0)/libdecor/plugins-1"
CFLAGS="$CFLAGS -DUSE_SYSTEM_LIBDECOR"
diff --git a/documentation/src/bundled-libs.dox b/documentation/src/bundled-libs.dox
index 331c8a2789..1cdaeae2a2 100644
--- a/documentation/src/bundled-libs.dox
+++ b/documentation/src/bundled-libs.dox
@@ -23,14 +23,14 @@ The nanosvg library is not affected.
\section bundled-status Current status
\code
-Current versions of bundled libraries (as of March 12, 2024):
+Current versions of bundled libraries (as of March 13, 2024):
Library Version/git commit Release date FLTK Version
--------------------------------------------------------------------------
jpeg jpeg-9f 2024-01-14 1.4.0
nanosvg 7aeda550a8 [1] 2023-12-02 1.4.0
png libpng-1.6.42 2024-01-29 1.4.0
zlib zlib-1.3.1 2024-01-22 1.4.0
- libdecor 09875530 [2] 2024-03-03 1.4.0
+ libdecor 4f2c03d5 [2] 2024-03-04 1.4.0
--------------------------------------------------------------------------
Previous versions of bundled libraries (FLTK 1.3.x):
diff --git a/documentation/src/wayland.dox b/documentation/src/wayland.dox
index 56f47c208f..8af4555dea 100644
--- a/documentation/src/wayland.dox
+++ b/documentation/src/wayland.dox
@@ -694,7 +694,7 @@ FLTK creates a \c wl_buffer object each time an Fl_Window is mapped on a display
That's done by member function \c Fl_Wayland_Graphics_Driver::create_shm_buffer()
which follows this 3-step procedure to create a "buffer factory" for FLTK and to construct
Wayland buffers from it:
-- Libdecor function os_create_anonymous_file(off_t size) creates an adequate file
+- Libdecor function libdecor_os_create_anonymous_file(off_t size) creates an adequate file
and mmap's it. This file lives in RAM because it is created by function \c memfd_create().
FLTK sets this file size to 10 MB unless the size of the buffer to be created
is larger; in that case the anonymous file is sized to twice the buffer size.
@@ -1104,8 +1104,7 @@ and also to draw window titlebars when in CSD mode (see \ref bundled-libdecor).
\c Libdecor is conceived to be present in a shared library linked to the Wayland
client application which itself, and if the running Wayland compositor uses CSD mode,
loads another shared library intended to draw titlebars in a way that best matches the
-Desktop. As of late 2023, libdecor is at version 0.2.0 and contains two titlebar-drawing
-plugins:
+Desktop. As of late 2023, libdecor contains two titlebar-drawing plugins:
- \c libdecor-gtk intended for the Gnome desktop;
- \c libdecor-cairo for other situations.
@@ -1114,15 +1113,10 @@ FLTK bundles the most recent source code of \c libdecor and its plugins. This co
is included in libfltk. FLTK uses \c libdecor-gtk when software package \c libgtk-3-dev
is present in the build system, and \c libdecor-cairo otherwise.
-As of late 2023, libdecor version 0.2.0 is available in very recent Linux distributions
-in packages \c libdecor-0-dev and \c libdecor-0-plugin-1-gtk. If they are installed on the
-build system, preprocessor variable \c USE_SYSTEM_LIBDECOR is 1,
-and both \c libdecor and its plugin are loaded at run-time from shared libraries.
-When these packages are not available or are at an earlier version, FLTK uses the bundled
-copy of \c libdecor.
-When CMake \c FLTK_USE_SYSTEM_LIBDECOR is OFF, FLTK uses the bundled \c libdecor copy
-even if shared libraries \c libdecor.so and \c libdecor-gtk.so are installed.
-This option is ON by default.
+As of early 2024, libdecor version 0.2.2 is available in very recent Linux distributions.
+This version is not binary compatible with the libdecor version bundled by FLTK.
+For this reason, CMake option \c FLTK_USE_SYSTEM_LIBDECOR is OFF by default, and
+FLTK uses the bundled \c libdecor copy to draw titlebars.
\c Libdecor uses the Wayland protocol
XDG decoration
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index 1ce11a116b..3e44d29fa3 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -136,14 +136,8 @@ endforeach(src)
# create example programs requiring cairo
############################################################
-if(FLTK_HAVE_CAIRO)
- set(cairo_libs "fltk::fltk;cairo")
-else()
- set(cairo_libs "fltk::fltk")
-endif()
-
foreach(src ${CAIRO_SOURCES})
- fl_create_example(${src} ${src}.cxx "${cairo_libs}")
+ fl_create_example(${src} ${src}.cxx fltk::fltk)
endforeach(src)
############################################################
diff --git a/libdecor/build/fl_libdecor-plugins.c b/libdecor/build/fl_libdecor-plugins.c
index fbf4eb657d..1e73d736ab 100644
--- a/libdecor/build/fl_libdecor-plugins.c
+++ b/libdecor/build/fl_libdecor-plugins.c
@@ -301,23 +301,6 @@ unsigned char *fl_libdecor_titlebar_buffer(struct libdecor_frame *frame,
}
-// When the libdecor version after 0.2.2 will be released, support of older versions
-// will be removed from FLTK. LIBDECOR_MR131 stuff also will be removed.
-struct libdecor_022 { // for libdecor versions ≤ 0.2.2
- int ref_count;
- const struct libdecor_interface *iface;
- struct libdecor_plugin *plugin;
- bool plugin_ready;
- struct wl_display *wl_display;
- struct wl_registry *wl_registry;
- struct xdg_wm_base *xdg_wm_base;
- struct zxdg_decoration_manager_v1 *decoration_manager;
- struct wl_callback *init_callback;
- bool init_done;
- bool has_error;
- struct wl_list frames;
-};
-
struct libdecor { // copied from libdecor.c, for libdecor versions > 0.2.2
int ref_count;
const struct libdecor_interface *iface;
@@ -338,18 +321,9 @@ struct libdecor { // copied from libdecor.c, for libdecor versions > 0.2.2
/* Returns whether surface is a GTK-titlebar created by libdecor-gtk */
bool fl_is_surface_gtk_titlebar(struct wl_surface *surface, struct libdecor *context) {
if (!context || get_plugin_kind(NULL) != GTK3) return false;
- static void *new_symbol = NULL;
- static bool first = true;
- if (first) {
- first = false;
- // new_symbol is NULL for libdecor versions ≤ 0.2.2
- new_symbol = dlsym(RTLD_DEFAULT, "libdecor_frame_get_user_data");
- }
- struct wl_list *frames_addr = (new_symbol ? &context->frames :
- &(((struct libdecor_022*)context)->frames) );
// loop over all decorations created by libdecor-gtk
struct libdecor_frame *frame;
- wl_list_for_each(frame, frames_addr, link) {
+ wl_list_for_each(frame, &context->frames, link) {
struct libdecor_frame_gtk *frame_gtk = (struct libdecor_frame_gtk*)frame;
if (frame_gtk->headerbar.wl_surface == surface) return true;
}
diff --git a/libdecor/src/os-compatibility.c b/libdecor/src/os-compatibility.c
index 8287da0e6d..23766473db 100644
--- a/libdecor/src/os-compatibility.c
+++ b/libdecor/src/os-compatibility.c
@@ -148,7 +148,7 @@ os_resize_anonymous_file(int fd, off_t size)
* XDG_RUNTIME_DIR.
*/
int
-os_create_anonymous_file(off_t size)
+libdecor_os_create_anonymous_file(off_t size)
{
static const char template[] = "/libdecor-shared-XXXXXX";
const char *path;
diff --git a/libdecor/src/os-compatibility.h b/libdecor/src/os-compatibility.h
index d0e69acd93..6ce49d01c6 100644
--- a/libdecor/src/os-compatibility.h
+++ b/libdecor/src/os-compatibility.h
@@ -29,6 +29,6 @@
#include
int
-os_create_anonymous_file(off_t size);
+libdecor_os_create_anonymous_file(off_t size);
#endif /* OS_COMPATIBILITY_H */
diff --git a/libdecor/src/plugins/cairo/libdecor-cairo.c b/libdecor/src/plugins/cairo/libdecor-cairo.c
index 765800df68..30f6f87202 100644
--- a/libdecor/src/plugins/cairo/libdecor-cairo.c
+++ b/libdecor/src/plugins/cairo/libdecor-cairo.c
@@ -597,7 +597,7 @@ create_shm_buffer(struct libdecor_plugin_cairo *plugin_cairo,
stride = buffer_width * 4;
size = stride * buffer_height;
- fd = os_create_anonymous_file(size);
+ fd = libdecor_os_create_anonymous_file(size);
if (fd < 0) {
fprintf(stderr, "creating a buffer file for %d B failed: %s\n",
size, strerror(errno));
diff --git a/libdecor/src/plugins/gtk/libdecor-gtk.c b/libdecor/src/plugins/gtk/libdecor-gtk.c
index 2d0ebde459..de6ec90c6c 100644
--- a/libdecor/src/plugins/gtk/libdecor-gtk.c
+++ b/libdecor/src/plugins/gtk/libdecor-gtk.c
@@ -612,7 +612,7 @@ create_shm_buffer(struct libdecor_plugin_gtk *plugin_gtk,
stride = buffer_width * 4;
size = stride * buffer_height;
- fd = os_create_anonymous_file(size);
+ fd = libdecor_os_create_anonymous_file(size);
if (fd < 0) {
fprintf(stderr, "creating a buffer file for %d B failed: %s\n",
size, strerror(errno));
@@ -2246,15 +2246,16 @@ handle_titlebar_gesture(struct libdecor_frame_gtk *frame_gtk,
break;
case TITLEBAR_GESTURE_MIDDLE_CLICK:
break;
- case TITLEBAR_GESTURE_RIGHT_CLICK:
- const int title_height = gtk_widget_get_allocated_height(frame_gtk->header);
-
- libdecor_frame_show_window_menu(&frame_gtk->frame,
- seat->wl_seat,
- serial,
- seat->pointer_x,
- seat->pointer_y
- -title_height);
+ case TITLEBAR_GESTURE_RIGHT_CLICK: { /* FLTK */
+ const int title_height = gtk_widget_get_allocated_height(frame_gtk->header);
+
+ libdecor_frame_show_window_menu(&frame_gtk->frame,
+ seat->wl_seat,
+ serial,
+ seat->pointer_x,
+ seat->pointer_y
+ -title_height);
+ } /* FLTK */
break;
}
}
@@ -2409,6 +2410,7 @@ pointer_button(void *data,
handle_button_on_header (frame_gtk, seat, serial, time, button, state);
break;
default:
+ break; /* FLTK */
}
}
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 757fcac913..bc1a6f14e8 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -764,9 +764,6 @@ if(UNIX AND FLTK_BACKEND_WAYLAND)
if(DBUS_FOUND)
list(APPEND OPTIONAL_LIBS "${DBUS_LDFLAGS}")
endif(DBUS_FOUND)
- if(NOT FLTK_BACKEND_WAYLAND_ONLY)
- list(APPEND OPTIONAL_LIBS "-lXcursor -lXrender -lXinerama -lXfixes -lXft -lXext -lX11")
- endif(NOT FLTK_BACKEND_WAYLAND_ONLY)
if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux" AND NOT FLTK_BUILD_SHARED_LIBS)
list(APPEND OPTIONAL_LIBS "-no-pie")
endif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux" AND NOT FLTK_BUILD_SHARED_LIBS)
diff --git a/src/Fl_Screen_Driver.cxx b/src/Fl_Screen_Driver.cxx
index f975195ba4..2956b7b3a4 100644
--- a/src/Fl_Screen_Driver.cxx
+++ b/src/Fl_Screen_Driver.cxx
@@ -564,7 +564,12 @@ void Fl_Screen_Driver::use_startup_scale_factor()
if ((p = fl_getenv("FLTK_SCALING_FACTOR"))) {
float factor = 1;
sscanf(p, "%f", &factor);
- for (int i = 0; i < s_count; i++) scale(i, factor * scale(i));
+ if (rescalable() == SYSTEMWIDE_APP_SCALING) {
+ float new_val = factor * scale(0);
+ for (int i = 0; i < s_count; i++) scale(i, new_val);
+ } else {
+ for (int i = 0; i < s_count; i++) scale(i, factor * scale(i));
+ }
}
}
diff --git a/src/Fl_Terminal.cxx b/src/Fl_Terminal.cxx
index 566cb08205..7c3c91de3c 100644
--- a/src/Fl_Terminal.cxx
+++ b/src/Fl_Terminal.cxx
@@ -3659,8 +3659,8 @@ void Fl_Terminal::draw(void) {
}
// Detect if Fl::scrollbar_size() was changed in size, recalc if so
if (scrollbar_size_ == 0 &&
- ( scrollbar->visible() && scrollbar->w() != Fl::scrollbar_size() ||
- hscrollbar->visible() && hscrollbar->h() != Fl::scrollbar_size())) {
+ ((scrollbar->visible() && scrollbar->w() != Fl::scrollbar_size()) ||
+ (hscrollbar->visible() && hscrollbar->h() != Fl::scrollbar_size()))) {
update_scrollbar();
}
// Draw group first, terminal last
@@ -3905,6 +3905,8 @@ int Fl_Terminal::handle(int e) {
free((void*)s); // free() the copy when done!
\endcode
+ \param[in] lines_below_cursor include lines below cursor, default: false
+
\return A string allocated with strdup(3) which must be free'd, text is UTF-8.
*/
const char* Fl_Terminal::text(bool lines_below_cursor) const {
@@ -3922,8 +3924,8 @@ const char* Fl_Terminal::text(bool lines_below_cursor) const {
const char *s = u8c->text_utf8(); // first byte of char
for (int i=0; ilength(); i++) lines += *s++; // append all bytes in multibyte char
// Count any trailing whitespace to trim
- if (u8c->length()==1 && *s==' ') trim++; // trailing whitespace? trim
- else trim = 0; // non-whitespace? don't trim
+ if (u8c->length()==1 && s[-1]==' ') trim++; // trailing whitespace? trim
+ else trim = 0; // non-whitespace? don't trim
}
// trim trailing whitespace from each line, if any
if (trim) lines.resize(lines.size() - trim);
diff --git a/src/Fl_x.cxx b/src/Fl_x.cxx
index 67ed872dc2..9f22b08476 100644
--- a/src/Fl_x.cxx
+++ b/src/Fl_x.cxx
@@ -1215,24 +1215,20 @@ static void react_to_screen_reconfiguration() {
#if USE_XFT
static void after_display_rescale(float *p_current_xft_dpi) {
- FILE *pipe = popen("xrdb -query", "r");
- if (!pipe) return;
- char line[100];
- while (fgets(line, sizeof(line), pipe) != NULL) {
- if (memcmp(line, "Xft.dpi:", 8)) continue;
- float dpi;
- if (sscanf(line+8, "%f", &dpi) == 1) {
- //fprintf(stderr," previous=%g dpi=%g \n", *p_current_xft_dpi, dpi);
- if (fabs(dpi - *p_current_xft_dpi) > 0.01) {
- *p_current_xft_dpi = dpi;
- float f = dpi/96.;
- for (int i = 0; i < Fl::screen_count(); i++)
- Fl::screen_driver()->rescale_all_windows_from_screen(i, f, f);
- }
+ Display *new_dpy = XOpenDisplay(XDisplayString(fl_display));
+ if (!new_dpy) return;
+ char *s = XGetDefault(new_dpy, "Xft", "dpi");
+ float dpi;
+ if (s && sscanf(s, "%f", &dpi) == 1) {
+ //printf("%s previous=%g dpi=%g \n", s, *p_current_xft_dpi, dpi);
+ if (fabs(dpi - *p_current_xft_dpi) > 0.1) {
+ *p_current_xft_dpi = dpi;
+ float f = dpi / 96.;
+ for (int i = 0; i < Fl::screen_count(); i++)
+ Fl::screen_driver()->rescale_all_windows_from_screen(i, f, f);
}
- break;
}
- pclose(pipe);
+ XCloseDisplay(new_dpy);
}
#endif // USE_XFT
diff --git a/src/drivers/Wayland/Fl_Wayland_Graphics_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Graphics_Driver.cxx
index 2dd6ac5279..ce9dcaf4e8 100644
--- a/src/drivers/Wayland/Fl_Wayland_Graphics_Driver.cxx
+++ b/src/drivers/Wayland/Fl_Wayland_Graphics_Driver.cxx
@@ -25,7 +25,7 @@
extern "C" {
-# include "../../../libdecor/src/os-compatibility.h" // for os_create_anonymous_file()
+# include "../../../libdecor/src/os-compatibility.h" // for libdecor_os_create_anonymous_file()
}
// used by create_shm_buffer and do_buffer_release
@@ -76,9 +76,9 @@ void Fl_Wayland_Graphics_Driver::create_shm_buffer(Fl_Wayland_Graphics_Driver::w
pool_size = default_pool_size;
if (buffer->draw_buffer.data_size > pool_size)
pool_size = 2 * buffer->draw_buffer.data_size; // a larger pool is needed
- int fd = os_create_anonymous_file(pool_size);
+ int fd = libdecor_os_create_anonymous_file(pool_size);
if (fd < 0) {
- Fl::fatal("os_create_anonymous_file failed: %s\n", strerror(errno));
+ Fl::fatal("libdecor_os_create_anonymous_file failed: %s\n", strerror(errno));
}
pool_data = (struct wld_shm_pool_data*)calloc(1, sizeof(struct wld_shm_pool_data));
pool_data->pool_memory = (char*)mmap(NULL, pool_size, PROT_READ | PROT_WRITE,
diff --git a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.H b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.H
index cc33a4f60b..9df903da59 100644
--- a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.H
+++ b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.H
@@ -76,6 +76,9 @@ public:
bool done;
struct wl_list link;
};
+ enum cursor_shapes {arrow = 0, wait, insert, hand, help, cross, move,
+ north, south, west, east, north_south, west_east, south_west, south_east, north_east, north_west, nesw, nwse};
+ static const int cursor_count = nwse + 1; // nber of elements of 'enum cursor_shapes'
// static member variables
static FL_EXPORT struct wl_display *wl_display;
@@ -91,25 +94,7 @@ public:
static void do_set_cursor(struct Fl_Wayland_Screen_Driver::seat *,
struct wl_cursor *wl_cursor = NULL);
// member variables
- struct wl_cursor *xc_arrow;
- struct wl_cursor *xc_ns;
- struct wl_cursor *xc_wait;
- struct wl_cursor *xc_insert;
- struct wl_cursor *xc_hand;
- struct wl_cursor *xc_help;
- struct wl_cursor *xc_cross;
- struct wl_cursor *xc_move;
- struct wl_cursor *xc_north;
- struct wl_cursor *xc_south;
- struct wl_cursor *xc_west;
- struct wl_cursor *xc_east;
- struct wl_cursor *xc_we;
- struct wl_cursor *xc_nesw;
- struct wl_cursor *xc_nwse;
- struct wl_cursor *xc_sw;
- struct wl_cursor *xc_se;
- struct wl_cursor *xc_ne;
- struct wl_cursor *xc_nw;
+ struct wl_cursor *xc_cursor[cursor_count]; // one for each element of enum cursor_shapes
struct wl_registry *wl_registry;
struct wl_compositor *wl_compositor;
struct wl_subcompositor *wl_subcompositor;
diff --git a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx
index 2a0e087905..efbb176abc 100644
--- a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx
+++ b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx
@@ -471,7 +471,7 @@ static void init_cursors(struct Fl_Wayland_Screen_Driver::seat *seat) {
seat->cursor_theme = theme;
}
if (seat->cursor_theme) {
- seat->default_cursor = scr_driver->xc_arrow =
+ seat->default_cursor = scr_driver->xc_cursor[Fl_Wayland_Screen_Driver::arrow] =
wl_cursor_theme_get_cursor(seat->cursor_theme, "left_ptr");
}
if (!seat->cursor_surface) {
@@ -1731,9 +1731,7 @@ struct wl_cursor *Fl_Wayland_Screen_Driver::cache_cursor(const char *cursor_name
void Fl_Wayland_Screen_Driver::reset_cursor() {
- xc_arrow = xc_ns = xc_wait = xc_insert = xc_hand = xc_help = xc_cross = xc_move =
- xc_north = xc_south = xc_west = xc_east = xc_we = xc_nesw = xc_nwse = xc_sw = xc_se =
- xc_ne = xc_nw = NULL;
+ for (int i = 0; i < cursor_count; i++) xc_cursor[i] = NULL;
}
@@ -1878,7 +1876,12 @@ int Fl_Wayland_Screen_Driver::get_key(int k) {
float Fl_Wayland_Screen_Driver::base_scale(int numscreen) {
- return 1.f;
+ const char *p;
+ float factor = 1;
+ if ((p = fl_getenv("FLTK_SCALING_FACTOR"))) {
+ sscanf(p, "%f", &factor);
+ }
+ return factor;
}
diff --git a/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx
index d86d713dcb..2aa0803754 100644
--- a/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx
+++ b/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx
@@ -89,7 +89,7 @@ void Fl_Wayland_Window_Driver::delete_cursor(
free(wl_cursor);
Fl_Wayland_Screen_Driver *scr_driver = (Fl_Wayland_Screen_Driver*)Fl::screen_driver();
if (scr_driver->default_cursor() == wl_cursor) {
- scr_driver->default_cursor(scr_driver->xc_arrow);
+ scr_driver->default_cursor(scr_driver->xc_cursor[Fl_Wayland_Screen_Driver::arrow]);
}
if (delete_rgb) delete custom->rgb;
delete custom;
@@ -769,69 +769,6 @@ static struct Fl_Wayland_Screen_Driver::output *screen_num_to_output(int num_scr
}
-#define LIBDECOR_MR131 1 // this means libdecor does not include MR!131 yet
-
-#ifdef LIBDECOR_MR131
-/* === Beginning of hack that would become un-needed if libdecor accepted MR!131 === */
-
-// true while the GUI is interactively resizing a decorated window
-static bool in_decorated_window_resizing = false;
-
-
-// libdecor's configure cb function for xdg_toplevel objects
-static void (*decor_xdg_toplevel_configure)(void*, struct xdg_toplevel *, int32_t,
- int32_t, struct wl_array *);
-
-
-static void fltk_xdg_toplevel_configure(void *user_data, struct xdg_toplevel *xdg_toplevel,
- int32_t width, int32_t height,
- struct wl_array *states) {
- uint32_t *p;
- in_decorated_window_resizing = false;
- // Replace wl_array_for_each(p, states) rejected by C++
- for (p = (uint32_t *)(states)->data;
- (const char *) p < ((const char *) (states)->data + (states)->size);
- (p)++) {
- if (*p == XDG_TOPLEVEL_STATE_RESIZING) {
- in_decorated_window_resizing = true;
- break;
- }
- }
- decor_xdg_toplevel_configure(user_data, xdg_toplevel, width, height, states);
-}
-
-
-struct wl_object { // copied from wayland-private.h
- const struct wl_interface *interface;
- const void *implementation;
- uint32_t id;
-};
-
-
-// replace libdecor's toplevel configure cb by FLTK's
-static void use_FLTK_toplevel_configure_cb(struct libdecor_frame *frame) {
- struct wl_object *object = (struct wl_object *)libdecor_frame_get_xdg_toplevel(frame);
- static struct xdg_toplevel_listener *fltk_listener = NULL;
- if (!fltk_listener) {
- struct xdg_toplevel_listener *decor_listener = (struct xdg_toplevel_listener*)
- object->implementation;
- fltk_listener = (struct xdg_toplevel_listener*)
- malloc(sizeof(struct xdg_toplevel_listener));
- // initialize FLTK's listener with libdecor's values
- *fltk_listener = *decor_listener;
- // memorize libdecor's toplevel configure cb
- decor_xdg_toplevel_configure = decor_listener->configure;
- // replace libdecor's toplevel configure cb by FLTK's
- fltk_listener->configure = fltk_xdg_toplevel_configure;
- }
- // replace the toplevel listener by a copy whose configure member is FLTK's
- object->implementation = fltk_listener;
-}
-
-/* === End of hack that would become un-needed if libdecor accepted MR!131 === */
-#endif // LIBDECOR_MR131
-
-
static void handle_configure(struct libdecor_frame *frame,
struct libdecor_configuration *configuration, void *user_data)
{
@@ -849,9 +786,6 @@ static void handle_configure(struct libdecor_frame *frame,
if (!window->xdg_surface) window->xdg_surface = libdecor_frame_get_xdg_surface(frame);
-#ifdef LIBDECOR_MR131
- if (is_1st_run) use_FLTK_toplevel_configure_cb(frame);
-#endif
struct wl_output *wl_output = NULL;
if (window->fl_win->fullscreen_active()) {
if (!(window->state & LIBDECOR_WINDOW_STATE_FULLSCREEN)) {
@@ -905,16 +839,13 @@ static void handle_configure(struct libdecor_frame *frame,
//fprintf(stderr,"handle_configure: using floating %dx%d\n",width,height);
}
-#ifndef LIBDECOR_MR131
- bool in_decorated_window_resizing = (window->state & LIBDECOR_WINDOW_STATE_RESIZING);
-#endif
- bool condition = in_decorated_window_resizing;
+ bool condition = (window->state & LIBDECOR_WINDOW_STATE_RESIZING);
if (condition) { // see issue #878
condition = (window->covered ? (window->buffer && window->buffer->in_use) : (window->frame_cb != NULL));
}
if (condition) {
// Skip resizing & redrawing. The last resize request won't be skipped because
- // in_decorated_window_resizing will be false or cb will be NULL then.
+ // LIBDECOR_WINDOW_STATE_RESIZING will be off or cb will be NULL then.
return;
}
@@ -1566,114 +1497,46 @@ int Fl_Wayland_Window_Driver::set_cursor(Fl_Cursor c) {
if (!scr_driver->seat->cursor_theme) return 1;
// Cursor names are the files of directory /usr/share/icons/XXXX/cursors/
// where XXXX is the name of the current 'cursor theme'.
- switch (c) {
- case FL_CURSOR_ARROW:
- if (!scr_driver->xc_arrow) scr_driver->xc_arrow = scr_driver->cache_cursor("left_ptr");
- scr_driver->default_cursor(scr_driver->xc_arrow);
- break;
- case FL_CURSOR_NS:
- if (!scr_driver->xc_ns) scr_driver->xc_ns =
- scr_driver->cache_cursor("sb_v_double_arrow");
- if (!scr_driver->xc_ns) return 0;
- scr_driver->default_cursor(scr_driver->xc_ns);
- break;
- case FL_CURSOR_CROSS:
- if (!scr_driver->xc_cross) scr_driver->xc_cross = scr_driver->cache_cursor("cross");
- if (!scr_driver->xc_cross) return 0;
- scr_driver->default_cursor(scr_driver->xc_cross);
- break;
- case FL_CURSOR_WAIT:
- if (!scr_driver->xc_wait) scr_driver->xc_wait = scr_driver->cache_cursor("wait");
- if (!scr_driver->xc_wait) scr_driver->xc_wait = scr_driver->cache_cursor("watch");
- if (!scr_driver->xc_wait) return 0;
- scr_driver->default_cursor(scr_driver->xc_wait);
- break;
- case FL_CURSOR_INSERT:
- if (!scr_driver->xc_insert) scr_driver->xc_insert = scr_driver->cache_cursor("xterm");
- if (!scr_driver->xc_insert) return 0;
- scr_driver->default_cursor(scr_driver->xc_insert);
- break;
- case FL_CURSOR_HAND:
- if (!scr_driver->xc_hand) scr_driver->xc_hand = scr_driver->cache_cursor("hand");
- if (!scr_driver->xc_hand) scr_driver->xc_hand = scr_driver->cache_cursor("hand1");
- if (!scr_driver->xc_hand) return 0;
- scr_driver->default_cursor(scr_driver->xc_hand);
- break;
- case FL_CURSOR_HELP:
- if (!scr_driver->xc_help) scr_driver->xc_help = scr_driver->cache_cursor("help");
- if (!scr_driver->xc_help) return 0;
- scr_driver->default_cursor(scr_driver->xc_help);
- break;
- case FL_CURSOR_MOVE:
- if (!scr_driver->xc_move) scr_driver->xc_move = scr_driver->cache_cursor("move");
- if (!scr_driver->xc_move) return 0;
- scr_driver->default_cursor(scr_driver->xc_move);
- break;
- case FL_CURSOR_WE:
- if (!scr_driver->xc_we) scr_driver->xc_we =
- scr_driver->cache_cursor("sb_h_double_arrow");
- if (!scr_driver->xc_we) return 0;
- scr_driver->default_cursor(scr_driver->xc_we);
- break;
- case FL_CURSOR_N:
- if (!scr_driver->xc_north) scr_driver->xc_north = scr_driver->cache_cursor("top_side");
- if (!scr_driver->xc_north) return 0;
- scr_driver->default_cursor(scr_driver->xc_north);
- break;
- case FL_CURSOR_E:
- if (!scr_driver->xc_east) scr_driver->xc_east = scr_driver->cache_cursor("right_side");
- if (!scr_driver->xc_east) return 0;
- scr_driver->default_cursor(scr_driver->xc_east);
- break;
- case FL_CURSOR_W:
- if (!scr_driver->xc_west) scr_driver->xc_west = scr_driver->cache_cursor("left_side");
- if (!scr_driver->xc_west) return 0;
- scr_driver->default_cursor(scr_driver->xc_west);
- break;
- case FL_CURSOR_S:
- if (!scr_driver->xc_south) scr_driver->xc_south =
- scr_driver->cache_cursor("bottom_side");
- if (!scr_driver->xc_south) return 0;
- scr_driver->default_cursor(scr_driver->xc_south);
- break;
- case FL_CURSOR_NESW:
- if (!scr_driver->xc_nesw) scr_driver->xc_nesw =
- scr_driver->cache_cursor("fd_double_arrow");
- if (!scr_driver->xc_nesw) return 0;
- scr_driver->default_cursor(scr_driver->xc_nesw);
- break;
- case FL_CURSOR_NWSE:
- if (!scr_driver->xc_nwse) scr_driver->xc_nwse =
- scr_driver->cache_cursor("bd_double_arrow");
- if (!scr_driver->xc_nwse) return 0;
- scr_driver->default_cursor(scr_driver->xc_nwse);
- break;
- case FL_CURSOR_SW:
- if (!scr_driver->xc_sw) scr_driver->xc_sw =
- scr_driver->cache_cursor("bottom_left_corner");
- if (!scr_driver->xc_sw) return 0;
- scr_driver->default_cursor(scr_driver->xc_sw);
- break;
- case FL_CURSOR_SE:
- if (!scr_driver->xc_se) scr_driver->xc_se =
- scr_driver->cache_cursor("bottom_right_corner");
- if (!scr_driver->xc_se) return 0;
- scr_driver->default_cursor(scr_driver->xc_se);
- break;
- case FL_CURSOR_NE:
- if (!scr_driver->xc_ne) scr_driver->xc_ne = scr_driver->cache_cursor("top_right_corner");
- if (!scr_driver->xc_ne) return 0;
- scr_driver->default_cursor(scr_driver->xc_ne);
- break;
- case FL_CURSOR_NW:
- if (!scr_driver->xc_nw) scr_driver->xc_nw = scr_driver->cache_cursor("top_left_corner");
- if (!scr_driver->xc_nw) return 0;
- scr_driver->default_cursor(scr_driver->xc_nw);
+ static struct cursor_file_struct {
+ Fl_Cursor c;
+ const char *fname;
+ Fl_Wayland_Screen_Driver::cursor_shapes wld_c;
+ } cursor_file_array[] = {
+ {FL_CURSOR_ARROW, "left_ptr", Fl_Wayland_Screen_Driver::arrow },
+ {FL_CURSOR_CROSS, "cross", Fl_Wayland_Screen_Driver::cross },
+ {FL_CURSOR_WAIT, "watch", Fl_Wayland_Screen_Driver::wait },
+ {FL_CURSOR_INSERT, "xterm", Fl_Wayland_Screen_Driver::insert },
+ {FL_CURSOR_HAND, "hand1", Fl_Wayland_Screen_Driver::hand },
+ {FL_CURSOR_HELP, "help", Fl_Wayland_Screen_Driver::help },
+ {FL_CURSOR_MOVE, "move", Fl_Wayland_Screen_Driver::move },
+ {FL_CURSOR_N, "top_side", Fl_Wayland_Screen_Driver::north },
+ {FL_CURSOR_E, "right_side", Fl_Wayland_Screen_Driver::east },
+ {FL_CURSOR_W, "left_side", Fl_Wayland_Screen_Driver::west },
+ {FL_CURSOR_S, "bottom_side", Fl_Wayland_Screen_Driver::south },
+ {FL_CURSOR_NS, "sb_v_double_arrow", Fl_Wayland_Screen_Driver::north_south },
+ {FL_CURSOR_WE, "sb_h_double_arrow", Fl_Wayland_Screen_Driver::west_east },
+ {FL_CURSOR_SW, "bottom_left_corner", Fl_Wayland_Screen_Driver::south_west },
+ {FL_CURSOR_SE, "bottom_right_corner", Fl_Wayland_Screen_Driver::south_east },
+ {FL_CURSOR_NE, "top_right_corner", Fl_Wayland_Screen_Driver::north_east },
+ {FL_CURSOR_NW, "top_left_corner", Fl_Wayland_Screen_Driver::north_west },
+ {FL_CURSOR_NESW, "fd_double_arrow", Fl_Wayland_Screen_Driver::nesw },
+ {FL_CURSOR_NWSE, "bd_double_arrow", Fl_Wayland_Screen_Driver::nwse }
+ };
+
+ int found = -1;
+ for (unsigned i = 0; i < sizeof(cursor_file_array) / sizeof(struct cursor_file_struct); i++) {
+ if (cursor_file_array[i].c == c) {
+ found = cursor_file_array[i].wld_c;
+ if (!scr_driver->xc_cursor[found]) scr_driver->xc_cursor[found] =
+ scr_driver->cache_cursor(cursor_file_array[i].fname);
+ if (scr_driver->xc_cursor[found]) {
+ scr_driver->default_cursor(scr_driver->xc_cursor[found]);
+ }
break;
-
- default:
- return 0;
+ }
}
+ if (found < 0 || !scr_driver->xc_cursor[found]) return 0;
+
if (xid->custom_cursor) {
delete_cursor(xid->custom_cursor);
xid->custom_cursor = NULL;
diff --git a/src/drivers/X11/Fl_X11_Screen_Driver.cxx b/src/drivers/X11/Fl_X11_Screen_Driver.cxx
index 76d7801b00..79875366e0 100644
--- a/src/drivers/X11/Fl_X11_Screen_Driver.cxx
+++ b/src/drivers/X11/Fl_X11_Screen_Driver.cxx
@@ -1,7 +1,7 @@
//
// Definition of X11 Screen interface
//
-// Copyright 1998-2022 by Bill Spitzak and others.
+// Copyright 1998-2024 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -429,7 +429,7 @@ extern void fl_fix_focus(); // in Fl.cxx
void Fl_X11_Screen_Driver::grab(Fl_Window* win)
{
const char *p;
- static bool using_kde =
+ static bool using_kde =
( p = getenv("XDG_CURRENT_DESKTOP") , (p && (strcmp(p, "KDE") == 0)) );
Fl_Window *fullscreen_win = NULL;
for (Fl_Window *W = Fl::first_window(); W; W = Fl::next_window(W)) {
@@ -1080,11 +1080,11 @@ void Fl_X11_Screen_Driver::set_spot(int font, int size, int X, int Y, int W, int
int change = 0;
XVaNestedList preedit_attr;
static XFontSet fs = NULL;
- char **missing_list;
- int missing_count;
- char *def_string;
+ char **missing_list = NULL;
+ int missing_count = 0;
+ char *def_string = NULL;
char *fnt = NULL;
- bool must_free_fnt =true;
+ bool must_free_fnt = true;
static XIC ic = NULL;
@@ -1096,7 +1096,7 @@ void Fl_X11_Screen_Driver::set_spot(int font, int size, int X, int Y, int W, int
focuswin = focuswin->window();
}
}
- //XSetICFocus(xim_ic);
+ // XSetICFocus(xim_ic);
if (X != fl_spot.x || Y != fl_spot.y) {
fl_spot.x = X;
fl_spot.y = Y;
@@ -1112,21 +1112,17 @@ void Fl_X11_Screen_Driver::set_spot(int font, int size, int X, int Y, int W, int
XFreeFontSet(fl_display, fs);
}
#if USE_XFT
-
-#if defined(__GNUC__)
- // FIXME: warning XFT support here
-#endif /*__GNUC__*/
-
- fnt = NULL; // fl_get_font_xfld(font, size);
- if (!fnt) {fnt = (char*)"-misc-fixed-*";must_free_fnt=false;}
- fs = XCreateFontSet(fl_display, fnt, &missing_list,
- &missing_count, &def_string);
+ fnt = NULL; // FIXME: missing XFT support here
#else
fnt = fl_get_font_xfld(font, size);
- if (!fnt) {fnt = (char*)"-misc-fixed-*";must_free_fnt=false;}
- fs = XCreateFontSet(fl_display, fnt, &missing_list,
- &missing_count, &def_string);
#endif
+ if (!fnt) {
+ fnt = (char*)"-misc-fixed-*";
+ must_free_fnt = false;
+ }
+ fs = XCreateFontSet(fl_display, fnt, &missing_list, &missing_count, &def_string);
+ if (missing_list)
+ XFreeStringList(missing_list);
}
if (xim_ic != ic) {
ic = xim_ic;
diff --git a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx
index 78c08af8df..5dafe503f5 100644
--- a/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx
+++ b/src/drivers/Xlib/Fl_Xlib_Graphics_Driver_image.cxx
@@ -1,7 +1,7 @@
//
// Image drawing routines for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2020 by Bill Spitzak and others.
+// Copyright 1998-2024 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -640,7 +640,6 @@ void Fl_Xlib_Graphics_Driver::draw_fixed(Fl_Bitmap *bm, int X, int Y, int W, int
XSetFillStyle(fl_display, gc_, FillSolid);
}
-
// Composite an image with alpha on systems that don't have accelerated
// alpha compositing...
static void alpha_blend(Fl_RGB_Image *img, int X, int Y, int W, int H, int cx, int cy) {
@@ -671,8 +670,9 @@ static void alpha_blend(Fl_RGB_Image *img, int X, int Y, int W, int H, int cx, i
int srcskip = ld - img->d() * W;
uchar *dstptr = dst;
- uchar srcr, srcg, srcb, srca;
- uchar dstr, dstg, dstb, dsta;
+ uchar srcr, srcg, srcb; // source color components
+ uchar dstr, dstg, dstb; // destination color components
+ unsigned int srca, dsta; // source alpha and inverse source alpha
if (img->d() == 2) {
// Composite grayscale + alpha over RGB...
@@ -680,15 +680,23 @@ static void alpha_blend(Fl_RGB_Image *img, int X, int Y, int W, int H, int cx, i
for (int x = W; x > 0; x--) {
srcg = *srcptr++;
srca = *srcptr++;
-
- dstr = dstptr[0];
- dstg = dstptr[1];
- dstb = dstptr[2];
- dsta = 255 - srca;
-
- *dstptr++ = (srcg * srca + dstr * dsta) >> 8;
- *dstptr++ = (srcg * srca + dstg * dsta) >> 8;
- *dstptr++ = (srcg * srca + dstb * dsta) >> 8;
+ if (srca == 255) { // special case "copy"
+ *dstptr++ = srcg;
+ *dstptr++ = srcg;
+ *dstptr++ = srcg;
+ } else if (srca == 0) { // special case "ignore"
+ dstptr += 3;
+ } else { // common case "blend"
+ srca += srca>>7; // multiply by 1.004 to compensate integer rounding error
+ dstr = dstptr[0];
+ dstg = dstptr[1];
+ dstb = dstptr[2];
+ dsta = 256 - srca;
+ unsigned int srcg_pm = srcg * srca; // premultiply once
+ *dstptr++ = (srcg_pm + dstr * dsta) >> 8;
+ *dstptr++ = (srcg_pm + dstg * dsta) >> 8;
+ *dstptr++ = (srcg_pm + dstb * dsta) >> 8;
+ }
}
} else {
// Composite RGBA over RGB...
@@ -698,18 +706,24 @@ static void alpha_blend(Fl_RGB_Image *img, int X, int Y, int W, int H, int cx, i
srcg = *srcptr++;
srcb = *srcptr++;
srca = *srcptr++;
-
- dstr = dstptr[0];
- dstg = dstptr[1];
- dstb = dstptr[2];
- dsta = 255 - srca;
-
- *dstptr++ = (srcr * srca + dstr * dsta) >> 8;
- *dstptr++ = (srcg * srca + dstg * dsta) >> 8;
- *dstptr++ = (srcb * srca + dstb * dsta) >> 8;
+ if (srca == 255) { // special case "copy"
+ *dstptr++ = srcr;
+ *dstptr++ = srcg;
+ *dstptr++ = srcb;
+ } else if (srca == 0) { // special case "ignore"
+ dstptr += 3;
+ } else { // common case "blend"
+ srca += srca>>7; // multiply by 1.004 to compensate integer rounding error
+ dstr = dstptr[0];
+ dstg = dstptr[1];
+ dstb = dstptr[2];
+ dsta = 256 - srca;
+ *dstptr++ = (srcr * srca + dstr * dsta) >> 8;
+ *dstptr++ = (srcg * srca + dstg * dsta) >> 8;
+ *dstptr++ = (srcb * srca + dstb * dsta) >> 8;
+ }
}
}
-
fl_draw_image(dst, X, Y, W, H, 3, 0);
delete[] dst;
diff --git a/src/flstring.h b/src/flstring.h
index e4c7ea4910..04199d13e2 100644
--- a/src/flstring.h
+++ b/src/flstring.h
@@ -82,8 +82,8 @@ FL_EXPORT extern size_t fl_strlcat(char *, const char *, size_t);
# define strlcat fl_strlcat
# endif /* !HAVE_STRLCAT */
-// promoted to
-//FL_EXPORT extern size_t fl_strlcpy(char *, const char *, size_t);
+/* promoted to */
+/* FL_EXPORT extern size_t fl_strlcpy(char *, const char *, size_t); */
# ifndef HAVE_STRLCPY
# define strlcpy fl_strlcpy
# endif /* !HAVE_STRLCPY */
diff --git a/src/numericsort.c b/src/numericsort.c
index bf73bb9273..244f0334d7 100644
--- a/src/numericsort.c
+++ b/src/numericsort.c
@@ -73,7 +73,6 @@ static int numericsort(struct dirent **A, struct dirent **B, int cs) {
}
if (a >= end_a) break;
- //a++; b++;
}
}
if (!ret) return 0;
diff --git a/src/xutf8/utf8Wrap.c b/src/xutf8/utf8Wrap.c
index 5ca8f25d4f..4a2b45bb61 100644
--- a/src/xutf8/utf8Wrap.c
+++ b/src/xutf8/utf8Wrap.c
@@ -37,7 +37,7 @@
*/
/* The ARM header files have a bug by not taking into account that ARM cpu
- * likes packing to 4 bytes. This little trick defines our own version of
+ * likes padding to 4 bytes. This little trick defines our own version of
* XChar2b which does not have this problem
*/
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 2dfb39883f..5ff5cff780 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -89,6 +89,8 @@ fl_create_example(boxtype boxtype.cxx fltk::fltk)
fl_create_example(browser browser.cxx fltk::fltk)
fl_create_example(button button.cxx fltk::fltk)
fl_create_example(buttons buttons.cxx fltk::fltk)
+# Cairo demo, built with and w/o Cairo (libcairo is linked implicitly - or not at all)
+fl_create_example(cairo_test cairo_test.cxx fltk::fltk)
fl_create_example(checkers "checkers.cxx;checkers_pieces.fl;checkers.icns" fltk::images)
fl_create_example(clipboard clipboard.cxx fltk::images)
fl_create_example(clock clock.cxx fltk::fltk)
@@ -214,13 +216,6 @@ if(OPENGL_FOUND)
fl_create_example(shape shape.cxx "${GLDEMO_LIBS}")
endif(OPENGL_FOUND)
-# Cairo demo - must also be built w/o Cairo (displays a message box)
-if(FLTK_HAVE_CAIRO)
- fl_create_example(cairo_test cairo_test.cxx "fltk::fltk;cairo")
-else()
- fl_create_example(cairo_test cairo_test.cxx fltk::fltk)
-endif(FLTK_HAVE_CAIRO)
-
# *** EXPERIMENTAL ***
# Build some of the demo programs linked against the shared FLTK lib(s).
# This is currently pretty complicated and should be improved.
@@ -267,8 +262,9 @@ if(FLTK_BUILD_SHARED_LIBS)
else() # not MSVC
+ fl_create_example(cairo_test-shared cairo_test.cxx fltk::fltk-shared)
fl_create_example(hello-shared hello.cxx fltk::fltk-shared)
- fl_create_example(pixmap_browser-shared pixmap_browser.cxx "fltk::images-shared")
+ fl_create_example(pixmap_browser-shared pixmap_browser.cxx fltk::images-shared)
fl_create_example(unittests-shared "${UNITTEST_SRCS}" "${GLDEMO_SHARED}")
if(OPENGL_FOUND)
@@ -276,11 +272,6 @@ if(FLTK_BUILD_SHARED_LIBS)
fl_create_example(shape-shared shape.cxx "${GLDEMO_SHARED}")
endif(OPENGL_FOUND)
- if(FLTK_HAVE_CAIRO)
- fl_create_example(cairo_test-shared cairo_test.cxx "fltk::fltk-shared;cairo")
- else()
- fl_create_example(cairo_test-shared cairo_test.cxx "fltk::fltk-shared")
- endif()
endif(MSVC) # (not MSVC)
diff --git a/test/ask.cxx b/test/ask.cxx
index 9ff06b45a1..527b43dfac 100644
--- a/test/ask.cxx
+++ b/test/ask.cxx
@@ -4,7 +4,7 @@
// This also demonstrates how to trap attempts by the user to
// close the last window by overriding Fl::exit
//
-// Copyright 1998-2021 by Bill Spitzak and others.
+// Copyright 1998-2024 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -90,10 +90,11 @@ void window_callback(Fl_Widget *win, void *) {
"Close" button will reactivate the popups (only possible if "recursive"
dialogs are enabled, see below).
- Note 1: This dialog box had been blocked in FLTK 1.3.x if another common
- dialog was already open because the window used was a static (i.e. permanently
- allocated) Fl_Window instance. This has been fixed in FLTK 1.4.0.
- See STR #334 (sic !) and also STR #2751 ("Limit input field characters").
+ Note 1: This dialog box had been blocked in FLTK 1.3 if another common
+ dialog was already open because the used window was a static (i.e.
+ permanently allocated) Fl_Window instance. This has been fixed in FLTK 1.4.
+ See STR #334 ("technical change : remove statics in fl_ask") and also
+ STR #2751 ("Limit input field characters").
*/
void timer_cb(void *) {
@@ -132,10 +133,10 @@ void timer_cb(void *) {
// pop up a message:
stop |= fl_choice(
"Timeout. Click the 'Close' button or press Escape.\n"
- "Note: this message had been blocked in FLTK 1.3.x\n"
+ "Note: this message had been blocked in FLTK 1.3\n"
"and earlier if another message window was open.\n"
"This message should pop up every 5 seconds (max. 10 times)\n"
- "in FLTK 1.4.0 and later until stopped by clicking the button\n"
+ "in FLTK 1.4 and later until stopped by clicking the button\n"
"below or by pressing the Enter (Return) key.\n",
"Close", "Stop these funny popups", NULL);
}
diff --git a/test/fractals.cxx b/test/fractals.cxx
index b680d3d0d7..bbdde0569b 100644
--- a/test/fractals.cxx
+++ b/test/fractals.cxx
@@ -5,7 +5,7 @@
// demonstrate how to add FLTK controls to a GLUT program. The GLUT
// code is unchanged except for the end (search for FLTK to find changes).
//
-// Copyright 1998-2016 by Bill Spitzak and others.
+// Copyright 1998-2024 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -77,6 +77,7 @@ typedef enum { NOTALLOWED, MOUNTAIN, TREE, ISLAND, BIGMTN, STEM, LEAF,
MOUNTAIN_MAT, WATER_MAT, LEAF_MAT, TREE_MAT, STEMANDLEAVES,
AXES } DisplayLists;
+// Note: MAXLEVEL is the highest level, range is 0..MAXLEVEL
#define MAXLEVEL 8
int Rebuild = 1, /* Rebuild display list in next display? */
@@ -146,11 +147,11 @@ float xzslope(float v1[3], float v2[3])
/************************ MOUNTAIN STUFF ***********************/
/***************************************************************/
-GLfloat DispFactor[MAXLEVEL]; /* Array of what to multiply random number
- by for a given level to get midpoint
- displacement */
-GLfloat DispBias[MAXLEVEL]; /* Array of what to add to random number
- before multiplying it by DispFactor */
+GLfloat DispFactor[MAXLEVEL + 1]; /* Array of what to multiply random number
+ by for a given level to get midpoint
+ displacement */
+GLfloat DispBias[MAXLEVEL + 1]; /* Array of what to add to random number
+ before multiplying it by DispFactor */
#define NUMRANDS 191
float RandTable[NUMRANDS]; /* hash table of random numbers so we can
@@ -233,9 +234,9 @@ void FMR(GLfloat v1[3], GLfloat v2[3], GLfloat v3[3], int level)
void FractalMountain(GLfloat v1[3], GLfloat v2[3], GLfloat v3[3],
int pegged[3])
{
- GLfloat lengths[MAXLEVEL];
- GLfloat fraction[8] = { 0.3f, 0.3f, 0.4f, 0.2f, 0.3f, 0.2f, 0.4f, 0.4f };
- GLfloat bias[8] = { 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f };
+ GLfloat lengths[MAXLEVEL + 1];
+ GLfloat fraction[8] = { 0.3f, 0.3f, 0.4f, 0.2f, 0.3f, 0.2f, 0.4f, 0.4f };
+ GLfloat bias[8] = { 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f, 0.1f };
int i;
float avglen = (xzlength(v1, v2) +
xzlength(v2, v3) +
diff --git a/test/grid_alignment.cxx b/test/grid_alignment.cxx
index 59a5368c3f..d16ea086f5 100644
--- a/test/grid_alignment.cxx
+++ b/test/grid_alignment.cxx
@@ -2,7 +2,7 @@
// Fl_Grid demo program for the Fast Light Tool Kit (FLTK).
//
// Copyright 2021 by Albrecht Schlosser
-// Copyright 2022-2023 by Bill Spitzak and others.
+// Copyright 2022-2024 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -61,7 +61,7 @@ void remove_cb(void *v) {
int main(int argc, char **argv) {
Fl_Grid::Cell *c;
Fl_Box *b;
- Fl_Double_Window *win = new Fl_Double_Window(440, 350, "FLTK 1.4.0 - Fl_Grid Alignment Test");
+ Fl_Double_Window *win = new Fl_Double_Window(440, 350, "Fl_Grid Alignment Test");
Fl_Grid *grid = new Fl_Grid(10, 10, 420, 330);
grid->layout(7, 7, 8, 4); // cols, rows, margin, gap
grid->box(FL_FLAT_BOX);
diff --git a/test/handle_keys.cxx b/test/handle_keys.cxx
index 09838a5de7..a081de933e 100644
--- a/test/handle_keys.cxx
+++ b/test/handle_keys.cxx
@@ -21,8 +21,10 @@
#include
#include
#include
+#include
#include
#include
+#include // free()
// Global variables to simplify the code
@@ -230,7 +232,7 @@ int app::handle(int ev) {
char capslk = (Fl::event_state() & FL_CAPS_LOCK) ? 'L' : '.';
tty->printf("%06x ", ekey); // event key number (hex)
- int lg;
+ int lg = 0;
tty->printf("%s", get_keyname(ekey, lg));
for (int i = lg; i < 14; i++) {
tty->printf(" ");
@@ -266,11 +268,30 @@ void clear_cb(Fl_Button *b, void *) {
Terminal *tty = ((app *)b->window())->tty;
tty->clear_screen_home();
tty->clear_history();
- tty->printf("%s\n", headline_text); // test, helpful for copy to clipboard
+ tty->printf("%s\n", headline_text); // helpful if copied to the clipboard
tty->redraw();
tty->take_focus();
}
+// Copy button callback: copies the selected text to the clipboard
+void copy_cb(Fl_Widget *b, void *) {
+ Terminal *tty = ((app *)b->window())->tty;
+ const char *what = "Full";
+ const char *text;
+ int tlen = tty->selection_text_len();
+ if (tlen > 0) {
+ text = tty->selection_text();
+ what = "Selected";
+ } else {
+ text = tty->text();
+ }
+ tlen = (int)strlen(text);
+ Fl::copy(text, tlen, 1, Fl::clipboard_plain_text);
+ fl_message("%s text has been copied to the clipboard, length = %d.", what, tlen);
+ free((void *)text);
+ tty->take_focus();
+}
+
// Callback for all (light) buttons
void toggle_cb(Fl_Widget *w, void *) {
Terminal *tty = ((app *)w->window())->tty;
@@ -309,40 +330,47 @@ int main(int argc, char **argv) {
const int WW = 700, WH = 400;
app *win = new app(0, 0, WW, WH);
win->tty->box(FL_DOWN_BOX);
+ win->tty->show_unknown(true);
win->tty->printf("Please press any key ...\n");
Fl_Grid *grid = new Fl_Grid(0, WH - 75, WW, 75);
grid->layout(2, 5, 5, 5);
keydown = new Fl_Check_Button(0, 0, 80, 30, "Keydown");
- grid->widget(keydown, 0, 1);
+ grid->widget(keydown, 0, 0);
keydown->value(1);
keydown->callback(toggle_cb);
keydown->tooltip("Show FL_KEYDOWN aka FL_KEYBOARD events");
keyup = new Fl_Check_Button(0, 0, 80, 30, "Keyup");
- grid->widget(keyup, 0, 2);
+ grid->widget(keyup, 0, 1);
keyup->value(0);
keyup->callback(toggle_cb);
keyup->tooltip("Show FL_KEYUP events");
- scaling = new Fl_Check_Button(0, 0, 80, 30, "GUI scaling");
- grid->widget(scaling, 1, 2);
- scaling->value(1);
- scaling->callback(toggle_scaling);
- scaling->tooltip("Use GUI scaling shortcuts");
-
shortcut = new Fl_Check_Button(0, 0, 80, 30, "Shortcut");
- grid->widget(shortcut, 0, 3);
+ grid->widget(shortcut, 0, 2);
shortcut->value(0);
shortcut->callback(toggle_cb);
shortcut->tooltip("Show FL_SHORTCUT events");
+ scaling = new Fl_Check_Button(0, 0, 80, 30, "GUI scaling");
+ grid->widget(scaling, 0, 3);
+ scaling->value(0);
+ scaling->callback(toggle_scaling);
+ scaling->tooltip("Use GUI scaling shortcuts");
+ toggle_scaling(scaling, 0);
+
Fl_Button *clear = new Fl_Button(0, 0, 80, 30, "Clear");
grid->widget(clear, 1, 0);
clear->callback((Fl_Callback *)clear_cb);
clear->tooltip("Clear the display");
+ Fl_Button *copy = new Fl_Button(0, 0, 80, 30, "Copy");
+ grid->widget(copy, 1, 1);
+ copy->callback(copy_cb);
+ copy->tooltip("Copy terminal contents to clipboard");
+
Fl_Button *quit = new Fl_Button(WW - 70, WH - 50, 80, 30, "Quit");
grid->widget(quit, 1, 4);
quit->box(FL_THIN_UP_BOX);
diff --git a/test/unittest_scrollbarsize.cxx b/test/unittest_scrollbarsize.cxx
index b964fcebef..afc34789ac 100644
--- a/test/unittest_scrollbarsize.cxx
+++ b/test/unittest_scrollbarsize.cxx
@@ -1,7 +1,7 @@
//
// Unit tests for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2022 by Bill Spitzak and others.
+// Copyright 1998-2024 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -204,7 +204,7 @@ class Ut_Scrollbar_Size_Test : public Fl_Group {
int texty = tabley + tableh + ysep;
int texth = browh;
int termy = texty + texth + ysep;
- int termh = texth;
+ // int termh = texth; // unused but left because it's documented above
brow_a = makebrowser(X+ 10,browy,100,browh,"Browser A");
brow_b = makebrowser(X+120,browy,100,browh,"Browser B");
brow_c = makebrowser(X+230,browy,100,browh,"Browser C");