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.
(cherry picked from commit b29a7ae399)
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.
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.
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).
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.
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.
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.
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.)
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.
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).
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.
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.
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.
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.
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.
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.