Commit Graph

56 Commits

Author SHA1 Message Date
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
79a3a9ebf8 use cross-system-type for the mred installer 2015-08-27 20:59:33 -06:00
Matthew Flatt
73065a3ba6 fix propagation of 'deleted flag for low-level editor-canvas% 2015-08-27 20:52:34 -06:00
Matthew Flatt
cb8f2ef3fd GTK+ 3: fix auto-resize of message% 2015-08-27 15:28:09 -06:00
Matthew Flatt
b06ee46854 GTK+ 3: fix client->global in a frame with a menu bar
It seems that the right answer was produced in GTK+ 2 due to a
client-location callback, but change the code to use the intended
approach of tracking the menu height.
2015-08-21 16:19:47 -06:00
Matthew Flatt
3be6a90ec7 GTK+3: fix scrolling panels
Use a GtkLayout instead of GtkFixed for the outer widget,
so that it isn't forced to a large allocation by its
children.
2015-08-21 11:50:46 -06:00
Matthew Flatt
91a1ab52c3 GTK 3: try yet again to make panels work right
To enable mouse events to a panel, go back to using a
GtkEventBox for a panel, but make it non-visible so that
it doesn't interfere with the parent's background color.
The extra layers added in the previous commit are still
important to avoid turning that into a native window
(which can completely breaks background drawing). Finally,
add an extra layer just around tab panels so that events
get delivered to the tabs. (It's possible that the extra
layer will make the background wrong just around the tabs,
if the tabs don't fill the area above the panel; too bad.)
2015-08-21 08:31:48 -06:00
Matthew Flatt
2c6848f3c9 GTK 3: try to make panels work right 2015-08-19 15:59:11 -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
4f3216f55a fix GC blit resizing
Conversion of a bitmap to the specified size was broken and made more
broken by recent changes.
2015-08-19 11:59:29 -06:00
Matthew Flatt
4453642e52 GTK+ 3: make panel's event box invisible
Making the event box invisible prevents painting a gray
background when placed over a different background (such
as a table panel that is given a different background by
its theme).
2015-08-19 10:35:14 -06:00
Matthew Flatt
312456d1bb GTK+ 3: treat combo-field% canvas like transparent canvases
The canvas part of a `combo-field%` needs to be non-native
(in the GdkWindow sense), so treat it like a transparent
canvas.
2015-08-19 08:18:20 -06:00
Matthew Flatt
0fc8ef6492 GTK+ 3: fix flicker with transparent canvases
Restore the use of freeze & thaw on transparent canvases, but
ensure that the implementation underlying the GDK window won't
change while a freeze is in effect.
2015-08-18 17:34:24 -06:00
Matthew Flatt
55c4eb22e4 GTK: fix field use before definition
Fix the ordering of a field definition due to recent changes for
GTK+ 3. Also, limit the new behavior to GTK+ 3.
2015-08-18 15:11:45 -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
018dbd6add fix get-unscaled-client-size docs and Win32/GTK implementations
Fix `get-unscaled-client-size` for Win32 and GTK scaling, and make the
docs more generally sensible.
2015-08-18 15:10:02 -06:00
Matthew Flatt
92842cd195 unbreak windows 2015-08-18 15:10:02 -06:00
Matthew Flatt
e67865a8ba remove unnecessary finalization (GTK+ 3)
Essentially the same as the GTK+ 2 repair.
2015-08-18 10:58:13 -06:00
Matthew Flatt
1c65d669f3 remove unnecessary finalization (GTK+ 2)
Remove a misguided attempt to improve finaliation while
making GTK+ 3 changes, although this change affected only
GTK+ 2.
2015-08-18 10:28:44 -06:00
Matthew Flatt
ef07121b9f recognize GTK+ 3 scroll events 2015-08-18 09:35:32 -06:00
Matthew Flatt
9058a148f8 another try at fixing graphics for GTK+ 3
The `gdk_window_ensure_native` call for window freeze and thaw
really is needed, but since it is incompatible with transparent
canvases, don't use freeze and thaw at all for those.

Meanwhile, repair the backing bitmap for both GTK+ 2 and 3
for a transparent canvas when a scale is in effect. And go
back to using X11 bitmaps for backing a canvas on GTK+ 3;
I'm not sure that's the right choice, but probably putting
the bitmap data on the X server instead of client is the
right thing.

Finally, restore GL bitmap support (partly by using X11 bitmaps
to back a canvas).

GL rendering to a canvas with a backing scale is not yet right,
either for GTK+ 2 or 3.
2015-08-18 09:01:28 -06:00
Matthew Flatt
8ee481840c fix transparent canvases on GTK+ 3
For GTK+ 2, we used `gdk_window_ensure_native` to make sure
that freeze and thaw work. For GTK+ 3, `gdk_window_ensure_native`
seems not to be needed and prevents a canvas from drawing over
its background.
2015-08-17 20:11:40 -06:00
Matthew Flatt
63a62b0832 fixup for old versions of GTK+ 2
Restore support for Debian Lenny, at least.
2015-08-16 20:55:39 -06:00
Matthew Flatt
3f4302e948 hide editor-canvas%'s => blink timer expires
Ensure that a blink timer for a canvas stops running
if the canvas becomes hidden. Otherwise, though a race
condition, it's possible for a GUI program to never
terminate if a "focus-out" event gets lost.
2015-08-16 20:55:35 -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
Matthew Flatt
bf79fb427c ignore system scaling factor if it's not a positive rational 2015-08-04 15:45:30 -06:00
Matthew Flatt
54de09f30e add PLT_DISPLAY_BACKING_SCALE
Also, fix conversion of @2x bitmaps to pixbufs at 2.0 scale.
2015-08-03 20:44:29 -06:00
Matthew Flatt
e7399f2bcc another repair
(Mangled the previous commit.)
2015-08-01 19:14:05 -06:00
Matthew Flatt
84a5dfb367 fix HiDPI detection
Work (in unscaled mode) on systems where the relevant
setting is not available.
2015-08-01 19:08:50 -06:00
Matthew Flatt
5b7bf69a13 HiDPI support on Unix (Gtk2)
Support GUI scaling in much the same way as on Windows, where
the OS setting ("org.gnome.desktop.interface.scaling-factor"
times "...text-scaling-factor") determines the scale that is
used for both graphics and GUI sizing.

As I understand it, a complete solution requires porting to
Gtk3. With Gtk2, the graphical part of a widget doesn't scale.
Text and image labels should scale correctly, though.
2015-08-01 18:06:12 -06:00
Sam Tobin-Hochstadt
60410356cc Pass strings to raise-type-error.
Closes PR 13178.
2015-07-30 14:35:18 -07:00
Matthew Flatt
6ed4157c51 fix boundary case for responding to horizontal scroll request 2015-05-21 08:52:01 -06:00
Matthew Flatt
12612670f6 editor-canvas%: fix scroll refresh when scroll bars are hidden 2015-05-21 08:52:01 -06:00
Jay McCarthy
6fa420d947 add get-scaled-client-size 2015-05-20 12:59:51 -04:00
Matthew Flatt
b882281b33 canvas% on-scroll: call in non-atomic mode
Add a missing exit from atomic mode on the way to an overidden
`on-scroll` method.

Closes PR 15068
2015-05-19 14:01:07 -06:00
Matthew Flatt
030a02a53c add {get,set}-area-selctable to pasetboard% 2015-05-16 09:05:22 -06:00
Jay McCarthy
be6bd0160c supporting opengl hires mode 2015-05-03 08:13:22 -04:00
Jay Kominek
f71f1c3ccb win32 support for frame% fullscreen and is-fullscreened? 2015-05-01 12:39:55 -06:00
Jay Kominek
eb2b279712 gtk support for frame% fullscreen and is-fullscreened? 2015-05-01 12:39:33 -06:00
Neil Toronto
7541838b78 Check for X errors as well as NULL contexts to work around broken graphics drivers
From the ARB_create_context_profile standard:

  On failure glXCreateContextAttribsARB returns NULL and generates an
  X error with extended error information.

Some NVIDIA drivers on Linux won't return a core profile. When they don't,
they're supposed to return NULL as well as generate an X error, but they
only generate an X error and return a non-NULL, garbage context. This is
not only nonstandard behavior, but lame. It's a major pain to check for X
errors. But whatever, NVIDIA, you big old gorilla.

This may or may not fix segfaults some people are having with Pict3D. If
it does, they won't have to use (current-pict3d-legacy? #t) anymore.
2015-03-16 10:53:10 -04:00
Sam Tobin-Hochstadt
9cc25592c3 Use object-or-false=? on snip admins.
Fixes PR 15002.
2015-03-10 19:57:57 -04:00
Daniel Feltey
93a21dd7cd Use object=? instead of eq? to handle equality for contracted objects 2015-03-05 14:10:47 -07:00
Robby Findler
cf6a3d6ecb change backspace in overwrite mode to be more what one
might expect it to be
2015-02-12 15:31:08 -06: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
Gustavo Massaccesi
5a126f552e Change color in editor: Grey -> Gray 2015-01-30 13:27:08 -07: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