Commit Graph

105 Commits

Author SHA1 Message Date
William G Hatch
d0adb8bc70 make GdkCursor nullable 2017-01-29 19:35:43 -07:00
Matthew Flatt
f8eab2a732 unbreak for GTK+ 2 2017-01-05 17:02:14 -07:00
Matthew Flatt
38f0c6adb5 avoid GTK3 warning 2017-01-04 16:28:13 -07:00
Matthew Flatt
48c1b28284 initial support for GTK+ 3 on Wayland
GL contexts and GC blits don't work, dialog placement doesn't work,
and checkbox animations seem to interefere with updating --- but at
least things mostly work.

Relevant to racket/racket#1547
2017-01-03 08:18:11 -07:00
Matthew Flatt
5a09d2b825 "Mac OS X" -> "Mac OS" 2016-12-23 12:33:59 -07:00
Matthew Flatt
5e70534b43 adjust workaround for GTK+3 before version 3.22
Adjust a workaround for versions before 3.22 when setting the font for
a control.

GTK+ version 3.22 starts paying attention to whether a font size for a
control is absolute (as opposed to being in points), so the workaround
that was put in place for earlier versions breaks.

In addition, some part of the drawing stack seems to round point sizes
to an integeral size after DPI conversion. Take that rounding into
account when setting the font size in `normal-control-font`.

Closes #1522
2016-12-19 07:21:28 -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
William G Hatch
3b280551c2 GTK+: accumulate small scroll events into appropriate wheel events 2016-11-17 15:25:33 -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
6b2f4a72ae GTK+ 3: fix problem with sizing initially unshown items
This repair is especially aimed at avoiding missing toolbar
buttons in DrRacket.
2016-08-20 09:26:03 -06:00
Matthew Flatt
c700e32c17 0-sized window =/=> 0-sized backing bitmap 2016-08-19 18:16:05 -06: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
2fa9b94683 repair to work with ancient Gtk 2016-04-17 14:30:31 -06:00
Matthew Flatt
6de1e4310c fix disable of tab-panel% with 'no-border 2016-04-15 21:59:13 -06:00
Matthew Flatt
32f8bfd90e repairs to work with old Gtk 2016-04-14 06:06:34 -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
2c5b1480f4 fix mouse wheel for GTK+ 3
Closes PR 15271
2016-03-15 13:28:13 -06:00
Matthew Flatt
c4ef1829fc Gtk: adjust handling of composed input
Intended to fix #29
2016-03-10 13:10:37 -07: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
5736535b8a avoid spurious screen refresh on text-measure operations
The drawing layer now indicates whether drawing content was
changed as it releases a drawing handle.
2016-02-05 16:51:39 -07:00
Matthew Flatt
d28ab71058 fix -singleInstance for GTK+3
Closes PR 15240
2016-02-05 10:40:04 -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
55d0d96dbe Gtk: fix handling of widget to extract text colors
With GTK+ 3 on Raspbian, at least, the old management of the
widget causes a crash.
2016-01-12 10:05:09 -07:00
Matthew Flatt
e206dab087 use #:runtime?-id for improved cross-build support 2016-01-09 09:47:28 -07:00
Matthew Flatt
4d5d08f07f fix back-end reference for cross-build 2016-01-08 16:45:16 -07:00
Matthew Flatt
6e7964b0b7 include icons needed by "gui-lib" in the package
The "plt-logo-48x48.png" file is a copy of "plt-48x48.png" from
"icons", but renamed to avoid conflicts.
2016-01-08 16:31:52 -07:00
Matthew Flatt
dbce2e2878 avoid an NSTableColumn warning 2016-01-08 07:58:53 -07:00
Matthew Flatt
0e344def40 Windows play-sound: remove extra delay after async 2016-01-05 07:31:01 -07:00
Matthew Flatt
8ae077c22a Windows play-sound: use the right custodian registration
Otherwise, a GC tends to terminate the sound.
2016-01-04 19:19:51 -07:00
Matthew Flatt
76c305852b Windows play-sound: avoid leaks and shutdown on custodian
Also, stop a synchronous sound on a break exception.
2016-01-04 18:10:23 -07:00
Matthew Flatt
edc56ee8de Windows: change play-sound to use MCI
Provided by Eli Barzilay.

This approach is better than a separate process, because creating
too many processes can overwhelm the OS. Also, MCI supports more
sound formats.
2016-01-04 17:41: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
196797b529 Windows: fix play-sound to return a boolean 2015-12-28 10:09:10 -06: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
87c2317cbc Windows: change play-sound to run an external program
Running a sound through a separate process allows multiple
sounds to be played at once.
2015-12-28 08:24:34 -07:00
Matthew Flatt
87e17a89da Windows: fix get-current-mouse-state for HiDPI 2015-12-23 08:31:38 -07: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
Jay McCarthy
c1cddc538c Casting flag-x-error-handler in this case too. Necessary for getting GL working on my Linux/Nvidia box to test pict3d 2015-12-14 08:55:36 -05:00
Matthew Flatt
c4793a218f Windows: avoid refresh on no-op canvas show-scrollbars 2015-12-03 05:36:42 -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
b29a7ae399 Gtk+ 3: open library in "global" mode to support the printer dialog
Opening a shared object in global mode risks conflicts with
other shared objects, but opening only one library that way
will hopefully not create conflicts.
2015-11-19 12:03:18 -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
746956a6ae skip clean-up of bitmap that isn't there
Backing-bitmap allocation might fail for a too-large window?
2015-10-29 07:43:45 -04:00
Matthew Flatt
172b7d5a56 implement GL screen sync for Windows canvases 2015-10-18 18:15:03 -06:00