Keep Cocoa screen list in sync on screen connect.
The backtrace in QTBUG-33012 indicates that the screen list is getting out of sync on plugging/unplugging an external monitor. This happens on 10.9 only. Check if we are about to out of bounds access the screen list; call updateScreens() which will add the new screen. Task-number: QTBUG-33012 Change-Id: Id1acc3baca9e60e7f2a83188d66cdf9d322a582c Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
This commit is contained in:
parent
5ee6c24901
commit
8f46cb3ade
@ -125,7 +125,7 @@ public:
|
||||
QList<int> possibleKeys(const QKeyEvent *event) const;
|
||||
|
||||
void updateScreens();
|
||||
QCocoaScreen *screenAtIndex(int index) const { return mScreens.at(index); }
|
||||
QCocoaScreen *screenAtIndex(int index);
|
||||
|
||||
private:
|
||||
|
||||
|
@ -343,6 +343,14 @@ void QCocoaIntegration::updateScreens()
|
||||
screen->setVirtualSiblings(siblings);
|
||||
}
|
||||
|
||||
QCocoaScreen *QCocoaIntegration::screenAtIndex(int index)
|
||||
{
|
||||
if (index >= mScreens.count())
|
||||
updateScreens();
|
||||
|
||||
return mScreens.at(index);
|
||||
}
|
||||
|
||||
bool QCocoaIntegration::hasCapability(QPlatformIntegration::Capability cap) const
|
||||
{
|
||||
switch (cap) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user