desktop: cleanup, unify desktop elements as views (#12563)
This commit is contained in:
parent
834f019bab
commit
920353370b
105 changed files with 2636 additions and 2337 deletions
|
|
@ -1,5 +1,5 @@
|
|||
#include "AlphaModifier.hpp"
|
||||
#include "../desktop/WLSurface.hpp"
|
||||
#include "../desktop/view/WLSurface.hpp"
|
||||
#include "../render/Renderer.hpp"
|
||||
#include "alpha-modifier-v1.hpp"
|
||||
#include "core/Compositor.hpp"
|
||||
|
|
@ -31,7 +31,7 @@ void CAlphaModifier::setResource(UP<CWpAlphaModifierSurfaceV1>&& resource) {
|
|||
});
|
||||
|
||||
m_listeners.surfaceCommitted = m_surface->m_events.commit.listen([this] {
|
||||
auto surface = CWLSurface::fromResource(m_surface.lock());
|
||||
auto surface = Desktop::View::CWLSurface::fromResource(m_surface.lock());
|
||||
|
||||
if (surface && surface->m_alphaModifier != m_alpha) {
|
||||
surface->m_alphaModifier = m_alpha;
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
#include <vector>
|
||||
#include <unordered_map>
|
||||
#include "WaylandProtocol.hpp"
|
||||
#include "desktop/DesktopTypes.hpp"
|
||||
#include "../desktop/DesktopTypes.hpp"
|
||||
#include "ext-foreign-toplevel-list-v1.hpp"
|
||||
|
||||
class CForeignToplevelHandle {
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ CForeignToplevelHandleWlr::CForeignToplevelHandleWlr(SP<CZwlrForeignToplevelHand
|
|||
if UNLIKELY (!PWINDOW)
|
||||
return;
|
||||
|
||||
if UNLIKELY (PWINDOW->m_suppressedEvents & SUPPRESS_FULLSCREEN)
|
||||
if UNLIKELY (PWINDOW->m_suppressedEvents & Desktop::View::SUPPRESS_FULLSCREEN)
|
||||
return;
|
||||
|
||||
if UNLIKELY (!PWINDOW->m_isMapped) {
|
||||
|
|
@ -66,7 +66,7 @@ CForeignToplevelHandleWlr::CForeignToplevelHandleWlr(SP<CZwlrForeignToplevelHand
|
|||
if UNLIKELY (!PWINDOW)
|
||||
return;
|
||||
|
||||
if UNLIKELY (PWINDOW->m_suppressedEvents & SUPPRESS_FULLSCREEN)
|
||||
if UNLIKELY (PWINDOW->m_suppressedEvents & Desktop::View::SUPPRESS_FULLSCREEN)
|
||||
return;
|
||||
|
||||
g_pCompositor->changeWindowFullscreenModeClient(PWINDOW, FSMODE_FULLSCREEN, false);
|
||||
|
|
@ -78,7 +78,7 @@ CForeignToplevelHandleWlr::CForeignToplevelHandleWlr(SP<CZwlrForeignToplevelHand
|
|||
if UNLIKELY (!PWINDOW)
|
||||
return;
|
||||
|
||||
if UNLIKELY (PWINDOW->m_suppressedEvents & SUPPRESS_MAXIMIZE)
|
||||
if UNLIKELY (PWINDOW->m_suppressedEvents & Desktop::View::SUPPRESS_MAXIMIZE)
|
||||
return;
|
||||
|
||||
if UNLIKELY (!PWINDOW->m_isMapped) {
|
||||
|
|
@ -95,7 +95,7 @@ CForeignToplevelHandleWlr::CForeignToplevelHandleWlr(SP<CZwlrForeignToplevelHand
|
|||
if UNLIKELY (!PWINDOW)
|
||||
return;
|
||||
|
||||
if UNLIKELY (PWINDOW->m_suppressedEvents & SUPPRESS_MAXIMIZE)
|
||||
if UNLIKELY (PWINDOW->m_suppressedEvents & Desktop::View::SUPPRESS_MAXIMIZE)
|
||||
return;
|
||||
|
||||
g_pCompositor->changeWindowFullscreenModeClient(PWINDOW, FSMODE_MAXIMIZED, false);
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
#include "WaylandProtocol.hpp"
|
||||
#include "wlr-foreign-toplevel-management-unstable-v1.hpp"
|
||||
|
||||
class CWindow;
|
||||
class CMonitor;
|
||||
|
||||
class CForeignToplevelHandleWlr {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#include "HyprlandSurface.hpp"
|
||||
#include "../desktop/WLSurface.hpp"
|
||||
#include "../desktop/view/WLSurface.hpp"
|
||||
#include "../render/Renderer.hpp"
|
||||
#include "core/Compositor.hpp"
|
||||
#include "hyprland-surface-v1.hpp"
|
||||
|
|
@ -52,7 +52,7 @@ void CHyprlandSurface::setResource(SP<CHyprlandSurfaceV1> resource) {
|
|||
});
|
||||
|
||||
m_listeners.surfaceCommitted = m_surface->m_events.commit.listen([this] {
|
||||
auto surface = CWLSurface::fromResource(m_surface.lock());
|
||||
auto surface = Desktop::View::CWLSurface::fromResource(m_surface.lock());
|
||||
|
||||
if (surface && (surface->m_overallOpacity != m_opacity || m_visibleRegionChanged)) {
|
||||
surface->m_overallOpacity = m_opacity;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@
|
|||
#include "input-method-unstable-v2.hpp"
|
||||
#include "text-input-unstable-v3.hpp"
|
||||
#include "../helpers/signal/Signal.hpp"
|
||||
#include "../desktop/WLSurface.hpp"
|
||||
#include "../desktop/view/WLSurface.hpp"
|
||||
|
||||
class CInputMethodKeyboardGrabV2;
|
||||
class CInputMethodPopupV2;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#include "LayerShell.hpp"
|
||||
#include "../Compositor.hpp"
|
||||
#include "../desktop/LayerSurface.hpp"
|
||||
#include "../desktop/view/LayerSurface.hpp"
|
||||
#include "XDGShell.hpp"
|
||||
#include "core/Compositor.hpp"
|
||||
#include "core/Output.hpp"
|
||||
|
|
@ -247,7 +247,7 @@ void CLayerShellProtocol::onGetLayerSurface(CZwlrLayerShellV1* pMgr, uint32_t id
|
|||
}
|
||||
|
||||
SURF->m_role = makeShared<CLayerShellRole>(RESOURCE);
|
||||
g_pCompositor->m_layers.emplace_back(CLayerSurface::create(RESOURCE));
|
||||
g_pCompositor->m_layers.emplace_back(Desktop::View::CLayerSurface::create(RESOURCE));
|
||||
|
||||
LOGM(LOG, "New wlr_layer_surface {:x}", (uintptr_t)RESOURCE.get());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -509,12 +509,12 @@ void CLinuxDMABufV1Protocol::resetFormatTable() {
|
|||
feedback->m_resource->sendFormatTable(newFormatTable->m_tableFD.get(), newFormatTable->m_tableSize);
|
||||
if (feedback->m_lastFeedbackWasScanout) {
|
||||
PHLMONITOR mon;
|
||||
auto HLSurface = CWLSurface::fromResource(feedback->m_surface);
|
||||
auto HLSurface = Desktop::View::CWLSurface::fromResource(feedback->m_surface);
|
||||
if (!HLSurface) {
|
||||
feedback->sendDefaultFeedback();
|
||||
continue;
|
||||
}
|
||||
if (auto w = HLSurface->getWindow(); w)
|
||||
if (auto w = Desktop::View::CWindow::fromView(HLSurface->view()); w)
|
||||
if (auto m = w->m_monitor.lock(); m)
|
||||
mon = m->m_self.lock();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#include "PointerConstraints.hpp"
|
||||
#include "../desktop/WLSurface.hpp"
|
||||
#include "../desktop/view/WLSurface.hpp"
|
||||
#include "../desktop/state/FocusState.hpp"
|
||||
#include "../desktop/Window.hpp"
|
||||
#include "../desktop/view/Window.hpp"
|
||||
#include "../config/ConfigValue.hpp"
|
||||
#include "../managers/SeatManager.hpp"
|
||||
#include "core/Compositor.hpp"
|
||||
|
|
@ -17,7 +17,7 @@ CPointerConstraint::CPointerConstraint(SP<CZwpLockedPointerV1> resource_, SP<CWL
|
|||
resource_->setOnDestroy([this](CZwpLockedPointerV1* p) { PROTO::constraints->destroyPointerConstraint(this); });
|
||||
resource_->setDestroy([this](CZwpLockedPointerV1* p) { PROTO::constraints->destroyPointerConstraint(this); });
|
||||
|
||||
m_hlSurface = CWLSurface::fromResource(surf);
|
||||
m_hlSurface = Desktop::View::CWLSurface::fromResource(surf);
|
||||
|
||||
if (!m_hlSurface)
|
||||
return;
|
||||
|
|
@ -35,7 +35,7 @@ CPointerConstraint::CPointerConstraint(SP<CZwpLockedPointerV1> resource_, SP<CWL
|
|||
m_hintSet = true;
|
||||
|
||||
float scale = 1.f;
|
||||
const auto PWINDOW = m_hlSurface->getWindow();
|
||||
const auto PWINDOW = Desktop::View::CWindow::fromView(m_hlSurface->view());
|
||||
if (PWINDOW) {
|
||||
const auto ISXWL = PWINDOW->m_isX11;
|
||||
scale = ISXWL && *PXWLFORCESCALEZERO ? PWINDOW->m_X11SurfaceScaledBy : 1.f;
|
||||
|
|
@ -56,7 +56,7 @@ CPointerConstraint::CPointerConstraint(SP<CZwpConfinedPointerV1> resource_, SP<C
|
|||
resource_->setOnDestroy([this](CZwpConfinedPointerV1* p) { PROTO::constraints->destroyPointerConstraint(this); });
|
||||
resource_->setDestroy([this](CZwpConfinedPointerV1* p) { PROTO::constraints->destroyPointerConstraint(this); });
|
||||
|
||||
m_hlSurface = CWLSurface::fromResource(surf);
|
||||
m_hlSurface = Desktop::View::CWLSurface::fromResource(surf);
|
||||
|
||||
if (!m_hlSurface)
|
||||
return;
|
||||
|
|
@ -159,7 +159,7 @@ void CPointerConstraint::onSetRegion(wl_resource* wlRegion) {
|
|||
g_pInputManager->simulateMouseMovement(); // to warp the cursor if anything's amiss
|
||||
}
|
||||
|
||||
SP<CWLSurface> CPointerConstraint::owner() {
|
||||
SP<Desktop::View::CWLSurface> CPointerConstraint::owner() {
|
||||
return m_hlSurface.lock();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -6,10 +6,10 @@
|
|||
#include <cstdint>
|
||||
#include "WaylandProtocol.hpp"
|
||||
#include "pointer-constraints-unstable-v1.hpp"
|
||||
#include "../desktop/view/WLSurface.hpp"
|
||||
#include "../helpers/math/Math.hpp"
|
||||
#include "../helpers/signal/Signal.hpp"
|
||||
|
||||
class CWLSurface;
|
||||
class CWLSurfaceResource;
|
||||
|
||||
class CPointerConstraint {
|
||||
|
|
@ -18,23 +18,23 @@ class CPointerConstraint {
|
|||
CPointerConstraint(SP<CZwpConfinedPointerV1> resource_, SP<CWLSurfaceResource> surf, wl_resource* region, zwpPointerConstraintsV1Lifetime lifetime_);
|
||||
~CPointerConstraint();
|
||||
|
||||
bool good();
|
||||
bool good();
|
||||
|
||||
void deactivate();
|
||||
void activate();
|
||||
bool isActive();
|
||||
void deactivate();
|
||||
void activate();
|
||||
bool isActive();
|
||||
|
||||
SP<CWLSurface> owner();
|
||||
SP<Desktop::View::CWLSurface> owner();
|
||||
|
||||
CRegion logicConstraintRegion();
|
||||
bool isLocked();
|
||||
Vector2D logicPositionHint();
|
||||
CRegion logicConstraintRegion();
|
||||
bool isLocked();
|
||||
Vector2D logicPositionHint();
|
||||
|
||||
private:
|
||||
SP<CZwpLockedPointerV1> m_resourceLocked;
|
||||
SP<CZwpConfinedPointerV1> m_resourceConfined;
|
||||
|
||||
WP<CWLSurface> m_hlSurface;
|
||||
WP<Desktop::View::CWLSurface> m_hlSurface;
|
||||
|
||||
CRegion m_region;
|
||||
bool m_hintSet = false;
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
#include "PointerWarp.hpp"
|
||||
#include "core/Compositor.hpp"
|
||||
#include "core/Seat.hpp"
|
||||
#include "../desktop/WLSurface.hpp"
|
||||
#include "../desktop/view/WLSurface.hpp"
|
||||
#include "../managers/SeatManager.hpp"
|
||||
#include "../managers/PointerManager.hpp"
|
||||
#include "../desktop/Window.hpp"
|
||||
#include "../desktop/view/Window.hpp"
|
||||
|
||||
CPointerWarpProtocol::CPointerWarpProtocol(const wl_interface* iface, const int& ver, const std::string& name) : IWaylandProtocol(iface, ver, name) {
|
||||
;
|
||||
|
|
@ -27,11 +27,11 @@ void CPointerWarpProtocol::bindManager(wl_client* client, void* data, uint32_t v
|
|||
if (g_pSeatManager->m_state.pointerFocus != PSURFACE)
|
||||
return;
|
||||
|
||||
auto SURFBOXV = CWLSurface::fromResource(PSURFACE)->getSurfaceBoxGlobal();
|
||||
if (!SURFBOXV.has_value())
|
||||
auto WINDOW = Desktop::View::CWindow::fromView(Desktop::View::CWLSurface::fromResource(PSURFACE)->view());
|
||||
if (!WINDOW)
|
||||
return;
|
||||
|
||||
const auto SURFBOX = SURFBOXV->expand(1);
|
||||
const auto SURFBOX = WINDOW->getWindowMainSurfaceBox().expand(1);
|
||||
const auto LOCALPOS = Vector2D{wl_fixed_to_double(x), wl_fixed_to_double(y)};
|
||||
const auto GLOBALPOS = LOCALPOS + SURFBOX.pos();
|
||||
if (!SURFBOX.containsPoint(GLOBALPOS))
|
||||
|
|
|
|||
|
|
@ -212,12 +212,12 @@ void CScreencopyFrame::renderMon() {
|
|||
g_pHyprOpenGL->popMonitorTransformEnabled();
|
||||
|
||||
auto hidePopups = [&](Vector2D popupBaseOffset) {
|
||||
return [&, popupBaseOffset](WP<CPopup> popup, void*) {
|
||||
if (!popup->m_wlSurface || !popup->m_wlSurface->resource() || !popup->m_mapped)
|
||||
return [&, popupBaseOffset](WP<Desktop::View::CPopup> popup, void*) {
|
||||
if (!popup->wlSurface() || !popup->wlSurface()->resource() || !popup->visible())
|
||||
return;
|
||||
|
||||
const auto popRel = popup->coordsRelativeToParent();
|
||||
popup->m_wlSurface->resource()->breadthfirst(
|
||||
popup->wlSurface()->resource()->breadthfirst(
|
||||
[&](SP<CWLSurfaceResource> surf, const Vector2D& localOff, void*) {
|
||||
const auto size = surf->m_current.size;
|
||||
const auto surfBox = CBox{popupBaseOffset + popRel + localOff, size}.translate(m_monitor->m_position).scale(m_monitor->m_scale).translate(-m_box.pos());
|
||||
|
|
@ -233,7 +233,7 @@ void CScreencopyFrame::renderMon() {
|
|||
if (!l->m_ruleApplicator->noScreenShare().valueOrDefault())
|
||||
continue;
|
||||
|
||||
if UNLIKELY ((!l->m_mapped && !l->m_fadingOut) || l->m_alpha->value() == 0.f)
|
||||
if UNLIKELY (!l->visible())
|
||||
continue;
|
||||
|
||||
const auto REALPOS = l->m_realPosition->value();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#include "SinglePixel.hpp"
|
||||
#include "../desktop/LayerSurface.hpp"
|
||||
#include "../desktop/view/LayerSurface.hpp"
|
||||
#include <limits>
|
||||
#include "render/Renderer.hpp"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#include "TearingControl.hpp"
|
||||
#include "../managers/ProtocolManager.hpp"
|
||||
#include "../desktop/Window.hpp"
|
||||
#include "../desktop/view/Window.hpp"
|
||||
#include "../Compositor.hpp"
|
||||
#include "core/Compositor.hpp"
|
||||
#include "../managers/HookSystemManager.hpp"
|
||||
|
|
@ -54,7 +54,7 @@ CTearingControl::CTearingControl(SP<CWpTearingControlV1> resource_, SP<CWLSurfac
|
|||
m_resource->setSetPresentationHint([this](CWpTearingControlV1* res, wpTearingControlV1PresentationHint hint) { this->onHint(hint); });
|
||||
|
||||
for (auto const& w : g_pCompositor->m_windows) {
|
||||
if (w->m_wlSurface->resource() == surf_) {
|
||||
if (w->wlSurface()->resource() == surf_) {
|
||||
m_window = w;
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
#include "WaylandProtocol.hpp"
|
||||
#include "tearing-control-v1.hpp"
|
||||
|
||||
class CWindow;
|
||||
class CTearingControlProtocol;
|
||||
class CWLSurfaceResource;
|
||||
|
||||
|
|
|
|||
|
|
@ -372,9 +372,9 @@ bool CToplevelExportFrame::shouldOverlayCursor() const {
|
|||
if (!pointerSurfaceResource)
|
||||
return false;
|
||||
|
||||
auto pointerSurface = CWLSurface::fromResource(pointerSurfaceResource);
|
||||
auto pointerSurface = Desktop::View::CWLSurface::fromResource(pointerSurfaceResource);
|
||||
|
||||
return pointerSurface && pointerSurface->getWindow() == m_window;
|
||||
return pointerSurface && Desktop::View::CWindow::fromView(pointerSurface->view()) == m_window;
|
||||
}
|
||||
|
||||
bool CToplevelExportFrame::good() {
|
||||
|
|
@ -382,7 +382,11 @@ bool CToplevelExportFrame::good() {
|
|||
}
|
||||
|
||||
CToplevelExportProtocol::CToplevelExportProtocol(const wl_interface* iface, const int& ver, const std::string& name) : IWaylandProtocol(iface, ver, name) {
|
||||
;
|
||||
static auto P1 = g_pHookSystem->hookDynamic("closeWindow", [this](void* self, SCallbackInfo& info, std::any data) {
|
||||
auto window = std::any_cast<PHLWINDOW>(data);
|
||||
|
||||
onWindowUnmap(window);
|
||||
});
|
||||
}
|
||||
|
||||
void CToplevelExportProtocol::bindManager(wl_client* client, void* data, uint32_t ver, uint32_t id) {
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@
|
|||
#include <vector>
|
||||
|
||||
class CMonitor;
|
||||
class CWindow;
|
||||
|
||||
class CToplevelExportClient {
|
||||
public:
|
||||
|
|
@ -78,7 +77,6 @@ class CToplevelExportProtocol : IWaylandProtocol {
|
|||
void destroyResource(CToplevelExportClient* client);
|
||||
void destroyResource(CToplevelExportFrame* frame);
|
||||
|
||||
void onWindowUnmap(PHLWINDOW pWindow);
|
||||
void onOutputCommit(PHLMONITOR pMonitor);
|
||||
|
||||
private:
|
||||
|
|
@ -86,6 +84,8 @@ class CToplevelExportProtocol : IWaylandProtocol {
|
|||
std::vector<SP<CToplevelExportFrame>> m_frames;
|
||||
std::vector<WP<CToplevelExportFrame>> m_framesAwaitingWrite;
|
||||
|
||||
void onWindowUnmap(PHLWINDOW pWindow);
|
||||
|
||||
void shareFrame(CToplevelExportFrame* frame);
|
||||
bool copyFrameDmabuf(CToplevelExportFrame* frame, const Time::steady_tp& now);
|
||||
bool copyFrameShm(CToplevelExportFrame* frame, const Time::steady_tp& now);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#include "XDGBell.hpp"
|
||||
#include "core/Compositor.hpp"
|
||||
#include "../desktop/Window.hpp"
|
||||
#include "../desktop/view/Window.hpp"
|
||||
#include "../managers/EventManager.hpp"
|
||||
#include "../Compositor.hpp"
|
||||
|
||||
|
|
@ -31,10 +31,10 @@ CXDGSystemBellManagerResource::CXDGSystemBellManagerResource(UP<CXdgSystemBellV1
|
|||
}
|
||||
|
||||
for (const auto& w : g_pCompositor->m_windows) {
|
||||
if (!w->m_isMapped || w->m_isX11 || !w->m_xdgSurface || !w->m_wlSurface)
|
||||
if (!w->m_isMapped || w->m_isX11 || !w->m_xdgSurface || !w->wlSurface())
|
||||
continue;
|
||||
|
||||
if (w->m_wlSurface->resource() == SURFACE) {
|
||||
if (w->wlSurface()->resource() == SURFACE) {
|
||||
g_pEventManager->postEvent(SHyprIPCEvent{
|
||||
.event = "bell",
|
||||
.data = std::format("{:x}", rc<uintptr_t>(w.get())),
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#include "XDGDialog.hpp"
|
||||
#include "XDGShell.hpp"
|
||||
#include "../desktop/WLSurface.hpp"
|
||||
#include "../desktop/view/WLSurface.hpp"
|
||||
#include "../Compositor.hpp"
|
||||
#include <algorithm>
|
||||
|
||||
|
|
@ -26,11 +26,16 @@ void CXDGDialogV1Resource::updateWindow() {
|
|||
if UNLIKELY (!m_toplevel || !m_toplevel->m_parent || !m_toplevel->m_parent->m_owner)
|
||||
return;
|
||||
|
||||
auto HLSurface = CWLSurface::fromResource(m_toplevel->m_parent->m_owner->m_surface.lock());
|
||||
if UNLIKELY (!HLSurface || !HLSurface->getWindow())
|
||||
const auto HLSURFACE = Desktop::View::CWLSurface::fromResource(m_toplevel->m_parent->m_owner->m_surface.lock());
|
||||
if UNLIKELY (!HLSURFACE)
|
||||
return;
|
||||
|
||||
HLSurface->getWindow()->m_ruleApplicator->propertiesChanged(Desktop::Rule::RULE_PROP_MODAL);
|
||||
const auto WINDOW = Desktop::View::CWindow::fromView(HLSURFACE->view());
|
||||
|
||||
if UNLIKELY (!WINDOW)
|
||||
return;
|
||||
|
||||
WINDOW->m_ruleApplicator->propertiesChanged(Desktop::Rule::RULE_PROP_MODAL);
|
||||
}
|
||||
|
||||
bool CXDGDialogV1Resource::good() {
|
||||
|
|
|
|||
|
|
@ -460,7 +460,7 @@ CXDGSurfaceResource::CXDGSurfaceResource(SP<CXdgSurface> resource_, SP<CXDGWMBas
|
|||
|
||||
LOGM(LOG, "xdg_surface {:x} gets a toplevel {:x}", (uintptr_t)m_owner.get(), (uintptr_t)RESOURCE.get());
|
||||
|
||||
g_pCompositor->m_windows.emplace_back(CWindow::create(m_self.lock()));
|
||||
g_pCompositor->m_windows.emplace_back(Desktop::View::CWindow::create(m_self.lock()));
|
||||
|
||||
for (auto const& p : m_popups) {
|
||||
if (!p)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#include "XDGTag.hpp"
|
||||
#include "XDGShell.hpp"
|
||||
#include "../desktop/Window.hpp"
|
||||
#include "../desktop/view/Window.hpp"
|
||||
|
||||
CXDGToplevelTagManagerResource::CXDGToplevelTagManagerResource(UP<CXdgToplevelTagManagerV1>&& resource) : m_resource(std::move(resource)) {
|
||||
if UNLIKELY (!good())
|
||||
|
|
|
|||
|
|
@ -356,7 +356,7 @@ void CWLSurfaceResource::bfHelper(std::vector<SP<CWLSurfaceResource>> const& nod
|
|||
break;
|
||||
if (c->m_surface.expired())
|
||||
continue;
|
||||
nodes2.push_back(c->m_surface.lock());
|
||||
nodes2.emplace_back(c->m_surface.lock());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -381,7 +381,7 @@ void CWLSurfaceResource::bfHelper(std::vector<SP<CWLSurfaceResource>> const& nod
|
|||
continue;
|
||||
if (c->m_surface.expired())
|
||||
continue;
|
||||
nodes2.push_back(c->m_surface.lock());
|
||||
nodes2.emplace_back(c->m_surface.lock());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -391,7 +391,7 @@ void CWLSurfaceResource::bfHelper(std::vector<SP<CWLSurfaceResource>> const& nod
|
|||
|
||||
void CWLSurfaceResource::breadthfirst(std::function<void(SP<CWLSurfaceResource>, const Vector2D&, void*)> fn, void* data) {
|
||||
std::vector<SP<CWLSurfaceResource>> surfs;
|
||||
surfs.push_back(m_self.lock());
|
||||
surfs.emplace_back(m_self.lock());
|
||||
bfHelper(surfs, fn, data);
|
||||
}
|
||||
|
||||
|
|
@ -558,7 +558,9 @@ void CWLSurfaceResource::commitState(SSurfaceState& state) {
|
|||
|
||||
SImageDescription CWLSurfaceResource::getPreferredImageDescription() {
|
||||
static const auto PFORCE_HDR = CConfigValue<Hyprlang::INT>("quirks:prefer_hdr");
|
||||
if (*PFORCE_HDR == 1 || (*PFORCE_HDR == 2 && m_hlSurface && m_hlSurface->getWindow() && m_hlSurface->getWindow()->m_class == "gamescope"))
|
||||
const auto WINDOW = Desktop::View::CWindow::fromView(m_hlSurface->view());
|
||||
|
||||
if (*PFORCE_HDR == 1 || (*PFORCE_HDR == 2 && m_hlSurface && WINDOW && WINDOW->m_class == "gamescope"))
|
||||
return g_pCompositor->getHDRImageDescription();
|
||||
|
||||
auto parent = m_self;
|
||||
|
|
@ -569,8 +571,8 @@ SImageDescription CWLSurfaceResource::getPreferredImageDescription() {
|
|||
WP<CMonitor> monitor;
|
||||
if (parent->m_enteredOutputs.size() == 1)
|
||||
monitor = parent->m_enteredOutputs[0];
|
||||
else if (m_hlSurface.valid() && m_hlSurface->getWindow())
|
||||
monitor = m_hlSurface->getWindow()->m_monitor;
|
||||
else if (m_hlSurface.valid() && WINDOW)
|
||||
monitor = WINDOW->m_monitor;
|
||||
|
||||
return monitor ? monitor->m_imageDescription : g_pCompositor->getPreferredImageDescription();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@
|
|||
#include "../../render/Texture.hpp"
|
||||
#include "../types/SurfaceStateQueue.hpp"
|
||||
#include "wayland.hpp"
|
||||
#include "../../desktop/view/WLSurface.hpp"
|
||||
#include "../../helpers/signal/Signal.hpp"
|
||||
#include "../../helpers/math/Math.hpp"
|
||||
#include "../../helpers/time/Time.hpp"
|
||||
|
|
@ -25,7 +26,6 @@
|
|||
|
||||
class CWLOutputResource;
|
||||
class CMonitor;
|
||||
class CWLSurface;
|
||||
class CWLSurfaceResource;
|
||||
class CWLSubsurfaceResource;
|
||||
class CViewportResource;
|
||||
|
|
@ -109,7 +109,7 @@ class CWLSurfaceResource {
|
|||
CSurfaceStateQueue m_stateQueue;
|
||||
|
||||
WP<CWLSurfaceResource> m_self;
|
||||
WP<CWLSurface> m_hlSurface;
|
||||
WP<Desktop::View::CWLSurface> m_hlSurface;
|
||||
std::vector<PHLMONITORREF> m_enteredOutputs;
|
||||
bool m_mapped = false;
|
||||
std::vector<WP<CWLSubsurfaceResource>> m_subsurfaces;
|
||||
|
|
|
|||
|
|
@ -603,7 +603,7 @@ void CWLDataDeviceProtocol::initiateDrag(WP<CWLDataSourceResource> currentSource
|
|||
m_dnd.mouseMove = g_pHookSystem->hookDynamic("mouseMove", [this](void* self, SCallbackInfo& info, std::any e) {
|
||||
auto V = std::any_cast<const Vector2D>(e);
|
||||
if (m_dnd.focusedDevice && g_pSeatManager->m_state.dndPointerFocus) {
|
||||
auto surf = CWLSurface::fromResource(g_pSeatManager->m_state.dndPointerFocus.lock());
|
||||
auto surf = Desktop::View::CWLSurface::fromResource(g_pSeatManager->m_state.dndPointerFocus.lock());
|
||||
|
||||
if (!surf)
|
||||
return;
|
||||
|
|
@ -621,7 +621,7 @@ void CWLDataDeviceProtocol::initiateDrag(WP<CWLDataSourceResource> currentSource
|
|||
m_dnd.touchMove = g_pHookSystem->hookDynamic("touchMove", [this](void* self, SCallbackInfo& info, std::any e) {
|
||||
auto E = std::any_cast<ITouch::SMotionEvent>(e);
|
||||
if (m_dnd.focusedDevice && g_pSeatManager->m_state.dndPointerFocus) {
|
||||
auto surf = CWLSurface::fromResource(g_pSeatManager->m_state.dndPointerFocus.lock());
|
||||
auto surf = Desktop::View::CWLSurface::fromResource(g_pSeatManager->m_state.dndPointerFocus.lock());
|
||||
|
||||
if (!surf)
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ CWLOutputResource::CWLOutputResource(SP<CWlOutput> resource_, PHLMONITOR pMonito
|
|||
updateState();
|
||||
|
||||
PROTO::compositor->forEachSurface([](SP<CWLSurfaceResource> surf) {
|
||||
auto HLSurf = CWLSurface::fromResource(surf);
|
||||
auto HLSurf = Desktop::View::CWLSurface::fromResource(surf);
|
||||
|
||||
if (!HLSurf)
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#include "DMABuffer.hpp"
|
||||
#include "WLBuffer.hpp"
|
||||
#include "../../desktop/LayerSurface.hpp"
|
||||
#include "../../desktop/view/LayerSurface.hpp"
|
||||
#include "../../render/Renderer.hpp"
|
||||
#include "../../helpers/Format.hpp"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue