Commit Graph

45 Commits

Author SHA1 Message Date
Matthew Flatt
5a09d2b825 "Mac OS X" -> "Mac OS" 2016-12-23 12:33:59 -07:00
Matthew Flatt
b9e94f9c45 macOS: don't try to declare implementation of NSApplicationDelegate
There's no run-time representation of `NSApplicationDelegate`, so
trying to declare it ands up adding NULL as a protocol to the
Objective-C class for the application delegate.

Adding NULL that way leads to a crash on 10.12.1+ with TouchBar
support.

Closes racket/racket#1520
2016-12-14 13:29:56 -07:00
Leif Andersen
6c78cd266a Fixes bug in slider%
It would occasionally drop the last digit in the message field.

This turned out to be a bug where the number, while smaller, was wider.
For example:
11111
10101

In variable width fonts the second one will be wider
2016-10-24 14:28:49 -04:00
Matthew Flatt
3e6fcf18bb Cocoa: fix enable method of choice% 2016-05-18 14:33:16 -06:00
Matthew Flatt
f0d10e9cc8 OS X: disable reordering of tabs in the new tab-panel% widget
Fixes racket/drracket#52
2016-04-17 20:59:10 -06:00
Matthew Flatt
6de1e4310c fix disable of tab-panel% with 'no-border 2016-04-15 21:59:13 -06:00
Matthew Flatt
9ef883a79f Cocoa, 64-bit, 10.10 and later: use MMTabBarView
On 10.11 in 64-bit mode, showing a frame with a PSMTabBarControl
instance somehow causes the event loop to become occupied on
mouse movements, so that moving the mouse in a `2htdp/universe`
program is slow when more than one tab is open in DrRacket. The
modern MMTabBarView widget doesn't have that problem. Also, the
MMTabBarView widget has a Yosemite look (to replace Aqua).
2016-04-07 13:12:30 -06:00
Matthew Flatt
30c8202656 fix focus for windows within a floating frame
Make the `focus` method shift focus to a floating frame. Also, shift
focus away from the floating frame when `focus` is used in an window
within the current main frame.
2016-03-28 17:25:22 -06:00
Matthew Flatt
282a22b8f0 add any-control+alt-is-altgr
Thanks to Bert De Ketelaere for helping to sort out this new
behavior.
2016-03-17 16:39:40 -06:00
Matthew Flatt
2ab1fb319a rearrange dc fields to avoid undefined-checking chaperone 2016-03-02 08:42:55 -07:00
Matthew Flatt
be30bf721d Cocoa: avoid backing-dc failure on zero-sized canvas
Closes https://github.com/racket/racket#1255
2016-02-22 05:05:35 -07:00
Matthew Flatt
345a20c5e8 use NSOpenGLPFAAllowOfflineRenderers for GC bitmap
Try to tell Macs with two graphics cards that it's ok to
use the low-performance one for the GC bitmap (when
GL is used for that, which is OS X 10.11 and later).
2016-01-16 08:50:06 -07:00
Matthew Flatt
dbce2e2878 avoid an NSTableColumn warning 2016-01-08 07:58:53 -07:00
Matthew Flatt
41d4e9dd2d Cocoa: fix refresh and fullscreen problems
Add more agressive re-enabling of screen updates and explicit `update`
calls to avoid partially refreshed frames and never-updated titlebars
on El Capitan.

Also, use `close` instead of `orderOut` to hide a frame. That fixes
problems with closing windows that are in fullscreen mode.

Closes racket/drracket#33
2015-12-31 15:50:41 -07:00
Matthew Flatt
ca24d94cdc Cocoa: avoid screen sync for GC-blit GL context
Affects 10.11 and up
2015-12-28 09:42:23 -06:00
Matthew Flatt
1944cd8dbd regsiter-collecting-blit: support background bitmap in El Capitan
The GC blit implementation used on Mc OS X 10.11 assumed that
the no-GC bitmap is blank. Make it use the given no-GC bitmap.

Also, repair the left-to-right flipping(!) of the GC bitmap,
and repair a backing-scale mismatch that could leave a thin
border around a GC blit.
2015-12-18 16:05:48 -07:00
Matthew Flatt
33395ae1cf Cocoa: canvas DC copy improvement 2015-11-24 15:01:25 -07:00
Matthew Flatt
3873064c80 Cocoa: avoid over-eager refresh on OS X 10.11
A relatively late correction to refresh handling for El Capitan
(commit 9bf18505d5) causes a canvas to be refreshed too often
in some cases. Delay the refresh to restore the old timing
without the old bug.
2015-11-23 20:45:25 -07:00
Matthew Flatt
facc07e123 Cocoa: make copy method work for canvas DC
Also correct problems with disabled scrolling via `copy`.
2015-11-23 12:13:48 -07:00
Matthew Flatt
9bf18505d5 fix refresh on El Capitan
When restoring autodisplay, need to check whether a display was
lost since display was suspended.
2015-11-07 06:45:34 -07:00
Matthew Flatt
4daafb2357 implement GL screen sync for Cocoa canvases 2015-10-18 17:49:32 -06:00
Matthew Flatt
a35b0e4831 another Mac OS X 10.11 refresh repair
Avoid frames that start out unpainted and end up with a too-dark
titlebar.
2015-10-06 21:24:10 -06:00
Matthew Flatt
216798a08c don't overpaint for clearing a canvas
Just in case clipping is not in place, since we have the right
rectangle handy anyway.
2015-10-06 09:42:28 -06:00
Matthew Flatt
b842b1feec Mac OS X 10.11: register control font to make it Pango-accessible
The new system control font is (intentially) not associated with a
font family, so it's inaccessible via Pango. A patch to Pango lets
us synthesize and register new families, so the control font can
be made accessible.
2015-10-04 20:36:17 -06:00
Matthew Flatt
cdc992ccb9 fix problems and consistency with fullscreen in frame%
The `fullscreen` method implied `show` on Mac OS X and Windows, but
not on Gtk, and a frae shown that was was not properly registered
as shown (e.g., the application could exit). For consistency, adjust
`fullscreen` to not imply `show`. Also, shift to a remaining frame
on Mac OS X when a fullscreen frame is closed.
2015-10-04 14:19:00 -06:00
Matthew Flatt
ea576d3177 Mac OS X 10.11: disable auto-update for suspended-flush windows
Previous versions of OS X seem to have automatically disabled
update for a window when flushing is disabled, but now we have to
do it ourselves, otherwise text editors can flicker a lot. (The
system change is probably related to the removal of the
`isFlushWindowDisabled` method of `NSWindow` (which was
deprecated in 10.10).
2015-10-04 12:11:21 -06:00
Matthew Flatt
a948c8a2f0 avoid showing GC icon for a frame that is not shown
Commit ac2d39e0e1 has the side effect of showing the window when its
parent is still hidden.
2015-10-03 13:20:59 -06:00
Matthew Flatt
5f63b8c95b fix get-color-from-user on Mac OS X
Closes PR 15121

A better solution would be to implement the dialog, but given
how long it's been broken, maybe no one cares enough for that
to be worthwhile.
2015-10-02 15:56:42 -06:00
Matthew Flatt
ac2d39e0e1 fix GC blit for Mac OS X 10.11
The old strategy of switching a transparent window to solid and back
doesn't work on 10.11; it appears that queued messages must be handled
for the window to become visible, but that's not allowed during a GC.
The strategy for 10.11 and up create an OpenGL canvas, which acts as a
direct-to-screen drawing area that a GC callback can affect without
Racket-level allocation.
2015-10-01 22:02:37 -06:00
Matthew Flatt
580e49f520 cocoa: fix placement of the file dialog as a sheet 2015-09-04 07:54:34 -06:00
Matthew Flatt
f91e549e59 Cocoa: no child-window workaround in 10.10 (to avoid different bug)
A GC-icon display is implemented with a child window on OS X. In some
OS X version prior to 10.10 (not sure which ones), screen
reconfigurations did not move child windows properly relative to
parent windows, so all child windows were reset after a screen change.
In 10.10, meanwhile, Mission Control can cause screen-change
notifications, and adding a child window to a Mission
Control-minimized fullscreened window will goes terribly wrong.
Fortunately, 10.10 seems to update child-window locations correctly on
screen reconfigurations, in which case the old workaround that hits
the new bug can be skipped.
2015-08-19 12:05:47 -06:00
Matthew Flatt
999c603ba0 Cocoa: avoid showing GC blits when canvas is hidden 2015-08-19 12:05:24 -06:00
Matthew Flatt
d1736765b6 add get-gl-client-size to canvas%
GL scaling in a canvas depends on a combination of the `gl-config%`
setting and the platform, so `get-gl-client-size` takes into account
both.
2015-08-18 15:10:02 -06:00
Matthew Flatt
f42356da3f Support and prefer GTK+ 3 on Unix/X
The main advantage of GTK+ 3 is better support for HiDPI
displays. If GTK+ 3 libraries are not available or if the
`PLT_GTK2` environment variable is defined, GTK+ 2 is used
as before.
2015-08-16 20:55:35 -06:00
Jay McCarthy
6fa420d947 add get-scaled-client-size 2015-05-20 12:59:51 -04:00
Jay McCarthy
be6bd0160c supporting opengl hires mode 2015-05-03 08:13:22 -04:00
Matthew Flatt
ff6b409f28 Cocoa: avoid atomic-mode problems in clipboard
Get data from a clipboard client before going into atomic mode. This
correction can avoid an "about to suspend in atomic mode" failure,
particularly if a snip fails to copy correctly.
2015-02-05 10:33:47 +01:00
Matthew Flatt
99a04d5f52 cocoa: get file-dialog results atomically
Otherwise, the NSURL object that is returned from the dialog can
be relased before we get the result.
2015-01-23 15:37:37 -07:00
Matthew Flatt
1185faa590 cocoa: adjust key events for empty Ctl- combos and special Option
In particular, restore key handling that makes Ctl-Space produce an
event with a Space character. Also, restore `special-option-key`
support, while correcting the documentation to say what
`special-option-key` and `special-control-key` actually do.

Closes PR 14934
2015-01-14 14:08:28 -07:00
Matthew Flatt
60611bc081 cocoa: fix focus method
Don't confuse "should the Tab key advance the focus to this window?"
with "can this window have the focus?".
2015-01-11 11:05:36 -07:00
Matthew Flatt
31231a6a8d narrow dependencies on Carbon
(reduced Carbon footprint?)
2015-01-09 08:37:38 -07:00
Jens Axel Søgaard
4dc47ef413 Compute other-key-codes
Use UCKeyTranslate to compute and store other-key-codes in the key-event.
2015-01-09 08:11:02 -07:00
Jens Axel Søgaard
fb0356d2fb Bindings for UCKeyTranslate
Bindings for UCKeyTranslate.
UCKeyTranslate converts a combination of a key-code, a modifier key state, keyboard layout and dead key state to a unicode string.
2015-01-09 08:11:01 -07:00
Matthew Flatt
de783c8378 avoid crashing via GCed racket/gui instance 2015-01-06 19:54:52 -07:00
Sam Tobin-Hochstadt
135e357a37 Remove extra directories. 2014-12-02 02:33:07 -05:00