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

376 commits

Author SHA1 Message Date
Anthony Nicholls
2efd3e0661 Component: Prevent unnecessary image clearing in createComponentSnapshot 2025-11-10 22:37:39 +00:00
Anthony Nicholls
cea19a9d12 Component: Fix an issue calculating the relative bounds of opaque components
For top level components the relative bounds of a child opaque
component would be wrong unless the top level component was at 0,0
2025-11-10 22:37:39 +00:00
Anthony Nicholls
5ec4d85d82 Component: Add some basic unit tests 2025-11-03 13:48:02 +00:00
Anthony Nicholls
961ff32b9e Component: Improve opaque component checks
- Improve default performance when components check if they are opaque
- Allows all components to take advantage of setPaintingIsUnclipped
- Give more control to opt out of opaque checks separate from setPaintingIsUnclipped
2025-11-03 13:48:02 +00:00
reuk
7981957f50
Docs: Fix typo in juce_Component.h 2025-09-10 10:49:40 +01:00
Anthony Nicholls
36d07a6ce3 Docs: Replace doxygen preprocessor conditionals with @cond and @endconds 2025-07-21 18:11:43 +02:00
attila
8433428036 Accessibility: Make the FocusTraverser navigate onto disabled components
With this change disabled components become discoverable by screen
readers, similarly to how OS native user interface components behave by
default.

The KeyboardFocusTraverser will still skip disabled components so this
does not affect keyboard navigation without screen readers.
2025-07-10 13:51:12 +02:00
reuk
5d7208bb54
ModifierKeys: Avoid direct access to currentModifiers when reading but not writing 2025-06-19 14:42:49 +01:00
reuk
84eed04a59
Component: Add function to clear all cached image resources
In the DemoRunner, switching to and fro between the Settings tab and
the Demo tab displaying the OpenGL demo could lead to
GL_INVALID_OPERATION errors. This is because closing the demo shuts
down the GL context, destroying resources such as framebuffers. If any
Image objects backed by framebuffers outlive the context, they will be
invalidated. Component effect images are especially likely to hold onto
invalid framebuffer references.

With this change in place, images cached by Components will be
invalidated when the attached GL context goes out of scope, and will be
recreated when the new context is created.
2025-05-19 13:32:52 +01:00
reuk
bf54fb1fe9
Component: Recreate cached images if ideal type changes
This is intended to fix an issue where drawing a component snapshot into
a temporary OpenGL image can fail, because the GL context may not be
bound.
2025-05-19 13:32:52 +01:00
Oli
4ba01a80a0 Component: Use Context appropriate ImageType for temporary images
Co-authored-by: Matt Gonzalez <matt@echoaudio.com>
2025-04-24 13:58:23 +01:00
Matt Gonzalez
e9a5531587 Direct2D: Disable software backup for component effect image
Co-authored-by: Matt Gonzalez <matt@echoaudio.com>
2025-04-24 13:58:23 +01:00
reuk
a8c85f5969
SafePointer: Add new equality operators to avoid ambiguous operator warnings with clang 14 2025-04-14 13:05:28 +01:00
reuk
6ff5e57b62
Component: Add overload for setTopRightPosition(Point<int>) 2025-02-11 18:11:12 +00:00
reuk
95610e6c5e
Component: Add more stringent checks for deleted components when handling mouse events 2025-02-06 18:22:32 +00: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
reuk
fdf74a7477
Windowing: Reinstate old WindowFromPoint behaviour in ComponentPeer::contains
This reverts 515e9b9f89.

In order to avoid recursive calls through WM_NCHITTEST, we remove calls
to Component::contains in DocumentWindow::findControlAtPoint.
2024-10-02 11:35:39 +01:00
reuk
c02ec2e3d5 DocumentWindow: Ensure button callbacks are called on Windows 2024-09-30 20:12:51 +01:00
reuk
f5f758c032 Partially revert "ComponentPeer: Add isShowing() member, which more closely matches expected behaviour of Component::isShowing"
This partially reverts commit 555b667d22.

Using ComponentPeer::isShowing instead of ComponentPeer::isMinimised
inside Component::isShowing can cause problems when displaying OpenGL
components.

Specifically, OpenGL components use a ComponentMovementWatcher to
determine when they should be attached/detached from the parent window.
The ComponentMovementWatcher updates whenever a component visibility
change event is emitted, which happens in two cases:
- Component::setVisible is called on the OpenGL component or an ancestor
- ComponentPeer::handleMovedOrResized is called in response to a
  minimisation state change

When handling either of these events, the ComponentMovementWatcher will
call Component::isShowing to determine whether or not the component is
really showing.

The problem is that the result of ComponentPeer::isShowing may change
independently of changes to the Component visiblity state or
ComponentPeer minimisation state, so the ComponentPeerWatcher might not
notify its listeners when a component is really shown/hidden.

One potential workaround would be for the ComponentPeer to send
notifications when the showing state of the window changes, so that the
ComponentMovementWatcher can forward those notifications. The main
problem with this approach is that on Windows, the window doesn't seem
to receive a message on hide/show, and it's not clear whether there
exists some other approach to detect a hide/show event.

If there were some event we could listen for on Windows, then we could
call Component::sendVisibilityChangeMessage in response to this event
and things would *likely* work at that point, but this may still have
unintended side-effect. As a result, I think the best approach to
restore the old behaviour is to revert the change to
Component::isShowing. The implementations of ComponentPeer::isShowing
have been left in place so that users can do still query the real
visibility state of native windows if necessary.
2024-09-30 19:50:37 +01:00
reuk
555b667d22
ComponentPeer: Add isShowing() member, which more closely matches expected behaviour of Component::isShowing 2024-09-18 15:44:05 +01:00
attila
5ce2fc388e Fix C++23 compilation 2024-08-15 11:15:15 +02:00
reuk
225f1526ee
Component: Avoid creating ModalComponentManager unnecessarily 2024-06-20 17:52:23 +01:00
reuk
9a91ae2ab6
Component: Add API for window-control hit-testing 2024-05-31 11:43:30 +01:00
reuk
d7788100d5
ModalComponentManager: Remove friendship with Component
This change makes it slightly easier to audit invariants of
ModalComponentManager, as we can now be certain that only member
functions of ModalComponentManager can access its data members.
2024-05-31 11:43:28 +01:00
reuk
631b2ea2ba
Component: Cache effect images internally to Component, to avoid hash collisions in the ImageCache 2024-05-20 12:49:54 +01:00
reuk
aeeb06ccb9
SafePointer: Avoid potential double-deletes
deleteAndZero now behaves more like unique_ptr::reset, which sets the
new stored value before freeing the old one.
2024-05-20 12:48:11 +01:00
reuk
19061e6d17
Direct2D: Add initial support 2024-04-18 14:16:02 +01:00
reuk
4533077b75
LookAndFeel: Allow specifying a default typeface metrics kind to use 2024-04-18 14:16:00 +01:00
Tom Poole
94d98a2b10 Update licensing information 2024-04-16 11:39:35 +01:00
attila
fb14118771 MacOS: Disable window controls for windows created by JUCE when a Component is modal
The change does not affect plugin windows, which are created by the
host.
2024-01-17 18:54:37 +01:00
attila
7650c85ba5 Avoid focus changes due to mouse clicks for Components with setMouseClickGrabsKeyboardFocus (false)
Even if this focus change is being propagated up by a child Component.
2024-01-02 15:10:02 +01:00
Anthony Nicholls
c5fbeb859d Component: Improve the accuracy of the relative mouse position 2023-10-31 12:47:39 +00:00
Tom Poole
6bf9bb9a2e Add final specifiers in implementation files 2023-10-10 16:12:38 +01:00
Tom Poole
4153d59e39 Formatting 2023-10-02 15:42:20 +01:00
Tom Poole
7d45d498b9 Removed some superfluous consts from definitions 2023-09-20 16:31:10 +01:00
Anthony Nicholls
02eb66ee7a ProgressBar: Add style parameter 2023-06-22 13:07:03 +00:00
attila
7657efd227 WebBrowserComponent: Windows: Add accessibility integration 2023-06-08 16:07:11 +00:00
Anthony Nicholls
c7689793f2 Widgets: call repaint() in colourChanged() callbacks 2023-03-22 14:59:37 +00:00
Anthony Nicholls
5fb78e30ac Component: update docs to reflect what happens when the look-and-feel changes 2023-03-22 14:59:15 +00:00
Anthony Nicholls
cff722a4af GUI Basics: Refactor juce_gui_basics file structure
- Created a new detail namespace
- Moved shared module implementation details into the detail namespace
- Split dependencies so source files only rely on details in the detail namespace
- Removed all code from the juce_gui_basics.cpp file
2023-03-16 08:53:12 +00:00
reuk
9cfbccca8e
Accessibility: Make createAccessibilityHandler public to allow calls from derived classes 2023-02-09 17:54:18 +00:00
James Johnson
098262aa8a Add default return value for Component::exitModalState 2023-01-03 14:21:34 +00:00
attila
49cc7a0e09 Component: Fix potential bad access during mouse double click 2022-12-23 13:09:36 +00:00
reuk
2e16de3501
Component: Avoid mouseListener use-after-free when deleting components in mouse callbacks 2022-12-14 11:12:31 +00:00
attila
c1f3d30679 Component::MouseListenerList: Fix bad access 2022-11-07 13:08:19 +01:00
Fabian Renn-Giles
f2de0f12b0 GUI: Ensured that mouse listeners are still called even if the originating component is deleted in response to such an event 2022-11-02 22:52:49 +00:00
reuk
697643c0b6
Component: Add an assertion to check that the component remains alive when entering modal state 2022-11-02 11:35:51 +00:00
reuk
2b1745272e
Android: Fix a couple of accessibility-related crashes
These crashes could be seen in the DemoRunner when selecting items in
nested PopupMenu windows.
2022-06-13 15:29:56 +01:00
attila
5d5610286f Component: Use the rounded integer mouse position when evaluating hitTest
This commit reverts a small part of
4ca923a34b.
2022-06-10 20:38:37 +02:00