mirror of
https://github.com/hyprwm/Hyprland.git
synced 2024-12-21 14:41:39 +03:00
fixed floating window dragging and rendering
This commit is contained in:
parent
8a8b26a635
commit
8fe1cec87c
@ -31,7 +31,6 @@ Nevertheless, REPORT any you find! Make an issue!
|
||||
- Fadein/out
|
||||
- Window rules
|
||||
- Fix electron rendering issues
|
||||
- Fix sloppy dragging of windows
|
||||
- Optimization
|
||||
- Fix weird scroll on XWayland
|
||||
- Become sane
|
||||
|
@ -210,9 +210,17 @@ bool CCompositor::windowExists(CWindow* pWindow) {
|
||||
|
||||
CWindow* CCompositor::vectorToWindow(const Vector2D& 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) {
|
||||
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;
|
||||
}
|
||||
|
||||
@ -236,7 +244,7 @@ CWindow* CCompositor::vectorToWindowIdeal(const Vector2D& pos) {
|
||||
// TODO: make an actual Z-system
|
||||
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, 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;
|
||||
}
|
||||
|
||||
@ -256,7 +264,7 @@ CWindow* CCompositor::windowFromCursor() {
|
||||
// TODO: make an actual Z-system
|
||||
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, 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;
|
||||
}
|
||||
|
||||
@ -273,7 +281,7 @@ CWindow* CCompositor::windowFloatingFromCursor() {
|
||||
const auto PMONITOR = getMonitorFromCursor();
|
||||
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, 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;
|
||||
}
|
||||
|
||||
|
@ -109,15 +109,34 @@ void CHyprRenderer::renderAllClientsForMonitor(const int& ID, timespec* time) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Non-floating
|
||||
for (auto& w : g_pCompositor->m_lWindows) {
|
||||
if (!g_pCompositor->windowValidMapped(&w))
|
||||
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))
|
||||
continue;
|
||||
|
||||
// render the bad boy
|
||||
renderWindow(&w, PMONITOR, time, true);
|
||||
renderWindow(&w, PMONITOR, time, true);
|
||||
}
|
||||
|
||||
// Render surfaces above windows for monitor
|
||||
|
Loading…
Reference in New Issue
Block a user