-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: JUCS Titlebar close button non-functional in Windows #1469
Comments
I'm currently unable to reproduce this behaviour in testing. Please can you provide some more detail about the exact steps you're taking in order to trigger the issue? Ideally, share a minimal code example that demonstrates the problem, or explain how to trigger the issue in one of the JUCE examples from the main repository. In particular, it's not clear which close button is not working - the modal dialog's close button, or the main window's button. I tried modifying a standalone plugin project to use a non-native titlebar for the Audio/MIDI settings window by changing line 313 of juce_StandaloneFilterWindow.h like so: o.useNativeTitleBar = false; The behaviour I see is as follows:
This is the behaviour I'd expect to see. Are you seeing different behaviour to this? If so, it would be helpful to test exactly the code you're running, in order to debug the issue. If you'd prefer not to share the code publicly, you can also reach us at |
Hi,
Both minimise and close buttons are inoperative in both Document windows and Modal dialog boxes. Closing the window via Alt & F4 or pressing the escape button for modal windows correctly triggers the events that lead to the Window(s) being closed.
I have tracked the issue to the message that is being generated when a window button is clicked. I added some debug code to dispatchNextMessage in juce_Messaging_windows.cpp in both versions of JUCE I have running.
JUCE 7.0.12
Mouse down = 513
MouseUp = 514
These messages above correspond with the hex codes for WM_LBUTTONDOWN and WM_RBUTTONDOWN.
JUCE 8.0.3
Mouse down = 161
MouseUp = 162
These messages from build 8.0.3 do not result in the relevant events being raised and their generation appears to be responsible for the lack of button functionality for my project.
I know this does not help you reproduce the issue but I thought it might help a little. I tried a couple of demo projects and they work normally so the only other thing I could do is to try create an emulation using the same custom StandaloneFilterWindow class I am using in my project.
Thanks in advance
Kirsten
|
If your window is fully custom, and doesn't inherit from DocumentWindow, perhaps you need to override |
Hi,
Done some more investigative work and built a new plugin in V8.03 to compare against my project that works fully in V7.0.12.
When the GetMessage macro is called in dispatchNextMessage (juce_Messaging_windows.cpp) the wParam value is incorrect when I run my project in V8.0.3.
My project
Test Project created in V8.0.3
I pressed the minimise window button and wParam = 8 is the correct value. I can track this further through the code to successful implementation. The wParam value of 2 generated by my project is passed through the same code but hits a switch (in peerWindowProc ) where there is no matching case so nothing happens.
Both times the code is referencing the same file (WinUser.h) in the same non-JUCE related location
Cheers
Kirsten
|
Please try implementing |
Hi,
Sorry I was unclear. I am using my own version of standaloneFilterWindow class which inherits from DocumentWindow.
Window looks like this. The white border appeared in V8. When I hover over the minimise or close buttons they are painted differently so the mouse hover is being detected.
Ran through code in peerWindowProc and the buttons are not identified @ const auto kind = component.findControlAtPoint (localPoint);
Cheers
Kirsten
|
How are you adding your buttons to the document window? The DocumentWindow implementation of findControlAtPoint does the following:
So, if you're adding additional buttons instead of styling the buttons that the window creates, this implementation won't work for you. You'd need to override the function yourself to do the right thing, or change your window implementation to use the buttons provided by the DocumentWindow. I recommend actually debugging into |
Hi,
My Document window does not have custom buttons. Went through code findControlAtPoint and deduced my issue is cause by using Desktop::getInstance().setGlobalScaleFactor().
My main window is fixed aspect ratio but I have a scale setting which resizes the main window. I am using Desktop::getInstance().setGlobalScaleFactor() to change the font sizes when the magnification factor is not 1.0.
So it seems that the value set Desktop::getInstance().setGlobalScaleFactor() is also scaling the point values returned from findControlAtPoint, so it returns incorrect scaled point values when setGlobalScaleFactor is not 1.0. Thus it does not return the buttons as the source because most significantly the pointX value is incorrect.
Hopefully you can now reproduce this and fix it 😊
Cheers
Kirsten
|
Detailed steps on how to reproduce the bug
I am using JUCE titlebar for main app (document window) & for modal dialog windows. The close button does not function so there is no way to close the main app window. If I change a modal dialog to Native (Windows) then that close button works. Bug exists in both 8.0.3 & develop branches
What is the expected behaviour?
Close button should close window
Operating systems
Windows
What versions of the operating systems?
Windows 10 Pro 22H2
Architectures
64-bit
Stacktrace
No response
Plug-in formats (if applicable)
VST3, Standalone
Plug-in host applications (DAWs) (if applicable)
No response
Testing on the
develop
branchThe bug is present on the
develop
branchCode of Conduct
The text was updated successfully, but these errors were encountered: