Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 26 additions & 14 deletions src/output/output.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,17 @@
#include <woutputrenderwindow.h>
#include <wquicktextureproxy.h>
#include <wsurfaceitem.h>
#include <wxdgpopupsurface.h>

Check warning on line 26 in src/output/output.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <wxdgpopupsurface.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <wxdgpopupsurfaceitem.h>

Check warning on line 27 in src/output/output.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <wxdgpopupsurfaceitem.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.

#include <optional>

#include <qwlayershellv1.h>

Check warning on line 29 in src/output/output.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <qwlayershellv1.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <qwoutputlayout.h>

Check warning on line 30 in src/output/output.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <qwoutputlayout.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.

#include <QQmlEngine>

Check warning on line 32 in src/output/output.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QQmlEngine> not found. Please note: Cppcheck does not need standard library headers to get proper results.

#include <algorithm>

Check warning on line 34 in src/output/output.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <algorithm> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <optional>

Check warning on line 35 in src/output/output.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <optional> not found. Please note: Cppcheck does not need standard library headers to get proper results.

#define SAME_APP_OFFSET_FACTOR 1.0
#define DIFF_APP_OFFSET_FACTOR 2.0
#define POPUP_EDGE_MARGIN 10
Expand Down Expand Up @@ -520,37 +521,34 @@

bool Output::removeExclusiveZone(QObject *object)
{
auto finder = [object](const auto &pair) {
return pair.first == object;
};
auto tmp = std::find_if(m_topExclusiveZones.begin(), m_topExclusiveZones.end(), finder);
auto tmp = std::ranges::find(m_topExclusiveZones, object, &std::pair<QObject *, int>::first);
if (tmp != m_topExclusiveZones.end()) {
m_topExclusiveZones.erase(tmp);
m_exclusiveZone.setTop(m_exclusiveZone.top() - tmp->second);
m_topExclusiveZones.erase(tmp);
Q_ASSERT(m_exclusiveZone.top() >= 0);
return true;
}

tmp = std::find_if(m_bottomExclusiveZones.begin(), m_bottomExclusiveZones.end(), finder);
tmp = std::ranges::find(m_bottomExclusiveZones, object, &std::pair<QObject *, int>::first);
if (tmp != m_bottomExclusiveZones.end()) {
m_bottomExclusiveZones.erase(tmp);
m_exclusiveZone.setBottom(m_exclusiveZone.bottom() - tmp->second);
m_bottomExclusiveZones.erase(tmp);
Q_ASSERT(m_exclusiveZone.bottom() >= 0);
return true;
}

tmp = std::find_if(m_leftExclusiveZones.begin(), m_leftExclusiveZones.end(), finder);
tmp = std::ranges::find(m_leftExclusiveZones, object, &std::pair<QObject *, int>::first);
if (tmp != m_leftExclusiveZones.end()) {
m_leftExclusiveZones.erase(tmp);
m_exclusiveZone.setLeft(m_exclusiveZone.left() - tmp->second);
m_leftExclusiveZones.erase(tmp);
Q_ASSERT(m_exclusiveZone.left() >= 0);
return true;
}

tmp = std::find_if(m_rightExclusiveZones.begin(), m_rightExclusiveZones.end(), finder);
tmp = std::ranges::find(m_rightExclusiveZones, object, &std::pair<QObject *, int>::first);
if (tmp != m_rightExclusiveZones.end()) {
m_rightExclusiveZones.erase(tmp);
m_exclusiveZone.setRight(m_exclusiveZone.right() - tmp->second);
m_rightExclusiveZones.erase(tmp);
Q_ASSERT(m_exclusiveZone.right() >= 0);
return true;
}
Expand Down Expand Up @@ -636,7 +634,21 @@
for (auto *s : std::as_const(surfaces())) {
if (s->type() != SurfaceWrapper::Type::Layer)
continue;
arrangeLayerSurface(s);

auto layer = qobject_cast<WLayerSurface *>(s->shellSurface());
Q_ASSERT(layer);
if (layer->exclusiveZone() > 0)
arrangeLayerSurface(s);
}

for (auto *s : std::as_const(surfaces())) {
if (s->type() != SurfaceWrapper::Type::Layer)
continue;

auto layer = qobject_cast<WLayerSurface *>(s->shellSurface());
Q_ASSERT(layer);
if (layer->exclusiveZone() <= 0)
arrangeLayerSurface(s);
}

if (oldExclusiveZone != m_exclusiveZone) {
Expand Down
Loading