void UIMachineLogicSeamless::prepareMachineWindows() { /* Do not create machine-window(s) if they created already: */ if (isMachineWindowsCreated()) return; #ifdef Q_WS_MAC // TODO: Is that really need here? /* We have to make sure that we are getting the front most process. * This is necessary for Qt versions > 4.3.3: */ ::darwinSetFrontMostProcess(); #endif /* Q_WS_MAC */ /* Update the multi-screen layout: */ m_pScreenLayout->update(); /* Create machine window(s): */ for (uint cScreenId = 0; cScreenId < session().GetMachine().GetMonitorCount(); ++cScreenId) addMachineWindow(UIMachineWindow::create(this, cScreenId)); /* Connect multi-screen layout change handler: */ for (int i = 0; i < machineWindows().size(); ++i) connect(m_pScreenLayout, SIGNAL(sigScreenLayoutChanged()), static_cast<UIMachineWindowSeamless*>(machineWindows()[i]), SLOT(sltShowInNecessaryMode())); /* Mark machine-window(s) created: */ setMachineWindowsCreated(true); }
void UIMachineLogicFullscreen::prepareMachineWindows() { /* Do not create machine-window(s) if they created already: */ if (isMachineWindowsCreated()) return; #ifdef Q_WS_MAC // TODO: Is that "darwinSetFrontMostProcess" really need here? /* We have to make sure that we are getting the front most process. * This is necessary for Qt versions > 4.3.3: */ ::darwinSetFrontMostProcess(); #endif /* Q_WS_MAC */ /* Update the multi-screen layout: */ m_pScreenLayout->update(); /* Create machine-window(s): */ for (uint cScreenId = 0; cScreenId < session().GetMachine().GetMonitorCount(); ++cScreenId) addMachineWindow(UIMachineWindow::create(this, cScreenId)); /* Connect multi-screen layout change handler: */ for (int i = 0; i < machineWindows().size(); ++i) connect(m_pScreenLayout, SIGNAL(sigScreenLayoutChanged()), static_cast<UIMachineWindowFullscreen*>(machineWindows()[i]), SLOT(sltShowInNecessaryMode())); #ifdef Q_WS_MAC /* If the user change the screen, we have to decide again if the * presentation mode should be changed. */ connect(m_pScreenLayout, SIGNAL(sigScreenLayoutChanged()), this, SLOT(sltScreenLayoutChanged())); /* Note: Presentation mode has to be set *after* the windows are created. */ setPresentationModeEnabled(true); #endif /* Q_WS_MAC */ /* Mark machine-window(s) created: */ setMachineWindowsCreated(true); }