mirror of
https://github.com/hyprwm/Hyprland.git
synced 2025-08-16 20:43:48 -07:00
protocols: Support content-type-v1 proto (#9226)
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#include "../managers/AnimationManager.hpp"
|
||||
#include "../protocols/XDGShell.hpp"
|
||||
#include "../protocols/core/Compositor.hpp"
|
||||
#include "../protocols/ContentType.hpp"
|
||||
#include "../xwayland/XWayland.hpp"
|
||||
#include "../helpers/Color.hpp"
|
||||
#include "../events/Events.hpp"
|
||||
@@ -29,6 +30,7 @@
|
||||
|
||||
using namespace Hyprutils::String;
|
||||
using namespace Hyprutils::Animation;
|
||||
using enum NContentType::eContentType;
|
||||
|
||||
PHLWINDOW CWindow::create(SP<CXWaylandSurface> surface) {
|
||||
PHLWINDOW pWindow = SP<CWindow>(new CWindow(surface));
|
||||
@@ -1724,3 +1726,16 @@ void CWindow::sendWindowSize(Vector2D size, bool force, std::optional<Vector2D>
|
||||
else if (m_pXDGSurface && m_pXDGSurface->toplevel)
|
||||
m_vPendingSizeAcks.emplace_back(m_pXDGSurface->toplevel->setSize(size), size.floor());
|
||||
}
|
||||
|
||||
NContentType::eContentType CWindow::getContentType() {
|
||||
return m_pWLSurface->resource()->contentType.valid() ? m_pWLSurface->resource()->contentType->value : CONTENT_TYPE_NONE;
|
||||
}
|
||||
|
||||
void CWindow::setContentType(NContentType::eContentType contentType) {
|
||||
if (!m_pWLSurface->resource()->contentType.valid())
|
||||
m_pWLSurface->resource()->contentType = PROTO::contentType->getContentType(m_pWLSurface->resource());
|
||||
// else disallow content type change if proto is used?
|
||||
|
||||
Debug::log(INFO, "ContentType for window {}", (int)contentType);
|
||||
m_pWLSurface->resource()->contentType->value = contentType;
|
||||
}
|
||||
|
Reference in New Issue
Block a user