Commit Graph

6606 Commits

Author SHA1 Message Date
Matthias Melcher
10d9010ed9
Improved, yet compatible, widget callback system using macros (#729)
* adds FL/fl_callback.macros.H
* adds FL_FUNCTION_CALLBACK_n(widget, function, [type, data])
* adds FL_METHOD_CALLBACK_n(widget, class, instance, method, [type, data])
* adds FL_INLINE_CALLBACK_n(widget, [type, name, data], callback_body)
* adds `examples/callback`
* full documentation
2023-08-15 11:36:58 +02:00
ManoloFLTK
e6440ca0a8 Wayland mouse wheel support: compositors can behave differently 2023-08-15 08:44:53 +02:00
Albrecht Schlosser
3c7610ec23 Handle shift + mousewheel event on Wayland (STR 3521)
Pressing the shift key while using the mousewheel changes
horizontal to vertical scrolling and vice versa. This allows users
with a standard mouse with only one scrollwheel to use it for both
scrolling directions.

This concludes "handling shift + mousewheel" for all supported platforms.
2023-08-14 16:57:33 +02:00
Albrecht Schlosser
847901623a Handle shift + mousewheel event on Windows (STR 3521)
Pressing the shift key while using the mousewheel changes
horizontal to vertical scrolling and vice versa. This allows users
with a standard mouse with only one scrollwheel to use it for both
scrolling directions.

Note: other mice that have either two buttons or a scroll ball can
generate both horizontal and vertical scrolling in one action. This
commit does not affect such behavior.

This patch is different than the one in file 'scroll.patch' (STR 3521).
It takes care of distinct mousewheel delta calculation for vertical
and horizontal mousewheels and avoids the "fallthrough" case.

Note: macOS takes care of this, there's no special handling required.

To do: the Wayland platform still needs to be updated.
2023-08-13 17:44:00 +02:00
Albrecht Schlosser
8c5c7aa7f4 Handle shift + mousewheel event on Linux (STR 3521)
Pressing the shift key while using the mousewheel changes
horizontal to vertical scrolling and vice versa. This allows users
with a standard mouse with only one scroll button to use it for both
scrolling directions.

Note: other mice that have either two buttons or a scroll ball can
generate both horizontal and vertical scrolling in one action. This
commit does not affect such behavior.

This patch has been provided by Manolo in file 'scroll.patch'
(see STR 3521).
2023-08-13 17:07:26 +02:00
Matthias Melcher
5e484524c8 Fl_Tabs now supports horizontal mouse wheel events. 2023-08-13 14:32:41 +02:00
Aditya Siram
17d0a4cc5f Fix access to Cairo context. 2023-08-12 23:18:09 +02:00
Albrecht Schlosser
76fb2d5b79 Reformat code, remove obsolete comments
No effective code changes, i.e. only formatting, indents and comments.
2023-08-10 15:40:45 +02:00
Albrecht Schlosser
dbb77b9657 Improve docs of Fl::hide_all_windows()
+ update fluid dependencies

No code changes.
2023-08-10 15:16:01 +02:00
ManoloFLTK
21fdd42838 macOS: add extra comment explaining need for PPC-specific source code 2023-08-09 21:15:20 +02:00
Sergey Fedorov
356ccc4b70 Fl_cocoa.mm: fix Apple macro for PPC case 2023-08-09 21:07:01 +02:00
ManoloFLTK
1943fe54c8 Wayland: fix fl_read_image() from offscreen buffer 2023-08-09 10:31:36 +02:00
ManoloFLTK
27c3d0b780 Wayland: improve layout of struct fl_wld_draw_buffer 2023-08-08 16:08:53 +02:00
ManoloFLTK
45d119eb3c Move repeated code to Fl_Wayland_Graphics_Driver::cairo_init() 2023-08-08 09:05:12 +02:00
ManoloFLTK
a98aaecf97 Fix for Broken "cube" demo (#762)
This commit fixes an error in the cube demo appearing specifically with the AMD Radeon GPU.
2023-08-07 19:16:38 +02:00
Albrecht Schlosser
5bcd6ca8f2 Revert "#733 partial: Adds rotation gesture event on MacOS"
This reverts commit 3049e6394a
as agreed upon in GitHub Issue #733.
2023-08-05 16:37:38 +02:00
Matthias Melcher
3049e6394a #733 partial: Adds rotation gesture event on MacOS 2023-08-05 12:19:42 +02:00
ManoloFLTK
2953db58c7 Let FLTK give more detailed description of a Wayland fatal error
Wayland protocol error messages now give the protocol name and the error code.
2023-08-05 12:09:13 +02:00
Albrecht Schlosser
157d27606f Fix typos in documentation of fl_overlay_rect() etc. (#735)
Thanks to Matt for the improved docs, I just fixed some typos and
added '()'s for better doxygen comments of functions.
2023-08-04 21:30:11 +02:00
Matthias Melcher
c5f5973c90 #735: better comments on fl_overlay_rect() 2023-08-04 19:30:27 +02:00
ManoloFLTK
c427f037ce Improve procedure to close decorated Wayland window
Libdecor complicates what should be simple, to close a decorated window,
because it uses the titlebar after return from the closing callback function.
Thus, FLTK delays the sending of the FL_CLOSE event to the window,
only when libdecor runs in CSD mode.
2023-08-04 19:14:13 +02:00
Matthias Melcher
ee4ab86c3c #211: adds optional parameter for Fl_Input_::drawtext()
Does not change the original API but adds a function and
keeps the original automatic.
2023-08-03 17:35:27 +02:00
ManoloFLTK
0bf6a4b044 Slightly improve Fl_Wayland_Screen_Driver::poll_or_select_with_delay() 2023-08-03 08:12:08 +02:00
Matthias Melcher
79d3b8d69d #762: saves all frequently used OpenGL attributes
When rendering the OpenGL layer, this prepares the FLTK rendering
parameters and restores them after FLTK rendering.
2023-08-02 20:24:46 +02:00
ManoloFLTK
e49f2008a6 Fix Fl_Wayland_Image_Surface_Driver::end_current() 2023-08-02 16:10:41 +02:00
ManoloFLTK
b440c26e65 Wayland: fix window closing with Sway's kill command or app menu 2023-08-02 10:04:45 +02:00
ManoloFLTK
e12eb99b5d Wayland: add test to avoid null pointer dereferencing 2023-07-31 19:26:37 +02:00
ManoloFLTK
7feddabd24 Implement Fl_Wayland_Screen_Driver::poll_or_select_with_delay(double) 2023-07-31 16:29:15 +02:00
ManoloFLTK
b1ab37eeff Wayland: simpler use of function eglChooseConfig() 2023-07-29 14:16:18 +02:00
Albrecht Schlosser
b9a89c92ea Fl_Shortcut_Button: Silence compiler warnings
Part 1: [-Wreorder] 'shortcut_value’ will be initialized after ...
Part 2: [-Wunused]  unused variable 'Y'
2023-07-28 17:42:59 +02:00
ManoloFLTK
d9fa2c6082 Wayland.dox: add info about the xdg decoration protocol
Also, use KWin to name the KDE desktop's Wayland compositor.
2023-07-28 15:27:38 +02:00
Matthias Melcher
f0375d6213 Adds default shortcut to Fl_Shortcut_Button. 2023-07-22 15:30:17 +02:00
ManoloFLTK
cdd617d094 Wayland: slightly improve procedure to close toplevel window 2023-07-21 15:34:24 +02:00
Albrecht Schlosser
4ec02555ef Fix missing (new) source file in fluid and dependencies
New file: Fl_Button_Type.cxx
2023-07-19 23:42:50 +02:00
Albrecht Schlosser
9ee8cdc727 Fix textcolor of transient scale display (#756)
Make background color and text (label) color of the transient scale
display consistent with tooltip colors.
2023-07-19 16:17:51 +02:00
ManoloFLTK
4dffa31520 Documentation: add detail about primary monitor 2023-07-15 08:41:57 +02:00
Albrecht Schlosser
1259275316 Keep sending FL_DRAG until all mouse buttons are released
The old version would send FL_MOVE events after dragging with more
than one mouse buttons pressed, as soon as the first button was
released.

The new version sends FL_DRAG until the last mouse button is released
and then FL_MOVE, as usual.

This change affects dragging only if more than one mouse button is
pushed and held while dragging. The order of pushing and releasing
mouse buttons does not affect the behavior.
2023-07-14 18:02:17 +02:00
ManoloFLTK
6f05af3c12 Wayland: add control of targeted screen by fullscreen windows 2023-07-13 18:19:01 +02:00
Albrecht Schlosser
580a531ef5 Clamp input values of Fl_Color_Chooser (#749)
Note: this may be somewhat confusing if the user enters out-of-range
values manually because they are overwritten immediately with valid
input but the effects seen in issue #749 are IMHO worse.
2023-07-13 14:34:25 +02:00
Albrecht Schlosser
44840af076 Wayland: keep mouse button state across push/release events
Notes:

(1) Fl::e_state holds the current state of all mouse buttons which is
    returned by Fl::event_buttons() - "plural form".

(2) Fl::e_keysym holds the "key" of the current event which can be a
    mouse button, returned by Fl::event_button() - "singular form".
2023-07-12 18:49:01 +02:00
Albrecht Schlosser
858c3cad86 Fix Wayland FL_RELEASE events reporting wrong button
... in Fl::event_button().

This can be seen when two buttons have been pressed simultaneously
and then released (see test/handle_events.cxx).
2023-07-12 18:05:07 +02:00
Matthias Melcher
9826b345ac corrects default popup menu box type for Fl_Choice (#748) 2023-07-12 13:18:48 +02:00
ManoloFLTK
c47cbf4402 More detailed documentation of Fl::screen_xywh() 2023-07-10 09:18:26 +02:00
Mohammed Alyousef
d939375a52 Update CMakeLists.txt 2023-07-09 08:11:42 +02:00
ManoloFLTK
3d03a5426b Improve documentation of Fl::screen_num(int x, int y) 2023-07-07 15:11:26 +02:00
Albrecht Schlosser
66bf6ea346 Clarify documentation of Fl_Window::size_range()
Document typical (recommended) usage and platform specific behavior.
2023-06-28 16:01:15 +02:00
ManoloFLTK
8bb29e823c Have Fl_Wayland_Window_Driver use Fl::add_check() when adequate 2023-06-28 08:47:21 +02:00
ManoloFLTK
f5879ae228 Slight simplification of Fl_Wayland_Gl_Window_Driver::swap_buffers()
Also, reorder members of class Fl_Wayland_Gl_Window_Driver
2023-06-27 09:05:46 +02:00
ManoloFLTK
81615bbe0b Fix Fl_Cocoa_Gl_Window_Driver::resize()
The additional [NSOpenGLContext flushBuffer] messages appear necessary when an Fl_Tile contains
2 or more GL subwindows.
2023-06-26 15:00:52 +02:00
ManoloFLTK
5196d66825 Wayland: improve mapping and hiding of GL (subs)windows 2023-06-24 09:23:01 +02:00