Commit Graph

11197 Commits

Author SHA1 Message Date
ManoloFLTK
1fdb1f7944 Improve Fl_Wayland_Window_Driver::hide() 2024-02-08 15:18:18 +01:00
Albrecht Schlosser
a1d3bf182e Fix GitHub CI build and minor CMake issues
- GitHub CI: fix wrong CMake option name
- fl_add_library: disable debug output (MSVC), fix formatting
2024-02-07 20:03:29 +01:00
Albrecht Schlosser
fd5cd80935 Introduce "Modern CMake" in FLTK
This is a big commit and there are too many changes to list them all.
The main changes are:

- rename all CMake build options to 'FLTK_*'
- export library targets with namespace (prefix) 'fltk::'
- standardize shared library target names with suffix '-shared'
- set public build properties on libraries for consumers
- document library names and aliases in README.CMake.txt
- document changes in "Migrating Code from FLTK 1.3 to 1.4"
- partial backwards compatibility for old user projects

Included but not directly related changes:

- fix Windows (Visual Studio) DLL build
- add CMake function fl_debug_target() to show target properties
- don't build test programs if FLTK is a subproject
- internal: reformat CMake code: remove space before '('

Thanks to Matthias and Manolo for their help, testing, and feeback.
2024-02-07 18:37:34 +01:00
Albrecht Schlosser
1cf6fdfa85 Fix Fl_Window::default_size_range() (#901)
Thanks to Manolo for the patch.
2024-02-07 12:38:58 +01:00
Matthias Melcher
f0c1eff069 Fix typo in function name in editor. 2024-02-06 22:00:11 +01:00
Matthias Melcher
78ae78b118 Add dynamic title to test/editor 2024-02-06 21:25:43 +01:00
ManoloFLTK
6d98c6a8b1
Restore 3-way close window dialog (#900) 2024-02-06 20:27:18 +01:00
ManoloFLTK
a651c89c85 Fix window moving in Fl_Wayland_Window_Driver::resize() 2024-02-06 09:24:31 +01:00
ManoloFLTK
676e976cb6 Fl_Window_Driver::set_popup_window(), Fl_Screen_Driver::screen_boundaries_known()
Fl_Window_Driver::set_popup_window() is to be used to declare a window should be
positioned relatively to a previously mapped other window.  This allows a platform
to process such windows differently from other windows if needed.
Menu and tooltip windows are so declared.

A call to Fl_Window_Driver::set_popup_window() also allows to distinguish a real
menu or tooltip window from a window marked by Fl_Window::set_menu_window()
or by Fl_Window::set_tooltip_window() but that's not a real menu or tooltip.

New member function bool Fl_Screen_Driver::screen_boundaries_known() returns
true by default. A platform where the position of windows inside a screen is hidden
(e.g., Wayland) returns false. This allows FLTK to refrain from trying to make sure
a computed position is inside a screen.
2024-02-05 12:39:10 +01:00
ManoloFLTK
0da00995a8 Shorten parameter list of Fl_Wayland_Window_Driver::delete_cursor_(bool) 2024-02-04 16:55:01 +01:00
ManoloFLTK
865aed4eec Wayland: fix setting cursor to FL_NO_CURSOR 2024-02-03 16:04:06 +01:00
Albrecht Schlosser
b21a3910a9 Improve documentation of Fl_Native_File_Chooser
Document restrictions imposed by the new system file chooser dialogs,
particularly by 'kdialog' and 'zenity' (Unix/X11/Wayland only).
2024-01-31 18:50:25 +01:00
Matthias Melcher
faff63130c Fix cached GL context on all platforms (#737) 2024-01-29 14:01:41 +01:00
Matthias Melcher
c40b165353 Fix OpenGL context caching on macOS (#737) 2024-01-29 13:42:05 +01:00
Matthias Melcher
d9612e3cc7
RFC: Different approach to Editor tutorial (see #189) (#883)
Update test/editor code and tutorial (#189, #883)

Different, sequential approach to Editor tutorial
Co-authored-by: Albrecht Schlosser <albrechts.fltk@online.de>
2024-01-29 11:43:34 +01:00
Matthias Melcher
fa8799bcef Fix animated gif reloading (#897) 2024-01-28 00:14:49 +01:00
Matthias Melcher
444ee8bc36 Fix warning for out of range index. 2024-01-27 17:54:49 +01:00
Matthias Melcher
4123605aab Fix inlined animated GIFs with NULL name (#897) 2024-01-27 16:27:34 +01:00
Greg Ercolano
f2544509c1 Fix mousewheel problem with Fl_Text_Editor (issue #879)
When an Fl_Text_Editor ended up under the mouse, it took
mousewheel events for itself, freezing navigation of a
parent's Fl_Scroll.

Patch handles mousewheel events for both up/down and left/right
by checking:

    > If editor has no scrollbar (e.g. no content to scroll to),
      then mousewheel events for that scrollbar are ignored
      so the parent can be navigated.

    > If editor has a scrollbar, it handles wheel events until scroller reaches
      an extreme position (e.g. top or bottom), it starts ignoring wheel events
      so the parent can be navigated.
2024-01-25 08:09:25 -08:00
Greg Ercolano
6a887bf69b Fix small typos in Anim GIF docs 2024-01-24 14:10:54 -08:00
ManoloFLTK
8a4aa619e4 Fix "Wrong tooltip position on Wayland …" - cont'd (#894) 2024-01-23 12:36:50 +01:00
ManoloFLTK
da8d6c8d77 Fix "Wrong tooltip position on Wayland with secondary monitor" (#894) 2024-01-23 10:40:25 +01:00
Albrecht Schlosser
5cc5a60e09 Fl_Preferences: fix missing '/' (#891)
Without the '/' FLTK 1.4 wouldn't fall back to the 1.3 prefs folder
even if it existed.
2024-01-22 21:13:19 +01:00
Matthias Melcher
667adac6dd Fix warning. 2024-01-22 21:06:04 +01:00
Matthias Melcher
7b01f0b39f Fixes mouse pointer visibility for popups (#890) 2024-01-22 20:58:48 +01:00
Matthias Melcher
595d2df049 Fix wrong path var and typos 2024-01-22 20:36:12 +01:00
Matthias Melcher
baa3c6ddc0
Fix User Preferences file search order for Unix (#891) 2024-01-22 20:20:52 +01:00
ManoloFLTK
45422a7d19 Add popup_window() virtual member functions to Fl_Window_Driver 2024-01-22 09:52:35 +01:00
ManoloFLTK
12854fd8e5 Fix Wayland: crash with set_menu_window() - cont'd (#892) 2024-01-21 10:57:45 +01:00
ManoloFLTK
2481bfe430 Fix Wayland: crash with set_menu_window() - cont'd (#892) 2024-01-21 10:41:18 +01:00
ManoloFLTK
ab8c84447e Fix "Wayland: crash with set_menu_window()" - cont'd (#892) 2024-01-21 08:39:46 +01:00
ManoloFLTK
2fbf5bed0d Fix "Wayland: crash with set_menu_window()" (#892)
Fixes also a similar crash occuring after use of set_tooltip_window().
Two bool member variables are added to class Fl_Window_Driver
to indicate true FLTK menu windows (i.e., created by Fl_Menu_Item::pulldown())
and true FLTK tooltip windows (i.e., Fl_Tooltip).
2024-01-21 08:30:49 +01:00
Albrecht Schlosser
b5b839e4f0 Fix compiler warning [-Wmaybe-uninitialized]
'buf' could indeed be used uninitialized if the switch statement
below was executed with an unknown style (no default case).
2024-01-19 19:38:11 +01:00
Matthias Melcher
ed757454eb Fix crash in Fl_Preferences for deformed group name (#891) 2024-01-19 11:47:41 +01:00
ManoloFLTK
13d412f82f Wayland: add necessary initializations after commit b7fba46 2024-01-19 09:32:57 +01:00
ManoloFLTK
01f2f760b6 Create struct wl_callback_listener *Fl_Wayland_Graphics_Driver::p_surface_frame_listener 2024-01-18 08:51:31 +01:00
ManoloFLTK
b7fba465ce Wayland: throttle resize operations also for top-level GL windows
Member cb of struct wld_buffer is replaced by member frame_cb of struct wld_window.
This allows frame_cb to be used both for non-GL and for top-level GL windows.
2024-01-18 08:10:33 +01:00
Matthias Melcher
554bccbecd Synchronize mouse and keyboard callbacks for Fl_Button (#877)
Keyboard behavior for button types was not consistent with mouse
click behavior. This change avoids callbacks when pressed radio buttons
are pressed again.
2024-01-17 20:24:47 +01:00
Matthias Melcher
a038e55783 Restore original Fl_Button event behavior(#877)
Previous commits introduced too many changes to Fl_Button callbacks,
creating problems in user apps. This is the base for a second much
more specific fix to event flags.
2024-01-17 18:54:07 +01:00
ManoloFLTK
0dfa37f4c0 Wayland + full-size subwindow resizing issue - cont'd (#878)
Implement a less strict handling of resizing of a decorated window entirely covered
by a subwindow where throttling of fast resize commands is guided by the
value of the in_use member variable of the window's wld_buffer.
2024-01-17 11:43:00 +01:00
ManoloFLTK
266bf1d3c0 Update libdecor to commit 7807ae34 dated 15-Jan-2024 2024-01-16 15:08:11 +01:00
Greg Ercolano
e5abb3bc86 Fixed issue number reference. 2024-01-15 15:10:54 -08:00
Greg Ercolano
d3914ef90e Addresses issue #879 2024-01-15 14:52:58 -08:00
Greg Ercolano
3142eb2fda Small code fixups
> Enabled -Wall -Wextra -Wpedantic to catch errors
    - Silenced resulting "unused parameters" warnings
    - Fixed char omission in protected Fl_Terminal::insert_char() methods
> Self doc code and better comments in RingBuffer::resize()
> Changed private RingBuffer::clear_disp_row() -> clear_disp_rows()
> Added private RingBuffer::hist_rows()/disp_rows() setter methods
> Added private RingBuffer::offset_adjust() method for adjusting RingBuffer offset_
> Fixed comment typos
> Remove white space inside outer parens of while()/if()/etc
2024-01-15 14:33:17 -08:00
ManoloFLTK
8679be8561 Restore correct copyright window for checkers demo 2024-01-15 17:28:25 +01:00
Matthias Melcher
31daa83f2b #877: Formatting, comments, debug output 2024-01-14 16:58:34 +01:00
Matthias Melcher
da6791d492 #877L: Formatting, Unused variable. 2024-01-14 15:48:33 +01:00
ManoloFLTK
c44bea787f #842 - cont'd: fix typos in documentation. 2024-01-14 14:32:46 +01:00
Matthias Melcher
5c90938aa3 #887: Fixes FLTK file chooser not releasing preview image.
...when hidden
2024-01-14 01:42:05 +01:00
Matthias Melcher
be1c96b98a #889: Fixes missing return statement. 2024-01-14 00:52:41 +01:00