From ef3398334e66cf559c0636957d1aefb66bacae5f Mon Sep 17 00:00:00 2001 From: JoergAtGithub Date: Sun, 1 May 2022 19:14:25 +0200 Subject: [PATCH 01/10] Made error dialog with "Show Details" so wide, that there are no unnecessary line breaks. --- src/errordialoghandler.cpp | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/src/errordialoghandler.cpp b/src/errordialoghandler.cpp index 4b67de7d987..c35f14375b1 100644 --- a/src/errordialoghandler.cpp +++ b/src/errordialoghandler.cpp @@ -2,6 +2,7 @@ #include #include +#include #include #include @@ -9,6 +10,15 @@ #include "util/assert.h" #include "util/compatibility/qmutex.h" #include "util/versionstore.h" +#include "util/widgethelper.h" + +namespace { +// Gross estimated dimensions for the size of the error dialog, +// with Show Details expanded. +constexpr int kEstimatedShowDetailedDialogWidth = 1000; // px +constexpr int kEstimatedShowDetailedDialogHeight = 500; // px +constexpr int kEstimatedDialogBorders = 50; // px +} // namespace ErrorDialogProperties::ErrorDialogProperties() : m_title(VersionStore::applicationName()), @@ -149,7 +159,21 @@ void ErrorDialogHandler::errorDialog(ErrorDialogProperties* pProps) { if (!props->m_details.isEmpty()) { pMsgBox->setDetailedText(props->m_details); if (props->m_detailsUseMonospaceFont) { - pMsgBox->setStyleSheet("QTextEdit { font-family: monospace; }"); + // There is no event to repond on the Show Details button of QMessagBox. + // Therefore we must consider the expanded size for positioning the dialog initially. + const auto* const pScreen = + mixxx::widgethelper::getScreen(*pMsgBox); + pMsgBox->setGeometry(QStyle::alignedRect( + Qt::LeftToRight, + Qt::AlignCenter, + QSize(kEstimatedShowDetailedDialogWidth, kEstimatedShowDetailedDialogHeight), + pScreen->geometry())); + pMsgBox->setStyleSheet("QTextEdit { min-width: " + + QString::number(kEstimatedShowDetailedDialogWidth - + kEstimatedDialogBorders) + + "px ; max-height: " + + QString::number(kEstimatedShowDetailedDialogHeight) + + "px; font-family: monospace;}"); } } From 75fdda783a9b319fe9f09af94c3d65f6310458fa Mon Sep 17 00:00:00 2001 From: JoergAtGithub Date: Wed, 4 May 2022 21:34:02 +0200 Subject: [PATCH 02/10] Fixed spelling in comment --- src/errordialoghandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/errordialoghandler.cpp b/src/errordialoghandler.cpp index c35f14375b1..aecf49d9343 100644 --- a/src/errordialoghandler.cpp +++ b/src/errordialoghandler.cpp @@ -159,7 +159,7 @@ void ErrorDialogHandler::errorDialog(ErrorDialogProperties* pProps) { if (!props->m_details.isEmpty()) { pMsgBox->setDetailedText(props->m_details); if (props->m_detailsUseMonospaceFont) { - // There is no event to repond on the Show Details button of QMessagBox. + // There is no event to respond on the Show Details button of QMessagBox. // Therefore we must consider the expanded size for positioning the dialog initially. const auto* const pScreen = mixxx::widgethelper::getScreen(*pMsgBox); From 7b468f8693d5580bd80dfa7d9e39101d33e30465 Mon Sep 17 00:00:00 2001 From: JoergAtGithub Date: Wed, 4 May 2022 21:49:23 +0200 Subject: [PATCH 03/10] Limit maximum detailed dialog size to screen size, to support devices with very small screens --- src/errordialoghandler.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/errordialoghandler.cpp b/src/errordialoghandler.cpp index aecf49d9343..89cd0c7b08a 100644 --- a/src/errordialoghandler.cpp +++ b/src/errordialoghandler.cpp @@ -163,16 +163,25 @@ void ErrorDialogHandler::errorDialog(ErrorDialogProperties* pProps) { // Therefore we must consider the expanded size for positioning the dialog initially. const auto* const pScreen = mixxx::widgethelper::getScreen(*pMsgBox); + int dialogWidth = kEstimatedShowDetailedDialogWidth; + int dialogHeight = kEstimatedShowDetailedDialogHeight; + // Limit dialog size to screen size, for the case of devices with very small display - like Raspberry Pi. + if (dialogWidth > pScreen->geometry().width()) { + dialogWidth = pScreen->geometry().width(); + } + if (dialogHeight > pScreen->geometry().height()) { + dialogHeight = pScreen->geometry().height(); + } pMsgBox->setGeometry(QStyle::alignedRect( Qt::LeftToRight, Qt::AlignCenter, - QSize(kEstimatedShowDetailedDialogWidth, kEstimatedShowDetailedDialogHeight), + QSize(dialogWidth, dialogHeight), pScreen->geometry())); pMsgBox->setStyleSheet("QTextEdit { min-width: " + - QString::number(kEstimatedShowDetailedDialogWidth - + QString::number(dialogWidth - kEstimatedDialogBorders) + "px ; max-height: " + - QString::number(kEstimatedShowDetailedDialogHeight) + + QString::number(dialogHeight) + "px; font-family: monospace;}"); } } From 3657c9c9bad566d7bdbe4e677825311fe34ea497 Mon Sep 17 00:00:00 2001 From: JoergAtGithub Date: Sun, 8 May 2022 13:10:53 +0200 Subject: [PATCH 04/10] Compose string as QString and use .arg --- src/errordialoghandler.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/errordialoghandler.cpp b/src/errordialoghandler.cpp index 89cd0c7b08a..b87d1aeb3d0 100644 --- a/src/errordialoghandler.cpp +++ b/src/errordialoghandler.cpp @@ -177,12 +177,11 @@ void ErrorDialogHandler::errorDialog(ErrorDialogProperties* pProps) { Qt::AlignCenter, QSize(dialogWidth, dialogHeight), pScreen->geometry())); - pMsgBox->setStyleSheet("QTextEdit { min-width: " + - QString::number(dialogWidth - - kEstimatedDialogBorders) + - "px ; max-height: " + - QString::number(dialogHeight) + - "px; font-family: monospace;}"); + pMsgBox->setStyleSheet( + QString("QTextEdit { min-width: %1px ; max-height: %2px; " + "font-family: monospace;}") + .arg(dialogWidth - kEstimatedDialogBorders) + .arg(dialogHeight)); } } From d5f4edf4251b118f6f4254a79a4a203b93efad58 Mon Sep 17 00:00:00 2001 From: JoergAtGithub Date: Wed, 11 May 2022 20:06:10 +0200 Subject: [PATCH 05/10] Introduced constexpr for minimum supported screen size --- src/errordialoghandler.cpp | 38 ++++++++++++++++++++--------- src/library/dlgcoverartfullsize.cpp | 7 ++++-- src/util/widgethelper.h | 8 ++++++ 3 files changed, 40 insertions(+), 13 deletions(-) diff --git a/src/errordialoghandler.cpp b/src/errordialoghandler.cpp index b87d1aeb3d0..190d1bdcdda 100644 --- a/src/errordialoghandler.cpp +++ b/src/errordialoghandler.cpp @@ -18,6 +18,7 @@ namespace { constexpr int kEstimatedShowDetailedDialogWidth = 1000; // px constexpr int kEstimatedShowDetailedDialogHeight = 500; // px constexpr int kEstimatedDialogBorders = 50; // px +constexpr int kMinimumSpaceAroundDialog = 40; // px } // namespace ErrorDialogProperties::ErrorDialogProperties() @@ -165,18 +166,33 @@ void ErrorDialogHandler::errorDialog(ErrorDialogProperties* pProps) { mixxx::widgethelper::getScreen(*pMsgBox); int dialogWidth = kEstimatedShowDetailedDialogWidth; int dialogHeight = kEstimatedShowDetailedDialogHeight; - // Limit dialog size to screen size, for the case of devices with very small display - like Raspberry Pi. - if (dialogWidth > pScreen->geometry().width()) { - dialogWidth = pScreen->geometry().width(); - } - if (dialogHeight > pScreen->geometry().height()) { - dialogHeight = pScreen->geometry().height(); + if (pScreen) { + // Limit dialog size to screen size, for the case of devices with very small display - like Raspberry Pi. + if (dialogWidth > pScreen->geometry().width() - 2 * kMinimumSpaceAroundDialog) { + dialogWidth = pScreen->geometry().width() - 2 * kMinimumSpaceAroundDialog; + } + if (dialogHeight > pScreen->geometry().height() - 2 * kMinimumSpaceAroundDialog) { + dialogHeight = pScreen->geometry().height() - 2 * kMinimumSpaceAroundDialog; + } + pMsgBox->setGeometry(QStyle::alignedRect( + Qt::LeftToRight, + Qt::AlignCenter, + QSize(dialogWidth, dialogHeight), + pScreen->geometry())); + } else { + pMsgBox->setStyleSheet("QTextEdit { font-family: monospace; }"); + // some safe defaults for max pos, width and height + dialogWidth = + mixxx::widgethelper::kWidthOfMinimumSupportedScreen - + 2 * kMinimumSpaceAroundDialog; + dialogHeight = + mixxx::widgethelper::kHeightOfMinimumSupportedScreen - + 2 * kMinimumSpaceAroundDialog; + pMsgBox->setGeometry(kMinimumSpaceAroundDialog, + kMinimumSpaceAroundDialog, + dialogWidth, + dialogHeight); } - pMsgBox->setGeometry(QStyle::alignedRect( - Qt::LeftToRight, - Qt::AlignCenter, - QSize(dialogWidth, dialogHeight), - pScreen->geometry())); pMsgBox->setStyleSheet( QString("QTextEdit { min-width: %1px ; max-height: %2px; " "font-family: monospace;}") diff --git a/src/library/dlgcoverartfullsize.cpp b/src/library/dlgcoverartfullsize.cpp index ac22b959047..934e4bb3547 100644 --- a/src/library/dlgcoverartfullsize.cpp +++ b/src/library/dlgcoverartfullsize.cpp @@ -173,8 +173,11 @@ void DlgCoverArtFullSize::slotCoverFound( const QScreen* const pScreen = mixxx::widgethelper::getScreen(*centerOverWidget); QRect screenGeometry; VERIFY_OR_DEBUG_ASSERT(pScreen) { - qWarning() << "Assuming screen size of 800x600px."; - screenGeometry = QRect(0, 0, 800, 600); + qWarning() << "Assuming minimum supported screen size"; + screenGeometry = QRect(0, + 0, + mixxx::widgethelper::kWidthOfMinimumSupportedScreen, + mixxx::widgethelper::kHeightOfMinimumSupportedScreen); } else { screenGeometry = pScreen->geometry(); diff --git a/src/util/widgethelper.h b/src/util/widgethelper.h index 4eb1473ee2e..30127bcfdde 100644 --- a/src/util/widgethelper.h +++ b/src/util/widgethelper.h @@ -12,6 +12,14 @@ namespace mixxx { namespace widgethelper { +/// Value to be used as fallback for screen width, +/// when getScreen fails to determine the screen +constexpr int kWidthOfMinimumSupportedScreen = 800; // px + +/// Value to be used as fallback for screen height, +/// when getScreen fails to determine the screen +constexpr int kHeightOfMinimumSupportedScreen = 600; // px + /// Returns an adjusted upper left point for displaying the popup /// with the given size on the screen, shifting the popup if it would go off /// the right or bottom edges of the screen. From 7d40391c207d9882a55b315d9a1b458f5fa62912 Mon Sep 17 00:00:00 2001 From: JoergAtGithub Date: Sun, 15 May 2022 16:49:54 +0200 Subject: [PATCH 06/10] Better symbol naming for constexpressions --- src/errordialoghandler.cpp | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/errordialoghandler.cpp b/src/errordialoghandler.cpp index 190d1bdcdda..bd981bfe2ab 100644 --- a/src/errordialoghandler.cpp +++ b/src/errordialoghandler.cpp @@ -17,8 +17,9 @@ namespace { // with Show Details expanded. constexpr int kEstimatedShowDetailedDialogWidth = 1000; // px constexpr int kEstimatedShowDetailedDialogHeight = 500; // px -constexpr int kEstimatedDialogBorders = 50; // px -constexpr int kMinimumSpaceAroundDialog = 40; // px +constexpr int kEstimatedDialogPadding = 50; // px +// used to push the dialog away from screen borders to not cover taskbars +constexpr int kMinimumDialogMargin = 40; // px } // namespace ErrorDialogProperties::ErrorDialogProperties() @@ -168,11 +169,11 @@ void ErrorDialogHandler::errorDialog(ErrorDialogProperties* pProps) { int dialogHeight = kEstimatedShowDetailedDialogHeight; if (pScreen) { // Limit dialog size to screen size, for the case of devices with very small display - like Raspberry Pi. - if (dialogWidth > pScreen->geometry().width() - 2 * kMinimumSpaceAroundDialog) { - dialogWidth = pScreen->geometry().width() - 2 * kMinimumSpaceAroundDialog; + if (dialogWidth > pScreen->geometry().width() - 2 * kMinimumDialogMargin) { + dialogWidth = pScreen->geometry().width() - 2 * kMinimumDialogMargin; } - if (dialogHeight > pScreen->geometry().height() - 2 * kMinimumSpaceAroundDialog) { - dialogHeight = pScreen->geometry().height() - 2 * kMinimumSpaceAroundDialog; + if (dialogHeight > pScreen->geometry().height() - 2 * kMinimumDialogMargin) { + dialogHeight = pScreen->geometry().height() - 2 * kMinimumDialogMargin; } pMsgBox->setGeometry(QStyle::alignedRect( Qt::LeftToRight, @@ -184,19 +185,19 @@ void ErrorDialogHandler::errorDialog(ErrorDialogProperties* pProps) { // some safe defaults for max pos, width and height dialogWidth = mixxx::widgethelper::kWidthOfMinimumSupportedScreen - - 2 * kMinimumSpaceAroundDialog; + 2 * kMinimumDialogMargin; dialogHeight = mixxx::widgethelper::kHeightOfMinimumSupportedScreen - - 2 * kMinimumSpaceAroundDialog; - pMsgBox->setGeometry(kMinimumSpaceAroundDialog, - kMinimumSpaceAroundDialog, + 2 * kMinimumDialogMargin; + pMsgBox->setGeometry(kMinimumDialogMargin, + kMinimumDialogMargin, dialogWidth, dialogHeight); } pMsgBox->setStyleSheet( QString("QTextEdit { min-width: %1px ; max-height: %2px; " "font-family: monospace;}") - .arg(dialogWidth - kEstimatedDialogBorders) + .arg(dialogWidth - kEstimatedDialogPadding) .arg(dialogHeight)); } } From 1bd01c61b9708300419f6510044a0b3d6dbeb9cd Mon Sep 17 00:00:00 2001 From: JoergAtGithub Date: Sun, 15 May 2022 17:23:52 +0200 Subject: [PATCH 07/10] Changed fallback behavior if screen can't be determined. In this case the dialog will appear as before this PR. --- src/errordialoghandler.cpp | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/src/errordialoghandler.cpp b/src/errordialoghandler.cpp index bd981bfe2ab..1c1bacf5733 100644 --- a/src/errordialoghandler.cpp +++ b/src/errordialoghandler.cpp @@ -165,9 +165,10 @@ void ErrorDialogHandler::errorDialog(ErrorDialogProperties* pProps) { // Therefore we must consider the expanded size for positioning the dialog initially. const auto* const pScreen = mixxx::widgethelper::getScreen(*pMsgBox); - int dialogWidth = kEstimatedShowDetailedDialogWidth; - int dialogHeight = kEstimatedShowDetailedDialogHeight; if (pScreen) { + int dialogWidth = kEstimatedShowDetailedDialogWidth; + int dialogHeight = kEstimatedShowDetailedDialogHeight; + // Limit dialog size to screen size, for the case of devices with very small display - like Raspberry Pi. if (dialogWidth > pScreen->geometry().width() - 2 * kMinimumDialogMargin) { dialogWidth = pScreen->geometry().width() - 2 * kMinimumDialogMargin; @@ -180,25 +181,16 @@ void ErrorDialogHandler::errorDialog(ErrorDialogProperties* pProps) { Qt::AlignCenter, QSize(dialogWidth, dialogHeight), pScreen->geometry())); + pMsgBox->setStyleSheet( + QString("QTextEdit { min-width: %1px ; max-height: %2px; " + "font-family: monospace;}") + .arg(dialogWidth - kEstimatedDialogPadding) + .arg(dialogHeight)); } else { + // Fallback when mixxx::widgethelper::getScreen can't determine the screen + // This happens always with Qt5.12 pMsgBox->setStyleSheet("QTextEdit { font-family: monospace; }"); - // some safe defaults for max pos, width and height - dialogWidth = - mixxx::widgethelper::kWidthOfMinimumSupportedScreen - - 2 * kMinimumDialogMargin; - dialogHeight = - mixxx::widgethelper::kHeightOfMinimumSupportedScreen - - 2 * kMinimumDialogMargin; - pMsgBox->setGeometry(kMinimumDialogMargin, - kMinimumDialogMargin, - dialogWidth, - dialogHeight); } - pMsgBox->setStyleSheet( - QString("QTextEdit { min-width: %1px ; max-height: %2px; " - "font-family: monospace;}") - .arg(dialogWidth - kEstimatedDialogPadding) - .arg(dialogHeight)); } } From 80c9a4241026384c0f6b0ec9096af2e8d3977c69 Mon Sep 17 00:00:00 2001 From: JoergAtGithub Date: Sun, 15 May 2022 17:57:00 +0200 Subject: [PATCH 08/10] Reverted unrelated changes in widgethelper.h and dlgcoverartfullsize.cpp --- src/library/dlgcoverartfullsize.cpp | 7 ++----- src/util/widgethelper.h | 8 -------- 2 files changed, 2 insertions(+), 13 deletions(-) diff --git a/src/library/dlgcoverartfullsize.cpp b/src/library/dlgcoverartfullsize.cpp index 934e4bb3547..ac22b959047 100644 --- a/src/library/dlgcoverartfullsize.cpp +++ b/src/library/dlgcoverartfullsize.cpp @@ -173,11 +173,8 @@ void DlgCoverArtFullSize::slotCoverFound( const QScreen* const pScreen = mixxx::widgethelper::getScreen(*centerOverWidget); QRect screenGeometry; VERIFY_OR_DEBUG_ASSERT(pScreen) { - qWarning() << "Assuming minimum supported screen size"; - screenGeometry = QRect(0, - 0, - mixxx::widgethelper::kWidthOfMinimumSupportedScreen, - mixxx::widgethelper::kHeightOfMinimumSupportedScreen); + qWarning() << "Assuming screen size of 800x600px."; + screenGeometry = QRect(0, 0, 800, 600); } else { screenGeometry = pScreen->geometry(); diff --git a/src/util/widgethelper.h b/src/util/widgethelper.h index 30127bcfdde..4eb1473ee2e 100644 --- a/src/util/widgethelper.h +++ b/src/util/widgethelper.h @@ -12,14 +12,6 @@ namespace mixxx { namespace widgethelper { -/// Value to be used as fallback for screen width, -/// when getScreen fails to determine the screen -constexpr int kWidthOfMinimumSupportedScreen = 800; // px - -/// Value to be used as fallback for screen height, -/// when getScreen fails to determine the screen -constexpr int kHeightOfMinimumSupportedScreen = 600; // px - /// Returns an adjusted upper left point for displaying the popup /// with the given size on the screen, shifting the popup if it would go off /// the right or bottom edges of the screen. From dd5e0c38f83301ed9d62c6968184811b3ca18743 Mon Sep 17 00:00:00 2001 From: JoergAtGithub Date: Tue, 24 May 2022 23:54:20 +0200 Subject: [PATCH 09/10] Use primaryScreen as fallback if getScreen returns nullptr --- src/errordialoghandler.cpp | 53 +++++++++++++++++++------------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/src/errordialoghandler.cpp b/src/errordialoghandler.cpp index 1c1bacf5733..8829c22e6ff 100644 --- a/src/errordialoghandler.cpp +++ b/src/errordialoghandler.cpp @@ -1,6 +1,7 @@ #include "errordialoghandler.h" #include +#include #include #include #include @@ -163,34 +164,34 @@ void ErrorDialogHandler::errorDialog(ErrorDialogProperties* pProps) { if (props->m_detailsUseMonospaceFont) { // There is no event to respond on the Show Details button of QMessagBox. // Therefore we must consider the expanded size for positioning the dialog initially. - const auto* const pScreen = + auto* pScreen = mixxx::widgethelper::getScreen(*pMsgBox); - if (pScreen) { - int dialogWidth = kEstimatedShowDetailedDialogWidth; - int dialogHeight = kEstimatedShowDetailedDialogHeight; - - // Limit dialog size to screen size, for the case of devices with very small display - like Raspberry Pi. - if (dialogWidth > pScreen->geometry().width() - 2 * kMinimumDialogMargin) { - dialogWidth = pScreen->geometry().width() - 2 * kMinimumDialogMargin; - } - if (dialogHeight > pScreen->geometry().height() - 2 * kMinimumDialogMargin) { - dialogHeight = pScreen->geometry().height() - 2 * kMinimumDialogMargin; - } - pMsgBox->setGeometry(QStyle::alignedRect( - Qt::LeftToRight, - Qt::AlignCenter, - QSize(dialogWidth, dialogHeight), - pScreen->geometry())); - pMsgBox->setStyleSheet( - QString("QTextEdit { min-width: %1px ; max-height: %2px; " - "font-family: monospace;}") - .arg(dialogWidth - kEstimatedDialogPadding) - .arg(dialogHeight)); - } else { - // Fallback when mixxx::widgethelper::getScreen can't determine the screen - // This happens always with Qt5.12 - pMsgBox->setStyleSheet("QTextEdit { font-family: monospace; }"); + if (!pScreen) { + // Fallback to obtain the primary screen when mixxx::widgethelper::getScreen can't + // determine the screen This happens always with Qt5.12 + pScreen = qGuiApp->primaryScreen(); + } + DEBUG_ASSERT(pScreen); + int dialogWidth = kEstimatedShowDetailedDialogWidth; + int dialogHeight = kEstimatedShowDetailedDialogHeight; + + // Limit dialog size to screen size, for the case of devices with very small display - like Raspberry Pi. + if (dialogWidth > pScreen->geometry().width() - 2 * kMinimumDialogMargin) { + dialogWidth = pScreen->geometry().width() - 2 * kMinimumDialogMargin; + } + if (dialogHeight > pScreen->geometry().height() - 2 * kMinimumDialogMargin) { + dialogHeight = pScreen->geometry().height() - 2 * kMinimumDialogMargin; } + pMsgBox->setGeometry(QStyle::alignedRect( + Qt::LeftToRight, + Qt::AlignCenter, + QSize(dialogWidth, dialogHeight), + pScreen->geometry())); + pMsgBox->setStyleSheet( + QString("QTextEdit { min-width: %1px ; max-height: %2px; " + "font-family: monospace;}") + .arg(dialogWidth - kEstimatedDialogPadding) + .arg(dialogHeight)); } } From 1f32d426b4eb0c1b35ac6e1c379fea47ff82b554 Mon Sep 17 00:00:00 2001 From: JoergAtGithub Date: Sun, 29 May 2022 18:11:07 +0200 Subject: [PATCH 10/10] Improved code comment --- src/errordialoghandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/errordialoghandler.cpp b/src/errordialoghandler.cpp index 8829c22e6ff..4874ee91611 100644 --- a/src/errordialoghandler.cpp +++ b/src/errordialoghandler.cpp @@ -168,7 +168,7 @@ void ErrorDialogHandler::errorDialog(ErrorDialogProperties* pProps) { mixxx::widgethelper::getScreen(*pMsgBox); if (!pScreen) { // Fallback to obtain the primary screen when mixxx::widgethelper::getScreen can't - // determine the screen This happens always with Qt5.12 + // determine the screen. This happens always with Qt <5.14 pScreen = qGuiApp->primaryScreen(); } DEBUG_ASSERT(pScreen);