mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-27 03:05:59 +01:00
internal: nuke CWindow::m_bMappedX11
it's useless. m_bIsMapped is the same.
This commit is contained in:
parent
bf7374011b
commit
9fd928e114
7 changed files with 13 additions and 20 deletions
|
@ -1065,9 +1065,6 @@ bool CCompositor::windowValidMapped(CWindow* pWindow) {
|
||||||
if (!windowExists(pWindow))
|
if (!windowExists(pWindow))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (pWindow->m_bIsX11 && !pWindow->m_bMappedX11)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (!pWindow->m_bIsMapped)
|
if (!pWindow->m_bIsMapped)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
@ -1131,7 +1128,7 @@ SIMEPopup* CCompositor::vectorToIMEPopup(const Vector2D& pos, std::list<SIMEPopu
|
||||||
|
|
||||||
CWindow* CCompositor::getWindowFromSurface(wlr_surface* pSurface) {
|
CWindow* CCompositor::getWindowFromSurface(wlr_surface* pSurface) {
|
||||||
for (auto& w : m_vWindows) {
|
for (auto& w : m_vWindows) {
|
||||||
if (!w->m_bIsMapped || w->m_bFadingOut || !w->m_bMappedX11)
|
if (!w->m_bIsMapped || w->m_bFadingOut)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (w->m_pWLSurface.wlr() == pSurface)
|
if (w->m_pWLSurface.wlr() == pSurface)
|
||||||
|
@ -1374,7 +1371,7 @@ void CCompositor::changeWindowZOrder(CWindow* pWindow, bool top) {
|
||||||
toMove.emplace_front(pw);
|
toMove.emplace_front(pw);
|
||||||
|
|
||||||
for (auto& w : m_vWindows) {
|
for (auto& w : m_vWindows) {
|
||||||
if (w->m_bIsMapped && w->m_bMappedX11 && !w->isHidden() && w->m_bIsX11 && w->X11TransientFor() == pw) {
|
if (w->m_bIsMapped && !w->isHidden() && w->m_bIsX11 && w->X11TransientFor() == pw) {
|
||||||
x11Stack(w.get(), top, x11Stack);
|
x11Stack(w.get(), top, x11Stack);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1729,7 +1726,7 @@ CWindow* CCompositor::getConstraintWindow(SMouse* pMouse) {
|
||||||
const auto PSURFACE = pMouse->currentConstraint->surface;
|
const auto PSURFACE = pMouse->currentConstraint->surface;
|
||||||
|
|
||||||
for (auto& w : m_vWindows) {
|
for (auto& w : m_vWindows) {
|
||||||
if (w->isHidden() || !w->m_bMappedX11 || !w->m_bIsMapped || !w->m_pWLSurface.exists())
|
if (w->isHidden() || !w->m_bIsMapped || !w->m_pWLSurface.exists())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (w->m_bIsX11) {
|
if (w->m_bIsX11) {
|
||||||
|
|
|
@ -231,7 +231,7 @@ pid_t CWindow::getPID() {
|
||||||
|
|
||||||
wl_client_get_credentials(wl_resource_get_client(m_uSurface.xdg->resource), &PID, nullptr, nullptr);
|
wl_client_get_credentials(wl_resource_get_client(m_uSurface.xdg->resource), &PID, nullptr, nullptr);
|
||||||
} else {
|
} else {
|
||||||
if (!m_bIsMapped || !m_bMappedX11)
|
if (!m_bIsMapped)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
PID = m_uSurface.xwayland->pid;
|
PID = m_uSurface.xwayland->pid;
|
||||||
|
@ -322,7 +322,7 @@ void sendLeaveIter(wlr_surface* pSurface, int x, int y, void* data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void CWindow::updateSurfaceOutputs() {
|
void CWindow::updateSurfaceOutputs() {
|
||||||
if (m_iLastSurfaceMonitorID == m_iMonitorID || !m_bIsMapped || m_bHidden || !m_bMappedX11)
|
if (m_iLastSurfaceMonitorID == m_iMonitorID || !m_bIsMapped || m_bHidden)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const auto PLASTMONITOR = g_pCompositor->getMonitorFromID(m_iLastSurfaceMonitorID);
|
const auto PLASTMONITOR = g_pCompositor->getMonitorFromID(m_iLastSurfaceMonitorID);
|
||||||
|
|
|
@ -238,7 +238,6 @@ class CWindow {
|
||||||
|
|
||||||
// XWayland stuff
|
// XWayland stuff
|
||||||
bool m_bIsX11 = false;
|
bool m_bIsX11 = false;
|
||||||
bool m_bMappedX11 = false;
|
|
||||||
CWindow* m_pX11Parent = nullptr;
|
CWindow* m_pX11Parent = nullptr;
|
||||||
uint64_t m_iX11Type = 0;
|
uint64_t m_iX11Type = 0;
|
||||||
bool m_bIsModal = false;
|
bool m_bIsModal = false;
|
||||||
|
|
|
@ -52,7 +52,6 @@ void Events::listener_mapWindow(void* owner, void* data) {
|
||||||
const auto PWORKSPACE =
|
const auto PWORKSPACE =
|
||||||
PMONITOR->specialWorkspaceID ? g_pCompositor->getWorkspaceByID(PMONITOR->specialWorkspaceID) : g_pCompositor->getWorkspaceByID(PMONITOR->activeWorkspace);
|
PMONITOR->specialWorkspaceID ? g_pCompositor->getWorkspaceByID(PMONITOR->specialWorkspaceID) : g_pCompositor->getWorkspaceByID(PMONITOR->activeWorkspace);
|
||||||
PWINDOW->m_iMonitorID = PMONITOR->ID;
|
PWINDOW->m_iMonitorID = PMONITOR->ID;
|
||||||
PWINDOW->m_bMappedX11 = true;
|
|
||||||
PWINDOW->m_iWorkspaceID = PMONITOR->specialWorkspaceID ? PMONITOR->specialWorkspaceID : PMONITOR->activeWorkspace;
|
PWINDOW->m_iWorkspaceID = PMONITOR->specialWorkspaceID ? PMONITOR->specialWorkspaceID : PMONITOR->activeWorkspace;
|
||||||
PWINDOW->m_bIsMapped = true;
|
PWINDOW->m_bIsMapped = true;
|
||||||
PWINDOW->m_bReadyToDelete = false;
|
PWINDOW->m_bReadyToDelete = false;
|
||||||
|
@ -712,8 +711,6 @@ void Events::listener_unmapWindow(void* owner, void* data) {
|
||||||
g_pInputManager->releaseAllMouseButtons();
|
g_pInputManager->releaseAllMouseButtons();
|
||||||
}
|
}
|
||||||
|
|
||||||
PWINDOW->m_bMappedX11 = false;
|
|
||||||
|
|
||||||
// remove the fullscreen window status from workspace if we closed it
|
// remove the fullscreen window status from workspace if we closed it
|
||||||
const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(PWINDOW->m_iWorkspaceID);
|
const auto PWORKSPACE = g_pCompositor->getWorkspaceByID(PWINDOW->m_iWorkspaceID);
|
||||||
|
|
||||||
|
@ -794,7 +791,7 @@ void Events::listener_ackConfigure(void* owner, void* data) {
|
||||||
void Events::listener_commitWindow(void* owner, void* data) {
|
void Events::listener_commitWindow(void* owner, void* data) {
|
||||||
CWindow* PWINDOW = (CWindow*)owner;
|
CWindow* PWINDOW = (CWindow*)owner;
|
||||||
|
|
||||||
if (!PWINDOW->m_bMappedX11 || PWINDOW->isHidden() || (PWINDOW->m_bIsX11 && !PWINDOW->m_bMappedX11))
|
if (!PWINDOW->m_bIsMapped || PWINDOW->isHidden())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (PWINDOW->m_bIsX11)
|
if (PWINDOW->m_bIsX11)
|
||||||
|
@ -1027,7 +1024,7 @@ void Events::listener_configureX11(void* owner, void* data) {
|
||||||
|
|
||||||
const auto E = (wlr_xwayland_surface_configure_event*)data;
|
const auto E = (wlr_xwayland_surface_configure_event*)data;
|
||||||
|
|
||||||
if (!PWINDOW->m_uSurface.xwayland->surface || !PWINDOW->m_uSurface.xwayland->surface->mapped || !PWINDOW->m_bMappedX11) {
|
if (!PWINDOW->m_uSurface.xwayland->surface || !PWINDOW->m_uSurface.xwayland->surface->mapped || !PWINDOW->m_bIsMapped) {
|
||||||
wlr_xwayland_surface_configure(PWINDOW->m_uSurface.xwayland, E->x, E->y, E->width, E->height);
|
wlr_xwayland_surface_configure(PWINDOW->m_uSurface.xwayland, E->x, E->y, E->width, E->height);
|
||||||
PWINDOW->m_vPendingReportedSize = {E->width, E->height};
|
PWINDOW->m_vPendingReportedSize = {E->width, E->height};
|
||||||
PWINDOW->m_vReportedSize = {E->width, E->height};
|
PWINDOW->m_vReportedSize = {E->width, E->height};
|
||||||
|
@ -1090,7 +1087,7 @@ void Events::listener_configureX11(void* owner, void* data) {
|
||||||
void Events::listener_unmanagedSetGeometry(void* owner, void* data) {
|
void Events::listener_unmanagedSetGeometry(void* owner, void* data) {
|
||||||
CWindow* PWINDOW = (CWindow*)owner;
|
CWindow* PWINDOW = (CWindow*)owner;
|
||||||
|
|
||||||
if (!PWINDOW->m_bMappedX11)
|
if (!PWINDOW->m_bIsMapped)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const auto POS = PWINDOW->m_vRealPosition.goalv();
|
const auto POS = PWINDOW->m_vRealPosition.goalv();
|
||||||
|
@ -1223,7 +1220,7 @@ void Events::listener_requestMaximize(void* owner, void* data) {
|
||||||
|
|
||||||
wlr_xdg_surface_schedule_configure(PWINDOW->m_uSurface.xdg);
|
wlr_xdg_surface_schedule_configure(PWINDOW->m_uSurface.xdg);
|
||||||
} else {
|
} else {
|
||||||
if (!PWINDOW->m_bMappedX11 || PWINDOW->m_iX11Type != 1)
|
if (!PWINDOW->m_bIsMapped || PWINDOW->m_iX11Type != 1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
g_pCompositor->setWindowFullscreen(PWINDOW, !PWINDOW->m_bIsFullscreen, FULLSCREEN_MAXIMIZED);
|
g_pCompositor->setWindowFullscreen(PWINDOW, !PWINDOW->m_bIsFullscreen, FULLSCREEN_MAXIMIZED);
|
||||||
|
@ -1236,7 +1233,7 @@ void Events::listener_requestMinimize(void* owner, void* data) {
|
||||||
Debug::log(LOG, "Minimize request for {}", PWINDOW);
|
Debug::log(LOG, "Minimize request for {}", PWINDOW);
|
||||||
|
|
||||||
if (PWINDOW->m_bIsX11) {
|
if (PWINDOW->m_bIsX11) {
|
||||||
if (!PWINDOW->m_bMappedX11 || PWINDOW->m_iX11Type != 1)
|
if (!PWINDOW->m_bIsMapped || PWINDOW->m_iX11Type != 1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const auto E = (wlr_xwayland_minimize_event*)data;
|
const auto E = (wlr_xwayland_minimize_event*)data;
|
||||||
|
|
|
@ -1044,7 +1044,7 @@ std::string CHyprDwindleLayout::getLayoutName() {
|
||||||
|
|
||||||
void CHyprDwindleLayout::onEnable() {
|
void CHyprDwindleLayout::onEnable() {
|
||||||
for (auto& w : g_pCompositor->m_vWindows) {
|
for (auto& w : g_pCompositor->m_vWindows) {
|
||||||
if (w->m_bIsFloating || !w->m_bMappedX11 || !w->m_bIsMapped || w->isHidden())
|
if (w->m_bIsFloating || !w->m_bIsMapped || w->isHidden())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
onWindowCreatedTiling(w.get());
|
onWindowCreatedTiling(w.get());
|
||||||
|
|
|
@ -1407,7 +1407,7 @@ void CHyprMasterLayout::replaceWindowDataWith(CWindow* from, CWindow* to) {
|
||||||
|
|
||||||
void CHyprMasterLayout::onEnable() {
|
void CHyprMasterLayout::onEnable() {
|
||||||
for (auto& w : g_pCompositor->m_vWindows) {
|
for (auto& w : g_pCompositor->m_vWindows) {
|
||||||
if (w->m_bIsFloating || !w->m_bMappedX11 || !w->m_bIsMapped || w->isHidden())
|
if (w->m_bIsFloating || !w->m_bIsMapped || w->isHidden())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
onWindowCreatedTiling(w.get());
|
onWindowCreatedTiling(w.get());
|
||||||
|
|
|
@ -119,7 +119,7 @@ std::string CHyprXWaylandManager::getTitle(CWindow* pWindow) {
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string CHyprXWaylandManager::getAppIDClass(CWindow* pWindow) {
|
std::string CHyprXWaylandManager::getAppIDClass(CWindow* pWindow) {
|
||||||
if (!pWindow->m_bMappedX11 || !pWindow->m_bIsMapped)
|
if (!pWindow->m_bIsMapped)
|
||||||
return "";
|
return "";
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in a new issue