mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-22 20:25:59 +01:00
fixed floating window dragging and rendering
This commit is contained in:
parent
8a8b26a635
commit
8fe1cec87c
3 changed files with 32 additions and 6 deletions
|
@ -31,7 +31,6 @@ Nevertheless, REPORT any you find! Make an issue!
|
||||||
- Fadein/out
|
- Fadein/out
|
||||||
- Window rules
|
- Window rules
|
||||||
- Fix electron rendering issues
|
- Fix electron rendering issues
|
||||||
- Fix sloppy dragging of windows
|
|
||||||
- Optimization
|
- Optimization
|
||||||
- Fix weird scroll on XWayland
|
- Fix weird scroll on XWayland
|
||||||
- Become sane
|
- Become sane
|
||||||
|
|
|
@ -210,9 +210,17 @@ bool CCompositor::windowExists(CWindow* pWindow) {
|
||||||
|
|
||||||
CWindow* CCompositor::vectorToWindow(const Vector2D& pos) {
|
CWindow* CCompositor::vectorToWindow(const Vector2D& pos) {
|
||||||
const auto PMONITOR = getMonitorFromVector(pos);
|
const auto PMONITOR = getMonitorFromVector(pos);
|
||||||
|
// first loop over floating cuz they're above
|
||||||
|
// 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 (wlr_box_contains_point(&box, pos.x, pos.y) && w.m_iWorkspaceID == PMONITOR->activeWorkspace)
|
if (wlr_box_contains_point(&box, pos.x, pos.y) && w.m_bIsFloating && isWorkspaceVisible(w.m_iWorkspaceID))
|
||||||
|
return &w;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (auto& w : m_lWindows) {
|
||||||
|
wlr_box box = {w.m_vRealPosition.x, w.m_vRealPosition.y, w.m_vRealSize.x, w.m_vRealSize.y};
|
||||||
|
if (wlr_box_contains_point(&box, pos.x, pos.y) && !w.m_bIsFloating && PMONITOR->activeWorkspace == w.m_iWorkspaceID)
|
||||||
return &w;
|
return &w;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -236,7 +244,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 (wlr_box_contains_point(&box, m_sWLRCursor->x, m_sWLRCursor->y) && w.m_bIsFloating && w.m_iWorkspaceID == PMONITOR->activeWorkspace)
|
if (wlr_box_contains_point(&box, m_sWLRCursor->x, m_sWLRCursor->y) && w.m_bIsFloating && isWorkspaceVisible(w.m_iWorkspaceID))
|
||||||
return &w;
|
return &w;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -256,7 +264,7 @@ CWindow* CCompositor::windowFromCursor() {
|
||||||
// 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 (wlr_box_contains_point(&box, m_sWLRCursor->x, m_sWLRCursor->y) && w.m_bIsFloating && w.m_iWorkspaceID == PMONITOR->activeWorkspace)
|
if (wlr_box_contains_point(&box, m_sWLRCursor->x, m_sWLRCursor->y) && w.m_bIsFloating && isWorkspaceVisible(w.m_iWorkspaceID))
|
||||||
return &w;
|
return &w;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -273,7 +281,7 @@ CWindow* CCompositor::windowFloatingFromCursor() {
|
||||||
const auto PMONITOR = getMonitorFromCursor();
|
const auto PMONITOR = getMonitorFromCursor();
|
||||||
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 (wlr_box_contains_point(&box, m_sWLRCursor->x, m_sWLRCursor->y) && w.m_bIsFloating && w.m_iWorkspaceID == PMONITOR->activeWorkspace)
|
if (wlr_box_contains_point(&box, m_sWLRCursor->x, m_sWLRCursor->y) && w.m_bIsFloating && isWorkspaceVisible(w.m_iWorkspaceID))
|
||||||
return &w;
|
return &w;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -109,15 +109,34 @@ void CHyprRenderer::renderAllClientsForMonitor(const int& ID, timespec* time) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Non-floating
|
||||||
for (auto& w : g_pCompositor->m_lWindows) {
|
for (auto& w : g_pCompositor->m_lWindows) {
|
||||||
if (!g_pCompositor->windowValidMapped(&w))
|
if (!g_pCompositor->windowValidMapped(&w))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if (w.m_bIsFloating)
|
||||||
|
continue; // floating are in second pass
|
||||||
|
|
||||||
|
if (!shouldRenderWindow(&w, PMONITOR))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
// render the bad boy
|
||||||
|
renderWindow(&w, PMONITOR, time, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
// floating on top
|
||||||
|
for (auto& w : g_pCompositor->m_lWindows) {
|
||||||
|
if (!g_pCompositor->windowValidMapped(&w))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (!w.m_bIsFloating)
|
||||||
|
continue;
|
||||||
|
|
||||||
if (!shouldRenderWindow(&w, PMONITOR))
|
if (!shouldRenderWindow(&w, PMONITOR))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// render the bad boy
|
// render the bad boy
|
||||||
renderWindow(&w, PMONITOR, time, true);
|
renderWindow(&w, PMONITOR, time, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Render surfaces above windows for monitor
|
// Render surfaces above windows for monitor
|
||||||
|
|
Loading…
Reference in a new issue