This adds a new QComboBox subclass called MUComboBox
to widgets/MUComboBox.{cpp,h}.
This QComboBox subclass explicitly uses a QListView
as the backing view for the QComboBox.
This fixes various styling issues for QComboBox
on macOS.
By default on macOS, QComboBoxes are backed by
something that tries to emulate a native macOS
menu. However, that QAbstractItemView behaves
inconsistently when styled. For example, it does
not seem possible to set the size of individual
items, because they're restricted to the height
of a normal macOS menu item.
Also, in some cases (such as the QComboBox used
for the transmission picker in MainWindow's
QToolbar), the height of the QAbstractItemView
was also wrong when styled. This caused the combo
box to always scroll, even though it seemingly
was sized correctly.
To get consistent behavior, we use QListView as
the QComboBox's view in MUComboBox.
Also, at least for the default Mumble themes,
I've observed some weird eliding behavior for
the text of added items in the transmission picker
QComboBox in MainWindow's toolbar. Because of that,
for MUComboBox, we don't show ellipses by default.
This fixes the display of the combo box in the
MainWindow's toolbar.
These strings from the registry are NUL terminated, but in practice, this
isn't guaranteed.
This means that the displayable version string for Windows 10 currently
contains NUL values.
The Mumble client doesn't care, but it isn't very nice. It breaks things
like CVP providers that don't sanitize Murmur's output.
To fix the problem, this change introduces a regString function that
converts a wchar_t string to QString. Any NUL value in the input
string will terminate the string.
Fixesmumble-voip/mumble#2469
The controller ID is shifted 24 bits, so the correct mask is
0x00ffffff.
Also, 0x00ffffffff (40 bits) should have been a red flag, since
we're working with uint32_t types here.
This fixes button names for Xbox controllers that are at indexes > 0.
It is possible for QTextDocument::size() to return
invalid sizes. For example, very big img tags with
sizes such as 33554451x33554451 cause QTextDocument
to return a QSizeF with a negative width or height.
This commits adds a call to QSizeF::isValid() to ensure
we treat QSizeFs with negative sizes as invalid.
Fixesmumble-voip/mumble#2477
This is a sensible default, because it looks good using all themes.
Previously, we used Qt's default style, which is platform-specific.
On Windows, we got an Aero-like style.
This change also fixes our issue with some parts of the wizard not
being styled correctly.
Fixesmumble-voip/mumble#2436
Like we log dwDevType when adding a device, let us also log it when
rejecting a blacklisted device.
We never reach the other log statement when a device is rejected, so
without this change, we can't see the device type of blacklisted
devices in the log.
We've previously resorted to blacklisting devices that cause hangs and
other issues.
The goal of logging dwDevType here is to be able to diagnose such issues
in the future. It would be interesting to know what such devices advertise
themselves as to DirectInput.
Perhaps, once we have more data, we can limit the amount of devices we
query, instead of querying all devices all the time.
This commit adds a new config option,
"shortcut/windows/directinput/verboselogging".
If set to true, GlobalShortcut_win will log all objects (that is, buttons,
keys, axes, etc.) for a device.
Some devices, such as the keyboard from mumble-voip/mumble#2426 advertise
an odd number of objects. In this case, 1024 objects.
This will hopefully help us in troubleshooting this issue.
This removes a lot of very hacky stuff. Its own job was to
let the manual plugin be a separate DLL.
Now that the manual plugin is built into Mumble itself, all
these dirty tricks can be removed.
Since we don't have to export a lot of symbols that we don't
use anymore, the linker can remove a lot of unused code for us:
mumble_app.dll before (1.3.0~969): 40.345 KB
mumble_app.dll after: 36.819 KB
Difference: -3.526 KB
The machinery needed to support the "manual" plugin as a DLL
file on Windows is very complex.
This is because we build Mumble itself as mumble_app.dll and link
our dependencies statically. And also because of various changes
made in Qt 5.
The manual plugin uses Qt. When Mumble linked dynamically against
Qt4Gui.dll, etc. - everything worked fine. The manual plugin simply
linked against the same DLLs.
With the move to mumble_app.dll, we also moved to statically link
against Qt for mumble_app.dll.
To accommodate the manual plugin, we implemented various hacks to
export the Qt symbols from mumble_app.dll that were necessary for
loading the manual plugin.
And that worked for a while.
However, right now, with Qt 5.6, the plugin is broken. And I get
a lot of weird crashes when interacting with the manual plugin.
Most of it boils down to the fact that both manual.dll and mumble_app.dll
have copies of statically initialized data, like QArrayData::shared_null.
Sharing objects between mumble_app.dll and manual.dll in this scenario is
impossible, because using the object in one module will cause one set of
statically initialized data to be used, while use in the other will cause
the other data to be accessed. This is especially bad for things that use
reference counting, because it'll get out of sync.
So, to get rid of this mess, we're moving the manual plugin into Mumble
itself. Functionally, it doesn't change anything. The manual plugin could
not be auto-updated because it depended on a specific Qt and Mumble
version. Mostly because it depended on the correct set of Qt symbols to be
exported from mumble_app.dll.
The plugin now works correctly, and we can safely remove a lot of the
hacks that were required to load the manual plugin in its earlier
incarnation.
The only downside is that we can't test the manual plugin in PAHelper.
But that wasn't really the case before either, because the plugin
practically depended on Mumble to run.
If a plugin implements MumblePluginQt, it is a signal to Mumble
that the plugin wishes to use Qt-based about and config dialogs.
The MmublePluginQt interface includes two methods: "about" and
"config".
Mumble will call these methods with a pointer to a QWidget that
is suitable to be the parent for the plugin's about and/or config
dialogs.
The MumblePluginQt interface is only useful for plugins that use Qt.
That, for now, is only the "manual" plugin. In general, plugins can't
really use Qt unless they're very tightly coupled to Mumble.
This new feature improves keyboard navigation in Mumble's main window
and is a great help to users of screen readers.
It was requested in mumble-voip/mumble#2291.
The behavior emulates Windows's (File) Explorer, where pressing F6
allows you to swtich focus between the application's main panes/panels.
In Mumble, pressing F6 switches between
Log view -> Chat input bar -> User tree view -> Log view [...]
Fixes part of mumble-voip/mumble#2291