Commit Graph

794 Commits

Author SHA1 Message Date
ManoloFLTK
7d58e23854 macOS: add necessary setWantsBestResolutionOpenGLSurface:YES message. 2022-09-28 08:23:36 +02:00
ManoloFLTK
59fc60ea4c Simpler code to support FLTK widgets in macOS OpenGL 3 windows.
Also, the application-level code to add widgets to a GL3 window becomes
platform-independent.
2022-09-27 14:12:39 +02:00
ManoloFLTK
53d9614adb Fix crash under macOS 13 Ventura public beta 6 when closing menu window.
Bizarrely, an NSMouseEntered event arrives returning nil to [event window]!
2022-09-26 10:46:50 +02:00
ManoloFLTK
bfba62a8a2 GL3 for macOS platform: allow creation of GL1 and GL3 contexts by an app. 2022-09-23 18:21:29 +02:00
ManoloFLTK
8bbedd65a8 Fix issue #501: build error under macOS 10.10 2022-09-22 20:12:40 +02:00
ManoloFLTK
699cca8ff4 Make Fl::set_color(r,g,b,a) effective under Wayland and macOS. 2022-09-15 15:01:12 +02:00
ManoloFLTK
87ee126e1f Allow use of Fl_Window::default_icon() with a scaled image. 2022-09-12 11:07:03 +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
ManoloFLTK
c720aae515 Make hybrid Wayland/X11 platform. 2022-08-29 12:15:32 +02:00
ManoloFLTK
c2185f31b9 Remove unused code controlled by the FLTK_CONSOLIDATE_MOTION preprocessor variable. 2022-06-27 14:55:40 +02:00
ManoloFLTK
617dc2ce12 Fix for issue #450: Fl_Counter slips into infinite loop.
This issue revealed that the macOS and Wayland platform processed events slightly differently
from other platforms.
Under X11 and Windows, Fl::wait() processes one event if one is present, and also all other events
present in the event queue immediately after the processing of that event.
Under macOS and Wayland, Fl::wait() processes one event if one is present and returns.

This commits makes the macOS and Wayland platforms behave as other platforms.
2022-06-23 19:12:35 +02:00
ManoloFLTK
e02ee7d5f1 Add check against null pointer occurrence reported with Gmsh (Issue #434). 2022-05-05 10:21:50 +02:00
ManoloFLTK
a8da590d11 Fix for issue #434 : Segfaults on macOS. 2022-04-29 09:38:27 +02:00
ManoloFLTK
0d59e32b84 Fix for issue #426 - cont'd. 2022-04-10 15:09:25 +02:00
ManoloFLTK
223bf6309b Fix for issue #426: "configure --enable-cairoext" flips display upside down 2022-04-08 16:22:22 +02:00
Albrecht Schlosser
9a7af11108 Silence compiler warnings [-Wunused-but-set-variable] 2022-04-03 22:30:59 +02:00
ManoloFLTK
a9412b41bb Issue #359 RFE: access the MacOS windowid . 2022-03-21 11:41:51 +01:00
ManoloFLTK
bc606cce57 Simpler updateTrackingAreas method of class FLView is enough. 2022-03-20 14:06:30 +01:00
ManoloFLTK
f5628aa66d Fix issue #413: Commit 29d9e31 creates memory handling problem under macOS. 2022-03-20 08:09:34 +01:00
ManoloFLTK
5884d37ee8 Restore default YES value for FLWindow releasedWhenClosed property. 2022-03-19 08:42:09 +01:00
ManoloFLTK
aa955812f9 Fix for issue #411: send FL_ENTER / FL_LEAVE events to Fl_Window objects. 2022-03-18 14:26:44 +01:00
Albrecht Schlosser
091712bea8 Fix default size_range() calculation (issue #392, STR 3352) 2022-03-01 13:45:51 +01:00
ManoloFLTK
01db172010 Fix for issue #373 apparent with macOS platform and SDK ≤ 10.13
Many thanks to @CendioOssman for finding the cure.
2022-02-08 07:16:37 +01:00
Albrecht Schlosser
e73f9d466d Rearrange "Print Button Window" functions
- Rename Fl_Screen_Driver::print_or_copy_window() to
    fl_print_or_copy_window()
- Add header file src/print_button.h
- Update dependencies
2022-02-03 21:57:47 +01:00
ManoloFLTK
2e6e0b9c36 Reorganize classes Fl_System_Driver and Fl_Screen_Driver
These virtual members are moved from Fl_Screen_Driver to Fl_System_Driver
- wait(double)
- ready()

These virtual members are moved from Fl_System_Driver to Fl_Screen_Driver
- copy(const char *stuff, int len, int clipboard, const char *type)
- void paste(Fl_Widget &widget, int clipboard, const char *type)
- clipboard_contains(const char *type)
- clipboard_notify_change()

These members are moved from Fl_X11_Screen_Driver to Fl_X11_System_Driver
- poll_or_select_with_delay(double time_to_wait)
- poll_or_select()
and are made virtual in preparation for the introduction of class
Fl_Unix_System_Driver.
2022-02-03 07:03:44 +01:00
ManoloFLTK
d9451a8669 Add platform-independent Fl_Screen_Driver::print_or_copy_window().
This member function is available for all platforms to print or copy the front window
with or without its titlebar.
2022-02-02 14:55:48 +01:00
ManoloFLTK
895ac51c69 macOS: add "Toggle printing of titlebar" to application menu - cont'd. 2022-02-02 11:19:09 +01:00
ManoloFLTK
935074ba0b macOS: add "Toggle printing of titlebar" to application menu. 2022-02-02 11:05:53 +01:00
Albrecht Schlosser
29d9e31c51
Consolidate timeout handling across platforms (#379)
Add Fl_Timeout class

Move platform independent code of Fl::wait() to main part

- basic timeout handling
- Fl::run_checks()
- Fl::run_idle()
- Fl::idle()
- waiting time calculation (next timeout)
- remove platform dependent "screen driver" stuff
2022-01-31 22:27:17 +01:00
Matthias Melcher
09eff7243a
Fixing and upgrading Fl_Preferences (#374)
* Added filename function to Fl_Preferences

Static function to get filename before opening.
Member to get filename after opening.
Bug fixes for memory mapped preferences.

* ERROR is a macro on Windows, don't use it

* Added Fl_Preferences::dirty().

User can now check if the database will be written
when flushed or destroyed.
Flush returns a crude error code.

* Fl_Preferences::get binary data returns # of bytes read.

* Verified group deletion code

* Fl_Preferences ignores locale.

This will make .prefs files interchangeable
between different computers.

* Updating the Preferences Mode to ignore locale.

* Fixes in docs.
2022-01-19 16:08:29 +01:00
Albrecht Schlosser
92e9181a0a Rename FL/fl_string.h to FL/fl_string_functions.h
This is part 1 of the final fix for a previous name clash on case
insensitive file systems (fl_string.h vs. Fl_String.H).
2022-01-16 19:47:16 +01:00
ManoloFLTK
5bab46940c Re-organize cross-platform support for text input methods.
FLTK 1.3 supports complex text input methods (TIMs) for the 3 platforms
(X11, Windows, macOS). This support has an interface with FLTK that is
common for X11 and Windows, via (undocumented) functions fl_set_spot(),
fl_set_status() and fl_reset_spot().
In contrast, and because it's been developed independently, the
interface between the macOS TIM and FLTK 1.3 is completely different :
static functions FL::insertion_point_location() and Fl::reset_marked_text().

The present change implements a single TIM/FLTK interface
used by all platforms based on functions fl_set_spot() and
fl_reset_spot().

The previous macOS-specific functions FL::insertion_point_location() and
Fl::reset_marked_text() are maintained only for compatibility with 1.3
and deprecated.
2022-01-07 16:34:54 +01:00
ManoloFLTK
27c175dad8 Add virtual void Fl_Graphics_Driver::set_status() and implement for X11 platform. 2022-01-07 07:50:36 +01:00
ManoloFLTK
eeb3e92eb2 Fix fullscreen window level corner cases on macOS - cont'd
See long discussion in PR#277 at
https://github.com/fltk/fltk/pull/277
2021-12-29 17:18:47 +01:00
Albrecht Schlosser
5438954d8c Generate FL/fl_config.h rather than FL/abi-version.h
... as discussed in fltk.coredev in thread "RFC: introduce public
config header <FL/fl_config.h>", see:
https://groups.google.com/g/fltkcoredev/c/xLCs1AIXMVo/m/MHZpQggzAQAJ

- Rename abi-version.h to fl_config.h, rename input files,
  update dependencies, .gitignore, CMake, configure and Makefiles.

- Include Cairo options in FL/fl_config.h

- Rename FLTK_USE_CAIRO to FLTK_HAVE_CAIROEXT for consistency.

- Include <FL/fl_config.h> in config.h and wherever necessary,
  fix include order (move FL/Fl.H to the top) and more.

- Move USE_X11 to fl_config.h and rename to FLTK_USE_X11

- Do not include <config.h> in Cairo demo program which is no
  longer required in Cairo programs since FLTK 1.4.0
2021-12-18 22:44:08 +01:00
ManoloFLTK
93a55f64c3 macOS platform: fix for issue #325 Disabling IM disables Greek and Cyrillic layouts
Thanks to Pierre Ossman who gave the fix.
2021-12-17 16:00:57 +01:00
ManoloFLTK
939d536b66 Fix for fltk.coredev "reentrant calls with Fl_Window::resize" - cont'd 2021-12-07 10:54:41 +01:00
ManoloFLTK
8bf62c67cf macOS platform: compute the screen number where a top window is mapped. 2021-12-06 10:18:29 +01:00
Greg Ercolano
74dd5164d3 Fixes STR #3352: "tiny window problem if child group larger than window" 2021-12-05 12:26:25 -08:00
ManoloFLTK
7e484c614c Fix for [fltk.coredev] reentrant calls with Fl_Window::resize 2021-11-24 10:35:18 +01:00
ManoloFLTK
76a3ded549 Fix for issue #279 about detecting early retina with GL windows. 2021-11-05 15:21:56 +01:00
Albrecht Schlosser
0ad192a27b Make "FLTK_CONSOLIDATE_MOTION" user-definable (issue #76)
This undocumented macro is used on X11 and macOS platforms to
consolidate mouse move events, i.e. to collect some events and send
them later as one event. The old macro name CONSOLIDATE_MOTION has been
renamed to FLTK_CONSOLIDATE_MOTION since it is now a "global" symbol.

Users can define FLTK_CONSOLIDATE_MOTION in their build system, e.g.
on the compiler commandline, as 0 or 1 to disable or enable this
feature, respectively.

In FLTK 1.3 the default was 0 (OFF) on macOS and 1 (ON) on X11.
In FLTK 1.4 the default is always 0 (OFF).
2021-11-05 12:46:21 +01:00
Albrecht Schlosser
14f842708d Fix indenting, whitespace errors and dependencies
(no code changes)
2021-10-27 20:52:08 +02:00
ManoloFLTK
d2c41924a6 macOS: "Fix fullscreen window level corner cases"
This corresponds to changes of PR#277 (Author: Samuel Mannehed)
2021-10-06 11:11:59 +02:00
ManoloFLTK
0f12e96d13 macOS platform: facilitate use when another toolkit handles the system menu. 2021-09-24 17:56:35 +02:00
ManoloFLTK
e4ce39559a macOS: account for deprecation of [NSBitmapImageRep initWithFocusedViewRect:] in macOS 10.14 2021-08-04 18:25:37 +02:00
ManoloFLTK
fa49d29ec8 macOS: fix paste of image for macOS 11.x
With macOS 11.x, the pasteboard image can be found with floating point pixel values.
This changes makes FLTK process adequately such image data.
2021-08-03 18:08:33 +02:00
ManoloFLTK
ded0253bb7 Fix © year. 2021-07-24 18:10:16 +02:00
ManoloFLTK
47ba6632b1 macOS: Avoid premature FL_RELEASE event at start of drag-n-drop operation.
This fixes this issue mentioned in fltk.general :
https://www.fltk.org/newsgroups.php?s40623+gfltk.general+v40638+T
2021-05-27 08:49:27 +02:00
ManoloFLTK
d93fc2bfa6 Use <config.h> when appropriate. 2021-02-16 11:08:59 +01:00