1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-19 01:04:20 +00:00
Commit graph

293 commits

Author SHA1 Message Date
reuk
72f3a15616
HWNDComponentPeer: Avoid auto-scaling child hwnds
The scaling machinery in the component peer was causing problems for
hosted plugin views. Scaling the plugin view size requires close
collaboration between the plugin and the host, and it's important for
the host to have exact control over the size of the plugin's view. The
removed code in the HWNDComponentPeer was modifying the sizes of
embedded plugin windows, which would often leave them at an incorrect
size.

The faulty behaviour was especially noticable with plugins that do not
support DPI-aware behaviour. I tested with the following plugins (VST2 +
VST3), which should all now display correctly in the AudioPluginHost,
and assume the correct size when opened on hi-res displays, or dragged
between displays with different scale factors:
- Plogue AlterEgo
- U-He Hive 2
- FabFilter Pro-C
- Native Instruments Supercharger
- Surge
2021-09-30 14:19:26 +01:00
reuk
7cd04f7d74
Windowing: Refactor DPI-related function loading 2021-09-30 14:19:26 +01:00
ed
3d282c1078 Desktop: Deprecate isOSXDarkModeActive() and add isDarkModeActive() for other platforms 2021-09-29 17:40:58 +01:00
reuk
4e694c96b3
ScopedDPIAwarenessDisabler: Move to juce_gui_basics 2021-09-28 11:31:50 +01:00
reuk
8b45ff83e2
Windowing: Ignore suggested window sizes for windows that should not be DPI aware 2021-09-28 11:31:50 +01:00
reuk
31500551e1
Move declaration of createSnapshotOfNativeWindow to module header 2021-09-28 11:31:49 +01:00
reuk
6c59a31456
Win32 Windowing: Fix uninitialised data members warning 2021-09-28 11:31:49 +01:00
ed
baa1bbafdf Windows: Fall back to old-style modal dialog when showing native message box modally since TaskDialog does not support fully modal dialogs 2021-09-02 12:33:59 +01:00
ed
f5eee033ba NativeMessageBox: Return correctly mapped value when shown modally 2021-09-02 08:35:14 +01:00
reuk
087cda7e1f
HWNDComponentPeer: Fix reentrancy bug in DPICHANGED handler
Sometimes, changing the bounds of the window inside the DPICHANGED
handler can cause further DPI change events to be processed. Previously,
the scaleFactor set by the "inner" events was also being used when
notifying listeners about the "outer" events, leading to graphical
glitches.

An effect of the bug was that VST2 views in the AudioPluginHost would
occasionally render with an incorrect size and position after dragging
them between displays with different scale factors.

With this change in place, we only notify listeners and update window
bounds once there are no DPI changes in progress.
2021-07-30 09:20:11 +01:00
reuk
20c23700e5 MinGW: Fix some build issues for 32-bit platforms 2021-07-28 19:28:34 +01:00
ed
551d7b9c5b Add MessageBoxOptions class for specifying a set of AlertWindow and NativeMessageBox options
- Add AlertWindow::show() and showAsync() methods that take a MessageBoxOptions argument
  - Add NativeMessageBox::show() and showAsync() methods that take a MessageBoxOptions argument
  - Update the DialogsDemo to demonstrate the new methods
  - Deprecate AlertWindow::showNativeDialogBox() in favour of the NativeMessageBox methods
  - Pass button strings specified in MesssageBoxOptions to native dialog boxes correctly
  - Use modern TaskDialog on Windows for the native dialog box where available
2021-07-21 16:34:12 +01:00
ed
d5175b6e23 Windows: Use ScopedThreadDPIAwarenessSetter in keyboard hooks to set correct thread DPI awareness 2021-06-10 18:14:50 +01:00
reuk
1ee106d730
PopupMenu: Avoid dismissing PopupMenus in bridged plugin editors
When bridging 32-bit/64-bit plugins on Windows, the plugin is hosted in
an auxilliary process, and the plugin's editor is embedded into an HWND
owned by a different process (the plugin host).

Previously, the `isForegroundProcess` check would fail for bridged
plugins, because the foreground window may belong to the DAW, rather
than to the auxilliary hosting process.

This patch adds an additional check, to find whether the same process
owns both the foreground window, and the window which embeds the
PopupMenu's target component. In this case, we avoid immediately
dismissing the PopupMenu.
2021-06-08 14:57:42 +01:00
reuk
7ac6911ccc
Windows: Fix clang/gnu compiler warnings 2021-06-03 17:30:44 +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
c19cd73306
HWNDComponentPeer: Avoid dismissing modals from peer-initiated messages 2021-05-14 17:41:32 +01:00
ed
8b74ec2fb7 MinGW: Exclude native accessibility code 2021-05-12 08:02:20 +01:00
ed
70d0657f00 Windows: Only load UIA functions when accessibility is active 2021-05-11 15:57:54 +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
reuk
19821db2a3
HWNDComponentPeer: Dismiss modals when windows are moved
This change ensures that popup menus will be dismissed when hosted
plugin windows are moved, even when these plugin views are themselves
hosted inside JUCE views, like those used in the AudioPluginHost.
2021-05-04 14:24:22 +01:00
ed
c32142a215 Windows: Fixed a build error and some unreachable code warnings when JUCE_WIN_PER_MONITOR_DPI_AWARE=0 2021-03-05 18:40:03 +00:00
ed
1ff7fc38b1 Windows: Added ScopedDeviceContext helper 2021-03-02 15:56:55 +00:00
ed
f6338c0f8e Windows: Added ScopedThreadDPIAwarenessSetter for correctly setting and resetting thread DPI-awareness for methods which interact with an HWND and removed some DPI workarounds 2021-03-02 15:56:10 +00:00
ed
3a0af69eff AudioPluginHost: Added an application-level setting for scaling plug-ins on Windows 2021-03-02 15:53:45 +00:00
ed
3d378d0384 Windows: Avoid setting WINDOWPOS in handlePositionChanging() when "new" coordinates are floating-point rounding errors due to scale factor conversion 2021-02-19 19:07:12 +00:00
ed
ec0345c093 Windows: Check whether child HWNDs were already scaled during the scale factor listener callback to avoid double-scaling them in handleDPIChanging() 2021-02-19 19:07:12 +00:00
ed
cb57904740 Windows: Improved support for DPI-aware embedded windows in HWNDComponent 2021-02-19 19:07:05 +00:00
ed
b5a06b0e2f Windows: Use MapWindowPoints() in HWNDComponentPeer::getBounds() to get correct client coordinates when we're the child of another HWND 2021-02-11 11:23:07 +00:00
ed
fd83e0f51e Removed Displays const_casts from ComponentPeer implementations 2021-02-08 14:38:09 +00:00
ed
af69be5346 Windows: Tidied up the usage of the JUCE_COMCALL, JUCE_COMCLASS, and JUCE_IUNKNOWNCLASS macros 2021-01-29 15:40:12 +00:00
reuk
755e93e1c0 HWNDComponentPeer: Avoid assertions when opening submenus 2021-01-18 12:25:14 +00:00
reuk
85facf6d6e
HWNDComponentPeer: Dismiss modals more proactively
This change makes heavyweight views listen to window events from higher
in the window hierarchy. If a move or resize event from higher in the
hierarchy is encountered, blocking modal components will be dismissed.

This patch should resolve an issue where the popupmenu for a combobox
could become 'stranded' if the plugin window was moved while the box was
open.
2021-01-15 12:18:31 +00:00
ed
6325230f61 Windows: Use rectangleFromRECT() to clean up some code 2021-01-06 17:16:36 +00:00
ed
09c25fedfd Windows: Retrieve work area rectangle for all connected monitors 2021-01-06 17:16:36 +00:00
ed
b614f9e01e Windows: Only call Displays::updateToLogical() on per-monitor DPI-aware threads 2021-01-06 17:16:35 +00:00
reuk
88285acae1
DragAndDrop: Fix drag and drop in windows optimised builds
In very optimised builds, SHCore.dll may not be automatically loaded
into the address space of the calling executable. In these cases, the
call to `GetModuleHandle` will fail. Adding the call to LoadLibrary
ensures that the dll is loaded into the program's address space, which
will allow the call to GetModuleHandle to succeed.
2021-01-06 12:31:38 +00:00
reuk
e988c4c671
DragAndDrop: Tidy up windows implementation 2021-01-06 12:31:38 +00:00
ed
b7e28541ca Replaced deprecated Displays methods 2020-10-27 12:38:59 +00:00
ed
4a09440222 Windows: Return result of ComponentPeer::handleKeyPress() in doAppCommand() to prevent JUCE apps always consuming media keys 2020-09-22 10:52:03 +01:00
ed
af968f5d78 Small fix for previous commit 2020-07-07 09:04:06 +01:00
ed
f1a5f2ef1e Windows: Fixed drag and drop position for DPI-unaware windows 2020-07-06 17:21:14 +01:00
ed
009d685179 Updated all license headers 2020-06-29 08:30:22 +01:00
reuk
092bc44413
MinGW: Fix windows/gcc warnings 2020-05-11 11:28:28 +01:00
reuk
f49b3733ec
Warnings: Silence some GCC warnings 2020-05-05 12:28:47 +01:00
reuk
4cf66d6522 Cleanup: Remove redundant inlines 2020-04-27 10:22:06 +01:00
reuk
e13901d912 ClangCl: Silence code which warns when building on Windows with Clang 2020-04-27 10:22:06 +01:00
Tom Poole
894e7d2bd2 Updated all license headers 2020-04-23 17:30:39 +01:00
ed
fe61354c21 Linux: Added X11Symbols and WebKitSymbols singletons to dynamically load X11 and WebKit library functions at runtime 2020-04-16 12:18:48 +01:00
reuk
327f817b9b Copyrights: Update commercial/gpl headers to be gpl-only 2020-04-09 15:22:56 +01:00