Commit 9e61f503 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

Remove some Screens::count() usages

Screens is obsolete, use Platform::enabledOutputs().
parent 7f04ea57
Pipeline #204721 failed with stage
in 14 minutes and 52 seconds
......@@ -33,7 +33,6 @@
#include "atoms.h"
#include "group.h"
#include "rules.h"
#include "screens.h"
#include "useractions.h"
#include <QDebug>
......@@ -243,7 +242,7 @@ void Workspace::setActiveWindow(Window *window)
m_activeWindow->demandAttention(false);
// activating a client can cause a non active fullscreen window to loose the ActiveLayer status on > 1 screens
if (screens()->count() > 1) {
if (kwinApp()->platform()->enabledOutputs().count() > 1) {
for (auto it = m_allClients.begin(); it != m_allClients.end(); ++it) {
if (*it != m_activeWindow && (*it)->layer() == ActiveLayer && (*it)->output() == m_activeWindow->output()) {
(*it)->updateLayer();
......
......@@ -29,7 +29,6 @@
#include "input.h"
#include "output.h"
#include "platform.h"
#include "screens.h"
#include "scripting/scripting.h"
#include "virtualdesktops.h"
#include "workspace.h"
......@@ -370,7 +369,7 @@ void UserActionsMenu::menuAboutToShow()
} else {
initDesktopPopup();
}
if (screens()->count() == 1 || (!m_window->isMovable() && !m_window->isMovableAcrossScreens())) {
if (kwinApp()->platform()->enabledOutputs().count() == 1 || (!m_window->isMovable() && !m_window->isMovableAcrossScreens())) {
delete m_screenMenu;
m_screenMenu = nullptr;
} else {
......
......@@ -1597,7 +1597,7 @@ bool Window::startInteractiveMoveResize()
if (QApplication::activePopupWidget() != nullptr) {
return false; // popups have grab
}
if (isFullScreen() && (screens()->count() < 2 || !isMovableAcrossScreens())) {
if (isFullScreen() && (kwinApp()->platform()->enabledOutputs().count() < 2 || !isMovableAcrossScreens())) {
return false;
}
if (!doStartInteractiveMoveResize()) {
......@@ -2079,7 +2079,7 @@ void Window::handleInteractiveMoveResize(int x, int y, int x_root, int y_root)
// by moving the window slightly downwards, but it won't stuck)
// see bug #274466
// and bug #301805 for why we can't just match the titlearea against the screen
if (screens()->count() > 1) { // optimization
if (kwinApp()->platform()->enabledOutputs().count() > 1) { // optimization
// TODO: could be useful on partial screen struts (half-width panels etc.)
int newTitleTop = -1;
for (const QRect &r : strut) {
......
Supports Markdown
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