Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion src/window/IWaylandWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ void IWaylandWindow::setCursor(ePointerShape shape) {
}

SP<IWindow> IWaylandWindow::openPopup(const SWindowCreationData& data) {
auto x = makeShared<CWaylandPopup>(data, reinterpretPointerCast<CWaylandWindow>(m_self.lock()));
auto x = makeShared<CWaylandPopup>(data, reinterpretPointerCast<IWaylandWindow>(m_self.lock()));
x->m_self = x;
m_popups.emplace_back(x);
return x;
Expand Down
6 changes: 5 additions & 1 deletion src/window/WaylandPopup.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "WaylandPopup.hpp"
#include "WaylandWindow.hpp"
#include "WaylandLayer.hpp"

#include <hyprtoolkit/element/Null.hpp>

Expand All @@ -15,7 +16,7 @@
using namespace Hyprtoolkit;
using namespace Hyprutils::Math;

CWaylandPopup::CWaylandPopup(const SWindowCreationData& data, SP<CWaylandWindow> window) : m_parent(window), m_creationData(data) {
CWaylandPopup::CWaylandPopup(const SWindowCreationData& data, SP<IWaylandWindow> window) : m_parent(window), m_creationData(data) {
m_rootElement = CNullBuilder::begin()->commence();
}

Expand Down Expand Up @@ -65,6 +66,9 @@ void CWaylandPopup::open() {

m_wlPopupState.xdgPopup = makeShared<CCXdgPopup>(m_waylandState.xdgSurface->sendGetPopup(m_parent->m_waylandState.xdgSurface.get(), m_wlPopupState.xdgPositioner.get()));

if (dynamicPointerCast<CWaylandLayer>(m_parent))
dynamicPointerCast<CWaylandLayer>(m_parent)->m_layerState.layerSurface->sendGetPopup(m_wlPopupState.xdgPopup->resource());

if (!m_wlPopupState.xdgPopup->resource()) {
g_logger->log(HT_LOG_ERROR, "window opening failed: no xdgToplevel given. Errno: {}", errno);
return;
Expand Down
6 changes: 3 additions & 3 deletions src/window/WaylandPopup.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ namespace Hyprtoolkit {
// TODO: de-dup this shit
class CWaylandPopup : public IWaylandWindow {
public:
CWaylandPopup(const SWindowCreationData& data, SP<CWaylandWindow> parent);
CWaylandPopup(const SWindowCreationData& data, SP<IWaylandWindow> parent);
virtual ~CWaylandPopup();

virtual void close();
virtual void open();
virtual Hyprutils::Memory::CSharedPointer<IWindow> openPopup(const SWindowCreationData& data);

private:
WP<CWaylandWindow> m_parent;
WP<IWaylandWindow> m_parent;
SWindowCreationData m_creationData;

struct {
Expand All @@ -29,4 +29,4 @@ namespace Hyprtoolkit {
friend class CWaylandPlatform;
friend class CWaylandWindow;
};
};
};
Loading