Changeset View
Changeset View
Standalone View
Standalone View
app/mainwindow.cpp
Context not available. | |||||
135 | 135 | | |||
---|---|---|---|---|---|
136 | m_sessionStack->addSession(); | 136 | m_sessionStack->addSession(); | ||
137 | 137 | | |||
138 | if (Settings::firstRun()) | 138 | if(Settings::firstRun()) | ||
139 | { | 139 | { | ||
140 | QMetaObject::invokeMethod(this, "toggleWindowState", Qt::QueuedConnection); | 140 | QMetaObject::invokeMethod(this, "toggleWindowState", Qt::QueuedConnection); | ||
141 | QMetaObject::invokeMethod(this, "showFirstRunDialog", Qt::QueuedConnection); | 141 | QMetaObject::invokeMethod(this, "showFirstRunDialog", Qt::QueuedConnection); | ||
Context not available. | |||||
143 | else | 143 | else | ||
144 | { | 144 | { | ||
145 | showStartupPopup(); | 145 | showStartupPopup(); | ||
146 | if (Settings::pollMouse()) toggleMousePoll(true); | 146 | if(Settings::pollMouse()) toggleMousePoll(true); | ||
147 | } | 147 | } | ||
148 | 148 | | |||
149 | if (Settings::openAfterStart()) | 149 | if(Settings::openAfterStart()) | ||
150 | QMetaObject::invokeMethod(this, "toggleWindowState", Qt::QueuedConnection); | 150 | QMetaObject::invokeMethod(this, "toggleWindowState", Qt::QueuedConnection); | ||
151 | } | 151 | } | ||
152 | 152 | | |||
Context not available. | |||||
160 | #if HAVE_KWAYLAND | 160 | #if HAVE_KWAYLAND | ||
161 | void MainWindow::initWayland() | 161 | void MainWindow::initWayland() | ||
162 | { | 162 | { | ||
163 | if (!m_isWayland) { | 163 | if(!m_isWayland) { | ||
164 | return; | 164 | return; | ||
165 | } | 165 | } | ||
166 | 166 | | |||
167 | using namespace KWayland::Client; | 167 | using namespace KWayland::Client; | ||
168 | auto connection = ConnectionThread::fromApplication(this); | 168 | auto connection = ConnectionThread::fromApplication(this); | ||
169 | if (!connection) { | 169 | if(!connection) { | ||
170 | return; | 170 | return; | ||
171 | } | 171 | } | ||
172 | Registry *registry = new Registry(this); | 172 | Registry *registry = new Registry(this); | ||
Context not available. | |||||
174 | QObject::connect(registry, &Registry::interfacesAnnounced, this, | 174 | QObject::connect(registry, &Registry::interfacesAnnounced, this, | ||
175 | [registry, this] { | 175 | [registry, this] { | ||
176 | const auto interface = registry->interface(Registry::Interface::PlasmaShell); | 176 | const auto interface = registry->interface(Registry::Interface::PlasmaShell); | ||
177 | if (interface.name != 0) { | 177 | if(interface.name != 0) { | ||
178 | m_plasmaShell = registry->createPlasmaShell(interface.name, interface.version, this); | 178 | m_plasmaShell = registry->createPlasmaShell(interface.name, interface.version, this); | ||
179 | } | 179 | } | ||
180 | } | 180 | } | ||
Context not available. | |||||
186 | 186 | | |||
187 | void MainWindow::initWaylandSurface() | 187 | void MainWindow::initWaylandSurface() | ||
188 | { | 188 | { | ||
189 | if (m_plasmaShellSurface) { | 189 | if(m_plasmaShellSurface) { | ||
190 | return; | 190 | return; | ||
191 | } | 191 | } | ||
192 | if (!m_plasmaShell) { | 192 | if(!m_plasmaShell) { | ||
193 | return; | 193 | return; | ||
194 | } | 194 | } | ||
195 | if (auto surface = KWayland::Client::Surface::fromWindow(windowHandle())) { | 195 | if(auto surface = KWayland::Client::Surface::fromWindow(windowHandle())) { | ||
196 | m_plasmaShellSurface = m_plasmaShell->createSurface(surface, this); | 196 | m_plasmaShellSurface = m_plasmaShell->createSurface(surface, this); | ||
197 | m_plasmaShellSurface->setPosition(pos()); | 197 | m_plasmaShellSurface->setPosition(pos()); | ||
198 | } | 198 | } | ||
Context not available. | |||||
208 | QString closeQuestion = xi18nc("@info","Are you sure you want to quit?"); | 208 | QString closeQuestion = xi18nc("@info","Are you sure you want to quit?"); | ||
209 | QString warningMessage; | 209 | QString warningMessage; | ||
210 | 210 | | |||
211 | if ((confirmQuit && m_sessionStack->count() > 1) || hasUnclosableSessions) | 211 | if((confirmQuit && m_sessionStack->count() > 1) || hasUnclosableSessions) | ||
212 | { | 212 | { | ||
213 | if (confirmQuit && m_sessionStack->count() > 1) | 213 | if(confirmQuit && m_sessionStack->count() > 1) | ||
214 | { | 214 | { | ||
215 | if (hasUnclosableSessions) | 215 | if(hasUnclosableSessions) | ||
216 | warningMessage = xi18nc("@info", "<warning>There are multiple open sessions, <emphasis>some of which you have locked to prevent closing them accidentally.</emphasis> These will be killed if you continue.</warning>"); | 216 | warningMessage = xi18nc("@info", "<warning>There are multiple open sessions, <emphasis>some of which you have locked to prevent closing them accidentally.</emphasis> These will be killed if you continue.</warning>"); | ||
217 | else | 217 | else | ||
218 | warningMessage = xi18nc("@info", "<warning>There are multiple open sessions. These will be killed if you continue.</warning>"); | 218 | warningMessage = xi18nc("@info", "<warning>There are multiple open sessions. These will be killed if you continue.</warning>"); | ||
219 | } | 219 | } | ||
220 | else if (hasUnclosableSessions) | 220 | else if(hasUnclosableSessions) | ||
221 | { | 221 | { | ||
222 | warningMessage = xi18nc("@info", "<warning>There are one or more open sessions that you have locked to prevent closing them accidentally. These will be killed if you continue.</warning>"); | 222 | warningMessage = xi18nc("@info", "<warning>There are one or more open sessions that you have locked to prevent closing them accidentally. These will be killed if you continue.</warning>"); | ||
223 | } | 223 | } | ||
Context not available. | |||||
461 | 461 | | |||
462 | void MainWindow::handleContextDependentAction(QAction* action, int sessionId) | 462 | void MainWindow::handleContextDependentAction(QAction* action, int sessionId) | ||
463 | { | 463 | { | ||
464 | if (sessionId == -1) sessionId = m_sessionStack->activeSessionId(); | 464 | if(sessionId == -1) sessionId = m_sessionStack->activeSessionId(); | ||
465 | if (sessionId == -1) return; | 465 | if(sessionId == -1) return; | ||
466 | 466 | | |||
467 | if (!action) action = qobject_cast<QAction*>(QObject::sender()); | 467 | if(!action) action = qobject_cast<QAction*>(QObject::sender()); | ||
468 | 468 | | |||
469 | if (action == actionCollection()->action(QStringLiteral("edit-profile"))) | 469 | if(action == actionCollection()->action(QStringLiteral("edit-profile"))) | ||
470 | m_sessionStack->editProfile(sessionId); | 470 | m_sessionStack->editProfile(sessionId); | ||
471 | 471 | | |||
472 | if (action == actionCollection()->action(QStringLiteral("close-session"))) | 472 | if(action == actionCollection()->action(QStringLiteral("close-session"))) | ||
473 | m_sessionStack->removeSession(sessionId); | 473 | m_sessionStack->removeSession(sessionId); | ||
474 | 474 | | |||
475 | if (action == actionCollection()->action(QStringLiteral("move-session-left"))) | 475 | if(action == actionCollection()->action(QStringLiteral("move-session-left"))) | ||
476 | m_tabBar->moveTabLeft(sessionId); | 476 | m_tabBar->moveTabLeft(sessionId); | ||
477 | 477 | | |||
478 | if (action == actionCollection()->action(QStringLiteral("move-session-right"))) | 478 | if(action == actionCollection()->action(QStringLiteral("move-session-right"))) | ||
479 | m_tabBar->moveTabRight(sessionId); | 479 | m_tabBar->moveTabRight(sessionId); | ||
480 | 480 | | |||
481 | if (action == actionCollection()->action(QStringLiteral("rename-session"))) | 481 | if(action == actionCollection()->action(QStringLiteral("rename-session"))) | ||
482 | m_tabBar->interactiveRename(sessionId); | 482 | m_tabBar->interactiveRename(sessionId); | ||
483 | 483 | | |||
484 | if (action == actionCollection()->action(QStringLiteral("close-active-terminal"))) | 484 | if(action == actionCollection()->action(QStringLiteral("close-active-terminal"))) | ||
485 | m_sessionStack->closeActiveTerminal(sessionId); | 485 | m_sessionStack->closeActiveTerminal(sessionId); | ||
486 | 486 | | |||
487 | if (action == actionCollection()->action(QStringLiteral("split-left-right"))) | 487 | if(action == actionCollection()->action(QStringLiteral("split-left-right"))) | ||
488 | m_sessionStack->splitSessionLeftRight(sessionId); | 488 | m_sessionStack->splitSessionLeftRight(sessionId); | ||
489 | 489 | | |||
490 | if (action == actionCollection()->action(QStringLiteral("split-top-bottom"))) | 490 | if(action == actionCollection()->action(QStringLiteral("split-top-bottom"))) | ||
491 | m_sessionStack->splitSessionTopBottom(sessionId); | 491 | m_sessionStack->splitSessionTopBottom(sessionId); | ||
492 | 492 | | |||
493 | if (action == actionCollection()->action(QStringLiteral("grow-terminal-right"))) | 493 | if(action == actionCollection()->action(QStringLiteral("grow-terminal-right"))) | ||
494 | m_sessionStack->tryGrowTerminalRight(m_sessionStack->activeTerminalId()); | 494 | m_sessionStack->tryGrowTerminalRight(m_sessionStack->activeTerminalId()); | ||
495 | 495 | | |||
496 | if (action == actionCollection()->action(QStringLiteral("grow-terminal-left"))) | 496 | if(action == actionCollection()->action(QStringLiteral("grow-terminal-left"))) | ||
497 | m_sessionStack->tryGrowTerminalLeft(m_sessionStack->activeTerminalId()); | 497 | m_sessionStack->tryGrowTerminalLeft(m_sessionStack->activeTerminalId()); | ||
498 | 498 | | |||
499 | if (action == actionCollection()->action(QStringLiteral("grow-terminal-top"))) | 499 | if(action == actionCollection()->action(QStringLiteral("grow-terminal-top"))) | ||
500 | m_sessionStack->tryGrowTerminalTop(m_sessionStack->activeTerminalId()); | 500 | m_sessionStack->tryGrowTerminalTop(m_sessionStack->activeTerminalId()); | ||
501 | 501 | | |||
502 | if (action == actionCollection()->action(QStringLiteral("grow-terminal-bottom"))) | 502 | if(action == actionCollection()->action(QStringLiteral("grow-terminal-bottom"))) | ||
503 | m_sessionStack->tryGrowTerminalBottom(m_sessionStack->activeTerminalId()); | 503 | m_sessionStack->tryGrowTerminalBottom(m_sessionStack->activeTerminalId()); | ||
504 | } | 504 | } | ||
505 | 505 | | |||
506 | void MainWindow::handleContextDependentToggleAction(bool checked, QAction* action, int sessionId) | 506 | void MainWindow::handleContextDependentToggleAction(bool checked, QAction* action, int sessionId) | ||
507 | { | 507 | { | ||
508 | if (sessionId == -1) sessionId = m_sessionStack->activeSessionId(); | 508 | if(sessionId == -1) sessionId = m_sessionStack->activeSessionId(); | ||
509 | if (sessionId == -1) return; | 509 | if(sessionId == -1) return; | ||
510 | 510 | | |||
511 | if (!action) action = qobject_cast<QAction*>(QObject::sender()); | 511 | if(!action) action = qobject_cast<QAction*>(QObject::sender()); | ||
512 | 512 | | |||
513 | if (action == actionCollection()->action(QStringLiteral("toggle-session-prevent-closing"))) { | 513 | if(action == actionCollection()->action(QStringLiteral("toggle-session-prevent-closing"))) { | ||
514 | m_sessionStack->setSessionClosable(sessionId, !checked); | 514 | m_sessionStack->setSessionClosable(sessionId, !checked); | ||
515 | 515 | | |||
516 | // Repaint the tab bar when the Prevent Closing action is toggled | 516 | // Repaint the tab bar when the Prevent Closing action is toggled | ||
Context not available. | |||||
518 | m_tabBar->repaint(); | 518 | m_tabBar->repaint(); | ||
519 | } | 519 | } | ||
520 | 520 | | |||
521 | if (action == actionCollection()->action(QStringLiteral("toggle-session-keyboard-input"))) | 521 | if(action == actionCollection()->action(QStringLiteral("toggle-session-keyboard-input"))) | ||
522 | m_sessionStack->setSessionKeyboardInputEnabled(sessionId, !checked); | 522 | m_sessionStack->setSessionKeyboardInputEnabled(sessionId, !checked); | ||
523 | 523 | | |||
524 | if (action == actionCollection()->action(QStringLiteral("toggle-session-monitor-activity"))) | 524 | if(action == actionCollection()->action(QStringLiteral("toggle-session-monitor-activity"))) | ||
525 | m_sessionStack->setSessionMonitorActivityEnabled(sessionId, checked); | 525 | m_sessionStack->setSessionMonitorActivityEnabled(sessionId, checked); | ||
526 | 526 | | |||
527 | if (action == actionCollection()->action(QStringLiteral("toggle-session-monitor-silence"))) | 527 | if(action == actionCollection()->action(QStringLiteral("toggle-session-monitor-silence"))) | ||
528 | m_sessionStack->setSessionMonitorSilenceEnabled(sessionId, checked); | 528 | m_sessionStack->setSessionMonitorSilenceEnabled(sessionId, checked); | ||
529 | } | 529 | } | ||
530 | 530 | | |||
Context not available. | |||||
539 | { | 539 | { | ||
540 | QAction* action = qobject_cast<QAction*>(QObject::sender()); | 540 | QAction* action = qobject_cast<QAction*>(QObject::sender()); | ||
541 | 541 | | |||
542 | if (!action || action->data().isNull()) return; | 542 | if(!action || action->data().isNull()) return; | ||
543 | 543 | | |||
544 | bool ok = false; | 544 | bool ok = false; | ||
545 | int terminalId = action->data().toInt(&ok); | 545 | int terminalId = action->data().toInt(&ok); | ||
546 | if (!ok) return; | 546 | if(!ok) return; | ||
547 | 547 | | |||
548 | m_sessionStack->setTerminalKeyboardInputEnabled(terminalId, !checked); | 548 | m_sessionStack->setTerminalKeyboardInputEnabled(terminalId, !checked); | ||
549 | } | 549 | } | ||
Context not available. | |||||
552 | { | 552 | { | ||
553 | QAction* action = qobject_cast<QAction*>(QObject::sender()); | 553 | QAction* action = qobject_cast<QAction*>(QObject::sender()); | ||
554 | 554 | | |||
555 | if (!action || action->data().isNull()) return; | 555 | if(!action || action->data().isNull()) return; | ||
556 | 556 | | |||
557 | bool ok = false; | 557 | bool ok = false; | ||
558 | int terminalId = action->data().toInt(&ok); | 558 | int terminalId = action->data().toInt(&ok); | ||
559 | if (!ok) return; | 559 | if(!ok) return; | ||
560 | 560 | | |||
561 | m_sessionStack->setTerminalMonitorActivityEnabled(terminalId, checked); | 561 | m_sessionStack->setTerminalMonitorActivityEnabled(terminalId, checked); | ||
562 | } | 562 | } | ||
Context not available. | |||||
565 | { | 565 | { | ||
566 | QAction* action = qobject_cast<QAction*>(QObject::sender()); | 566 | QAction* action = qobject_cast<QAction*>(QObject::sender()); | ||
567 | 567 | | |||
568 | if (!action || action->data().isNull()) return; | 568 | if(!action || action->data().isNull()) return; | ||
569 | 569 | | |||
570 | bool ok = false; | 570 | bool ok = false; | ||
571 | int terminalId = action->data().toInt(&ok); | 571 | int terminalId = action->data().toInt(&ok); | ||
572 | if (!ok) return; | 572 | if(!ok) return; | ||
573 | 573 | | |||
574 | m_sessionStack->setTerminalMonitorSilenceEnabled(terminalId, checked); | 574 | m_sessionStack->setTerminalMonitorSilenceEnabled(terminalId, checked); | ||
575 | } | 575 | } | ||
Context not available. | |||||
578 | { | 578 | { | ||
579 | Session* session = qobject_cast<Session*>(sender()); | 579 | Session* session = qobject_cast<Session*>(sender()); | ||
580 | 580 | | |||
581 | if (session) | 581 | if(session) | ||
582 | { | 582 | { | ||
583 | disconnect(terminal, SIGNAL(activityDetected(Terminal*)), session, SIGNAL(activityDetected(Terminal*))); | 583 | disconnect(terminal, SIGNAL(activityDetected(Terminal*)), session, SIGNAL(activityDetected(Terminal*))); | ||
584 | 584 | | |||
Context not available. | |||||
594 | { | 594 | { | ||
595 | Session* session = qobject_cast<Session*>(sender()); | 595 | Session* session = qobject_cast<Session*>(sender()); | ||
596 | 596 | | |||
597 | if (session) | 597 | if(session) | ||
598 | { | 598 | { | ||
599 | QString message(xi18nc("@info", "Silence detected in monitored terminal in session \"%1\".", | 599 | QString message(xi18nc("@info", "Silence detected in monitored terminal in session \"%1\".", | ||
600 | m_tabBar->tabTitle(session->id()))); | 600 | m_tabBar->tabTitle(session->id()))); | ||
Context not available. | |||||
606 | 606 | | |||
607 | void MainWindow::handleLastTabClosed() | 607 | void MainWindow::handleLastTabClosed() | ||
608 | { | 608 | { | ||
609 | if (isVisible() && !Settings::keepOpenAfterLastSessionCloses()) | 609 | if(isVisible() && !Settings::keepOpenAfterLastSessionCloses()) | ||
610 | toggleWindowState(); | 610 | toggleWindowState(); | ||
611 | } | 611 | } | ||
612 | 612 | | |||
Context not available. | |||||
614 | { | 614 | { | ||
615 | QAction* action = qobject_cast<QAction*>(QObject::sender()); | 615 | QAction* action = qobject_cast<QAction*>(QObject::sender()); | ||
616 | 616 | | |||
617 | if (action && !action->data().isNull()) | 617 | if(action && !action->data().isNull()) | ||
618 | m_sessionStack->raiseSession(m_tabBar->sessionAtTab(action->data().toInt()-1)); | 618 | m_sessionStack->raiseSession(m_tabBar->sessionAtTab(action->data().toInt()-1)); | ||
619 | } | 619 | } | ||
620 | 620 | | |||
Context not available. | |||||
688 | { | 688 | { | ||
689 | QAction* action = 0; | 689 | QAction* action = 0; | ||
690 | 690 | | |||
691 | if (m_windowWidthMenu->isEmpty()) | 691 | if(m_windowWidthMenu->isEmpty()) | ||
692 | { | 692 | { | ||
693 | for (int i = 10; i <= 100; i += 10) | 693 | for (int i = 10; i <= 100; i += 10) | ||
694 | { | 694 | { | ||
Context not available. | |||||
715 | { | 715 | { | ||
716 | QAction* action = 0; | 716 | QAction* action = 0; | ||
717 | 717 | | |||
718 | if (m_windowHeightMenu->isEmpty()) | 718 | if(m_windowHeightMenu->isEmpty()) | ||
719 | { | 719 | { | ||
720 | for (int i = 10; i <= 100; i += 10) | 720 | for (int i = 10; i <= 100; i += 10) | ||
721 | { | 721 | { | ||
Context not available. | |||||
750 | 750 | | |||
751 | void MainWindow::configureApp() | 751 | void MainWindow::configureApp() | ||
752 | { | 752 | { | ||
753 | if (KConfigDialog::showDialog(QStringLiteral("settings"))) return; | 753 | if(KConfigDialog::showDialog(QStringLiteral("settings"))) return; | ||
754 | 754 | | |||
755 | KConfigDialog* settingsDialog = new KConfigDialog(this, QStringLiteral("settings"), Settings::self()); | 755 | KConfigDialog* settingsDialog = new KConfigDialog(this, QStringLiteral("settings"), Settings::self()); | ||
756 | settingsDialog->setMinimumHeight(560); | 756 | settingsDialog->setMinimumHeight(560); | ||
Context not available. | |||||
787 | 787 | | |||
788 | void MainWindow::applySettings() | 788 | void MainWindow::applySettings() | ||
789 | { | 789 | { | ||
790 | if (Settings::dynamicTabTitles()) | 790 | if(Settings::dynamicTabTitles()) | ||
791 | { | 791 | { | ||
792 | connect(m_sessionStack, SIGNAL(titleChanged(int,QString)), | 792 | connect(m_sessionStack, SIGNAL(titleChanged(int,QString)), | ||
793 | m_tabBar, SLOT(setTabTitle(int,QString))); | 793 | m_tabBar, SLOT(setTabTitle(int,QString))); | ||
Context not available. | |||||
820 | { | 820 | { | ||
821 | bool gotSkin = m_skin->load(Settings::skin(), Settings::skinInstalledWithKns()); | 821 | bool gotSkin = m_skin->load(Settings::skin(), Settings::skinInstalledWithKns()); | ||
822 | 822 | | |||
823 | if (!gotSkin) | 823 | if(!gotSkin) | ||
824 | { | 824 | { | ||
825 | Settings::setSkin(QStringLiteral("default")); | 825 | Settings::setSkin(QStringLiteral("default")); | ||
826 | gotSkin = m_skin->load(Settings::skin()); | 826 | gotSkin = m_skin->load(Settings::skin()); | ||
827 | } | 827 | } | ||
828 | 828 | | |||
829 | if (!gotSkin) | 829 | if(!gotSkin) | ||
830 | { | 830 | { | ||
831 | KMessageBox::error(parentWidget(), | 831 | KMessageBox::error(parentWidget(), | ||
832 | xi18nc("@info", "<application>Yakuake</application> was unable to load a skin. It is likely that it was installed incorrectly.<nl/><nl/>" | 832 | xi18nc("@info", "<application>Yakuake</application> was unable to load a skin. It is likely that it was installed incorrectly.<nl/><nl/>" | ||
Context not available. | |||||
842 | 842 | | |||
843 | void MainWindow::applyWindowProperties() | 843 | void MainWindow::applyWindowProperties() | ||
844 | { | 844 | { | ||
845 | if (Settings::keepOpen() && !Settings::keepAbove()) | 845 | if(Settings::keepOpen() && !Settings::keepAbove()) | ||
846 | { | 846 | { | ||
847 | KWindowSystem::clearState(winId(), NET::KeepAbove); | 847 | KWindowSystem::clearState(winId(), NET::KeepAbove); | ||
848 | KWindowSystem::setState(winId(), NET::Sticky | NET::SkipTaskbar | NET::SkipPager); | 848 | KWindowSystem::setState(winId(), NET::Sticky | NET::SkipTaskbar | NET::SkipPager); | ||
Context not available. | |||||
860 | 860 | | |||
861 | QAction* action = actionCollection()->action(QStringLiteral("view-full-screen")); | 861 | QAction* action = actionCollection()->action(QStringLiteral("view-full-screen")); | ||
862 | 862 | | |||
863 | if (action->isChecked()) | 863 | if(action->isChecked()) | ||
864 | { | 864 | { | ||
865 | width = 100; | 865 | width = 100; | ||
866 | height = 100; | 866 | height = 100; | ||
Context not available. | |||||
890 | 890 | | |||
891 | maxHeight -= m_titleBar->height(); | 891 | maxHeight -= m_titleBar->height(); | ||
892 | m_titleBar->setGeometry(0, maxHeight, targetWidth, m_titleBar->height()); | 892 | m_titleBar->setGeometry(0, maxHeight, targetWidth, m_titleBar->height()); | ||
893 | if (!isVisible()) m_titleBar->updateMask(); | 893 | if(!isVisible()) m_titleBar->updateMask(); | ||
894 | 894 | | |||
895 | if (Settings::frames() > 0) | 895 | if(Settings::frames() > 0) | ||
896 | m_animationStepSize = maxHeight / Settings::frames(); | 896 | m_animationStepSize = maxHeight / Settings::frames(); | ||
897 | else | 897 | else | ||
898 | m_animationStepSize = maxHeight; | 898 | m_animationStepSize = maxHeight; | ||
899 | 899 | | |||
900 | if (Settings::showTabBar()) | 900 | if(Settings::showTabBar()) | ||
901 | { | 901 | { | ||
902 | if (m_skin->tabBarCompact()) | 902 | if(m_skin->tabBarCompact()) | ||
903 | { | 903 | { | ||
904 | m_tabBar->setGeometry(m_skin->tabBarLeft(), maxHeight, | 904 | m_tabBar->setGeometry(m_skin->tabBarLeft(), maxHeight, | ||
905 | width() - m_skin->tabBarLeft() - m_skin->tabBarRight(), m_tabBar->height()); | 905 | width() - m_skin->tabBarLeft() - m_skin->tabBarRight(), m_tabBar->height()); | ||
Context not available. | |||||
960 | 960 | | |||
961 | void MainWindow::increaseWindowWidth() | 961 | void MainWindow::increaseWindowWidth() | ||
962 | { | 962 | { | ||
963 | if (Settings::width() <= 90) setWindowWidth(Settings::width() + 10); | 963 | if(Settings::width() <= 90) setWindowWidth(Settings::width() + 10); | ||
964 | } | 964 | } | ||
965 | 965 | | |||
966 | void MainWindow:: decreaseWindowWidth() | 966 | void MainWindow:: decreaseWindowWidth() | ||
967 | { | 967 | { | ||
968 | if (Settings::width() >= 20) setWindowWidth(Settings::width() - 10); | 968 | if(Settings::width() >= 20) setWindowWidth(Settings::width() - 10); | ||
969 | } | 969 | } | ||
970 | 970 | | |||
971 | void MainWindow::increaseWindowHeight() | 971 | void MainWindow::increaseWindowHeight() | ||
972 | { | 972 | { | ||
973 | if (Settings::height() <= 90) setWindowHeight(Settings::height() + 10); | 973 | if(Settings::height() <= 90) setWindowHeight(Settings::height() + 10); | ||
974 | } | 974 | } | ||
975 | 975 | | |||
976 | void MainWindow::decreaseWindowHeight() | 976 | void MainWindow::decreaseWindowHeight() | ||
977 | { | 977 | { | ||
978 | if (Settings::height() >= 20) setWindowHeight(Settings::height() - 10); | 978 | if(Settings::height() >= 20) setWindowHeight(Settings::height() - 10); | ||
979 | } | 979 | } | ||
980 | 980 | | |||
981 | void MainWindow::updateMask() | 981 | void MainWindow::updateMask() | ||
Context not available. | |||||
993 | { | 993 | { | ||
994 | QPainter painter(this); | 994 | QPainter painter(this); | ||
995 | 995 | | |||
996 | if (useTranslucency()) | 996 | if(useTranslucency()) | ||
997 | { | 997 | { | ||
998 | painter.setOpacity(qreal(Settings::backgroundColorOpacity()) / 100); | 998 | painter.setOpacity(qreal(Settings::backgroundColorOpacity()) / 100); | ||
999 | painter.fillRect(rect(), Settings::backgroundColor()); | 999 | painter.fillRect(rect(), Settings::backgroundColor()); | ||
Context not available. | |||||
1014 | 1014 | | |||
1015 | void MainWindow::moveEvent(QMoveEvent* event) | 1015 | void MainWindow::moveEvent(QMoveEvent* event) | ||
1016 | { | 1016 | { | ||
1017 | if (Settings::screen() && QApplication::desktop()->screenNumber(this) != getScreen()) | 1017 | if(Settings::screen() && QApplication::desktop()->screenNumber(this) != getScreen()) | ||
1018 | { | 1018 | { | ||
1019 | Settings::setScreen(QApplication::desktop()->screenNumber(this)+1); | 1019 | Settings::setScreen(QApplication::desktop()->screenNumber(this)+1); | ||
1020 | 1020 | | |||
Context not available. | |||||
1029 | void MainWindow::closeEvent(QCloseEvent *event) | 1029 | void MainWindow::closeEvent(QCloseEvent *event) | ||
1030 | { | 1030 | { | ||
1031 | KMainWindow::closeEvent(event); | 1031 | KMainWindow::closeEvent(event); | ||
1032 | if (event->isAccepted()) { | 1032 | if(event->isAccepted()) { | ||
1033 | QApplication::quit(); | 1033 | QApplication::quit(); | ||
1034 | } | 1034 | } | ||
1035 | } | 1035 | } | ||
1036 | 1036 | | |||
1037 | void MainWindow::wmActiveWindowChanged() | 1037 | void MainWindow::wmActiveWindowChanged() | ||
1038 | { | 1038 | { | ||
1039 | if (m_toggleLock) { | 1039 | if(m_toggleLock) { | ||
1040 | m_toggleLock = false; | 1040 | m_toggleLock = false; | ||
1041 | return; | 1041 | return; | ||
1042 | } | 1042 | } | ||
1043 | 1043 | | |||
1044 | KWindowInfo info(KWindowSystem::activeWindow(), 0, NET::WM2TransientFor); | 1044 | KWindowInfo info(KWindowSystem::activeWindow(), 0, NET::WM2TransientFor); | ||
1045 | 1045 | | |||
1046 | if (info.valid() && info.transientFor() == winId()) { | 1046 | if(info.valid() && info.transientFor() == winId()) { | ||
1047 | return; | 1047 | return; | ||
1048 | } | 1048 | } | ||
1049 | 1049 | | |||
1050 | 1050 | | |||
1051 | if (m_isX11) { | 1051 | if(m_isX11) { | ||
1052 | if (!Settings::keepOpen() && isVisible() && KWindowSystem::activeWindow() != winId()) { | 1052 | if(!Settings::keepOpen() && isVisible() && KWindowSystem::activeWindow() != winId()) { | ||
1053 | toggleWindowState(); | 1053 | toggleWindowState(); | ||
1054 | } | 1054 | } | ||
1055 | } else { | 1055 | } else { | ||
1056 | if (!Settings::keepOpen() && hasFocus()) { | 1056 | if(!Settings::keepOpen() && hasFocus()) { | ||
1057 | toggleWindowState(); | 1057 | toggleWindowState(); | ||
1058 | } | 1058 | } | ||
1059 | } | 1059 | } | ||
Context not available. | |||||
1061 | 1061 | | |||
1062 | void MainWindow::changeEvent(QEvent* event) | 1062 | void MainWindow::changeEvent(QEvent* event) | ||
1063 | { | 1063 | { | ||
1064 | if (event->type() == QEvent::WindowStateChange | 1064 | if(event->type() == QEvent::WindowStateChange | ||
1065 | && (windowState() & Qt::WindowMaximized) | 1065 | && (windowState() & Qt::WindowMaximized) | ||
1066 | && Settings::width() != 100 | 1066 | && Settings::width() != 100 | ||
1067 | && Settings::height() != 100) | 1067 | && Settings::height() != 100) | ||
Context not available. | |||||
1080 | 1080 | | |||
1081 | bool MainWindow::event(QEvent* event) | 1081 | bool MainWindow::event(QEvent* event) | ||
1082 | { | 1082 | { | ||
1083 | if (event->type() == QEvent::Expose) { | 1083 | if(event->type() == QEvent::Expose) { | ||
1084 | // FIXME TODO: We can remove this once we depend on Qt 5.6.1+. | 1084 | // FIXME TODO: We can remove this once we depend on Qt 5.6.1+. | ||
1085 | // See: https://bugreports.qt.io/browse/QTBUG-26978 | 1085 | // See: https://bugreports.qt.io/browse/QTBUG-26978 | ||
1086 | applyWindowProperties(); | 1086 | applyWindowProperties(); | ||
1087 | #if (QT_VERSION > QT_VERSION_CHECK(5, 5, 0)) | 1087 | #if(QT_VERSION > QT_VERSION_CHECK(5, 5, 0)) | ||
1088 | } else if (event->type() == QEvent::PlatformSurface) { | 1088 | } else if(event->type() == QEvent::PlatformSurface) { | ||
1089 | const QPlatformSurfaceEvent *pSEvent = static_cast<QPlatformSurfaceEvent *>(event); | 1089 | const QPlatformSurfaceEvent *pSEvent = static_cast<QPlatformSurfaceEvent *>(event); | ||
1090 | 1090 | | |||
1091 | if (pSEvent->surfaceEventType() == QPlatformSurfaceEvent::SurfaceCreated) { | 1091 | if(pSEvent->surfaceEventType() == QPlatformSurfaceEvent::SurfaceCreated) { | ||
1092 | applyWindowProperties(); | 1092 | applyWindowProperties(); | ||
1093 | } | 1093 | } | ||
1094 | #endif | 1094 | #endif | ||
Context not available. | |||||
1101 | { | 1101 | { | ||
1102 | bool visible = isVisible(); | 1102 | bool visible = isVisible(); | ||
1103 | 1103 | | |||
1104 | if (visible && KWindowSystem::activeWindow() != winId() && Settings::keepOpen()) | 1104 | if(visible && KWindowSystem::activeWindow() != winId() && Settings::keepOpen()) | ||
1105 | { | 1105 | { | ||
1106 | // Window is open but doesn't have focus; it's set to stay open | 1106 | // Window is open but doesn't have focus; it's set to stay open | ||
1107 | // regardless of focus loss. | 1107 | // regardless of focus loss. | ||
1108 | 1108 | | |||
1109 | if (Settings::toggleToFocus()) | 1109 | if(Settings::toggleToFocus()) | ||
1110 | { | 1110 | { | ||
1111 | // The open/retract action is set to focus the window when it's | 1111 | // The open/retract action is set to focus the window when it's | ||
1112 | // open but lacks focus. The following will cause it to receive | 1112 | // open but lacks focus. The following will cause it to receive | ||
Context not available. | |||||
1119 | 1119 | | |||
1120 | return; | 1120 | return; | ||
1121 | } | 1121 | } | ||
1122 | else if (!Settings::showOnAllDesktops() | 1122 | else if(!Settings::showOnAllDesktops() | ||
1123 | && KWindowInfo(winId(), NET::WMDesktop).desktop() != KWindowSystem::currentDesktop()) | 1123 | && KWindowInfo(winId(), NET::WMDesktop).desktop() != KWindowSystem::currentDesktop()) | ||
1124 | { | 1124 | { | ||
1125 | // The open/restrict action isn't set to focus the window, but | 1125 | // The open/restrict action isn't set to focus the window, but | ||
Context not available. | |||||
1141 | } | 1141 | } | ||
1142 | 1142 | | |||
1143 | #if HAVE_X11 | 1143 | #if HAVE_X11 | ||
1144 | if (!Settings::useWMAssist() && m_kwinAssistPropSet) | 1144 | if(!Settings::useWMAssist() && m_kwinAssistPropSet) | ||
1145 | kwinAssistPropCleanup(); | 1145 | kwinAssistPropCleanup(); | ||
1146 | 1146 | | |||
1147 | if (m_isX11 && Settings::useWMAssist() && KWindowSystem::compositingActive()) | 1147 | if(m_isX11 && Settings::useWMAssist() && KWindowSystem::compositingActive()) | ||
1148 | kwinAssistToggleWindowState(visible); | 1148 | kwinAssistToggleWindowState(visible); | ||
1149 | else | 1149 | else | ||
1150 | #endif | 1150 | #endif | ||
1151 | if (!m_isWayland) { | 1151 | if(!m_isWayland) { | ||
1152 | xshapeToggleWindowState(visible); | 1152 | xshapeToggleWindowState(visible); | ||
1153 | } else { | 1153 | } else { | ||
1154 | if (visible) | 1154 | if(visible) | ||
1155 | { | 1155 | { | ||
1156 | sharedPreHideWindow(); | 1156 | sharedPreHideWindow(); | ||
1157 | 1157 | | |||
Context not available. | |||||
1162 | else | 1162 | else | ||
1163 | { | 1163 | { | ||
1164 | sharedPreOpenWindow(); | 1164 | sharedPreOpenWindow(); | ||
1165 | if (KWindowEffects::isEffectAvailable(KWindowEffects::Slide)) { | 1165 | if(KWindowEffects::isEffectAvailable(KWindowEffects::Slide)) { | ||
1166 | KWindowEffects::slideWindow(winId(), KWindowEffects::TopEdge); | 1166 | KWindowEffects::slideWindow(winId(), KWindowEffects::TopEdge); | ||
1167 | } | 1167 | } | ||
1168 | 1168 | | |||
Context not available. | |||||
1183 | int count; | 1183 | int count; | ||
1184 | Atom* list = XListProperties(display, DefaultRootWindow(display), &count); | 1184 | Atom* list = XListProperties(display, DefaultRootWindow(display), &count); | ||
1185 | 1185 | | |||
1186 | if (list != NULL) | 1186 | if(list != NULL) | ||
1187 | { | 1187 | { | ||
1188 | gotEffect = (std::find(list, list + count, atom) != list + count); | 1188 | gotEffect = (std::find(list, list + count, atom) != list + count); | ||
1189 | 1189 | | |||
1190 | XFree(list); | 1190 | XFree(list); | ||
1191 | } | 1191 | } | ||
1192 | 1192 | | |||
1193 | if (gotEffect) | 1193 | if(gotEffect) | ||
1194 | { | 1194 | { | ||
1195 | Atom atom = XInternAtom(display, "_KDE_SLIDE", false); | 1195 | Atom atom = XInternAtom(display, "_KDE_SLIDE", false); | ||
1196 | 1196 | | |||
1197 | if (Settings::frames() > 0) | 1197 | if(Settings::frames() > 0) | ||
1198 | { | 1198 | { | ||
1199 | QVarLengthArray<long, 1024> data(4); | 1199 | QVarLengthArray<long, 1024> data(4); | ||
1200 | 1200 | | |||
Context not available. | |||||
1211 | else | 1211 | else | ||
1212 | XDeleteProperty(display, winId(), atom); | 1212 | XDeleteProperty(display, winId(), atom); | ||
1213 | 1213 | | |||
1214 | if (visible) | 1214 | if(visible) | ||
1215 | { | 1215 | { | ||
1216 | sharedPreHideWindow(); | 1216 | sharedPreHideWindow(); | ||
1217 | 1217 | | |||
Context not available. | |||||
1238 | 1238 | | |||
1239 | void MainWindow::kwinAssistPropCleanup() | 1239 | void MainWindow::kwinAssistPropCleanup() | ||
1240 | { | 1240 | { | ||
1241 | if (!QX11Info::isPlatformX11()) | 1241 | if(!QX11Info::isPlatformX11()) | ||
1242 | return; | 1242 | return; | ||
1243 | 1243 | | |||
1244 | Display* display = QX11Info::display(); | 1244 | Display* display = QX11Info::display(); | ||
Context not available. | |||||
1252 | 1252 | | |||
1253 | void MainWindow::xshapeToggleWindowState(bool visible) | 1253 | void MainWindow::xshapeToggleWindowState(bool visible) | ||
1254 | { | 1254 | { | ||
1255 | if (m_animationTimer.isActive()) return; | 1255 | if(m_animationTimer.isActive()) return; | ||
1256 | 1256 | | |||
1257 | if (visible) | 1257 | if(visible) | ||
1258 | { | 1258 | { | ||
1259 | sharedPreHideWindow(); | 1259 | sharedPreHideWindow(); | ||
1260 | 1260 | | |||
Context not available. | |||||
1274 | 1274 | | |||
1275 | void MainWindow::xshapeOpenWindow() | 1275 | void MainWindow::xshapeOpenWindow() | ||
1276 | { | 1276 | { | ||
1277 | if (m_animationFrame == 0) | 1277 | if(m_animationFrame == 0) | ||
1278 | { | 1278 | { | ||
1279 | sharedPreOpenWindow(); | 1279 | sharedPreOpenWindow(); | ||
1280 | 1280 | | |||
Context not available. | |||||
1283 | sharedAfterOpenWindow(); | 1283 | sharedAfterOpenWindow(); | ||
1284 | } | 1284 | } | ||
1285 | 1285 | | |||
1286 | if (m_animationFrame == Settings::frames()) | 1286 | if(m_animationFrame == Settings::frames()) | ||
1287 | { | 1287 | { | ||
1288 | m_animationTimer.stop(); | 1288 | m_animationTimer.stop(); | ||
1289 | m_animationTimer.disconnect(); | 1289 | m_animationTimer.disconnect(); | ||
Context not available. | |||||
1308 | 1308 | | |||
1309 | void MainWindow::xshapeRetractWindow() | 1309 | void MainWindow::xshapeRetractWindow() | ||
1310 | { | 1310 | { | ||
1311 | if (m_animationFrame == 0) | 1311 | if(m_animationFrame == 0) | ||
1312 | { | 1312 | { | ||
1313 | m_animationTimer.stop(); | 1313 | m_animationTimer.stop(); | ||
1314 | m_animationTimer.disconnect(); | 1314 | m_animationTimer.disconnect(); | ||
Context not available. | |||||
1332 | 1332 | | |||
1333 | updateUseTranslucency(); | 1333 | updateUseTranslucency(); | ||
1334 | 1334 | | |||
1335 | if (Settings::pollMouse()) toggleMousePoll(false); | 1335 | if(Settings::pollMouse()) toggleMousePoll(false); | ||
1336 | if (Settings::rememberFullscreen()) setFullScreen(m_isFullscreen); | 1336 | if(Settings::rememberFullscreen()) setFullScreen(m_isFullscreen); | ||
1337 | } | 1337 | } | ||
1338 | 1338 | | |||
1339 | void MainWindow::sharedAfterOpenWindow() | 1339 | void MainWindow::sharedAfterOpenWindow() | ||
1340 | { | 1340 | { | ||
1341 | if (!Settings::firstRun()) KWindowSystem::forceActiveWindow(winId()); | 1341 | if(!Settings::firstRun()) KWindowSystem::forceActiveWindow(winId()); | ||
1342 | 1342 | | |||
1343 | connect(KWindowSystem::self(), &KWindowSystem::activeWindowChanged, | 1343 | connect(KWindowSystem::self(), &KWindowSystem::activeWindowChanged, | ||
1344 | this, &MainWindow::wmActiveWindowChanged); | 1344 | this, &MainWindow::wmActiveWindowChanged); | ||
Context not available. | |||||
1360 | 1360 | | |||
1361 | void MainWindow::sharedAfterHideWindow() | 1361 | void MainWindow::sharedAfterHideWindow() | ||
1362 | { | 1362 | { | ||
1363 | if (Settings::pollMouse()) toggleMousePoll(true); | 1363 | if(Settings::pollMouse()) toggleMousePoll(true); | ||
1364 | 1364 | | |||
1365 | #if HAVE_KWAYLAND | 1365 | #if HAVE_KWAYLAND | ||
1366 | delete m_plasmaShellSurface; | 1366 | delete m_plasmaShellSurface; | ||
Context not available. | |||||
1377 | 1377 | | |||
1378 | void MainWindow::toggleMousePoll(bool poll) | 1378 | void MainWindow::toggleMousePoll(bool poll) | ||
1379 | { | 1379 | { | ||
1380 | if (poll) | 1380 | if(poll) | ||
1381 | m_mousePoller.start(Settings::pollInterval()); | 1381 | m_mousePoller.start(Settings::pollInterval()); | ||
1382 | else | 1382 | else | ||
1383 | m_mousePoller.stop(); | 1383 | m_mousePoller.stop(); | ||
Context not available. | |||||
1391 | int windowX = workArea.x() + workArea.width() * Settings::position() * (100 - Settings::width()) / 10000; | 1391 | int windowX = workArea.x() + workArea.width() * Settings::position() * (100 - Settings::width()) / 10000; | ||
1392 | int windowWidth = workArea.width() * Settings::width() / 100; | 1392 | int windowWidth = workArea.width() * Settings::width() / 100; | ||
1393 | 1393 | | |||
1394 | if (pos.y() == 0 && pos.x() >= windowX && pos.x() <= (windowX + windowWidth)) | 1394 | if(pos.y() == 0 && pos.x() >= windowX && pos.x() <= (windowX + windowWidth)) | ||
1395 | toggleWindowState(); | 1395 | toggleWindowState(); | ||
1396 | } | 1396 | } | ||
1397 | 1397 | | |||
1398 | void MainWindow::setKeepOpen(bool keepOpen) | 1398 | void MainWindow::setKeepOpen(bool keepOpen) | ||
1399 | { | 1399 | { | ||
1400 | if (Settings::keepOpen() != keepOpen) | 1400 | if(Settings::keepOpen() != keepOpen) | ||
1401 | { | 1401 | { | ||
1402 | Settings::setKeepOpen(keepOpen); | 1402 | Settings::setKeepOpen(keepOpen); | ||
1403 | Settings::self()->save(); | 1403 | Settings::self()->save(); | ||
Context not available. | |||||
1411 | 1411 | | |||
1412 | void MainWindow::setFullScreen(bool state) | 1412 | void MainWindow::setFullScreen(bool state) | ||
1413 | { | 1413 | { | ||
1414 | if (isVisible()) m_isFullscreen = state; | 1414 | if(isVisible()) m_isFullscreen = state; | ||
1415 | if (state) | 1415 | if(state) | ||
1416 | { | 1416 | { | ||
1417 | setWindowState(windowState() | Qt::WindowFullScreen); | 1417 | setWindowState(windowState() | Qt::WindowFullScreen); | ||
1418 | setWindowGeometry(100, 100, Settings::position()); | 1418 | setWindowGeometry(100, 100, Settings::position()); | ||
Context not available. | |||||
1426 | 1426 | | |||
1427 | int MainWindow::getScreen() | 1427 | int MainWindow::getScreen() | ||
1428 | { | 1428 | { | ||
1429 | if (!Settings::screen()) | 1429 | if(!Settings::screen()) | ||
1430 | return QApplication::desktop()->screenNumber(QCursor::pos()); | 1430 | return QApplication::desktop()->screenNumber(QCursor::pos()); | ||
1431 | else | 1431 | else | ||
1432 | return Settings::screen() - 1; | 1432 | return Settings::screen() - 1; | ||
Context not available. | |||||
1438 | 1438 | | |||
1439 | QAction* action = actionCollection()->action(QStringLiteral("view-full-screen")); | 1439 | QAction* action = actionCollection()->action(QStringLiteral("view-full-screen")); | ||
1440 | 1440 | | |||
1441 | if (action->isChecked()) | 1441 | if(action->isChecked()) | ||
1442 | return screenGeometry; | 1442 | return screenGeometry; | ||
1443 | 1443 | | |||
1444 | if (m_isWayland) { | 1444 | if(m_isWayland) { | ||
1445 | // on Wayland it's not possible to get the work area | 1445 | // on Wayland it's not possible to get the work area | ||
1446 | return screenGeometry; | 1446 | return screenGeometry; | ||
1447 | } | 1447 | } | ||
1448 | 1448 | | |||
1449 | if (QGuiApplication::screens().count() > 1) | 1449 | if(QGuiApplication::screens().count() > 1) | ||
1450 | { | 1450 | { | ||
1451 | const QList<WId> allWindows = KWindowSystem::windows(); | 1451 | const QList<WId> allWindows = KWindowSystem::windows(); | ||
1452 | QList<WId> offScreenWindows; | 1452 | QList<WId> offScreenWindows; | ||
Context not available. | |||||
1457 | { | 1457 | { | ||
1458 | WId windowId = i.next(); | 1458 | WId windowId = i.next(); | ||
1459 | 1459 | | |||
1460 | if (KWindowSystem::hasWId(windowId)) | 1460 | if(KWindowSystem::hasWId(windowId)) | ||
1461 | { | 1461 | { | ||
1462 | KWindowInfo windowInfo = KWindowInfo(windowId, NET::WMDesktop, NET::WM2ExtendedStrut); | 1462 | KWindowInfo windowInfo = KWindowInfo(windowId, NET::WMDesktop, NET::WM2ExtendedStrut); | ||
1463 | 1463 | | |||
1464 | // If windowInfo is valid and the window is located at the same (current) | 1464 | // If windowInfo is valid and the window is located at the same (current) | ||
1465 | // desktop with the yakuake window... | 1465 | // desktop with the yakuake window... | ||
1466 | if (windowInfo.valid() && windowInfo.isOnCurrentDesktop()) | 1466 | if(windowInfo.valid() && windowInfo.isOnCurrentDesktop()) | ||
1467 | { | 1467 | { | ||
1468 | NETExtendedStrut strut = windowInfo.extendedStrut(); | 1468 | NETExtendedStrut strut = windowInfo.extendedStrut(); | ||
1469 | 1469 | | |||
Context not available. | |||||
1476 | strut.right_end - strut.right_start, strut.right_width); | 1476 | strut.right_end - strut.right_start, strut.right_width); | ||
1477 | 1477 | | |||
1478 | // If the window has no strut, no need to bother further. | 1478 | // If the window has no strut, no need to bother further. | ||
1479 | if (topStrut.isEmpty() && bottomStrut.isEmpty() && leftStrut.isEmpty() && rightStrut.isEmpty()) | 1479 | if(topStrut.isEmpty() && bottomStrut.isEmpty() && leftStrut.isEmpty() && rightStrut.isEmpty()) | ||
1480 | continue; | 1480 | continue; | ||
1481 | 1481 | | |||
1482 | // If any of the strut intersects with our screen geometry, it will be correctly handled | 1482 | // If any of the strut intersects with our screen geometry, it will be correctly handled | ||
1483 | // by workArea(). | 1483 | // by workArea(). | ||
1484 | if (topStrut.intersects(screenGeometry) || bottomStrut.intersects(screenGeometry) || | 1484 | if(topStrut.intersects(screenGeometry) || bottomStrut.intersects(screenGeometry) || | ||
1485 | leftStrut.intersects(screenGeometry) || rightStrut.intersects(screenGeometry)) | 1485 | leftStrut.intersects(screenGeometry) || rightStrut.intersects(screenGeometry)) | ||
1486 | continue; | 1486 | continue; | ||
1487 | 1487 | | |||
Context not available. | |||||
1510 | 1510 | | |||
1511 | const QList<QKeySequence> &shortcuts = KGlobalAccel::self()->shortcut(action); | 1511 | const QList<QKeySequence> &shortcuts = KGlobalAccel::self()->shortcut(action); | ||
1512 | 1512 | | |||
1513 | if (shortcuts.isEmpty()) | 1513 | if(shortcuts.isEmpty()) | ||
1514 | return; | 1514 | return; | ||
1515 | 1515 | | |||
1516 | QString shortcut(shortcuts.first().toString(QKeySequence::NativeText)); | 1516 | QString shortcut(shortcuts.first().toString(QKeySequence::NativeText)); | ||
Context not available. | |||||
1521 | 1521 | | |||
1522 | void MainWindow::showFirstRunDialog() | 1522 | void MainWindow::showFirstRunDialog() | ||
1523 | { | 1523 | { | ||
1524 | if (!m_firstRunDialog) | 1524 | if(!m_firstRunDialog) | ||
1525 | { | 1525 | { | ||
1526 | m_firstRunDialog = new FirstRunDialog(this); | 1526 | m_firstRunDialog = new FirstRunDialog(this); | ||
1527 | 1527 | | |||
Context not available. |