10067 Commits

Author SHA1 Message Date
ManoloFLTK
699cca8ff4 Make Fl::set_color(r,g,b,a) effective under Wayland and macOS. 2022-09-15 15:01:12 +02:00
ManoloFLTK
700fb1aadd Improve virtual void* Fl_Gl_Window_Driver::GetProcAddress(procName) 2022-09-14 08:53:45 +02:00
ManoloFLTK
f265ca2afc Avoid deprecated glGetString(GL_EXTENSIONS) call when possible. 2022-09-13 18:41:18 +02:00
ManoloFLTK
e43c2f566d Remove forgotten debug code. 2022-09-13 11:24:08 +02:00
ManoloFLTK
87ee126e1f Allow use of Fl_Window::default_icon() with a scaled image. 2022-09-12 11:07:03 +02:00
ManoloFLTK
d028f0b37d Fix fl_read_image() under hybrid Wayland/X11 platform.
Function fl_read_image() obliges to keep a minimal use of global variable fl_window
also under the Wayland platform, even if its type (Window) makes little sense for
the hybrid library because it has its X11 value (given by X11/X.h) which is not
meaningful for the Wayland leg of the hybrid platform.

Virtual member function Fl_Surface_Device::as_image_surface() becomes useless.
2022-09-11 19:45:48 +02:00
ManoloFLTK
98d8a5da0c Fix support of CMake OPTION_WAYLAND_ONLY. 2022-09-11 10:42:56 +02:00
ManoloFLTK
ef243d6c86 Add needed variable for Wayland-only platform. 2022-09-11 09:52:02 +02:00
ManoloFLTK
2ea85ea6d7 Fix regression in fl_read_image() after introduction of hybrid Wayland/X11 platform.
The special use context of fl_read_image() inside the draw() function of an
Fl_Double_Window, where the function should read inside the window's double buffer
rather than the on-screen window, no longer worked.

Removal of all uses of the fl_window global variable from platform-independent
code remains necessary, because this variable is ill-defined in the Wayland/X11
library.
2022-09-11 09:15:42 +02:00
ManoloFLTK
b37576aa55 New configure setting "--enable-wayland --disable-x11" to build pure Wayland platform. 2022-09-10 07:44:23 +02:00
ManoloFLTK
203e7b7098 New OPTION_WAYLAND_ONLY for CMake to build pure Wayland platform. 2022-09-09 15:19:15 +02:00
ManoloFLTK
1b0f21cc8f Wayland: support going from borderless to bordered window. 2022-09-09 08:23:09 +02:00
ManoloFLTK
7800c2f3c3 Wayland: fix handling of fast calls to Fl_Window::flush().
Also fix scaling of borderless windows.
2022-09-09 07:26:19 +02:00
ManoloFLTK
0ff31668a1 Wayland: remove memory leak from missing wl_callback_destroy() call.
This hopefully corresponds to the memory leak mentioned in fltk.general
named "FLTK and Wayland".
2022-09-08 16:11:53 +02:00
ManoloFLTK
71069b8570 Add necessary virtual qualifier to ~Fl_Font_Descriptor() and derived. 2022-09-08 16:04:09 +02:00
ManoloFLTK
13e05f4204 Improve support of child windows that may leak outside their parent window.
1) add Wayland code that prevent subwindows from leaking outside their parent.
This does not cover GL subwindows.

2) add macOS code that prevent GL subwindows from leaking outside their parent.
This fixes issue #494 for the macOS platform.

N.B.: Wayland GL subwindows are not prevented from leaking because no solution
that would not require any change in client applications was found. Code that
would cover Wayland GL subwindows but would require client applications to always
use the FL_ALPHA flag is included in this commit in commented out form.
2022-09-07 14:40:16 +02:00
Albrecht Schlosser
deeb977c2e Wayland: fix memory leak on FL_KEYUP events
The old code would allocate memory on FL_KEYDOWN and FL_KEYUP events
and never free the latter.

The fix is to allocate memory only on FL_KEYDOWN events which will
be free'd later as intended.

Also fix two unrelated whitespace errors.
2022-09-06 20:04:33 +02:00
ManoloFLTK
57e0cdec08 Fix for issue #493 2022-09-03 12:36:50 +02:00
ManoloFLTK
21864cf499 Attempt to fix issue #485. 2022-09-03 09:35:48 +02:00
Albrecht Schlosser
76858fc040 Fix compiler warning [-Wunused-function]
warning: ‘int xrender_supported()’ defined but not used

This happens only with certain configure options, particularly if
  FLTK_USE_CAIRO is set, i.e. drawing with Cairo is enabled.
2022-09-02 16:28:53 +02:00
ManoloFLTK
16f660f676 Wayland: fix issue #492 - mark FLTK differences. 2022-09-02 09:44:43 +02:00
ManoloFLTK
2a3b4e1f2d Wayland: fix issue #492 "Use after free()". 2022-09-02 09:35:44 +02:00
Albrecht Schlosser
e0bf25d911 Remove useless if (...) 2022-09-01 17:12:10 +02:00
ManoloFLTK
b75d7526fd Simplify Fl_Window_Driver::screen_num() member functions. 2022-09-01 11:55:41 +02:00
ManoloFLTK
b4686f0e5b Restore building with --disable-xft 2022-09-01 11:45:27 +02:00
ManoloFLTK
736c20f7a2 Wayland platform: remove redirection of stderr. 2022-08-31 10:43:10 +02:00
ManoloFLTK
5701313340 Hybrid Wayland/X11: remove setenv() call from Fl_Wayland_System_Driver::disable_wayland(). 2022-08-31 08:56:56 +02:00
ManoloFLTK
07fd2628fe Hybrid Wayland/X11 platform: improve control of chosen backend. 2022-08-30 17:37:55 +02:00
ManoloFLTK
fcdc2f0e10 Attempt to improve fl_disable_wayland(). 2022-08-30 12:58:57 +02:00
ManoloFLTK
84af966109 Add FL_EXPORT to Fl_Wayland_Screen_Driver::wl_display member variable. 2022-08-30 08:55:14 +02:00
ManoloFLTK
2c1effc385 Wayland: Fix Fl_Gl_Window_Driver::newGlWindowDriver() for shared libs 2022-08-30 08:15:21 +02:00
ManoloFLTK
95c851fda1 Set Fl_Graphics_Driver::set_color(Fl_Color, unsigned) used by macOS, Wayland and display-cairo. 2022-08-30 07:58:16 +02:00
Albrecht Schlosser
510f711513 Improve selection of Wayland or X11 backend
Calling fl_disable_wayland() at runtime must have highest priority
before environment variables are considered.
2022-08-29 19:56:18 +02:00
Albrecht Schlosser
746135f0ae X11: Fix rescaling of non-resizable window (issue #491) 2022-08-29 18:55:01 +02:00
ManoloFLTK
1ca767eb13 Hybrid Wayland/X11 : more accurate writing of fl_wl_display(). 2022-08-29 18:49:15 +02:00
ManoloFLTK
9276ade07b Wayland/X11 hybrid: fix crash of test program demo. 2022-08-29 18:34:11 +02:00
Albrecht Schlosser
c20e7d9efc Update dependencies, fix trailing whitespace 2022-08-29 14:26:28 +02:00
ManoloFLTK
c720aae515 Make hybrid Wayland/X11 platform. 2022-08-29 12:15:32 +02:00
ManoloFLTK
28981f6fd3 Wayland/Libdecor: update from upstream
These changes fix issue #474.
2022-08-27 10:15:40 +02:00
Albrecht Schlosser
6a546d4e9c Fix dependencies and whitespace errors
No "real" code changes, but dependencies can affect building.
2022-08-25 22:04:59 +02:00
ManoloFLTK
6064518100 Remove unneeded FL_EXPORT declaration. 2022-08-25 15:48:54 +02:00
ManoloFLTK
feac10ec89 Wayland: reduce the number of platform-specific FL_EXPORT directives. 2022-08-25 10:42:58 +02:00
ManoloFLTK
51e9b28f39 Add FL_EXPORT directives to support building shared libs with -no-undefined 2022-08-24 15:09:30 +02:00
ManoloFLTK
80ecf605ec Wayland: Fix obscure problem when closing file dialog under recent OS versions.
The problem is that the app sometimes stops after closing a file dialog window.
It results in fact from a bug in function draw_title_bar of libdecor-gtk.c that erroneously
calls libdecor_frame_set_max_content_size(). This bug is being proposed to be fixed
by a MR to libdecor.

But moving the libdecor_frame_set_min/max_content_size() calls after the capability changes
hides the bug, and the problem with file dialog doesn't show.
2022-08-23 16:20:47 +02:00
ManoloFLTK
4611327672 Comment-only changes. 2022-08-23 09:04:14 +02:00
ManoloFLTK
1631e39187 Add FL_EXPORT directives erroneously removed at 7deff86. 2022-08-23 09:02:06 +02:00
ManoloFLTK
a70bd69cfb Fix argument of glMatrixMode() call. 2022-08-21 10:14:18 +02:00
ManoloFLTK
d5a1e7feb9 Add static Fl_Wayland_Window_Driver::gl_plugin() member function. 2022-08-20 17:26:02 +02:00
ManoloFLTK
7deff86b5d Remove FL_EXPORT qualifier from platform-specific class declarations. 2022-08-20 10:16:32 +02:00
ManoloFLTK
b24379133f Add int Fl::system(const char *command) static member function. 2022-08-20 09:57:00 +02:00