Hyprland/src/Window.hpp

71 lines
2.0 KiB
C++
Raw Normal View History

2022-03-17 20:22:29 +01:00
#pragma once
#include "defines.hpp"
#include "events/Events.hpp"
2022-03-27 21:46:27 +02:00
#include "helpers/SubsurfaceTree.hpp"
2022-03-17 20:22:29 +01:00
class CWindow {
public:
2022-03-30 21:18:42 +02:00
~CWindow();
2022-03-17 20:22:29 +01:00
DYNLISTENER(commitWindow);
DYNLISTENER(mapWindow);
DYNLISTENER(unmapWindow);
DYNLISTENER(destroyWindow);
DYNLISTENER(setTitleWindow);
DYNLISTENER(fullscreenWindow);
2022-03-20 14:00:46 +01:00
DYNLISTENER(newPopupXDG);
2022-03-27 17:25:20 +02:00
// DYNLISTENER(newSubsurfaceWindow);
2022-03-17 20:22:29 +01:00
union {
wlr_xdg_surface* xdg;
wlr_xwayland_surface* xwayland;
} m_uSurface;
// TODO: XWayland
// this is the position and size of the "bounding box"
Vector2D m_vPosition = Vector2D(0,0);
Vector2D m_vSize = Vector2D(0,0);
// this is the position and size of the goal placement
Vector2D m_vEffectivePosition = Vector2D(0,0);
Vector2D m_vEffectiveSize = Vector2D(0,0);
// this is the real position and size used to draw the thing
Vector2D m_vRealPosition = Vector2D(0,0);
Vector2D m_vRealSize = Vector2D(0,0);
uint64_t m_iTags = 0;
bool m_bIsFloating = false;
bool m_bIsFullscreen = false;
uint64_t m_iMonitorID = -1;
2022-03-18 22:35:51 +01:00
std::string m_szTitle = "";
2022-03-20 15:55:47 +01:00
int m_iWorkspaceID = -1;
2022-03-18 20:03:39 +01:00
2022-03-22 20:53:11 +01:00
bool m_bIsMapped = false;
// This is for fullscreen apps
bool m_bCreatedOverFullscreen = false;
2022-03-18 20:03:39 +01:00
// XWayland stuff
bool m_bIsX11 = false;
2022-03-18 23:16:15 +01:00
bool m_bMappedX11 = false;
2022-03-18 20:03:39 +01:00
uint64_t m_iX11Type = 0;
2022-03-22 18:29:13 +01:00
bool m_bIsModal = false;
2022-03-22 21:28:57 +01:00
bool m_bX11DoesntWantBorders = false;
2022-03-18 20:03:39 +01:00
DYNLISTENER(activateX11);
DYNLISTENER(configureX11);
//
2022-03-18 22:35:51 +01:00
2022-03-27 21:46:27 +02:00
SSurfaceTreeNode* m_pSurfaceTree = nullptr;
2022-03-18 22:35:51 +01:00
// For the list lookup
bool operator==(const CWindow& rhs) {
return m_uSurface.xdg == rhs.m_uSurface.xdg && m_uSurface.xwayland == rhs.m_uSurface.xwayland && m_vPosition == rhs.m_vPosition && m_vSize == rhs.m_vSize;
}
2022-03-17 20:22:29 +01:00
};