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

3394 commits

Author SHA1 Message Date
tpoole
902ddc7567 Bump version number to 8.0.5 2025-01-08 14:23:21 +00:00
Oliver James
98e21c6ad8 PopupMenu: Move section header size calculation into LookAndFeel methods.
This fixes a bug introduced in the previous commit that caused all menu items to be sized too large.
2024-12-19 21:51:40 +00:00
Oliver James
e360d83057 PopupMenu: Move IdealSize modifiers to LookAndFeel 2024-12-19 14:00:23 +00:00
reuk
d3d7d4c89c VBlank: If previous frame is still in progress, wait until next frame to trigger a new vblank
Previously, the vblank's thread loop would block on each iteration until
the current async callback had finished, at which point a new async
callback would be immediately triggered.

The new implementation only waits on the vblank event. If a vblank
callback is still in progress the next time the vblank event is
signalled, we assume the last frame is overrunning and avoid sending a
new async update.

The intention of this change is to avoid saturating the message thread
with expensive vblank callbacks. It's also nice to remove a lock,
although that's just an incidental change.
2024-12-13 14:49:46 +00:00
reuk
336dcfc08c Direct2DImage: Update interface to accept a Device instead of a DeviceContext 2024-12-13 14:43:06 +00:00
reuk
dcca72484f Image: Update return type of getPixelData to avoid dangling pointers 2024-12-13 14:42:26 +00:00
reuk
80bb7b0861 ScopedThreadDPIAwarenessSetter: Make moveable 2024-12-13 14:42:26 +00:00
reuk
4f474d97f4
FileChooser: Fix double-delete of UTType instances 2024-12-12 12:58:54 +00:00
reuk
269ebbb525
Accessibility: Add AccessibilityHandler::postSystemNotification() function for posting an OS-specific accessible notification 2024-12-04 11:11:21 +00:00
reuk
051e701780 Windowing: Update mousewheel handler on Windows to always process messages in the context of the peer receiving the event 2024-12-03 14:26:21 +00:00
reuk
cfee7cfc93
Windows: Fix bug where IME displayed at incorrect location on scaled displays 2024-12-02 17:20:43 +00:00
reuk
038b0d6c9e
Windows: Fix bug where IME failed to display on Windows 11 2024-12-02 17:20:42 +00:00
reuk
fc76e936d3
DragImageComponent: Avoid case where image may detach from mouse when dragging between screens
When two monitors are available, both with different scale factors, then
the drag-image may 'detach' from the mouse while the image's top-left
coordinate was on one display, and the mouse cursor was on the other
display.

This happened because, on Windows, the mouse cursor moves continuously
in physical (not logical!) space. In other words, the mouse may not move
continuously in logical space, and the discontinuity becomes visible
when components are positioned relative to the mouse in logical space.

In order to display consistently, the top-left position of the image
must be set relative to the physical position of the mouse.
2024-12-02 17:20:42 +00:00
reuk
2fcf9ebf38
Windowing: Fix issue where components dragged between monitors with different scalings could detach from the mouse
This bug could be observed by running the WidgetsDemo Drag+Drop pane on
Windows 10, and dragging an item between two displays at different scale
factors.

This is issue is a regression introduced in
9817a2bb66. The regression was caused by
the change in mouse position calculation. The incorrect version switched
to using ClientToScreen, but the correct version used
getPointFromLocalLParam.

The function getPointFromLocalLParam was replaced by clientLParamToPoint
in 24ab3cb6a3, and is restored by this
commit.
2024-12-02 17:20:42 +00:00
reuk
c24d1a17a7
Windowing: Avoid changing window bounds in WM_WINDOWPOSCHANGING
This change intends to address a bug observed only on Windows 10 with a
display scale factor of 125%.

When the native titlebar is enabled, and the window's border-resizer is
used to resize the window slowly the with mouse, the client area of the
window may move to the wrong location, or be drawn with some areas
obscured/clipped. This is especially observable when resizing the
WidgetsDemo to its smallest size, and then dragging the right border a
single pixel to the right. On my computer, this consistently causes the
client area to display at the wrong location.

I haven't been able to find any obvious bug in JUCE that might cause
this behaviour. In particular, it seems that the window begins
displaying incorrectly *before* the window ever actually resizes.

During the resize, the system sends events (WM_SIZING and
WM_WINDOWPOSCHANGING) to the window, and according to the documentation,
the window may modify the message parameters in order to constrain the
new window size. When running on a scaled display, JUCE attempts to map
the logical client area size to a sensible size in physical pixels, and
uses the sizing messages to enforce this size requirement.

In the case of the broken window rendering, the system requests a new
window size, which JUCE rejects. The window's display state doesn't
change, so the swap chain does not resize, and the swap chain does not
present. Put another way, the broken rendering happens *independently*
of JUCE modifying the swap chain in any way. Therefore, I believe that the
bug is introduced elsewhere, potentially by Windows itself.

I also checked to see whether the issue could be caused by mishandling
of the NCCALCSIZE message, which is normally used to configure the
relative positions of the client and nonclient areas. However, in the
buggy case, NCCALCSIZE is not sent until *after* the first 'broken'
frame is painted - and even then, the implementation immediately falls
back to DefWindowProc.

Given that the issue appears to be a bug in Windows, the proposed change
is a workaround, rather than a true fix. It appears as though the
problem goes away when WM_WINDOWPOSCHANGING does not modify the
requested bounds. Therefore, for windows with native titlebars, we rely
on the constraints to be applied in WM_SIZING only, when sizing the
window in a sizemove gesture.
2024-12-02 17:20:42 +00:00
reuk
81a95abb3c
Windowing: Use local coordinate space of component in call to findControlAtPoint 2024-12-02 17:20:42 +00:00
reuk
90d9f573c2
Windowing: Avoid using bogus window-border sizes when computing constrained window sizes
Previously, for windows with a native titlebar and a constrainer, the
window could be restored at the wrong size. This happened because
findPhysicalBorderSize() may return nonsensical values when called
during a SC_RESTORE, which in turn produces an unexpected window size
when adding the bogus border size to the constrained client area size.

We now avoid trying to constrain the window if we're unable to determine
the correct border size. I think this is only likely to happen during
SC_RESTORE, in which case the system should have a pretty good idea of
where the window should go, and constraining should not be necessary.
2024-12-02 17:20:42 +00:00
reuk
543ae06632
Windowing: Fix issue where edge resizers could incorrectly be displayed for non-resizable windows
The buggy behaviour could be seen in a blank GUI app project by setting
a native titlebar and calling setResizable (false, false). The resulting
window would still display a resize cursor when hovering the window
border.
2024-12-02 17:20:42 +00:00
reuk
2583b06481
NSViewComponentPeer: Guard API availability 2024-12-02 15:20:49 +00:00
reuk
c2f567f3ee
Fix unused variable warnings 2024-12-02 14:44:24 +00:00
Anthony Nicholls
5e803ded5f Deprecations: Add ignore deprecation warning macros 2024-11-27 11:07:04 +00:00
reuk
f0928ebd6e
Windowing: Fix link of UserNotifications framework on iOS
Since eb6ebaf5, juce_gui_basics always depends on UserNotifications when
building for iOS.
2024-11-21 22:19:31 +00:00
reuk
b72e43620c
Grid: Fix cell ordering comparison
Previously, the set Comparator behaved the same way, regardless of the
value of columnFirst. This is incorrect; the set should be sorted such
that the final item in the set has the greatest cross-dimension.

There was also an off-by-one error in the result of
getHighestCrossDimension(). The highestCrossDimension data member is
exclusive, but the cell values in the occupiedCells set are inclusive.
We need to add 1 to the maximum cell cross-dimension in order to convert
it to an exclusive value.
2024-11-21 13:42:54 +00:00
reuk
8fa09ae8ab
Grid: Refactor to move columnFirst data member to set Comparator 2024-11-21 13:41:09 +00:00
reuk
d4107836cd
Grid: Convert nonstatic member function to static 2024-11-21 13:41:08 +00:00
Tom Poole
5737c42ccf Use getSiblingFile in more places 2024-11-20 10:10:35 +00:00
Tom Poole
71af005543 Bump version number to 8.0.4 2024-11-18 10:12:15 +00:00
reuk
24ab3cb6a3
Windows: Fix mouse position reporting for maximised windows with non-native titlebars
Previously, windows with non-native titlebars but with native shadows
would misreport mouse-down and mouse-up positions when maximised.
2024-11-05 13:28:10 +00:00
reuk
93640b63ff
Compatibility: Add new macros for straightforward checking of minimum deployment target
This also fixes a bug introduced in f7c7225f5c
where the condition guarding the definition of traitCollectionDidChange
was incorrect. This function is never required if the deployment target
is at least 17.0.
2024-11-05 13:28:10 +00:00
reuk
b108fe26c3
NSViewComponentPeer: Only forward a mouse move event if the view is not occluded by a child view 2024-11-04 11:10:54 +00:00
reuk
fcf62ab105
NSViewComponentPeer: Fix coordinate system conversion in contains()
The argument to hitTest must be in the superview's coordinate system.
The old implementation would sometimes break in the presence of nested
NSViews.
2024-11-04 11:10:54 +00:00
reuk
3005b716fe
ObjCHelpers: Add new macros to help with version checking 2024-10-29 19:46:35 +00:00
reuk
eb6ebaf5af
Windowing: Fix deprecation warnings for iOS 17 2024-10-29 19:46:35 +00:00
reuk
dbe74e9f5d
UIViewComponentPeer: Fix deprecation warnings for iOS 13 2024-10-29 19:46:35 +00:00
reuk
f7c7225f5c
UIViewComponentPeer: Fix deprecation warnings for iOS 17 2024-10-29 19:46:35 +00:00
reuk
128e258845
UIViewComponentPeer: Remove unnecessary method declarations from interface 2024-10-29 19:46:34 +00:00
reuk
a4ba0c1b1c
FileChooser: Fix deprecation warnings for iOS 14 2024-10-29 19:46:34 +00:00
無常
d9ed81b4f0
WindowsDLL: Add missing JUCE_API attributes 2024-10-27 16:16:26 +00:00
attila
425f1858b5 VBlankAttachment: Add new constructor with a callback that receives a timestamp 2024-10-25 15:45:56 +02:00
attila
d9a3efd3cb ComponentPeer::VBlankListener: Add timestamp parameter to the vblank callback 2024-10-25 15:44:34 +02:00
attila
3c38adcc03 ResizableWindow: Remove assertion
The assertion can routinely fire on Linux, where a window may go through
many size changes from (0, 0) to its actual size due to the nature of
how XWindow reports these in subsequent ConfigureNotify events.

These subsequent changes aren't visibly observable by users.
2024-10-24 13:10:14 +02:00
attila
3118ee1e5c Linux: Prevent stale ConfigureNotify events from overwriting the current window position 2024-10-24 13:10:14 +02:00
reuk
90f37e27ea Windows: Fix DLL build
There were a few "ambiguous operator new/delete" errors that were due to
inheriting from a private base class that used the leak detector. These
errors are resolved by adding the leak detector to the derived classes.

JUCE_API was missing from a few useful types, notably the ARA hosting
types.
2024-10-22 13:24:46 +01:00
reuk
8ccea668e4
PopupMenu: Adjust mouse interactions so that menu is only dismissed on mouseUp if the mouse has moved
Previously, MouseSourceState::checkButtonState would trigger a menu item
if the MouseSourceState had observed the mouse button transition from
pressed to released while over an item, after more than 250ms had
elapsed since creating the menu window. In situations where the main
thread was very busy, this timeout could sometimes be reached inside the
same mouse click/release gesture. If the menu was created inside a
mouse-down, then simply tapping the mouse could sometimes trigger an
item from the menu as soon as the menu window appeared.

To help avoid accidentally triggering menu items, the menu window now
prevents any item from being triggered by the mouse until either the
mouse has been released once, or the mouse has moved. Put another way,
if the mouse is initially pressed when the menu is shown, it cannot
trigger a menu item unless the mouse is moved before it is released.
2024-10-20 22:59:40 +01:00
reuk
db4a2c0b9f
PopupMenu: Make dismissOnMouseUp private 2024-10-20 22:59:40 +01:00
reuk
570b86ff0c
PopupMenu: Refactor mouseOver detection
The mouseWasOver member will now be updated on each mouse event, rather
than on a timer.
2024-10-20 22:59:40 +01:00
reuk
44a84e3a4d
MessageBox: Avoid potential divide-by-zero for boxes with no buttons 2024-10-20 22:59:39 +01:00
reuk
b292ba215a
Component: Ensure global mouse listeners are notified on mouse up
Previously, listeners would sometimes fail to receive mouse up events
blocked by modal components
2024-10-20 22:59:39 +01:00
reuk
80ac9a78a0
Singleton: Add new macros to simplify singleton creation
The INLINE macros allow singletons to be declared and defined in one
line, without requiring a separate JUCE_IMPLEMENT_SINGLETON statement.
2024-10-16 10:36:52 +01:00
Tom Poole
14c8d06fb0 Bump version number to 8.0.3 2024-10-15 22:16:12 +01:00