Commit Graph

7153 Commits

Author SHA1 Message Date
ManoloFLTK
bbbc3a739c X11: Window scaling makes window lose resizable status if resizable_ is NULL (#923) 2024-03-03 20:53:16 +01:00
ManoloFLTK
130f5b6dc1 A window needs is_resizable() true to obey fullscreen() or maximize() 2024-03-03 17:50:49 +01:00
Albrecht Schlosser
d832ab742a Fix Visual Studio compiler warnings 2024-03-03 16:15:43 +01:00
Greg Ercolano
257e20e929 Added Fl_Terminal::text() and docs 2024-03-02 22:47:45 -08:00
Matthias Melcher
f1c9b198bb Promote fl_strlcpy to <FL/fl_string_functions.h> 2024-03-02 23:49:35 +01:00
ManoloFLTK
7fea97c7a7 Fix regression introduced at 41740ca for non resizable windows - cont'd 2024-03-02 20:02:11 +01:00
ManoloFLTK
b74099c5fd Add OPTION_SIMPLE_ZOOM_SHORTCUT to fine tune zoom-in shortcut 2024-03-02 17:25:10 +01:00
ManoloFLTK
a76229972e macOS: remove test that became useless after 5f20698 2024-03-02 08:12:54 +01:00
ManoloFLTK
34b8801fed Windows: fix moving window with Windows+Shift+arrow (#919) 2024-03-01 18:30:20 +01:00
ManoloFLTK
cc15700bdb Windows: improve changing scale values of display while app runs. 2024-03-01 14:00:43 +01:00
ManoloFLTK
266647d2a7 Windows: fix issue if moving window back & forth across screens (#919) 2024-03-01 12:20:10 +01:00
ManoloFLTK
0eef561e7b Windows: make Ctrl/+/-/0/ scaling system-wide if all screens have same DPI 2024-03-01 11:11:15 +01:00
ManoloFLTK
5f2069871d Move recognition of Ctrl= out of Fl::test_shortcut(unsigned) 2024-02-29 07:17:31 +01:00
Albrecht Schlosser
367826979d Fix a typo and the URL to an STR in a comment
no code changes
2024-02-28 15:54:02 +01:00
ManoloFLTK
f4fb973c5d Simplify code to recognize GUI rescaling shortcuts 2024-02-28 09:13:35 +01:00
ManoloFLTK
eb3977ac43 Fix regression introduced at 41740ca for non resizable windows 2024-02-27 18:52:25 +01:00
ManoloFLTK
fc46e771cd Improve prioritization of event handlers added at open display time 2024-02-27 16:20:25 +01:00
ManoloFLTK
746cbf861a Minor optimization of macOS automatic Window menu 2024-02-27 13:46:41 +01:00
ManoloFLTK
4863f959c8 macOS: Window menu of system menubar follows changes in active window 2024-02-27 09:13:41 +01:00
ManoloFLTK
f35ae7122d Stop GUI scaling when window is maximized or full screen (#919)
Don't rescale when any top window on same screen as focus window is fullscreen or maximized
2024-02-27 08:46:40 +01:00
ManoloFLTK
3f794d3abe Allow FL_COMMAND+'+' as macOS system menu shortcuts - cont'd 2024-02-26 17:48:18 +01:00
ManoloFLTK
0818d4ec5b Fix: Fl_Window::fullscreen() does not work correctly on Mac (#920) 2024-02-26 12:15:47 +01:00
ManoloFLTK
41740caa2e Don't rescale when top window is fullscreen or maximized (#919) 2024-02-26 11:00:42 +01:00
ManoloFLTK
2ea5291821 Allow FL_COMMAND+'+' and FL_CTRL+'0' as menu shortcuts 2024-02-26 10:46:28 +01:00
Albrecht Schlosser
f288aea10a Fix Fl_Group::resize() for groups w/o resizable() (#917)
Improve code comments to clarify which cases are handled in a code
block and why this is done. Subwindows have some special needs.
2024-02-23 19:21:26 +01:00
ManoloFLTK
957becbe28 Fix: fl_height(int, int) decreases the font size after each call (#915) 2024-02-21 09:38:24 +01:00
ManoloFLTK
681e22a452 Add scale_handler first so it has least priority of all handlers 2024-02-20 21:47:43 +01:00
ManoloFLTK
69d7991acc FL_MENU_TOGGLE/RADIO items do not update in macOS menu bar (#916) 2024-02-20 18:41:12 +01:00
ManoloFLTK
ba5ed296e9 Improve implementation of the macOS Window menu
The macOS Window menu is connected to the item array of the  macOS menubar
via FL_SUBMENU_POINTER. This facilitates memorization of pointers
to items of the macOS menubar because the item array no longer changes
each time a window opens of gets closed.
2024-02-20 16:00:01 +01:00
Matthias Melcher
2f343ad64d
Fix Terminal character position and add word selection (#906)
* Improve horizontal interactive selection
* Using half-character positions to implement selection
  similar to Fl_Input.
* Add word and line selection
* Fix vertical position of text
2024-02-18 13:29:37 +01:00
Greg Ercolano
58a1496389 Fixed Fl_Terminal xterm color 39/49 handling, and other mods.
Fixed a bug in the handling of xterm color 39 + 49, which avoids
applying Dim/Bold if default color is the special "see through" color
0xffffff00. A test will be added to test/terminal to excercise this
in a follow up commit.

Renamed CharStyle::?gcolor_uchar() -> CharStyle::?gcolor_xterm()
for a consistent naming convention.

Changed fltk_fg_color() from a static func to a CharStyle method
because it needs to access the defaultcolor for the special cases
for xterm colors 39 and 49.

Made CharStyle::attr_color() private, as per Jonathan Griffitts request
in issue #909.

Improved docs regarding effects of Dim/Bold for xterm and non-xterm color
methods.

Fl_Terminal::text?gcolor_xterm() methods now use CharStyle::?gcolor_xterm()
methods, removing the duplicate code logic.
2024-02-16 13:10:06 -08:00
Greg Ercolano
1069ebc1b6 Fix Fl_Terminal xterm CharStyle charflags (#909) 2024-02-16 04:46:05 -08:00
ManoloFLTK
cf551ddf5a Improve recognition of re-scaling shortcuts - cont'd 2024-02-11 19:10:39 +01:00
ManoloFLTK
2776071144 Improve recognition of re-scaling shortcuts w/ various keyboard layouts 2024-02-11 11:07:03 +01:00
ManoloFLTK
63b0bcf599 KDE+X11 keyboard stops working after menu display (#904) 2024-02-11 08:23:23 +01:00
ManoloFLTK
fc6d364057 Change parameters of Fl_Wayland_Window_Driver::delete_cursor() 2024-02-09 10:04:13 +01:00
ManoloFLTK
1fdb1f7944 Improve Fl_Wayland_Window_Driver::hide() 2024-02-08 15:18:18 +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
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
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
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
Matthias Melcher
e0a334840d #842: Documents args() color values and how they apply 2024-01-13 23:07:13 +01:00
Matthias Melcher
826eb39d68 #877: Fixes shortcut callbacks for Fl_Button
- this commit does rewrite some of the logic,
hoping to make thing more, um, logical. The bits
react mostly the same and hopefully as expected.
Everything is documented in the Fl_Button ctor.
2024-01-13 22:36:35 +01:00
ManoloFLTK
a6e5b5b35b Remove compilation warning
converting to non pointer type "int" from NULL (-Wconversion-null)
2024-01-13 21:08:41 +01:00
Albrecht Schlosser
92b48c3936 Fix yet another typo in documentation 2024-01-13 20:05:34 +01:00
Albrecht Schlosser
0f1a803eb8 Fix doxygen docs (typo, undocumented parameter) 2024-01-13 20:01:23 +01:00
Matthias Melcher
332a87aa43 #887: Fixes Fl_Shared_Image reference counting
- adds documentation to all calls
- changes implementation details on ::copy()
and copy(w,h)
2024-01-13 19:32:32 +01:00
ManoloFLTK
994b5824dc Wayland: fix processing of keypad keys - cont'd (#881) 2024-01-13 10:48:52 +01:00
ManoloFLTK
421e917f03 Comment out debug statement 2024-01-11 17:21:49 +01:00
Greg Ercolano
c9534460f7 Solves issue #882. 2024-01-11 08:20:16 -08:00
Greg Ercolano
d9125d76cb Solves issue #884: single quote zenity/kdialog 2024-01-11 07:50:09 -08:00
Matthias Melcher
a237743c8b #885: Fixes keyboard text selection in Fl_Text_Editor 2024-01-11 16:20:55 +01:00
Greg Ercolano
dc70a04100 Add Fl_String not-equal test 2024-01-10 21:32:02 -08:00
Greg Ercolano
08e64283aa Add textattrib() get method+docs
Requested by Jonathan Griffitts during rust bindings.
2024-01-10 09:10:07 -08:00
ManoloFLTK
2db1929985 Wayland: fix processing of keypad keys - tidying (#881) 2024-01-07 10:14:40 +01:00
Albrecht Schlosser
b4697c33ff Remove Fl_Simple_Terminal (replaced by Fl_Terminal)
... as discussed previously.
2024-01-06 18:29:25 +01:00
Albrecht Schlosser
37eefe5548 Wld: Add missing keypad key to keypad translation table (#881)
Keypad key 'Del' aka '.' (or ',') was missing in the key translation
table for Fl::e_original_keysym.

Also: add DEBUG_KEYBOARD macro to enable/disable keyboard debugging
code easier.
2024-01-06 17:56:04 +01:00
ManoloFLTK
516f9e7885 Fix "When zooming window, the window size range must be adjusted" (#880) 2024-01-06 14:52:57 +01:00
ManoloFLTK
e1cd6dec4a Wld: Fix e_original_keysym for keypad number keys + NumLock off (#881) 2024-01-06 12:38:24 +01:00
ManoloFLTK
a893cc3f5e Wayland: fix processing of '.' keypad key (#881) 2024-01-06 09:22:40 +01:00
ManoloFLTK
bc28433f2e Wayland: numeric keypad keys don't work as intended - cont'd (#881) 2024-01-05 19:34:46 +01:00
ManoloFLTK
944b5e7072 Wayland: numeric keypad keys don't work as intended (#881) 2024-01-05 19:05:36 +01:00
Albrecht Schlosser
3b1ea22d1d Remove unused variables [-Wunused-variable] 2024-01-04 15:29:07 +01:00
Matthias Melcher
71d3cdd337 Removes debugging printf. 2024-01-04 01:27:40 +01:00
Matthias Melcher
46c9cf2f10 #797: Improves Fl_Tile resize behaviour
- if a tile with a size range is resize smaller than the
minimum size of all children, the children will now no
longer shrink, and expanding will make them work
again as expected.
2024-01-04 01:26:40 +01:00
Matthias Melcher
a09c75e9bc Adds Fl_Input RMB menu translation to test/preferences
This also updates the RMB menu labels before every popup so
that changing the labels after creating the widgets still reflects
that change correctly.
2023-12-28 15:43:21 +01:00
ManoloFLTK
30f2ec8185 Fix for bug in Mutter Wayland compositor (#878) - cont'd
Add more tests to do additional operations under stricter conditions
2023-12-28 11:28:47 +01:00
ManoloFLTK
6143764885 Fix for bug in Mutter Wayland compositor (#878)
Mutter implements too strictly this rule expected from compositors about "frame callbacks" :
"A server should avoid signaling the frame callbacks if the surface is not visible in any way,
e.g. the surface is off-screen, or completely obscured by other opaque surfaces."
When a window is being interactively resized, it makes no sense to create a frame callback
for an entirely covered surface but then never signal the surface can be redrawn,
because this blocks the resize operation.

Neither KWin nor Weston have this problem.
2023-12-28 09:59:51 +01:00
ManoloFLTK
73bd4a53dd Fix position of 1-button Fl_Message windows 2023-12-27 12:15:25 +01:00
ManoloFLTK
bb5cb5b6d4 Wld: export only member functions for ./configure --enable-shared (#872) 2023-12-26 16:00:44 +01:00
Albrecht Schlosser
1d73c0195c Improve docs and add two new Fl_Menu_Item methods (#875)
This addresses some issues pointed out by GitHub Issue #875.

Documentation lacked details about Fl_Multi_Label assignment and
correct memory handling.

The new methods
 - Fl_Menu_Item::image_label(const Fl_Image *) and
 - Fl_Menu_Item::multi_label(const Fl_Multi_Label *)
provide a cleaner interface to assign images and Fl_Multi_Label's
to menu items.

examples/howto-menu-with-images.cxx: carify some issues, fix leak,
  and use new Fl_Menu_Item::multi_label(const Fl_Multi_Label *).
2023-12-23 20:08:18 +01:00
Albrecht Schlosser
016c36c917 Fix memory free() mismatch (#875)
This issue was revealed during testing for GitHub Issue #875.

"ERROR: AddressSanitizer: attempting free on address which was not
malloc()-ed", reported by examples/howto-menu-with-images.cxx if
the window object was released at the end of the program, causing
Fl_Menu_::clear() to be called.

The issue was caused by casting all supported label types to
'const char *' which are stored in Fl_Menu_Item::text and then trying
to free() all text strings in Fl_Menu_::clear() under certain
conditions.

Now images and Fl_Multi_Label's are no longer (tried to be) free'd.
2023-12-23 20:05:48 +01:00
ManoloFLTK
f59702e290 A more cross-platform way to fix issue #876 2023-12-22 09:16:48 +01:00
ManoloFLTK
fcf91e51c0 Fix "Fl_Plugin_Manager::loadAll doesn't work correct" (#876) 2023-12-21 17:12:13 +01:00
ManoloFLTK
e466fe20c8 Fix "Fl_Input popup menu customize doesn't work" (#874) 2023-12-21 15:23:38 +01:00
ManoloFLTK
42ff55026e Fix "commit 96bacd3 may crash on X11" (#873) 2023-12-21 14:22:08 +01:00
Albrecht Schlosser
76a2c95f07 Fix a typo, trailing whitespace, and dependencies 2023-12-21 14:03:04 +01:00
ManoloFLTK
3984639270 Restore "configure --enable-shared" under Linux (#872) 2023-12-20 23:42:45 +01:00
Albrecht Schlosser
5df5daf78e Make the 'Forms' compatibility library 'fltk_forms' optional
This library is no longer needed in FLTK itself. There is only one
demo program (test/forms.cxx) that uses it if it is built. The demo
program displays a message if fltk_forms is not available.

The default is 'enabled' for backwards compatibility but this may
be changed to 'disabled' in a future version.
2023-12-20 17:33:37 +01:00
ManoloFLTK
96bacd3f9d Procedure to instruct FLTK to use given X11 connexion (#149) 2023-12-19 15:48:26 +01:00
Greg Ercolano
1e6ac9c9bb Fix issue #871 for html causing crashes 2023-12-18 11:32:34 -08:00
ManoloFLTK
46b2f50750 Wayland: Menu items are accessible when mouse is over another win (#869) 2023-12-18 07:49:02 +01:00
Matthias Melcher
469d3ef3d5 #842: Enables command line color arguments on macOS 2023-12-16 21:59:43 +01:00
Greg Ercolano
c0d7fe9af9 Small doc clarification 2023-12-16 07:39:17 -08:00
Matthias Melcher
f7eb21d92e Fixes fl_message_position for widgets and subwindows
-  https://groups.google.com/d/msgid/fltkcoredev/902a753e-7430-4302-b384-c30c7d45e3bfn%40googlegroups.com.
2023-12-16 14:45:40 +01:00
Matthias Melcher
046bf23a5d Adds mouse wheel input to Fl_Counter 2023-12-16 14:22:22 +01:00
Matthias Melcher
ca028872e7 #868: Suppress warning about unused private members of Fl_Shortcut_Button 2023-12-16 14:07:08 +01:00
Albrecht Schlosser
411c3df1cb Fix memory leak in Fl_Terminal (#867) 2023-12-16 01:37:21 +01:00
Albrecht Schlosser
e951db4c49 Fix C++ comments in C file 2023-12-15 20:03:35 +01:00
MatthiasWM
fdf578d936 #840: Fixes fixed buffer size in Fl::args_to_utf8() (fl_call_main) 2023-12-15 12:56:06 +01:00
ManoloFLTK
673fa2e09c FLTK implementation of the "GTK Shell" Wayland protocol - cont'd
The loop over all libdecor-gtk decorations is now made using libdecor's
data structures, rather than using FLTK's mapped window list.
2023-12-14 07:55:31 +01:00
MatthiasWM
6ac3e8e230 #840: Fixes fixed buffer size in Fl::args_to_utf8() 2023-12-13 20:00:49 +01:00
Albrecht Schlosser
0c712e50bc Fix X11 '_NET_ACTIVE_WINDOW' message (STR 3396)
Send a valid timestamp rather than 0.

For details see STR 3396.
2023-12-13 19:07:30 +01:00
Matthias Melcher
41dd84016d #862: Removes default shortcut from Fl_Shortcut_Button
- the current UI for fallback/default/original shortcut was
confusing, so I remove it until we find something better. I
kept the values so we can reinstate a better interface without
changing the API.
2023-12-13 16:55:16 +01:00
ManoloFLTK
0936c2a55d FLTK implementation of the "GTK Shell" Wayland protocol - cont'd
The pointer_enter() function now checks that its non-FLTK wl_surface  argument
is the wl_surface of the titlebar of a GTK-decorated window.
2023-12-13 14:48:08 +01:00
Greg Ercolano
eedc5bdc0e Allow walk while selection is being made 2023-12-13 02:52:03 -08:00
ManoloFLTK
9738e52511 macOS platform + GLUT: fix crash with glut_test - cont'd 2023-12-13 10:41:15 +01:00
ManoloFLTK
36d34983bb Wayland+GLUT: fix crash in glut_test application - cont'd 2023-12-13 10:17:22 +01:00
Greg Ercolano
817966f215 Address hang in issue #866 2023-12-12 13:47:55 -08:00
Matthias Melcher
c10183379f #188: Fixes Fl_Shared_Image ref count and find op
- ported froward from 1.3.9
- fixes ref count for original and other images
- fixes binary search issues
2023-12-12 22:44:49 +01:00
Matthias Melcher
32b10cb626 #863: Fixes Fl_tile resize behavior when scaling window 2023-12-12 22:07:39 +01:00
ManoloFLTK
04cf2c4c7d Wayland+GLUT: fix crash in glut_test application 2023-12-12 21:17:42 +01:00
ManoloFLTK
a20bace4e1 macOS platform + GLUT: fix crash with glut_test app 2023-12-12 19:46:38 +01:00
Kyriet
5e3681c22a Documentation: Improve doc comment for ~Fl_Group 2023-12-10 22:04:08 +01:00
ManoloFLTK
861bc339c0 Replace wl_output_destroy() by wl_output_release() when possible 2023-12-10 12:48:06 +01:00
Albrecht Schlosser
094ee9e953 Documentation: remove obsolete deprecation warning
This warning was only useful when we used Fl_String in our public
interface which is no longer true.
2023-12-09 19:45:42 +01:00
Matthias Melcher
81a9cb74c3 #862: Fixes Fl_Shortut to swallow all FL_SHORCUT events if hot. 2023-12-08 15:09:42 +01:00
ManoloFLTK
d963dde3ef Document Fl_Image_Surface::mask() with commented code example 2023-12-07 15:01:23 +01:00
Greg Ercolano
2571f20111 Solve issue 856: manolo's parameter names 2023-12-06 12:14:45 -08:00
ManoloFLTK
18ccbb4a4f Wayland: much lighter but partial implementation of the "GTK Shell" protocol
Only the middle-button click gesture is implemented which avoids interference
with what libdecor does with right-click and double-click.
2023-12-05 22:53:26 +01:00
Matthias Melcher
7a69c22bd7 #856: FLUID: improved Declaration dialog
Also makes enum comment in Fl_File_Chooser.fl manageable.
Not backward compatible: don't try to recreate the
File Chooser with older FLUID versions.
2023-12-05 17:54:13 +01:00
ManoloFLTK
538ad1828f Wayland+CMake: use set_source_files_properties() for libdecor - cont'd 2023-12-05 16:09:36 +01:00
ManoloFLTK
7bbfa06e38 Wayland+CMake: use set_source_files_properties() for libdecor 2023-12-05 08:52:21 +01:00
Greg Ercolano
c3849b0a97 Fix issue 854 - append_ansi() len fix 2023-12-04 09:30:54 -08:00
Albrecht Schlosser
a73a14347d Fix compiler warnings
fluid/code.cxx: unused variable

src/drivers/Xlib/Fl_Xlib_Graphics_Driver_font_x.cxx:
  function may return address of local variable [-Wreturn-local-addr]
2023-12-04 16:50:23 +01:00
ManoloFLTK
3e61ec7044 New member function Fl_Image_Surface::mask(Fl_RGB_Image*) 2023-12-04 12:34:44 +01:00
Greg Ercolano
b9ac6bd728 Solves issue #856: improve Fl_File_Chooser enum docs 2023-12-03 18:10:33 -08:00
Albrecht Schlosser
9950c8e082 Improve contrast of check marks and radio buttons (#443)
- add fl_draw_radio(...) to standardize radio button drawing
- src/Fl_Light_Button.cxx: use fl_contrast() to determine color of
  radio button and check (light) button check marks, and use
  new fl_draw_radio() method
- src/Fl_Menu.cxx: same as src/Fl_Light_Button.cxx and use
  fl_draw_check() instead of "manually" drawing the check mark
  (forgotten in an earlier update)
2023-12-02 19:34:29 +01:00
ManoloFLTK
f72748bb45 Wayland: make OPTION_USE_SYSTEM_LIBDECOR ON by default
This commit makes the default FLTK build setting use libdecor
as packaged in Linux when the build system contains packages
libdecor-0-dev and libdecor-0-plugin-1-gtk in version ≥ 0.2.0.
Otherwise, FLTK uses the bundled version of libdecor.
This includes situations where package libdecor-0-dev is
present in an earlier version.
2023-12-02 09:28:08 +01:00
Matthias Melcher
96730f80cb Adds some possible NULL references and small fixes 2023-12-01 16:53:27 +01:00
Matthias Melcher
1077d74958 Fixes name conflict in X11 GL swap_interval 2023-12-01 02:33:38 +01:00
ManoloFLTK
7472e41ccc Wayland: use GTK Shell also with system libdecor 2023-11-30 19:36:06 +01:00
Matthias Melcher
a69fc0c9e5 Fixes anonymous union intialisation for C++98 2023-11-30 15:55:37 +01:00
Greg Ercolano
38aff7d9b4 solve issue 853: make scrollbar public 2023-11-29 08:29:24 -08:00
Albrecht Schlosser
727bd94560 Add commandline conversion for Windows (no-op on other platforms)
- add Fl::args_to_utf8() to convert commandline arguments to UTF-8

This new function closes the gap that previously only Visual Studio
applications converted their commandlines to UTF-8.

Tested with MinGW, MSYS2/MinGW-w64, and Visual Studio (2019).
2023-11-29 16:29:54 +01:00
Matthias Melcher
49af3d88e3 Adds OpenGL swap interval documentation. 2023-11-29 14:02:50 +01:00
MatthiasWM
06e2bd7f0e Merge branch 'master' of https://github.com/fltk/fltk 2023-11-29 13:16:35 +01:00
MatthiasWM
75c879e2ff Implements swap_interval for MSWindows. 2023-11-29 13:16:24 +01:00
Matthias Melcher
82e838f1fd Adds OpenGL swap_interval for Wayland and X11. 2023-11-28 16:35:39 +01:00
ManoloFLTK
59bdb45566 Rearrange PostScript graphics driver code redundant with Cairo driver 2023-11-28 15:05:58 +01:00
ManoloFLTK
12af9dad3e Remove PostScript graphics driver code redundant with Cairo driver 2023-11-28 09:06:17 +01:00
Albrecht Schlosser
57371365d8 Fix compiler warning, dependencies, and trailing whitespace
The benign warning was:
  ‘Fl_Browser_::hscrollbar’ will be initialized after [-Wreorder]
  ‘int Fl_Browser_::linespacing_’ ...
2023-11-27 15:33:53 +01:00
ManoloFLTK
6ea31316fb Cairo graphics driver: Improve drawing of Fl_Pixmap and Fl_Bitmap 2023-11-27 12:15:21 +01:00
ManoloFLTK
f6d2ba651b Cairo graphics driver: Improve drawing of Fl_Pixmap and Fl_Bitmap 2023-11-27 10:02:59 +01:00
Matthias Melcher
f3348e8120 Adds GL swap control for X11 2023-11-26 21:44:00 +01:00
Matthias Melcher
6817e821af STR 1373: adds vsync control to OpenGL contexts on macOS
Windows and X11 to follow, no idea about Wayland.
2023-11-26 12:37:59 +01:00
Matthias Melcher
102437f1ee Restores mouse pointer before popping up cut/copy/paste menu
on Fl_Input and Fl_Text_Display
Also adds &ndash; to Help View
2023-11-26 12:00:09 +01:00
Matthias Melcher
39a3212fc3 Adds pulldown menu to Fl_Text_Display and ..._Editor 2023-11-25 22:52:00 +01:00
Matthias Melcher
c097f63ff8 Cleans up Fl_Input right mouse button menu 2023-11-25 22:08:05 +01:00
Matthias Melcher
7bef4ebf78 STR 749: Adds cut/copy/paste popup menu to Fl_Input 2023-11-25 21:42:27 +01:00
Albrecht Schlosser
09242ee16d Fix and improve fl_call_main.c
- add missing NULL pointer at end of argv
- fix #if condition for compilation

Todo: another update will follow soon, using a standardized FLTK
interface for argument conversion to UTF-8 for non-MSVC builds.
2023-11-25 21:17:27 +01:00
Matthias Melcher
34ed30fe1a Adds linespacing() to Fl_Browser_ and all derived widgets 2023-11-25 18:20:08 +01:00
Greg Ercolano
0080850092 Fl_Terminal better name for flags -> charflags 2023-11-25 06:56:38 -08:00
ManoloFLTK
4f894e4745 Cairo graphics driver: Improve drawing of Fl_Pixmap and Fl_Bitmap
Previously, these objects were drawn slightly blurred on HighDPI.
This commit has them resized to the pixel size of the area where
they are being drawn and then drawn.
2023-11-25 12:09:54 +01:00
Matthias Melcher
0beab855a0 Stabilizes Fl_Tile size_range mode.
- improved documentation
- new tile resize strategy
- robust against zero sized children
2023-11-23 17:19:20 +01:00
Matthias Melcher
b6be421a1f Added safety when calling Text_Display methods
- before assigning a buffer (Github #845)
- also fixed a warning form unused arg in Fl_Terminal
2023-11-23 15:16:34 +01:00
Matthias Melcher
de2dd0cddf Adds zero size check in Fl_Tile::on_move 2023-11-23 00:03:35 +01:00
Matthias Melcher
f8d915cfe6 Fixes warning in Fl_Tile by Doxygen 2023-11-22 22:17:35 +01:00
Matthias Melcher
c961f84086 Fixes warning and errors. 2023-11-22 14:51:59 +01:00
Matthias Melcher
81e26b9089 Adding size range settings to Fl_Tile, initial commit.
- some documentation missing
- Fl_Tile::resize() not satisfying yet
- minimums work, maximums currently ignored
- 0 size children may make program hang
2023-11-22 14:45:13 +01:00
Greg Ercolano
9383f172a8 Fl_Terminal docs: Added some tables 2023-11-21 14:41:15 -08:00
Greg Ercolano
c568056244 Added output_translate(): controls lf -> crlf translation 2023-11-21 11:24:27 -08:00
Greg Ercolano
11e6fb5911 Fl::check() docs fix: example indented 2023-11-20 13:36:55 -08:00
Greg Ercolano
7c95aa7c79 Change Fl_Terminal default color() 0x0 -> FL_BLACK 2023-11-20 13:33:08 -08:00
Greg Ercolano
6252131017 Solve issue 837, doc some protected methods. 2023-11-20 09:26:40 -08:00
ManoloFLTK
eb9dd202b2 Fix Fl_Wayland_Image_Surface_Driver c'tor 2023-11-20 10:56:36 +01:00
Greg Ercolano
bc8b186398 Doc all pub/prot members, remove unused, add todo
- Made sure all public+protected members are documented.

- Reclassified some private -> protected:
   > vscroll_width()

- Removed signatures for unimplemented (non-existant) methods:
   > u8c_cursor(void)
   > history_use(int,bool)
   > cursor_h()

- Reclassified some protected -> private:
   > x_to_glob_col()
   > xy_to_glob_rowcol()
   > is_hist_ring_row()
   > is_disp_ring_row()
   > handle_ctrl()
   > is_printable()
   > is_ctrl()
   ..etc..
   > handle_selection_autoscroll()
   > handle_selection()
   > is_redraw_style

- Add todo for ESC 7 and ESC 8
- Small code formatting mods
- Small typos
2023-11-19 22:46:04 -08:00
Albrecht Schlosser
7e8994c4a2 Windows/MSVC: Fix wide char commandline handling (#840)
Windows programs (subsystem:windows, not Windows console programs)
compiled with Visual Studio need a WinMain entry point. The commandline
arguments handled by this function are now properly converted to UTF-8
before the standard main() entry point is called.

This applies only to Visual Studio! Note that some build systems like
MinGW and/or MSYS2 may still have issues with some Unicode (non-ASCII)
commandline arguments.
2023-11-19 19:08:53 +01:00
Albrecht Schlosser
44bb080c0f Remove friend declaration from Fl_Window.H (see STR 3354)
Although this was not strictly necessary I decided to implement the
proposed patch, but in a slightly different way.

This adds a static public method for internal use only but it wouldn't
do any harm if a user called it.
2023-11-17 16:55:37 +01:00
Greg Ercolano
38fc08c15f Added clear(), some methods protected->public
New public methods:

    void clear(void);
    void clear(Fl_Color val);

old protected methods made public:

    void clear_screen(bool scroll_to_hist=true);      // ESC [ 2 J
    void clear_screen_home(bool scroll_to_hist=true); // ESC [ H ESC [ 2 J
    void cursor_home(void);                           // ESC [ 0 H

test/terminal modified to test these, and added separate tests
for both the API and ANSI code ways to do these ops.
2023-11-16 15:45:29 -08:00
Matthias Melcher
d1d38090fb Fixes return type of Fl_Input_::dvalue() 2023-11-15 22:45:20 +01:00
Albrecht Schlosser
6f021d4830 CMake: Raise cmake_minimum_required from 3.12 to 3.15
Remove code that checks CMake versions lower than 3.15
2023-11-15 21:30:12 +01:00
Albrecht Schlosser
45fd145370 Remove mention of Fl_Simple_Terminal 2023-11-15 14:11:25 +01:00
ManoloFLTK
dd1c2fc843 Wayland: fix moving top-level window around with mouse 2023-11-15 11:48:45 +01:00
Greg Ercolano
605328e045 Added textcolor() and color(), doc fixes.
textcolor() needed for consistency, color() behavior documented.

Both added to the test/terminal app.

Elaborated on the special background "see through" color value + behavior,
tested with color() in test/terminal app.
2023-11-14 12:23:23 -08:00
Albrecht Schlosser
4b315d190c Fix dependencies and whitespace issues 2023-11-14 18:14:48 +01:00
erco77
6842a43a31
Fl_Terminal widget (#800)
Pull Fl_Terminal widget from Greg's fork
2023-11-14 07:01:52 -08:00
ManoloFLTK
888dc5f5c5 Have libdecor-gtk implement the "GTK Shell" protocol 2023-11-12 19:13:35 +01:00
ManoloFLTK
768dcf2c11 Fix: Potential NULL pointer dereference in Fl_Image_Surface c'tor (#834) 2023-11-12 08:56:51 +01:00
ManoloFLTK
ce9ba4ba08 Remove unseless code in Fl_Wayland_Screen_Driver.cxx 2023-11-12 08:40:37 +01:00
ManoloFLTK
ff134f0081 Wayland: make fl_close_display() free more resources 2023-11-09 07:58:08 +01:00
ManoloFLTK
5989caf070 Wayland: fix crash in editor after return from switching user 2023-11-08 10:25:08 +01:00
ManoloFLTK
93b26e4d3b Let Wayland FLTK client apps survive switching user 2023-11-08 09:18:30 +01:00
Matthias Melcher
214b133298 Fixes initial calculation of line number in Fl_Text_Display (#830) 2023-11-07 15:09:08 +01:00
Matthias Melcher
90d7737254 Fix buttons overlapping icon in message box (#826) 2023-11-07 14:28:22 +01:00
Matthias Melcher
d7768b76d0 FLUID: Adds template for tutorial.
Tutorial still to be written.
Also adds convenience methods to Fl_Input_
for getting and setting numeric values.
2023-11-07 14:28:22 +01:00
ManoloFLTK
8b31954d66 "hitting esc to close fltk app blows out the window manager" (#821) 2023-11-07 11:32:12 +01:00
ManoloFLTK
acc96cdf56 CHANGES.txt: add Fl_Grid, Fl_Window::maximize()
Also, remove stray virtual keyword.
2023-11-06 07:44:55 +01:00
ManoloFLTK
6a607c8282 maximize method for Fl_Window (macOS) (#820) - cont'd 2023-11-06 00:05:18 +01:00
Matthias Melcher
f3b490134e Fixes text input widget undo propagation.
If not handled, undo propagates to other random widgets,
and if none takes it, it is resent as a redo to all widgets.
2023-11-05 22:19:03 +01:00
ManoloFLTK
0ae927a00e Add Fl_Window::maximize() and Fl_Window::un_maximize() 2023-11-05 19:42:55 +01:00
ManoloFLTK
d4d72cfdaf Related to "FLTK doesn't work normal on platform of rockchip" (#817) 2023-11-03 22:10:01 +01:00
ManoloFLTK
eb3afb2033 Wayland copy: destroy data_source object before creating new one 2023-11-03 15:16:36 +01:00
ManoloFLTK
a3f4c62826 Wayland copy: destroy data_source object before creating new one 2023-11-03 13:12:32 +01:00
ManoloFLTK
c0c0ea18aa Fix "fltk 1.4.x: hangs during paste in fluid code editor" (#818) 2023-11-03 12:50:18 +01:00
ManoloFLTK
040607b595 Minor change in Fl_Wayland_Graphics_Driver::copy_offscreen() 2023-11-02 09:08:16 +01:00
ManoloFLTK
914ee02c5f Fix typos in documentation 2023-11-01 12:26:54 +01:00
Albrecht Schlosser
c47fd75bcd Fix typos 2023-10-31 18:22:42 +01:00
ManoloFLTK
9a00f07c4f Move the Fl_String class to the DriverDeveloper Doxygen group 2023-10-31 18:01:53 +01:00
ManoloFLTK
8b603b9f1b Move private classes to the DriverDeveloper Doxygen group
Classes moved are
-Fl_Int_Vector
-Fl_Kdialog_Native_File_Chooser_Driver
-Fl_Zenity_Native_File_Chooser_Driver
2023-10-31 17:51:32 +01:00
ManoloFLTK
0e41ca820d Remove 81615bb causing GL window to blink when resizing on macOS (#813) 2023-10-31 16:52:59 +01:00
ManoloFLTK
99826a5fba Minor simplification in Fl_X11_Window_Driver::flush_double(int) 2023-10-30 18:27:12 +01:00
Matthias Melcher
aab6afd32c FLUID: Documentation and typos. 2023-10-27 16:09:06 +02:00
ManoloFLTK
06d12892f9 Fix "Wayland: Overlay windows look blurred" - cont'd (#808) 2023-10-25 15:20:34 +02:00
ManoloFLTK
35d8504263 Fix "Wayland: Overlay windows look blurred" - cont'd (#808) 2023-10-25 13:02:34 +02:00
ManoloFLTK
a5e8fbcca0 Fix "Wayland: Overlay windows look blurred" (#808) 2023-10-24 23:09:09 +02:00
ManoloFLTK
0636c0b3e6 Wayland: implement scale factor windows as popups - cont'd 2023-10-24 19:25:59 +02:00
Albrecht Schlosser
e391dc1bf9 Fix Fl_Flex::resize() and layout() (#811)
Remove "too optimistic optimization" in resize(). Resize must always
call layout() to recalculate widget positions.
2023-10-24 18:13:11 +02:00
Albrecht Schlosser
5a8a28cbb5 Remove test/debug statements from Fl_Table.cxx 2023-10-24 12:51:40 +02:00
ManoloFLTK
3868ea90bd Wayland: implement scale factor windows as popups - cont'd 2023-10-24 09:43:23 +02:00
Matthias Melcher
b9758f564f FLUID: Fixes two minor bugs
* Fl_Grid mixed up gap_ro_ vs. gap_col_ once
* Code formatting warning
2023-10-23 18:28:52 +02:00
ManoloFLTK
e0aae4401a Use #ifdef FLTK_USE_SVG instead of #if FLTK_USE_SVG 2023-10-23 16:40:48 +02:00
ManoloFLTK
3307a1281f Prepare Fl_Wayland_Screen_driver.cxx for removal of Fl_Int_Vector 2023-10-23 16:21:16 +02:00
ManoloFLTK
fa1f00cc46 Wayland: simpler implementation of transient scale factor windows 2023-10-23 15:00:34 +02:00
ManoloFLTK
234c153853 Avoid macOS 14 warning message when app is launched from command line 2023-10-23 12:13:29 +02:00
ManoloFLTK
39a157a7dd Wayland: implement transient scale factor windows as popups
as discussed in issue #794.
Also, fix for macOS the use of the FL_FOCUS event for these transient windows
2023-10-23 11:15:04 +02:00
Matthias Melcher
17baeceb7a FLUID: Positioning grid cells intuitively.
User can now drag widgets from the toolbox into the grid
or use the context menu to add them into the corresponding
cell. If no position is indicated, now children are added at the
first free cell.
2023-10-23 01:36:55 +02:00
Albrecht Schlosser
1209e9dcd7 Make Fl_String and Fl_Int_Vector private (#789)
- add CMake option 'OPTION_USE_STD'
- add configure option '--enable-use_std'
- move FL/Fl_String.H to src/Fl_String.H
- move FL/Fl_Int_Vector.H to src/Fl_Int_Vector.H
- remove Fl_String from demo program examples/callbacks.cxx
- remove Fl_Int_Vector from public header FL/Fl_Table.H
- some methods of Fl_Table are no longer inline
- add CMake option OPTION_USE_STD to allow std::string in some
  selected functions and methods

Experimental, may be removed before release:

- use either Fl_Int_Vector or std::vector in Fl_Table depending
  on CMake OPTION_USE_STD or configure --enable-use_std

Move all fl_filename* functions that use Fl_String to fluid

Main changes in fluid:
 - add fluid_filename.h and .cxx
 - include "fluid_filename.h" rather than <FL/filename.H>

Update fl_input(), fl_password() and test/ask

- add maxchar parameter to fl_input() and fl_password()
- fl_input_str() and fl_password_str() are optional and return
  std::string if enabled (FLTK_USE_STD)
2023-10-22 19:35:17 +02:00
Matthias Melcher
12c88f6506 FLUID: removes duplicate code 2023-10-22 01:57:08 +02:00
Matthias Melcher
b4fd7037ac FLUID: more Fl_Grid settings 2023-10-22 01:51:53 +02:00
Albrecht Schlosser
d102e466d6 Remove duplicated code that was commented out, fix includes
... and prevent confusing doxygen
2023-10-21 21:39:36 +02:00