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

217 commits

Author SHA1 Message Date
Tom Poole
94d98a2b10 Update licensing information 2024-04-16 11:39:35 +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
attila
7657efd227 WebBrowserComponent: Windows: Add accessibility integration 2023-06-08 16:07:11 +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
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
reuk
140f8fedb1
TextEditor: Add option to dismiss the virtual keyboard on touches outside
Previously, individual components had to ask the peer to hide and show
the keyboard, by calling textInputRequired() and
dismissPendingTextInput() respectively. When an onscreen keyboard (OSK)
was required, most Peer implementation would directly hide/show the OSK
inside these function. However, the iOS ComponentPeer implementation
instead listened to the application's global keyboard focus, and only
opened the OSK when the focused component was also a TextInputTarget
with active input.

The iOS scheme seems like a better design, as it enforces that the OSK
hiding and showing is synced with the keyboard focus of the application.
In the other implementations, it was possible for a Component to call
textInputRequired even when it didn't have the keyboard focus, putting
the application into an inconsistent state. The iOS scheme also makes
the TextInputTarget interface more useful, as it enforces that the OSK
will only display for components that implement TextInputTarget, and
return true from isTextInputActive().

This patch changes all Peer implementations to match the iOS
implementation, improving consistency. Each time the global keyboard
focus changes, refreshTextInputTarget is called automatically, and the
OSK is shown if the focused component is a TextInputTarget that returns
true from isTextInputActive, and hidden otherwise. Components can also
call refreshTextInputTarget manually. This should be done whenever the
component updates the return value of isTextInputActive(). Effectively,
the Peer is now responsible for keeping track of the focused
TextInputTarget, rather than allowing individual components to hide and
show the OSK at will.

Additionally, this patch adds an option to the TextEditor to
automatically dismiss the OSK when the mouse is clicked outside of the
editor. This should improve user experience on mobile platforms, where
touches on sibling components may cause a TextEditor to gain keyboard
focus and unnecessarily display the OSK.
2022-06-09 16:55:19 +01:00
attila
2c2c21ebc9 Linux: Fix sporadic positioning error after window creation 2022-05-19 12:06:28 +02:00
Tom Poole
2ec861d99e Update licensing banners to JUCE 7 2022-05-16 17:55:48 +01:00
Tom Poole
dea3fe60e4 Update copyright banners 2022-04-04 12:36:32 +01:00
attila
55b00fc846 Component: Fix mouseEnter and mouseExit positions when blocked by modal 2022-03-23 18:40:47 +00:00
Tom Poole
87a4ab4a78 Disable the effect of setPaintingIsUnclipped on components with children 2022-03-17 22:06:04 +00:00
Tom Poole
9ccfea9001 Component: Make getApproximateScaleFactorForComponent take a const argument 2022-03-04 10:25:51 +00:00
reuk
eb6e579f0a
ComponentPeer: Correctly scale drag and drop coordinates to account for global scale 2022-02-23 10:56:12 +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
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
ca4bdb6b3a
Component: Avoid calling member functions on objects destroyed when exiting modal state 2021-11-24 16:20:37 +00:00
reuk
eca02270ee
Component: Add Point<float> overloads for some common functions 2021-10-27 16:33:37 +01:00
reuk
4ca923a34b
NSViewComponentPeer: Allow mouse events to reach unfocused windows
This change allows mouse events (including enter and exit events) to
reach unfocused views on macOS. This matches the behaviour of unfocused
windows on Linux and Windows, where components paint in their "hovered"
states even when the application window is in the background.

As a byproduct of using tracking areas on macOS, we can remove the fake
mouse move generator.
2021-10-27 16:33:37 +01:00
reuk
f85ede6b47
Component: Ensure that mouseEnter and mouseExit calls are balanced when entering/leaving modal state 2021-10-26 16:52:15 +01:00
ed
3fac215534 Component: Give away keyboard focus when disabled 2021-10-08 17:19:04 +01:00
ed
a852f4f45f Component: Only pass mouse wheel and magnify events up to enabled parents 2021-10-08 17:19:04 +01:00
ed
46a4dc95a1 Accessibility: Fix potential infinite recursive component keyboard focus loop 2021-09-29 11:46:10 +01:00
ed
8d6ba3b54e Accessibility: Use AccessibilityRole::ignored for UI elements that should not be accessible to screen readers but have accessible children 2021-09-07 11:23:17 +01:00
ed
59333870f5 Accessibility: Disable accessibility of child components when calling Component::setAccessible (false); 2021-09-02 08:35:14 +01:00
ed
a2f7aaab2f Accessibility: Don't create AccessibilityHandler for Components without a native window handle 2021-07-28 11:44:28 +01:00
ed
a5c3b81f82 Use C++14 lambda capture initialisers for initialising deletion checkers 2021-07-12 11:58:29 +01:00
ed
e119178b5b Check BailOutChecker before sending accessibility moved/resized event in Component::sendMovedResizedMessages() 2021-07-01 16:23:48 +01:00
ed
d1b669e6ae Accessibility: Added InternalAccessibilityEvent::elementMovedOrResized 2021-06-16 17:22:35 +01:00
reuk
5db072b483 Component: Avoid calling native APIs from background threads
When rendering with OpenGL, the paint function is called from a
background thread. If we call `isMouseOver` from the paint function, we
may end up calling native functions via the ComponentPeer, which causes
threading warnings on macOS.
2021-06-16 11:35:25 +01:00
ed
550127945d Added floating-point implementations for some Component hit-testing methods to improve reliability when dealing with scaled Components 2021-06-08 14:14:22 +01:00
ed
df4ff3b225 Accessibility: Fixed some focus issues with modal components 2021-06-07 19:38:29 +01:00
ed
fa17310dd1 Added back in rounding error fix from e8518048 that was overwritten in 7909af4e 2021-05-26 16:54:38 +01:00
reuk
31a7c62baf
Windows: Fix and suppress some analysis warnings
This fixes warnings that are emitted when building with the `-analyze`
flag enabled.
2021-05-26 15:34:26 +01:00
reuk
1c2abc80d7
Component: Ensure getScreenPosition result is in terms of the logical coordinate space of the screen
Previously, getScreenPosition would return a result in the component's
coordinate space if it was called on a component that was not directly
or indirectly on the desktop. This behaviour is surprising and difficult
to program around. This change should ensure that the result is always
in the screen's coordinate space.
2021-05-24 14:57:26 +01:00
ed
82a5911d56 Accessibility: Send focus change notification in Component::enterModalState() 2021-05-20 18:24:57 +01:00
reuk
668f16f0ec
Component: Ensure component position does not change when removed and re-added to desktop 2021-05-12 12:50:08 +01:00
ed
ec990202b1 Accessibility: Added VoiceOver (macOS) and Narrator (Windows) accessibility screen reader support to juce_gui_basics 2021-05-10 10:53:14 +01:00
Tom Poole
79fbde7099 Added preliminary support for FreeBSD 2021-03-29 14:16:46 +01:00
ed
891d86fe6b Don't trigger a fake mouse move from Component::sendFakeMouseMove() if the component passes through all mouse events 2021-01-28 11:26:41 +00:00
ed
33dd896ab2 Ensure that keyboard focus is always given away when components are made invisible 2021-01-22 10:44:25 +00:00
reuk
586ab8927d Fix warnings when building in C++20 mode 2021-01-15 13:33:40 +00:00