Commit Graph

6382 Commits

Author SHA1 Message Date
ManoloFLTK
6276822e9e Allow cmake -DOPTION_APPLE_X11=On without -U__APPLE__ 2023-02-02 18:48:24 +01:00
Albrecht Schlosser
4e75549e7b Update dependencies and fix whitespace errors
- replace tabs with spaces
- remove trailing whitespace
2023-02-02 17:09:14 +01:00
Albrecht Schlosser
fb00fb3d66 Minimize and fix include statements of Fl_Int_Vector
- replace <FL/Fl.H> with <FL/Fl_Export.H> in public header
- add missing <string.h> in implementation
2023-02-02 17:00:28 +01:00
ManoloFLTK
16dff07994 Fix "Native file chooser on Linux fails with BROWSE_MULTI_FILE" (#669) 2023-02-02 15:20:55 +01:00
ManoloFLTK
ddc213d91c Add preliminary support of Wayland under macOS
Wayland under macOS is WIP at
  https://github.com/owl-compositor/owl
2023-02-02 14:39:11 +01:00
ManoloFLTK
96fd8a5f7a Wayland: use fl_wl_find() instead of fl_find() 2023-02-01 09:30:09 +01:00
ManoloFLTK
94c918a1ae Fix miscellaneous #include directives 2023-01-31 18:22:04 +01:00
ManoloFLTK
eaaf5ba90c Fix crash in Zenity filechooser with badly formed filter (#665) 2023-01-31 17:37:20 +01:00
ManoloFLTK
8ef592db1e Fix crash in Zenity filechooser with badly formed filter (#665) 2023-01-31 17:01:30 +01:00
ManoloFLTK
f75f05e7b7 Fix crash in Zenity filechooser with badly formed filter (#665) 2023-01-31 15:37:33 +01:00
ManoloFLTK
9bf2726bce Fix "Native Filechooser (Zenity) crashes on second invocation" (#665) 2023-01-31 13:13:48 +01:00
ManoloFLTK
1045538ed0 Fix launching of unbundled app from /tmp 2023-01-30 20:08:18 +01:00
ManoloFLTK
95f926fd01 Document that Fl::add_fd() opens display under macOS 2023-01-30 07:39:20 +01:00
Albrecht Schlosser
86a0a28815 Fix comments and remove a 'todo' item from docs
Comments and docs only, no code changes.
2023-01-28 16:09:54 +01:00
ManoloFLTK
d604c37c90 Fix for [fltk.coredev] native file chooser crash 2023-01-27 08:35:38 +01:00
Matthias Melcher
e2028c66fe STR 2936: FLUID: option to ignore syntax check in DeclBlock 2023-01-26 16:32:17 +01:00
ManoloFLTK
1581662d00 Simpler Fl_Wayland_Gl_Window_Driver::resize() is enough 2023-01-26 16:04:06 +01:00
Matthias Melcher
179771acd2
Fixing FLUID file corruption from issue #653 (#662)
Removing all globals in file writer (#653 )
Fix some static analyser complaints
Valgrind: handle width==0 in GfxDrivers on Wayland and X11
Don't use `Fl_Input_::static_value`, it accesses previous
buffer that may be deleted
Project file write encapsulated, removing globals
Encapsulating project file reader, removing states in glbals
Project i/o increased source code readability
2023-01-26 15:23:43 +01:00
Matthias Melcher
3a7c9fe978 STR 2639 Fixes Fl_Pack resize behaviour
FLUID cleanups
FLUID Fl_Pack support improvement
FLUID fix error in handling live mode resizables
2023-01-23 16:08:59 +01:00
ManoloFLTK
17467b48bd Wayland: remove useless member variables of struct output 2023-01-23 08:11:10 +01:00
wcout
2ddfd9d949
Animated GIF support (Fl_Anim_GIF_Image class) (#375) 2023-01-21 17:27:58 +01:00
Matthias Melcher
2c595e8dde STR 2822: function to count bytes in a UTF-8 string 2023-01-20 16:13:00 +01:00
Matthias Melcher
b19c0e4f63 STR 2894: pressed_menubutton_ now protected in Fl_Menu_Button 2023-01-20 15:22:21 +01:00
Matthias Melcher
4f3f2bb30b STR 2909: Fl_Tile now forwards FL_RELEASE event to children 2023-01-20 14:04:22 +01:00
Matthias Melcher
ab5cc5866d STR 3408: Fl_Scroll draws background inactive if needed 2023-01-20 13:51:17 +01:00
Matthias Melcher
f4620329f1 STR 3461: fix menu linespacing 2023-01-20 13:44:13 +01:00
ManoloFLTK
35b7473e70 Wayland menus: support tall popup menu + Sway support 2023-01-16 17:07:22 +01:00
ManoloFLTK
ff3906bec0 Wayland menus: support tall popup menu 2023-01-16 16:00:54 +01:00
Albrecht Schlosser
f44bdfb7cf Fl_Chart: minor update and additional documentation
Add forgotten parameter docs and some minor code fixes.
2023-01-16 00:08:47 +01:00
Albrecht Schlosser
dde2d21b5d Improve deriving from Fl_Chart (STR 2022)
This commit makes the local, static drawing functions in the source
file available for subclasses by converting them to static protected
methods as requested by STR 2022.

The source and header files have been reformatted according to the
CMP, documentation for the new protected methods was added.

Source code *functionality* has not been changed.

This resolves and closes STR 2022.

Todo:
 - investigate whether these drawing methods wouldn't better be
   member functions and "convert" them if applicable
 - investigate whether the internal struct FL_CHART_ENTRY could become
   a local part of the Fl_Chart class, maybe Fl_Chart::Entry.
 - rename private member variables with trailing underscore (see CMP)
2023-01-15 23:48:00 +01:00
ManoloFLTK
761aa5e485 Rename static member Fl_Wayland_Window_Driver::tall_popup to new_popup
The new name reflects better the role of this bool member variable.
Also, add explanatory comments about the use of this variable.
2023-01-15 10:18:50 +01:00
ManoloFLTK
37775538c4 Extend commit a4b33f8 to other uses of function convert_crlf()
Helper function convert_crlf() from file fl_wayland_clipboard_dnd.cxx has been
repaired by commit a4b33f8 (13 jan 2023). But the same function was also in
file Fl_cocoa.mm. This commit moves the repaired code to class Fl_Screen_Driver
and has both fl_wayland_clipboard_dnd.cxx and Fl_cocoa.mm use it.
2023-01-14 09:56:09 +01:00
ManoloFLTK
c8b4a56735 Add missing initialisation after dynamic memory allocation 2023-01-14 08:16:23 +01:00
Albrecht Schlosser
a4fdf92d06 Fix set_fonts() in Xlib/xft and Cairo Graphics_Driver
src/drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx:
 - fix font_name_process() out of bounds memory access
 - unify/align font_name_process() code (see also Xlib/xft)
 - fix font name string allocation

src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_xft.cxx
 - unify/align font_name_process() code (see also Cairo_Graphics)
 - fix font name string allocation

Todo: move common code to Fl_Graphics_Driver or another common file.
2023-01-13 22:39:23 +01:00
ManoloFLTK
f3e21ddad2 Fix for "Rename Fl_X* Fl_Window::i private class member" (#223) 2023-01-13 21:16:17 +01:00
ManoloFLTK
dd6b9b90ee Wayland menus: add missing use of scaling factor 2023-01-13 19:37:06 +01:00
Albrecht Schlosser
59bf6dc059 Fix "alloc-dealloc-mismatch" in Fl_Native_File_Chooser_Kdialog
Error was reported by Address Sanitizer (ASAN) when picking a file.
Platform: Unix/Linux.

==1734703==ERROR: AddressSanitizer: alloc-dealloc-mismatch (malloc vs operator delete []) on 0x607000108420
    #0 0x7f3357d846ef in operator delete[](void*) ../../../../src/libsanitizer/asan/asan_new_delete.cc:168
    #1 0x4e195f in Fl_Native_File_Chooser_Driver::strfree(char*) ../../src/Fl_Native_File_Chooser.cxx:262
...
0x607000108420 is located 0 bytes inside of 66-byte region [0x607000108420,0x607000108462)
allocated by thread T0 here:
    #0 0x7f3357d0a3ed in __interceptor_strdup ../../../../src/libsanitizer/asan/asan_interceptors.cc:445
    #1 0x57951a in Fl_Kdialog_Native_File_Chooser_Driver::filter(char const*) ../../src/Fl_Native_File_Chooser_Kdialog.cxx:245
    #2 0x4e14a0 in Fl_Native_File_Chooser::filter(char const*) ../../src/Fl_Native_File_Chooser.cxx:176
2023-01-13 18:15:51 +01:00
Albrecht Schlosser
a4b33f8e76 Wayland: Fix "heap-buffer-overflow" error
- replace strchr() with memchr() because buffer is not nul-terminated
- fix '*(p+1)' potentially accessing memory out of bounds

This fix also prevents
- multiple memmove() calls
- multiple searches from the beginning of the string
2023-01-13 16:44:06 +01:00
Albrecht Schlosser
54e75dc902 Improve debug output of Fl_String
- add newline (\n) before string output
- remove quotes (')
2023-01-13 16:41:40 +01:00
ManoloFLTK
6a5c326c39 Fix for "Screen resolution change (win32)" (#651) 2023-01-13 15:15:02 +01:00
ManoloFLTK
7dd7cfcf95 Wayland Fix "Error "heap-use-after-free" when scaling twice" (#650) 2023-01-12 21:28:03 +01:00
ManoloFLTK
66860c2e83 Improve "Implementation note about menu windows under Wayland" 2023-01-12 21:27:17 +01:00
Albrecht Schlosser
bafd3fd3d7 Add Fl_Scheme_Choice widget and use it in test programs
This widget offers the selection of all known FLTK schemes as a simple
widget based on Fl_Choice.

Some test and demo programs use Fl_Scheme_Choice to enable the developer
or user to switch schemes quickly for comparison.

Todo:
 - add features to add new schemes during runtime (partially done)
 - update status when the scheme is changed by Fl::scheme("...")
2023-01-12 19:21:09 +01:00
Albrecht Schlosser
79832b679f Add the initial version of class Fl_Scheme
This basic version of class Fl_Scheme contains only static methods that
are needed for Fl_Scheme_Choice and further extensions.
2023-01-12 19:21:09 +01:00
ManoloFLTK
b375d07d32 New static member Fl_Window *Fl_Wayland_Window_Driver::previous_floatingtitle 2023-01-12 11:58:53 +01:00
ManoloFLTK
62e33973a1 New static member bool Fl_Wayland_Window_Driver::tall_popup 2023-01-12 11:36:20 +01:00
ManoloFLTK
32b966ef8f Remove repeated code in classes menuwindow and menutitle 2023-01-12 10:33:41 +01:00
ManoloFLTK
b8d9f2282f Remove useless #include directives 2023-01-12 10:33:41 +01:00
ManoloFLTK
8a8a4c793e Simpler implementation of Fl_Window_Driver::scroll_to_selected_item() 2023-01-12 09:03:53 +01:00
ManoloFLTK
86a6d4e3d3 Wayland menus: remove useless Fl_Window_Driver::extra_menutitle() 2023-01-12 08:28:06 +01:00