mirror of
https://github.com/Trensa-Organization/hy3.git
synced 2025-03-16 03:03:40 +01:00
Fix getNextWindowCandidate not considering fullscreen or floating windows
This commit is contained in:
parent
92244e7285
commit
6a89b574c7
1 changed files with 19 additions and 0 deletions
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
#include <hyprland/src/Compositor.hpp>
|
#include <hyprland/src/Compositor.hpp>
|
||||||
#include <hyprland/src/plugins/PluginAPI.hpp>
|
#include <hyprland/src/plugins/PluginAPI.hpp>
|
||||||
|
#include <ranges>
|
||||||
|
|
||||||
#include "Hy3Layout.hpp"
|
#include "Hy3Layout.hpp"
|
||||||
#include "SelectionHook.hpp"
|
#include "SelectionHook.hpp"
|
||||||
|
@ -689,6 +690,24 @@ void Hy3Layout::alterSplitRatio(CWindow* pWindow, float delta, bool exact) {
|
||||||
std::string Hy3Layout::getLayoutName() { return "hy3"; }
|
std::string Hy3Layout::getLayoutName() { return "hy3"; }
|
||||||
|
|
||||||
CWindow* Hy3Layout::getNextWindowCandidate(CWindow* window) {
|
CWindow* Hy3Layout::getNextWindowCandidate(CWindow* window) {
|
||||||
|
auto* workspace = g_pCompositor->getWorkspaceByID(window->m_iWorkspaceID);
|
||||||
|
|
||||||
|
if (workspace->m_bHasFullscreenWindow) {
|
||||||
|
return g_pCompositor->getFullscreenWindowOnWorkspace(window->m_iWorkspaceID);
|
||||||
|
}
|
||||||
|
|
||||||
|
// return the first floating window on the same workspace that has not asked not to be focused
|
||||||
|
if (window->m_bIsFloating) {
|
||||||
|
for (std::unique_ptr<CWindow>& w: g_pCompositor->m_vWindows | std::views::reverse) {
|
||||||
|
if (w->m_bIsMapped && !w->isHidden() && w->m_bIsFloating && w->m_iX11Type != 2
|
||||||
|
&& w->m_iWorkspaceID == window->m_iWorkspaceID && !w->m_bX11ShouldntFocus
|
||||||
|
&& !w->m_bNoFocus && w.get() != window)
|
||||||
|
{
|
||||||
|
return w.get();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
auto* node = this->getWorkspaceFocusedNode(window->m_iWorkspaceID, true);
|
auto* node = this->getWorkspaceFocusedNode(window->m_iWorkspaceID, true);
|
||||||
if (node == nullptr) return nullptr;
|
if (node == nullptr) return nullptr;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue