Commit ddcf63d2 authored by Andreas Traczyk's avatar Andreas Traczyk

mainwindow: fix window hiding after first wizard

Change-Id: Ia7faa08732395e7bc752a6354f6e5dd6a45253f6
parent 33bfdecd
......@@ -103,7 +103,7 @@ main(int argc, char* argv[])
newArgv[argc] = ARG_DISABLE_WEB_SECURITY;
newArgv[argc + 1] = nullptr;
#if defined(Q_OS_WIN) && defined(PROCESS_DPI_AWARE)
#if defined(Q_OS_WIN) && (PROCESS_DPI_AWARE)
SetProcessDPIAware();
#endif // Q_OS_WIN
......
......@@ -170,8 +170,6 @@ MainWindow::MainWindow(QWidget* parent)
lastScr_ = startScreen;
this->show();
#ifdef DEBUG_STYLESHEET
QTimer *timer = new QTimer(this);
connect(timer, &QTimer::timeout,
......@@ -340,7 +338,6 @@ void MainWindow::setWindowSize(ScreenEnum scr, bool firstUse)
setMaximumSize(QtMaxDimension, QtMaxDimension);
}
if (firstUse || !accountList.size()) {
#if defined(Q_OS_WIN) && !defined(PROCESS_DPI_AWARE)
auto screenNumber = qApp->desktop()->screenNumber();
setGeometry(
QStyle::alignedRect(
......@@ -348,7 +345,6 @@ void MainWindow::setWindowSize(ScreenEnum scr, bool firstUse)
Qt::AlignCenter,
size(),
qApp->desktop()->screenGeometry(screenNumber)));
#endif
if (scr == ScreenEnum::WizardScreen) {
setWindowFlags(Qt::Dialog);
setWindowFlags(windowFlags() & (~Qt::WindowContextHelpButtonHint));
......@@ -364,7 +360,8 @@ void MainWindow::setWindowSize(ScreenEnum scr, bool firstUse)
void MainWindow::show()
{
#if defined(Q_OS_WIN) && !defined(PROCESS_DPI_AWARE)
QMainWindow::show();
#if defined(Q_OS_WIN)
disconnect(screenChangedConnection_);
screenChangedConnection_ = connect(windowHandle(), &QWindow::screenChanged,
this, &MainWindow::slotScreenChanged);
......
......@@ -82,7 +82,7 @@
<ExceptionHandling>Sync</ExceptionHandling>
<ObjectFileName>$(IntDir)</ObjectFileName>
<Optimization>MaxSpeed</Optimization>
<PreprocessorDefinitions>PROCESS_DPI_AWARE;_WINDOWS;UNICODE;_UNICODE;WIN32;WIN64;QT_NO_DEBUG;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>PROCESS_DPI_AWARE=1;_WINDOWS;UNICODE;_UNICODE;WIN32;WIN64;QT_NO_DEBUG;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessToFile>false</PreprocessToFile>
<ProgramDataBaseFileName>$(IntDir)vc$(PlatformToolsetVersion).pdb</ProgramDataBaseFileName>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
......@@ -121,7 +121,7 @@
<QtMoc>
<QTDIR>$(QTDIR)</QTDIR>
<OutputFile>.\GeneratedFiles\$(ConfigurationName)\moc_%(Filename).cpp</OutputFile>
<Define>PROCESS_DPI_AWARE;_WINDOWS;UNICODE;_UNICODE;WIN32;WIN64;QT_NO_DEBUG;NDEBUG;%(PreprocessorDefinitions)</Define>
<Define>PROCESS_DPI_AWARE=1;_WINDOWS;UNICODE;_UNICODE;WIN32;WIN64;QT_NO_DEBUG;NDEBUG;%(PreprocessorDefinitions)</Define>
<CompilerFlavor>msvc</CompilerFlavor>
<Include>$(Configuration)/moc_predefs.h</Include>
<ExecutionDescription>Moc'ing %(Identity)...</ExecutionDescription>
......
......@@ -90,7 +90,7 @@ SelectAreaDialog::mouseReleaseEvent(QMouseEvent* event)
QApplication::restoreOverrideCursor();
releaseMouse();
QRect rect = rubberBand_->geometry();
#if defined(Q_OS_WIN) && !defined(PROCESS_DPI_AWARE)
#if defined(Q_OS_WIN) && !(PROCESS_DPI_AWARE)
if (screen && screen->devicePixelRatio() > 1.0) {
auto scaledSize = screen->geometry();
auto sourceHdc = GetDC(nullptr);
......
......@@ -284,7 +284,7 @@ VideoView::showContextMenu(const QPoint& pos)
auto screenNumber = qApp->desktop()->screenNumber(this);
QScreen* screen = qApp->screens().at(screenNumber);
QRect rect = screen ? screen->geometry() : qApp->primaryScreen()->geometry();
#if defined(Q_OS_WIN) && defined(PROCESS_DPI_AWARE)
#if defined(Q_OS_WIN) && (PROCESS_DPI_AWARE)
rect.setSize(Utils::getRealSize(screen));
#endif
LRCInstance::avModel().setDisplay(screenNumber,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment