From ae1606b18c099b743e3cb410395b35ee290ae335 Mon Sep 17 00:00:00 2001 From: Norwegian Rock Cat Date: Mon, 30 Mar 2009 15:55:07 +0200 Subject: Call documented API. We were using the older CGSSetWindowAlpha function, which really is not well advertised. Instead, Apple eventually added SetWindowAlpha, but we neglected to update. May as well do that now skip the wrath of a change in the private API. Task-number: 244629 --- src/gui/kernel/qwidget_mac.mm | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/gui/kernel/qwidget_mac.mm b/src/gui/kernel/qwidget_mac.mm index 7a586e1..cd11b52 100644 --- a/src/gui/kernel/qwidget_mac.mm +++ b/src/gui/kernel/qwidget_mac.mm @@ -4450,14 +4450,6 @@ void QWidgetPrivate::setMask_sys(const QRegion ®ion) #endif } -extern "C" { - typedef struct CGSConnection *CGSConnectionRef; - typedef struct CGSWindow *CGSWindowRef; - extern OSStatus CGSSetWindowAlpha(CGSConnectionRef, CGSWindowRef, float); - extern CGSWindowRef GetNativeWindowFromWindowRef(WindowRef); - extern CGSConnectionRef _CGSDefaultConnection(); -} - void QWidgetPrivate::setWindowOpacity_sys(qreal level) { Q_Q(QWidget); @@ -4470,12 +4462,11 @@ void QWidgetPrivate::setWindowOpacity_sys(qreal level) if (!q->testAttribute(Qt::WA_WState_Created)) return; -#if QT_MAC_USE_COCOA OSWindowRef oswindow = qt_mac_window_for(q); +#if QT_MAC_USE_COCOA [oswindow setAlphaValue:level]; #else - CGSSetWindowAlpha(_CGSDefaultConnection(), - GetNativeWindowFromWindowRef(qt_mac_window_for(q)), level); + SetWindowAlpha(oswindow, level); #endif } -- cgit v0.12