1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00
Commit graph

8490 commits

Author SHA1 Message Date
reuk
1d1d743b9f
Build: Add -Wdeprecated to recommended flags and fix new warnings 2022-02-23 10:56:10 +00:00
reuk
fb1f94767d
AU Host: Improve allocation checks
If the block size changes from block to block, then it's possible for
inputBuffer to be smaller than buffer, but for buffer to be smaller than
the initially-allocated size of inputBuffer.
2022-02-23 10:56:10 +00:00
reuk
e1a7fe671a
Component: Make wheel/magnify behaviour more intuitive for disabled components
The previous implementation would pass the mouse wheel event up to the
component's parent, as long as the parent was enabled. This meant that a
wheel event on the innermost component of a hierarchy such as
"[[disabled] enabled]" would send the event to the parent, but a wheel
event on the innermost component of a hierarchy such as
"[[[disabled] disabled] enabled]" would 'eat' the event and prevent it
from propagating.

After this change, unhandled mouse wheel events will always be passed to
the nearest enabled parent. This behaviour is more consistent and
intuitive.
2022-02-23 10:56:10 +00:00
reuk
c229d160f9
PluginDescription: Fall back to using deprecatedUID in createIdentifierString() if the new uniqueID is not known 2022-02-23 10:56:10 +00:00
reuk
9e31eb1c6a
LookAndFeel: Update default name for tab/toolbar missing-item button
This button is used to access hidden toolbar items, as well as hidden
tabs. The old "tabs" name was misleading when the button was located in
a toolbar.
2022-02-23 10:56:10 +00:00
reuk
eb58b471c7
Toolbar: Add accessible name for custom popup menu item 2022-02-23 10:56:10 +00:00
reuk
6d404236e2
Toolbar: Fix missing-items button when LookAndFeel changes after construction of toolbar
Previously, setting a new look and feel would create a new missing-items
button, but would not add it to the toolbar or set the onClick callback.
2022-02-23 10:56:09 +00:00
reuk
e27fb35996
Fonts: Adjust attribute ranges correctly when rendering AttributedStrings
CFAttributedString ranges must be given in terms of 16-bit word offsets,
rather than codepoints.
2022-02-23 10:56:09 +00:00
reuk
0223e44ae7
Image: Keep track of contiguous buffer size to avoid heap buffer overflows
In CoreGraphicsPixelData::createImage, image data was copied from a
BitmapData created from the Image passed into the function.

The BitmapData instance didn't keep track of the size of the buffer it
pointed to, so the buffer size was computed by multiplying the
BitmapData height by its line stride. However, if the BitmapData pointed
to a subsection of an image, the `data` pointer might be offset from
the allocated region, and `data + lineStride * height` would point past
the end of the allocated region. Trying to read/copy this range would
cause a heap buffer overflow at the end of the range.

This change adjusts BitmapData so that it keeps track of the size of the
allocated region. Taking a subsection of an image should subtract the
data pointer offset from the size of the allocated region.
2022-02-23 10:56:09 +00:00
reuk
ec867690b7
VST3: Fix leak when setting/getting state via extensions mechanism 2022-02-18 16:43:27 +00:00
reuk
d3c4017685
OpenGLContext: Only create and use a VAO in contexts using the core profile 2022-02-18 16:43:27 +00:00
reuk
e367393a99
OpenGL: Use a core profile when OpenGL 3.2 is requested on Windows
This mirrors the behaviour on macOS.
2022-02-18 16:43:27 +00:00
reuk
199885baa8
OpenGL: Avoid deprecated function when querying available extensions
In OpenGL 3 and up, GL_EXTENSIONS is deprecated as an argument of
glGetString and glGetStringi should be used instead.
2022-02-18 16:43:27 +00:00
reuk
d9f8ea74e9
NativeMessageBox: Use associatedComponent on macOS 2022-02-18 16:43:26 +00:00
reuk
0a34e7fa71
Mac MessageBox: Fix result code conversion 2022-02-18 16:43:26 +00:00
reuk
eb8a419ac7
TooltipWindow: Avoid potential use-after-free of lastComponentUnderMouse
Showing the tip will in turn call getDesktopScaleFactor(), accessing the
lastComponentUnderMouse. In some cases, it was possible for
lastComponentUnderMouse to point to a deleted component, resulting in
UB.

There are two changes in this PR:
- Using a SafePointer rather than a raw pointer ensures that calls to
  getDesktopScaleFactor() will always be safe, regardless of when they
  happen.
- Moving the assignment of lastComponentUnderMouse to before the call to
  displayTipInternal() ensures that the returned scale factor is that of
  the component that the mouse is currently hovering.
2022-02-18 16:43:26 +00:00
reuk
72fa2d98e1
AU Wrapper: Ensure that correct input channels are cleared before processing 2022-02-18 16:43:26 +00:00
reuk
1bf9ebb4b1
VST3 Host: Avoid calling initialize twice on objects that implement both IComponent and IEditController 2022-02-18 16:43:26 +00:00
reuk
a3c55a967f
VST3 Host: Only call IPlugView::removed() if a previous call to attached() succeeded 2022-02-18 16:43:26 +00:00
reuk
92f350e617
Windows Accessibility: Fix single-character range/boundary calculation
Narrator on Windows seems to call ExpandToEnclosingUnit to find the
character immediately following the current cursor position. When
expanding a degenerate range with position `input` (used to represent
the cursor position) to a single-character range, the returned range
should start at `input` and end at `input+1`. Previously,
findTextBoundary() would always return the position before
currentPosition when searching backwards by character, so the result of
ExpandToEnclosingUnit would be off-by-one when expanding to the closest
character.
2022-02-18 16:43:26 +00:00
reuk
c1a3cc28fd
WavAudioFormat: Disambiguate ISRC and source information 2022-02-18 16:43:26 +00:00
reuk
d03fac6823
NSViewFrameWatcher: Extract from NSViewComponent implementation 2022-02-18 16:43:25 +00:00
reuk
bd0ca90952
Linux: Release X lock when unregistering file descriptor in order to avoid deadlocks 2022-02-18 16:43:25 +00:00
reuk
e4a7978621
Windowing: Output error text when window creation fails 2022-02-18 16:43:25 +00:00
reuk
84db4b186f
ComponentBoundsConstrainer: Refactor 2022-02-18 16:43:25 +00:00
reuk
3fa38114d1
AsyncUpdater: Cancel updates in derived class destructors 2022-02-18 16:43:25 +00:00
reuk
068dffdb8c
AudioProcessorEditorHostContext: Fix naming of getContextMenuForParameter 2022-02-18 16:43:25 +00:00
reuk
75981dd4b3
MidiFile: Fix typo 2022-02-18 16:43:25 +00:00
reuk
28c5775958
ProcessContextNonReplacing: Fix typo 2022-02-18 16:43:24 +00:00
reuk
1616c0ee26
CoreAudio: Ensure devices are restarted correctly after changing sample rate
f1b6bbc921 erroneously replaced

    callback = newCallback;
    previousCallback = callback;

with

    previousCallback = std::exchange (callback, newCallback);

It looks like previousCallback is intended to hold the last active
callback, so the previous version was correct after all.
2022-02-17 16:04:58 +00:00
reuk
409aaea43d
AUv3 Client: Add missing autorelease
This autorelease was accidentally removed in
2a199d5225
2022-02-17 16:04:58 +00:00
reuk
7eee7cd892
Windows: Fix non-C++14-compatible noexcept usage in mapi.h 2022-02-17 16:04:58 +00:00
Attila Szarvas
101a886821 MouseInputSource: Eliminate superfluous drag events caused by pressure change
The bug was triggered on Monterey where a pressure of 1 is reported
while a mouse button is being held down. This caused an extra drag
event being triggered between mouse down and up events, even if no
movement occurred.
2022-02-15 10:53:32 +00:00
reuk
3d7019bdc2
Fonts: Fix Xcode 13 build issue 2022-02-08 17:48:24 +00:00
attila
a1a8e1339f PopupMenu: Fix click-through from submenu
Previously it was possible to inadvertently activate a menu item by
clicking on a submenu item that was drawn on top of the parent menu.

The root cause was that hide() initiates an asynchronous mechanism
through exitModalState() that eventually destroys the MenuWindow, but
the MouseSourceState timer callbacks and event handlers sometimes still
had a chance to do a state update. Since the submenus have just been
destroyed the update could mistakenly conclude to activate one of the
items of the now lone parent.
2022-02-08 17:38:32 +01:00
reuk
cdba8eb8e9 NSViewComponentPeer: Fix NSTrackingArea leak 2022-02-07 14:24:11 +00:00
reuk
eabcfbad26 NSViewComponentPeer: Add support for true-full-screen with non-native titlebars 2022-02-07 14:24:11 +00:00
reuk
19536fc7a7 NSViewComponentPeer: Allow restoring previous size when zooming a non-native window 2022-02-07 14:24:11 +00:00
reuk
fdfc279bea String: Fix logical error in hex parsing code 2022-02-07 14:24:11 +00:00
reuk
53600d2d9e iOS Accessibility: Allow navigating tables by rows 2022-02-07 14:24:11 +00:00
reuk
793f1bf2ee FileChooser: Avoid crash when destroying an open non-native filechooser 2022-02-07 14:24:11 +00:00
reuk
0f06f45098 AUv3: Add timestamps to all parameter changes when possible 2022-02-07 14:24:11 +00:00
reuk
4cf74dfff6 Viewport: Improve drag-to-scroll on devices that can accept simultaneous mouse and touch input
Some Windows 11 devices have both touch screens and mouse inputs, and
these can be used simultaneously.

The Viewport (and ListBox) now check the input source of each mouse
down. If the source is not a mouse, the viewport will always enter
drag-to-scroll mode, regardless of the result of isScrollOnDragEnabled.
2022-02-07 14:24:11 +00:00
reuk
50dacbc8fc Mac Fonts: Fix rendering of AttributedStrings with empty ranges
Previously, lifetime management of CTFontRefs was not implemented
correctly. For zero-length ranges, the font may not be retained when
applying it to a CFAttributedString, meaning that the reference stored
in the fontMap sometimes became invalid before
createCFAttributedString() returned.

We now retain font refs when adding them to the font map, and release
them when the map is destroyed, ensuring that the font references remain
valid throughout the lifetime of the map.
2022-02-07 14:24:11 +00:00
reuk
3f315ddd00 Plugin clients: Fix bypass behaviours to match getBypassParameter() documentation 2022-02-07 14:24:11 +00:00
reuk
702bfdb2c0 WebView2: Fix nullptr check
This should ensure that the status bar and error page settings work as
intended.
2022-02-07 14:24:11 +00:00
reuk
88853f7eda AlertWindow: Show AlertWindows as modal sheets on macOS when associated component is present 2022-02-07 14:24:11 +00:00
reuk
00e7fbf1c2 DirectoryIterator: Avoid recursing into previously-visited directories 2022-02-07 14:24:11 +00:00
attila
4cf036bb8b ComponentPeer: Add documentation for OptionalBorderSize 2022-02-07 12:39:51 +01:00
attila
6575d24a81 ComponentPeer: Deprecate getFrameSize() 2022-02-03 21:46:36 +01:00