mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-26 06:05:59 +01:00
handle modals a bit better
This commit is contained in:
parent
b6f3aa5d01
commit
e6a848adc0
4 changed files with 9 additions and 4 deletions
|
@ -249,7 +249,7 @@ CWindow* CCompositor::vectorToWindowIdeal(const Vector2D& pos) {
|
||||||
// TODO: make an actual Z-system
|
// TODO: make an actual Z-system
|
||||||
for (auto& w : m_lWindows) {
|
for (auto& w : m_lWindows) {
|
||||||
wlr_box box = {w.m_vRealPosition.x, w.m_vRealPosition.y, w.m_vRealSize.x, w.m_vRealSize.y};
|
wlr_box box = {w.m_vRealPosition.x, w.m_vRealPosition.y, w.m_vRealSize.x, w.m_vRealSize.y};
|
||||||
if (w.m_bIsFloating && wlr_box_contains_point(&box, m_sWLRCursor->x, m_sWLRCursor->y) && isWorkspaceVisible(w.m_iWorkspaceID) && !w.m_bIsModal)
|
if (w.m_bIsFloating && wlr_box_contains_point(&box, m_sWLRCursor->x, m_sWLRCursor->y) && isWorkspaceVisible(w.m_iWorkspaceID))
|
||||||
return &w;
|
return &w;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -339,6 +339,9 @@ bool CCompositor::windowValidMapped(CWindow* pWindow) {
|
||||||
if (pWindow->m_bIsX11 && !pWindow->m_bMappedX11)
|
if (pWindow->m_bIsX11 && !pWindow->m_bMappedX11)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
if (!pWindow->m_bIsMapped)
|
||||||
|
return false;
|
||||||
|
|
||||||
if (!g_pXWaylandManager->getWindowSurface(pWindow))
|
if (!g_pXWaylandManager->getWindowSurface(pWindow))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
|
@ -42,6 +42,8 @@ public:
|
||||||
std::string m_szTitle = "";
|
std::string m_szTitle = "";
|
||||||
int m_iWorkspaceID = -1;
|
int m_iWorkspaceID = -1;
|
||||||
|
|
||||||
|
bool m_bIsMapped = false;
|
||||||
|
|
||||||
// XWayland stuff
|
// XWayland stuff
|
||||||
bool m_bIsX11 = false;
|
bool m_bIsX11 = false;
|
||||||
bool m_bMappedX11 = false;
|
bool m_bMappedX11 = false;
|
||||||
|
|
|
@ -22,6 +22,7 @@ void Events::listener_mapWindow(wl_listener* listener, void* data) {
|
||||||
PWINDOW->m_iMonitorID = PMONITOR->ID;
|
PWINDOW->m_iMonitorID = PMONITOR->ID;
|
||||||
PWINDOW->m_bMappedX11 = true;
|
PWINDOW->m_bMappedX11 = true;
|
||||||
PWINDOW->m_iWorkspaceID = PMONITOR->activeWorkspace;
|
PWINDOW->m_iWorkspaceID = PMONITOR->activeWorkspace;
|
||||||
|
PWINDOW->m_bIsMapped = true;
|
||||||
|
|
||||||
const auto PWINDOWSURFACE = g_pXWaylandManager->getWindowSurface(PWINDOW);
|
const auto PWINDOWSURFACE = g_pXWaylandManager->getWindowSurface(PWINDOW);
|
||||||
|
|
||||||
|
@ -52,6 +53,7 @@ void Events::listener_unmapWindow(wl_listener* listener, void* data) {
|
||||||
g_pCompositor->m_pLastFocus = nullptr;
|
g_pCompositor->m_pLastFocus = nullptr;
|
||||||
|
|
||||||
PWINDOW->m_bMappedX11 = false;
|
PWINDOW->m_bMappedX11 = false;
|
||||||
|
PWINDOW->m_bIsMapped = 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);
|
||||||
|
@ -61,8 +63,6 @@ void Events::listener_unmapWindow(wl_listener* listener, void* data) {
|
||||||
|
|
||||||
g_pLayoutManager->getCurrentLayout()->onWindowRemoved(PWINDOW);
|
g_pLayoutManager->getCurrentLayout()->onWindowRemoved(PWINDOW);
|
||||||
|
|
||||||
g_pCompositor->removeWindowFromVectorSafe(PWINDOW);
|
|
||||||
|
|
||||||
// refocus on a new window
|
// refocus on a new window
|
||||||
// TODO: investigate.
|
// TODO: investigate.
|
||||||
// If a parent window has focus, any popups (XWayland) will be broken (they will disappear instantly)
|
// If a parent window has focus, any popups (XWayland) will be broken (they will disappear instantly)
|
||||||
|
|
|
@ -47,7 +47,7 @@ void CInputManager::mouseMoveUnified(uint32_t time) {
|
||||||
|
|
||||||
// then windows
|
// then windows
|
||||||
const auto PWINDOWIDEAL = g_pCompositor->vectorToWindowIdeal(mouseCoords);
|
const auto PWINDOWIDEAL = g_pCompositor->vectorToWindowIdeal(mouseCoords);
|
||||||
if (!foundSurface && PWINDOWIDEAL && !PWINDOWIDEAL->m_bIsModal) {
|
if (!foundSurface && PWINDOWIDEAL) {
|
||||||
foundSurface = g_pXWaylandManager->getWindowSurface(PWINDOWIDEAL);
|
foundSurface = g_pXWaylandManager->getWindowSurface(PWINDOWIDEAL);
|
||||||
if (foundSurface)
|
if (foundSurface)
|
||||||
surfacePos = PWINDOWIDEAL->m_vRealPosition;
|
surfacePos = PWINDOWIDEAL->m_vRealPosition;
|
||||||
|
|
Loading…
Reference in a new issue