Phosphor
Qt6 / Wayland library suite for window-management tools
 
Loading...
Searching...
No Matches
LayerFocusSwitch.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2026 fuddlesworth
2// SPDX-License-Identifier: LGPL-2.1-or-later
3
4#pragma once
5
6#include <phosphorengine_export.h>
7
8#include <QString>
9#include <QStringList>
10
11#include <functional>
12
13namespace PhosphorEngine {
14
19{
24 QString candidate;
25
29 QStringList fallbacks;
30
36 std::function<bool(const QString&)> isEligible;
37
46};
47
53{
54 bool success = false;
57 bool toTiled = false;
61 QString reason;
62 QString source;
63 QString target;
64};
65
76PHOSPHORENGINE_EXPORT LayerSwitchResult resolveLayerFocusSwitch(bool floatingHasFocus, const LayerSwitchSide& tiledSide,
77 const LayerSwitchSide& floatingSide);
78
79} // namespace PhosphorEngine
Definition EngineTypes.h:14
PHOSPHORENGINE_EXPORT LayerSwitchResult resolveLayerFocusSwitch(bool floatingHasFocus, const LayerSwitchSide &tiledSide, const LayerSwitchSide &floatingSide)
Resolve niri's switch-focus-between-floating-and-tiling for any engine: pick the leg from floatingHas...
Outcome of resolving a layer focus switch.
Definition LayerFocusSwitch.h:53
bool success
Definition LayerFocusSwitch.h:54
QString target
Definition LayerFocusSwitch.h:63
bool toTiled
Which leg ran: true = float layer held focus and the switch targets the tiled side.
Definition LayerFocusSwitch.h:57
QString source
Definition LayerFocusSwitch.h:62
QString reason
Feedback reason token: "tiled" / "floating" on success, "no_target" on failure.
Definition LayerFocusSwitch.h:61
One side (tiled or floating) of a layer focus switch, as the owning engine sees it.
Definition LayerFocusSwitch.h:19
QString candidate
Preferred target on this side: the side's remembered last focus, or, for an engine whose live selecti...
Definition LayerFocusSwitch.h:24
QStringList fallbacks
Ordered fallback pool scanned when the candidate is not eligible.
Definition LayerFocusSwitch.h:29
QString focusForFeedback
The window reported as the feedback SOURCE when this side holds focus (i.e.
Definition LayerFocusSwitch.h:45
std::function< bool(const QString &)> isEligible
Eligibility filter applied to the candidate and every fallback.
Definition LayerFocusSwitch.h:36