wlr-foreign-toplevel: move to new impl

This commit is contained in:
Vaxry
2024-04-25 00:58:40 +01:00
parent 72e31d3335
commit ecf282d331
15 changed files with 477 additions and 166 deletions

View File

@@ -219,8 +219,6 @@ void CCompositor::initServer() {
m_sWLRVirtPtrMgr = wlr_virtual_pointer_manager_v1_create(m_sWLDisplay);
m_sWLRToplevelMgr = wlr_foreign_toplevel_manager_v1_create(m_sWLDisplay);
m_sWRLDRMLeaseMgr = wlr_drm_lease_v1_manager_create(m_sWLDisplay, m_sWLRBackend);
if (!m_sWRLDRMLeaseMgr) {
Debug::log(INFO, "Failed to create wlr_drm_lease_v1_manager");
@@ -954,9 +952,6 @@ void CCompositor::focusWindow(CWindow* pWindow, wlr_surface* pSurface) {
updateWindowAnimatedDecorationValues(PLASTWINDOW);
g_pXWaylandManager->activateWindow(PLASTWINDOW, false);
if (PLASTWINDOW->m_phForeignToplevel)
wlr_foreign_toplevel_handle_v1_set_activated(PLASTWINDOW->m_phForeignToplevel, false);
}
wlr_seat_keyboard_notify_clear_focus(m_sSeat.seat);
@@ -1016,9 +1011,6 @@ void CCompositor::focusWindow(CWindow* pWindow, wlr_surface* pSurface) {
if (!pWindow->m_bIsX11 || pWindow->m_iX11Type == 1)
g_pXWaylandManager->activateWindow(PLASTWINDOW, false);
if (PLASTWINDOW->m_phForeignToplevel)
wlr_foreign_toplevel_handle_v1_set_activated(PLASTWINDOW->m_phForeignToplevel, false);
}
m_pLastWindow = PLASTWINDOW;
@@ -1044,17 +1036,6 @@ void CCompositor::focusWindow(CWindow* pWindow, wlr_surface* pSurface) {
g_pLayoutManager->getCurrentLayout()->onWindowFocusChange(pWindow);
// TODO: implement this better
if (!PLASTWINDOW && pWindow->m_sGroupData.pNextWindow) {
for (auto curr = pWindow->m_sGroupData.pNextWindow; curr != pWindow; curr = curr->m_sGroupData.pNextWindow) {
if (curr->m_phForeignToplevel)
wlr_foreign_toplevel_handle_v1_set_activated(curr->m_phForeignToplevel, false);
}
}
if (pWindow->m_phForeignToplevel)
wlr_foreign_toplevel_handle_v1_set_activated(pWindow->m_phForeignToplevel, true);
g_pInputManager->recheckIdleInhibitorStatus();
// move to front of the window history
@@ -1203,23 +1184,6 @@ CWindow* CCompositor::getWindowFromHandle(uint32_t handle) {
return nullptr;
}
CWindow* CCompositor::getWindowFromZWLRHandle(wl_resource* handle) {
for (auto& w : m_vWindows) {
if (!w->m_bIsMapped || w->isHidden() || !w->m_phForeignToplevel)
continue;
wl_resource* current;
wl_list_for_each(current, &w->m_phForeignToplevel->resources, link) {
if (current == handle) {
return w.get();
}
}
}
return nullptr;
}
CWindow* CCompositor::getFullscreenWindowOnWorkspace(const int& ID) {
for (auto& w : m_vWindows) {
if (w->workspaceID() == ID && w->m_bIsFullscreen)