Commit Graph

794 Commits

Author SHA1 Message Date
ManoloFLTK
33eb87940d Fix a case when fl_read_window() did not capture subwindows correctly.
The case was under macOS with a non-GL parent window mapped to a retina display
containing a GL subwindow and if the app did not call Fl::use_high_res_GL(1).
2019-08-21 12:01:51 +02:00
ManoloFLTK
e16eea32be Avoid repetition of the same multiplication. 2019-08-19 09:34:42 +02:00
ManoloFLTK
8c39007b26 Improved implementation of layer-backed views under macOS ≥ 10.14
This new implementation does all screen drawing through the drawRect: method.
The benefit is that [[NSGraphicsContext currentContext] CGContext] provides
a system-built drawing context whose product ultimately appears on screen.
Feed-back from the fldigi FLTK application shows that this procedure is
measurably faster that the previous one when drawing a rapidly changing image.
2019-08-18 21:56:12 +02:00
ManoloFLTK
3c41e2d372 Correct guard for adequate version of macOS SDK 2019-07-06 09:22:06 +02:00
ManoloFLTK
71faa15432 Add support for macOS 10.15 "Catalina"
This is relatively to Catalina public beta for now.
2019-07-06 09:16:39 +02:00
ManoloFLTK
ef1c937606 Fix a bug appeared in macOS 10.15 Catalina Beta about GUI scaling transient window.
The bug is that the app freezes for a few seconds before the yellow transient window is closed
if the close message is set from within a timer callback.
If the window to close returns NO to the canBecomeKeyWindow message, the bug does not occur.
Anyway it's good that canBecomeKeyWindow returns NO for a window with the OUTPUT flag.
2019-07-03 15:21:31 +02:00
ManoloFLTK
aa9f0a6962 Move Fl_Cocoa_Window_Driver::capture_titlebar_and_borders() to Fl_Cocoa_Window_Driver.cxx from Fl_cocoa.mm 2019-06-12 10:02:11 +02:00
ManoloFLTK
5ab26a17b0 Better use of the did_view_resolution_change message sent to FLViewLayer 2019-06-03 21:09:03 +02:00
ManoloFLTK
da6d671d9b Support for fl_scroll() under macOS when GUI is scaled - cont'd
Handles support of non-layered windows
2019-05-22 10:56:19 +02:00
ManoloFLTK
9b80a38345 Support for fl_scroll() under macOS when GUI is scaled 2019-05-21 21:17:11 +02:00
ManoloFLTK
07f4fd4380 More accurate implementation of Fl_Cocoa_Window_Driver::decoration_sizes(). 2019-05-20 13:30:57 +02:00
ManoloFLTK
159572785d Remove small duplication of code 2019-05-20 13:16:31 +02:00
ManoloFLTK
30e05510fa Avoid small repetition 2019-05-18 17:40:18 +02:00
ManoloFLTK
99419b2f63 Have Fl_Cocoa_Window_Driver::flush() use the drawRect: method to draw to non-layered views 2019-05-17 15:23:55 +02:00
Manolo Gouy
88c2994e20 Restore use for GL windows under macOS 10.14.0 2019-05-15 21:55:10 +02:00
ManoloFLTK
fa5c2718da Remove class FLGLViewLayer and get simpler code. 2019-05-15 13:59:29 +02:00
ManoloFLTK
e236091a99 Fix GUI rescaling when one window is iconified (macOS) 2019-05-13 15:06:19 +02:00
ManoloFLTK
dd687e7fbc Fix GUI scaling in presence of un-show()'n subwindows (macOS) 2019-05-12 19:02:15 +02:00
ManoloFLTK
467e216681 Use more convenient API for function get_window_frame_sizes() 2019-05-09 10:22:31 +02:00
ManoloFLTK
32439ec259 Fix Fl_Cocoa_Window_Driver::capture_titlebar_and_borders() when GUI is scaled down 2019-05-08 16:27:53 +02:00
ManoloFLTK
12dedc26cd Adapt function fake_X_wm() to rescaled GUI. 2019-05-08 12:25:48 +02:00
ManoloFLTK
d88ef8f039 Avoid double window redraw after resize 2019-05-08 11:53:25 +02:00
ManoloFLTK
5a57c928a1 Remove unnecessary code 2019-05-07 12:45:44 +02:00
ManoloFLTK
c00f31ab10 Slightly simpler code for what is specific to macOS 10.14.0 2019-05-06 16:55:41 +02:00
ManoloFLTK
fea125eca9 Restore forcing the position of a window before it's shown 2019-05-06 16:50:42 +02:00
ManoloFLTK
38cf195727 Remove call to Fl_Group::init_sizes() because it's expected from the caller. 2019-05-04 13:25:28 +02:00
ManoloFLTK
ef355e2762 Fix control for subwindow leakage in presence of GUI scaling 2019-05-04 09:44:29 +02:00
ManoloFLTK
5fde73b9ea Reworked algorithm to support window moving across screens 2019-05-02 20:53:10 +02:00
ManoloFLTK
738cce154e macOS: further fix to window moving necessary for macOS 10.3
Running the tabs test app with all 6 subwindows shown under 10.3
and moving the window around had 3 subwindows drift away
from their correct position.
2019-04-28 18:34:24 +02:00
ManoloFLTK
172063b2ad macOS: yet simpler implementation of window resize and rescale. 2019-04-28 15:31:02 +02:00
ManoloFLTK
9ac73175be Use NSViewFrameDidChangeNotification instead of NSWindowDidResizeNotification
This allows to support the tabbing/untabbing of windows with simpler, clearer code.

This commit also fixes the resizing of Fl_Overlay_Window that was broken in the
recent commit "Simpler implementation of Fl_Cocoa_Window_Driver::resize()"
    c66caf5dce
2019-04-25 10:30:59 +02:00
ManoloFLTK
6f82d88af3 macOS: restore correct tabbing/untabbing of windows - continued
slightly simpler and more explicit than previous commit at
    602c6ffd8a
2019-04-23 08:11:10 +02:00
ManoloFLTK
94f859c373 Consistently compute the current GUI scaling factor value. 2019-04-22 10:02:32 +02:00
ManoloFLTK
602c6ffd8a macOS: restore correct tabbing/untabbing of windows
The recent commit "Simpler implementation of Fl_Cocoa_Window_Driver::resize()"
    c66caf5dce
did not take care of tabbing/untabbing of windows.
This is repaired here.
2019-04-22 09:48:15 +02:00
ManoloFLTK
98b4ece33e Reorder Fl_Cocoa_Window_Driver to support upward OS compatibility 2019-04-21 09:45:06 +02:00
ManoloFLTK
f3bfe93a51 Fix Fl_Cocoa_Window_Driver::fullscreen_off()
The correct order of operations is to resize the window after having set its style.
2019-04-21 09:27:44 +02:00
ManoloFLTK
3f5580d49c macOS: better support of Fl_Window::border(int) 2019-04-20 22:01:48 +02:00
ManoloFLTK
ebbee5301b macOS: simpler handling of GL windows when first displayed.
tested on macOS versions 10.3, 10.6, 10.9, 10.14
2019-04-19 13:03:49 +02:00
ManoloFLTK
698fe39ff1 Minor code reordering 2019-04-15 16:08:16 +02:00
ManoloFLTK
72954f39d8 Minor code reordering. 2019-04-15 12:04:52 +02:00
ManoloFLTK
3fa2b73698 Update comments of Fl_Cocoa_Window_Driver::make_current() for macOS 10.14 2019-04-11 13:04:53 +02:00
ManoloFLTK
86849aac8f Improve Fl_Cocoa_Window_Driver::make_current() 2019-04-09 12:43:03 +02:00
ManoloFLTK
c66caf5dce Simpler implementation of Fl_Cocoa_Window_Driver::resize() 2019-04-07 09:09:33 +02:00
ManoloFLTK
607689c890 macOS: More efficient window rescaling that rarely calls Fl_Group::resize() 2019-03-28 17:30:18 +01:00
ManoloFLTK
499ec5c291 Replace static void Fl_Window_Driver::default_icons() by virtual Fl_Screen_Driver::default_icons() 2019-03-25 18:47:29 +01:00
ManoloFLTK
6a807716a7 Rename fl_compute_macKeyLookUp() to Fl_Darwin_System_Driver::compute_macKeyLookUp() 2019-03-25 13:16:27 +01:00
ManoloFLTK
e8d7eb1e46 Invalidate Quit also when running native file chooser. 2019-03-23 14:38:20 +01:00
ManoloFLTK
f89593d0de Avoid crash when messages canBecomeKeyWindow or canBecomeMainWindow received by closed window. 2019-03-18 13:07:55 +01:00
ManoloFLTK
3d57d9136b Avoid recreation of the system menu bar without change 2019-02-27 10:41:50 +01:00
ManoloFLTK
21c0134931 New member function const Fl_Image* Fl_Window::shape() replaces int Fl_Window::is_shaped()
The new function allows to get the window's shaping image
and delete it after use, if appropriate.
2019-02-23 10:21:27 +01:00
ManoloFLTK
44552f3e63 Rename method -[FLViewLayer viewFrameDidChange] to -[FLViewLayer reset_layer_data]
The new name follows FLTK naming rules and has the benefit of avoiding potential
collision with future macOS method names that follow a different naming rule.
2019-02-08 11:04:30 +01:00
Matthias Melcher
452a410a3e STR #2714: remove new shadow lint for MacOS 2019-02-02 17:47:55 +01:00
ManoloFLTK
899eaf8a69 Remove useless statement. 2019-01-28 17:10:13 +01:00
ManoloFLTK
9b272cfa4e Fix minor text input problem related to dead key previewing.
macOS normally previews a dead key and then replaces the preview by the final text
after the second key is typed.
macOS ≥10.7 also opens an auxiliary window to help choosing among possible characters
after some keys (e.g., n, c, o, a) are pressed and maintained for a while.
The problem fixed here is that after an auxiliary window has been used,
dead keys are no longer previewed.
That problem emerged at some undetermined point before 10.14 and after 10.7.
2019-01-24 15:19:33 +01:00
ManoloFLTK
ba729e50b7 Remove unnecessary code related to layer-backed views.
That code is not useful if layer-backed views are used only with macOS 10.14.
2019-01-20 19:13:08 +01:00
ManoloFLTK
d17454ac6a Correct typo in comment. 2019-01-16 13:38:13 +01:00
Manolo Gouy
2bc7816cab Slight reorganization of the [FLWindow close] method.
It might be safer to use the window's contentView before sending the close message to the window.
2019-01-04 17:50:58 +01:00
ManoloFLTK
38b8dfaaea Remove [FLViewLayer dealloc] method.
The Apple doc recommends not to release resources in an object's dealloc method.
The job is now done in the [FLWindow close] method.
2019-01-04 17:06:10 +01:00
ManoloFLTK
06fdfaf822 Restore possibility to compile with SDK 10.7 or earlier. 2019-01-04 16:52:26 +01:00
Manolo Gouy
26bb0e5a83 Under macOS 10.14, Fl_Cocoa_Window_Driver::flush() draws to the bitmap and does [view setNeedsDisplay:YES] 2018-12-30 10:59:53 +01:00
ManoloFLTK
0240158d4c macOS: creation of window with subwindow in iconized form - continued.
With macOS 10.13 and 10.14 at least, recursivelySendToSubwindows:@selector(display)
is not necessary in the new procedure where the window icon is computed in
windowDidMiniaturize rather than in windowWillMiniaturize as was done before.
2018-12-09 10:45:17 +01:00
ManoloFLTK
433f9b8ccb macOS Mojave: fix window with subwindow created in iconized form - continued
Some more changes needed to keep support of MacOS < 10.5
2018-12-08 19:38:15 +01:00
ManoloFLTK
b4c3fec029 macOS Mojave: fix window with subwindow created in iconized form. 2018-12-08 16:31:18 +01:00
Manolo Gouy
ed87d98c24 macOS comment only: refer to OS 10.14.2 gone public now. 2018-12-07 16:59:00 +01:00
ManoloFLTK
3bcb1256bb New static member function: Fl_Device_Plugin *Fl_Device_Plugin::opengl_plugin() 2018-12-05 11:04:58 +01:00
ManoloFLTK
549d3555a1 Comment only: to try push with git 2018-12-02 19:20:44 +01:00
Manolo Gouy
f53c7fd128 macOS: rewrite opengl_plugin_device() to use less memory.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13143 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-11-30 09:29:08 +00:00
Manolo Gouy
b511f6a7a4 Use the Fl_Gl_Device_Plugin mechanism to simplify the construction of a layer-backed GL window.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13140 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-11-29 17:50:55 +00:00
Manolo Gouy
d8c4447c84 MacOS: slightly simpler implementation of Fl_Cocoa_Window_Driver::wait_for_expose().
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13133 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-11-26 09:21:40 +00:00
Manolo Gouy
3be39b03b4 MacOS: further support of scenarios mixing miniaturize/deminiaturize/change screen configurations.
Test scenario:
- use 2-screen configuration, one retina, one non-retina as main screen
- put subwindow-containing window on retina
- miniaturize window
- close retina screen
- de-miniaturize window
The subwindow was wrong without this change.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13131 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-11-23 09:47:08 +00:00
Manolo Gouy
97c0c6a024 MacOS: fix redraw of subwindow when display resolutions before miniaturize and after deminiaturize differ.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13129 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-11-22 11:55:04 +00:00
Manolo Gouy
7e5b04cab5 macOS: remove two useless statements for layer-backed OpenGL windows.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13128 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-11-21 11:55:04 +00:00
Manolo Gouy
3e6d8903d4 Minor reorder of operations performed when layered window is 1st drawn.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13127 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-11-20 16:52:35 +00:00
Manolo Gouy
95aa03d86d macOS: reorganize the code running when windows are moved between retina and non-retina displays.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13126 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-11-20 12:51:03 +00:00
Manolo Gouy
de797c7101 MacOS: introduce classes FLViewLayer and FLGLViewLayer to handle layer-backed views.
Both new classes are derived from FLView.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13124 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-11-16 11:58:39 +00:00
Manolo Gouy
015d460c49 MacOS: simpler implementation of extra code necessary at first display of layer-backed GL windows
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13123 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-11-16 09:11:54 +00:00
Manolo Gouy
d312284099 Account for property graphicsPort of NSGraphicsContext being deprecated in 10.14
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13121 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-11-10 09:00:45 +00:00
Manolo Gouy
43b511b784 Fix macOS 10.14 Mojave support of the FLTK-cairo interface.
After experimenting with a modified cairo_test program that draws both with
cairo and with regular FLTK drawing functions to the same window, it seems
necessary to control for possible changes to the graphics context made by
cairo in Fl_Cocoa_Window_Driver::make_current() rather than in
cairo_create_surface().

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13119 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-11-09 14:35:55 +00:00
Manolo Gouy
8a04aeb146 MacOS Mojave and gl_start(): fix for 10.14 but not 10.14.1
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13108 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-11-02 09:27:04 +00:00
Manolo Gouy
6a201d7070 Add useful cast
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13106 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-11-01 20:33:35 +00:00
Manolo Gouy
3a2439e31c MacOS Mojave: restore use of gl_start()/gl_finish()
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13105 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-11-01 14:34:22 +00:00
Manolo Gouy
6c8115ee9b Remove use of Fl_Gl_Window_Driver.H in file src/Fl_cocoa.mm
Thus, Fl_cocoa.mm is completely independent from code of libfltk_gl.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13104 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-10-31 12:45:51 +00:00
Manolo Gouy
22bcc7b4ca Remove all dependency to libfltk_gl from Fl_cocoa.mm.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13103 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-10-31 09:05:26 +00:00
Manolo Gouy
9e20113757 Fix issue when moving window between retina/non-retina screens while window is under progressive redraw.
The problem was visible with test/mandelbrot and with layer-backed views.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13100 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-10-30 08:12:03 +00:00
Manolo Gouy
c146ba344c Removed temporary comment.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13096 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-10-29 17:20:31 +00:00
Manolo Gouy
71d7a9db79 Fix handling of layer-backed sub GL window moved between retina and non-retina screens.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13093 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-10-29 17:09:37 +00:00
Manolo Gouy
61eb23a9ea Fix handling of GL window moved between retina and non-retina screens.
Part of the fix applies both to layer-backed and non layer-backed windows.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13090 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-10-29 15:30:44 +00:00
Manolo Gouy
185934b9b0 Fix handling of layer-backed GL window moved between retina and non retina screens.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13089 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-10-29 10:14:09 +00:00
Manolo Gouy
2106f867b6 Fixed first drawing of a layer-backed OpenGL window.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13087 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-10-28 16:22:05 +00:00
Manolo Gouy
d666a6f234 MacOS Mojave 10.14 support: fix creation of several OpenGL windows.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13086 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-10-28 14:20:44 +00:00
Manolo Gouy
50f90a6970 Fix suppport of tabbed windows.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13085 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-10-28 02:35:02 +00:00
Manolo Gouy
318a756a60 Stop using viewFrameDidChangeNotification and implement drawRect:(NSRect) for FLViewGL.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13084 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-10-26 07:47:47 +00:00
Manolo Gouy
ab51dfc636 Support GL windows on retina display when app does not set Fl::use_high_res_GL(1)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13078 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-10-20 22:09:28 +00:00
Manolo Gouy
e32b7e1fca Fix resize of layer-backed, top-level GL windows: no more blank window.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13076 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-10-20 07:42:15 +00:00
Manolo Gouy
1741a6c128 Minor improvement of macOS 10.14 mojave support: draw window views with the displayLayer: method
The doc recommends to draw views with the displayLayer: method when the view manages itself
completely its own bitmap:
       If your delegate implements the displayLayer: method, that implementation is responsible 
       for creating a bitmap and assigning it to the layer’s contents property. 

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13075 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-10-20 07:24:27 +00:00
Manolo Gouy
dd8e60a956 Add support for macOS 10.14 Mojave.
MacOS apps running under 10.14 AND linked with SDK 10.14 use a completely different way
to draw to the screen in comparison with the same app running under 10.13 or earlier:
all views are "layer-backed".
This commit makes FLTK apps running under 10.14 and linked with SDK 10.14 explicitly 
use layers to draw to the screen.
FLTK apps remain downward compatible with earlier macOS versions.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13071 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-10-19 05:17:24 +00:00
Manolo Gouy
7331900ef8 Remove compilation error when using clang 8:
error: non-constant-expression cannot be narrowed from type 'int' to 'CGFloat'

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13070 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-10-18 19:33:09 +00:00
Manolo Gouy
506b60a3f9 MacOS 10.14 Mojave: fix support of window capture - continued.
Window capture by initWithFocusedViewRect: does not work if the app is linked against 10.14 SDK
and run under 10.14. In that case, capture is performed instead by CGWindowListCreateImage().
Detection of whether the app was linked against 10.14 SDK is done by checking whether
the FLView possesses a CALayer.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13062 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-10-05 10:47:16 +00:00
Manolo Gouy
61c01d9f9a MacOS 10.14 Mojave: fix support of window capture that 10.14 broke.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13060 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-10-04 07:54:18 +00:00
Manolo Gouy
08910b74ac macOS: check for non-nil image before using it as miniaturized window icon.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13058 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-09-30 13:46:13 +00:00
Manolo Gouy
f76d2a2bf8 Support for macOS 10.14 Mojave: apps linked with SDK 10.14 did not draw anything in their windows.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13057 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-09-27 05:42:57 +00:00
Manolo Gouy
673d95b99c MacOS: fix is_bundled() function for case when [NSBundle mainBundle] is nil.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13055 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-09-22 07:24:57 +00:00
Manolo Gouy
3131757e9c MacOS: fix regression in OS 10.13 where an unbundled app had its system menu bar unresponsive.
The regression was detected by "FLTK 1.4 on macOS: Trouble compiling my Application with Makefile"
in fltk.general.
The fix is to have unbundled apps initialize under MacOS 10.13 as under earlier OS,
thus the new initialization procedure introduced for 10.13 is for bundled apps only.
Tested OK on 10.13.6 and 10.14 public beta 10.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13050 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-09-16 10:17:23 +00:00
Manolo Gouy
07f18a5190 MacOS: Fix rounding to nearest int for negative screen coordinates.
The previous method   int(x + 0.5) is incorrect when x < 0

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13046 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-09-12 15:12:11 +00:00
Manolo Gouy
b0e0e0912c MacOS ≥ 10.10: Fl_Window::fullscreen() and fullscreen_off() no longer call Fl_Window::hide() + Fl_Window::show()
The new procedure essentially resizes the window, as done on the X11+EWMH and Windows platforms.
This improves in particular the possibility to turn an Fl_Gl_Window fullscreen on and off.
MacOS ≥ 10.10 is required because the procedure isn't stable (random crashes during fast switches) with 10.9.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13045 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-09-12 12:46:09 +00:00
Manolo Gouy
ee3fbb849e MacOS: fix creation of fullscreen GL window
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13039 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-09-03 15:47:48 +00:00
Manolo Gouy
f50e9170dc MacOS: slightly simplify [FLAppDelegate applicationDidChangeScreenParameters:]
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13033 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-08-29 16:42:41 +00:00
Manolo Gouy
1b25d1d3a0 Support recent MS Office apps that use \r\n as end of line in pasteboard.
FLTK now transforms that into \n as is expected under MacOS.
Older MS Office apps used \r as old MacOS software.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13014 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-08-10 15:44:39 +00:00
Manolo Gouy
cd399d9898 Support for GUI scaling: add API to get/set the scaling factor value.
Also, define an FLTK event triggered when the scaling is changed and an option
to disable the transient window showing the new scaling factor.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13011 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-08-08 20:08:10 +00:00
Manolo Gouy
305e5dd21e Try dummy commit
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12990 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-07-02 15:21:57 +00:00
Manolo Gouy
7483651aaa Avoid giving same name (s) to 2 variables.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12988 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-06-30 05:57:21 +00:00
Manolo Gouy
3199e3331b Move Fl_Gl_Window_Driver.H from FL/ to src/
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12977 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-06-26 14:23:51 +00:00
Manolo Gouy
26cb08badb Move Fl_Screen_Driver.H from FL/ to src/
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12975 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-06-26 14:04:09 +00:00
Manolo Gouy
7ebe8e21b0 Move Fl_Window_Driver.H from FL/ to src/
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12974 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-06-26 13:43:18 +00:00
Matthias Melcher
a9fd08ff5a Doxygen: created Group to document drivers, disabled by default
Uncomment `ENABLED_SECTIONS += DriverDev` in documentation/Doxyfile.in
to enable driver documentation.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12968 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-06-23 16:47:40 +00:00
Manolo Gouy
af3625eb20 MacOS: use direct access to member variable in member function.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12929 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-05-23 16:43:43 +00:00
Manolo Gouy
2576f57384 MacOS: account for GUI rescaling in support of text input methods.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12927 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-05-23 16:19:37 +00:00
Manolo Gouy
10640df785 MacOS: move some code from file Fl_cocoa.mm to file Fl_Darwin_System_Driver.cxx - continued
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12919 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-05-12 17:03:26 +00:00
Manolo Gouy
aba87e8bb0 MacOS: move some code from file Fl_cocoa.mm to file Fl_Darwin_System_Driver.cxx
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12918 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-05-12 17:01:33 +00:00
Manolo Gouy
4c45bec127 MacOS: move some code from file Fl_cocoa.mm to file Fl_Cocoa_Window_Driver.cxx
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12917 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-05-12 16:59:03 +00:00
Manolo Gouy
6fd216d759 MacOS: move timer-related code from file Fl_cocoa.mm to file Fl_Cocoa_Screen_Driver.cxx
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12916 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-05-12 16:44:31 +00:00
Manolo Gouy
8b7f7c78b2 Remove public member function Fl_Window_Driver *Fl_Window::driver() so class Fl_Window_Driver is not in FLTK public API.
This function is replaced by static Fl_Window_Driver* Fl_Window_Driver::(const Fl_Window *win).
The purpose is to have class Fl_Window_Driver outside from FLTK ABI.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12915 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-05-12 09:36:36 +00:00
Manolo Gouy
2b7aac129b Rename Fl_Paged_Device::start_job() to begin_job() and Fl_Paged_Device::start_page() to begin_page().
The new function names begin_job() and begin_page() better match end_job() and end_page() with which
they must be used by pair.
The old names start_job() and start_page() are maintained for API compatibility with FLTK 1.3.x

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12910 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-05-09 14:16:35 +00:00
Manolo Gouy
ccae86b291 Remove useless #include <FL/Fl_Shared_Image.H> following usage of the new Fl_Image::scale() member function.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12903 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-05-06 10:20:45 +00:00
Manolo Gouy
5c16dcb65b Simplify Fl_XXX_Window_Driver::capture_titlebar_and_borders() using Fl_Image::scale().
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12902 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-05-06 07:14:13 +00:00
Manolo Gouy
20ccb6b7f2 Shorten the list of virtual member functions used to support Fl_Widget_Surface derived classes.
Change Fl_Cocoa_Screen_Driver::read_win_rectangle() so it captures only
from the current window and ignores its subwindows, as do other Fl_Screen_Driver derived classes.

Remove Fl_Cocoa_Printer_Driver::print_window_part() that is no longer necessary.
Remove Fl_Printer::print_widget() and Fl_Printer::print_window_part() that
are no longer necessary.

Stop Fl_Widget_Surface::print_window_part() from being virtual because its platform-independent
implementation should suffice.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12894 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-05-04 15:11:47 +00:00
Manolo Gouy
d4eeb75ac6 MacOS: improve fl_overlay_rect() when GUI scale factor = 1.7
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12893 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-05-04 08:25:45 +00:00
Manolo Gouy
31848b8565 MacOS: correct handling of window tabbing/untabbing together with GUI rescaling.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12681 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-02-20 12:09:32 +00:00
Manolo Gouy
06b925964d Remove Fl::run_also_windowless() and FL::wait_also_windowless() from planned public FLTK 1.4 API.
These were introduced at r12647, that is, during development of the 1.4 API.
These functions provided windowless support only on the MacOS platform,
where this can be obtained without those functions.
Windowless support on other platforms would require changing the event 
loop. There's no evidence from STR's there's a demand for windowless mode
on other platforms.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12680 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-02-20 09:08:38 +00:00
Manolo Gouy
a401c6c038 Fix Fl_Cocoa_Window_Driver::size_range() to make it support GUI rescaling.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12674 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-02-18 08:04:57 +00:00
Manolo Gouy
5bf7e5ece7 Fix Fl_Cocoa_Screen_Driver::screen_work_area() when the GUI is scaled - continued.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12670 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-02-16 17:12:23 +00:00
Manolo Gouy
38b924e12b Fix Fl_Cocoa_Screen_Driver::screen_work_area() when the GUI is scaled.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12669 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-02-16 17:10:06 +00:00
Manolo Gouy
0012debf37 After r.12653, it is also necessary to remove Fl_Cocoa_Window_Driver::bitmap_from_window_rect()
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12657 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-02-09 17:26:20 +00:00
Manolo Gouy
b78b2f7f5f Move xxx_also_windowless member functions from Fl_System_Driver to Fl_Screen_Driver.
Because these functions are related to Fl_Screen_Driver::wait(double)

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12652 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-02-08 12:47:40 +00:00
Manolo Gouy
425ab2e8bc Add support for detection and processing of clean program termination request.
The default handling of cmd-Q/Quit program under MacOS was to terminate the
program if all its windows are closed without returning from FLTK's event loop.
This was running against a strong design feature of FLTK that programs
should always complete their event loop and return from main() when cleanly
terminating.

In the new code for the MacOS platform, cmd-Q/Quit program no longer terminates
the program. Instead, the event loop is interrupted and a call to Fl::program_should_quit()
allows to detect that program termination has been requested, if necessary.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12647 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-02-06 17:26:11 +00:00
Albrecht Schlosser
42d8aba117 Replace FL/x.H with FL/platform.H - step 2 (STR #3435).
This second step replaces FL/x.H with FL/platform.H in all source files.
Dependencies have been adjusted as well.

This commit completes the replacement of FL/x.H with FL/platform.H.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12641 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-01-31 21:17:17 +00:00
Manolo Gouy
46d8ef2c1d MacOS: More accurate coordinate computation in rect_to_NSBitmapImageRep() when GUI is rescaled.
The modified statement uses the window height in graphics coordinates that has been truncated to
integer at window creation and resize.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12625 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-01-07 18:16:52 +00:00
Manolo Gouy
c6045962db Continue support for GUI rescaling under MacOS: fix test/resize() application - continued
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12607 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-12-27 07:48:52 +00:00
Manolo Gouy
d6a0e4a010 Continue support for GUI rescaling under MacOS: fix test/resize() application
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12606 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-12-27 07:46:50 +00:00
Manolo Gouy
8ee87d15e3 Continue support for GUI rescaling under MacOS: fix Fl_Cocoa_Window_Driver::capture_titlebar_and_borders()
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12604 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-12-24 07:20:25 +00:00
Manolo Gouy
e1893334fd Continue support for GUI rescaling under MacOS: fix Fl_Overlay_Window.
This patch also improves by simplification the code of class Fl_Quartz_Image_Surface_Driver:
because, under the driver model, there's a separate graphics content for the display and for 
each offscreen buffer, it's possible to reverse the drawing orientation (draw from top to bottom) 
once at offscreen creation. It's thus no longer necessary to reverse orientation in 
Fl_Quartz_Graphics_Driver::restore_clip() specifically for offscreen buffers.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12603 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-12-23 06:34:42 +00:00
Manolo Gouy
c44382e973 Scaling capability under MacOS platform: fix capture of scaled window.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12602 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-12-19 14:14:42 +00:00
Manolo Gouy
d361de4d0d STR#3437 : Support display of windows in tabbed form as in MacOS 10.12 Sierra
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12596 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-12-18 15:19:15 +00:00
Manolo Gouy
3f9f4debbb STR#3444: Add MacOS support for application rescaling (not quite complete)
With this, most MacOS FLTK app can be scaled with command/+/-/0/ keystrokes.
A scaling problem remains, visible in test/cube, where the "Test" string is not positioned correctly.

GLUT apps can also be scaled (across platforms).

SVG images are re-rasterized after app scaling for optimal drawing.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12594 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-12-18 08:52:55 +00:00
Manolo Gouy
eb763ae432 Further simpler code to initialise the MacOS-specific implementation of Fl_Sys_Menu_Bar_Driver
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12586 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-12-07 16:10:21 +00:00
Manolo Gouy
2da4cf8b9f Simpler code to initialise the MacOS-specific implementation of Fl_Sys_Menu_Bar_Driver
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12585 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-12-07 15:35:07 +00:00
Manolo Gouy
24a5fa7632 MacOS: support running fl_open_display() in static initializer.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12583 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-12-06 07:38:05 +00:00
Manolo Gouy
8612fea277 Make Fl_Sys_Menu_Bar class usable in static initializers.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12579 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-12-04 17:39:19 +00:00
Manolo Gouy
6586b77975 Restore possibility to run fl_open_display() within a static initializer.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12578 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-12-03 15:46:12 +00:00
Manolo Gouy
a8fe10cf88 MacOS: use rounded bottom corners when drawing windows
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12574 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-11-30 16:14:13 +00:00