Added zext_workspace protocol support 🎉
This commit is contained in:
parent
b56343133d
commit
a8e8729230
21 changed files with 1236 additions and 49 deletions
|
|
@ -33,6 +33,10 @@ struct SMonitor {
|
|||
DYNLISTENER(monitorFrame);
|
||||
DYNLISTENER(monitorDestroy);
|
||||
|
||||
// hack: a group = workspaces on a monitor.
|
||||
// I don't really care lol :P
|
||||
wlr_ext_workspace_group_handle_v1* pWLRWorkspaceGroupHandle = nullptr;
|
||||
|
||||
|
||||
// For the list lookup
|
||||
|
||||
|
|
|
|||
29
src/helpers/Workspace.cpp
Normal file
29
src/helpers/Workspace.cpp
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
#include "Workspace.hpp"
|
||||
#include "../Compositor.hpp"
|
||||
|
||||
CWorkspace::CWorkspace(int monitorID) {
|
||||
const auto PMONITOR = g_pCompositor->getMonitorFromID(monitorID);
|
||||
|
||||
if (!PMONITOR) {
|
||||
Debug::log(ERR, "Attempted a creation of CWorkspace with an invalid monitor?");
|
||||
return;
|
||||
}
|
||||
|
||||
m_iMonitorID = monitorID;
|
||||
|
||||
m_pWlrHandle = wlr_ext_workspace_handle_v1_create(PMONITOR->pWLRWorkspaceGroupHandle);
|
||||
|
||||
// set geometry here cuz we can
|
||||
wl_array_init(&m_wlrCoordinateArr);
|
||||
*reinterpret_cast<int*>(wl_array_add(&m_wlrCoordinateArr, sizeof(int))) = (int)PMONITOR->vecPosition.x;
|
||||
*reinterpret_cast<int*>(wl_array_add(&m_wlrCoordinateArr, sizeof(int))) = (int)PMONITOR->vecPosition.y;
|
||||
wlr_ext_workspace_handle_v1_set_coordinates(m_pWlrHandle, &m_wlrCoordinateArr);
|
||||
}
|
||||
|
||||
CWorkspace::~CWorkspace() {
|
||||
if (m_pWlrHandle) {
|
||||
wlr_ext_workspace_handle_v1_set_active(m_pWlrHandle, false);
|
||||
wlr_ext_workspace_handle_v1_destroy(m_pWlrHandle);
|
||||
m_pWlrHandle = nullptr;
|
||||
}
|
||||
}
|
||||
|
|
@ -2,8 +2,16 @@
|
|||
|
||||
#include "../defines.hpp"
|
||||
|
||||
struct SWorkspace {
|
||||
int ID = -1;
|
||||
uint64_t monitorID = -1;
|
||||
bool hasFullscreenWindow = false;
|
||||
class CWorkspace {
|
||||
public:
|
||||
CWorkspace(int monitorID);
|
||||
~CWorkspace();
|
||||
|
||||
int m_iID = -1;
|
||||
uint64_t m_iMonitorID = -1;
|
||||
bool m_bHasFullscreenWindow = false;
|
||||
|
||||
wlr_ext_workspace_handle_v1* m_pWlrHandle = nullptr;
|
||||
|
||||
wl_array m_wlrCoordinateArr;
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue