macOS: Remove checks for macHasAccessToWindowsServer

We do have access to the window server, as reported by the
CGSessionCopyCurrentDictionary() API. As most of our UI tests
do require window server access in some form, let's remove the
existing checks, as they should no longer be needed the way
we run CI these days.

Change-Id: I9ac18bbcc67abf0705c8b4e071dd5f2de0fb5092
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
This commit is contained in:
Tor Arne Vestbø 2024-09-29 18:45:32 +02:00
parent 6f4fcf63c1
commit 7d6bac5f2b
2 changed files with 0 additions and 39 deletions

View File

@ -85,17 +85,6 @@ static HWND winHandleOf(const QWidget *w)
# define Q_CHECK_PAINTEVENTS
#endif
#ifdef Q_OS_MACOS
#include <Security/AuthSession.h>
bool macHasAccessToWindowsServer()
{
SecuritySessionId mySession;
SessionAttributeBits sessionInfo;
SessionGetInfo(callerSecuritySession, &mySession, &sessionInfo);
return (sessionInfo & sessionHasGraphicAccess);
}
#endif
#if defined(Q_OS_WIN)
static inline void setWindowsAnimationsEnabled(bool enabled)
{
@ -3563,15 +3552,7 @@ void tst_QWidget::showMinimizedKeepsFocus()
window.showNormal();
QVERIFY(QTest::qWaitForWindowActive(&window));
#ifdef Q_OS_MACOS
if (!macHasAccessToWindowsServer())
QEXPECT_FAIL("", "When not having WindowServer access, we lose focus.", Continue);
#endif
QTRY_COMPARE(window.focusWidget(), firstchild);
#ifdef Q_OS_MACOS
if (!macHasAccessToWindowsServer())
QEXPECT_FAIL("", "When not having WindowServer access, we lose focus.", Continue);
#endif
QTRY_COMPARE(QApplication::focusWidget(), firstchild);
}
}
@ -9636,10 +9617,6 @@ void tst_QWidget::doubleRepaint()
QSKIP("QTBUG-52974");
#endif
#if defined(Q_OS_MACOS)
if (!macHasAccessToWindowsServer())
QSKIP("Not having window server access causes the wrong number of repaints to be issues");
#endif
UpdateWidget widget;
widget.setPalette(simplePalette());
widget.setWindowTitle(QLatin1String(QTest::currentTestFunction()));

View File

@ -413,18 +413,6 @@ void tst_QMdiArea::subWindowActivated()
}
}
#ifdef Q_OS_MAC
#include <Security/AuthSession.h>
bool macHasAccessToWindowsServer()
{
SecuritySessionId mySession;
SessionAttributeBits sessionInfo;
SessionGetInfo(callerSecuritySession, &mySession, &sessionInfo);
return (sessionInfo & sessionHasGraphicAccess);
}
#endif
void tst_QMdiArea::subWindowActivated2()
{
if (QGuiApplication::platformName().startsWith(QLatin1String("wayland"), Qt::CaseInsensitive))
@ -481,10 +469,6 @@ void tst_QMdiArea::subWindowActivated2()
// Check that we only emit _one_ signal and the active window
// is unchanged after showMinimized/showNormal.
mdiArea.showMinimized();
#if defined (Q_OS_MAC)
if (!macHasAccessToWindowsServer())
QEXPECT_FAIL("", "showMinimized doesn't really minimize if you don't have access to the server", Abort);
#endif
#ifdef Q_OS_MAC
QSKIP("QTBUG-25298: This test is unstable on Mac.");
#endif