Commit Graph

626 Commits

Author SHA1 Message Date
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