From 72c397112f221cb18f79ec5ed3934c3b2b6ff89e Mon Sep 17 00:00:00 2001 From: David Bailes Date: Thu, 9 Jun 2016 17:54:20 +0100 Subject: [PATCH] Fix that the Device toolbar can be higher than it should be. This happens on Windows 7 if the display scaling factor is set to 125% (and probably higher). This also happens on Windows 10, but only if in addition to the high scaling factor, the display scaling at high DPI is disabled on the compatibility tab of audacity.exe's properties dialog. (The behaviour on Windows 8.1 wasn't checked.) The effect of the toolbar becoming higher, is that on a row of a tooldock, no other toolbar can be in front of the Device toolbar. In void DeviceToolBar::RepositionCombos(), the desired size of the combo boxes was set to the best size. The fix is only use the x value of the best size, and leave the y value unchanged. Note that this may not be the only problem in the code which causes this problem, and so this problem may resurface in the future. --- src/toolbars/DeviceToolBar.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/toolbars/DeviceToolBar.cpp b/src/toolbars/DeviceToolBar.cpp index c6e351e8c..5e78b4861 100644 --- a/src/toolbars/DeviceToolBar.cpp +++ b/src/toolbars/DeviceToolBar.cpp @@ -446,15 +446,21 @@ void DeviceToolBar::RepositionCombos() return; // set up initial sizes and ratios + // Note that the y values of the desired sizes are not changed, so that the height + // of the toolbar is not changed hostRatio = kHostWidthRatio; inputRatio = kInputWidthRatio; outputRatio = kOutputWidthRatio; channelsRatio = kChannelsWidthRatio; - desiredHost = mHost->GetBestSize(); - desiredInput = mInput->GetBestSize(); - desiredOutput = mOutput->GetBestSize(); - desiredChannels = mInputChannels->GetBestSize(); + desiredHost.x = mHost->GetBestSize().x; + desiredHost.y = mHost->GetSize().y; + desiredInput.x = mInput->GetBestSize().x; + desiredInput.y = mInput->GetSize().y; + desiredOutput.x = mOutput->GetBestSize().x; + desiredOutput.y = mOutput->GetSize().y; + desiredChannels.x = mInputChannels->GetBestSize().x; + desiredChannels.y = mInputChannels->GetSize().y; // wxGtk has larger comboboxes than the other platforms. For DeviceToolBar this will cause // the height to be double because of the discrete grid layout. So we shrink it to prevent this.