mirror of
https://github.com/hyprwm/Hyprland
synced 2026-05-07 15:58:02 +02:00
layouts/master: impl of focus_master_on_close
This commit is contained in:
parent
a531c2ed6b
commit
17dafb33a2
3 changed files with 8 additions and 1 deletions
|
|
@ -293,6 +293,7 @@
|
|||
---| "master.center_ignores_reserved"
|
||||
---| "master.center_master_fallback"
|
||||
---| "master.drop_at_cursor"
|
||||
---| "master.focus_master_on_close"
|
||||
---| "master.mfact"
|
||||
---| "master.new_on_active"
|
||||
---| "master.new_on_top"
|
||||
|
|
@ -1129,6 +1130,7 @@ hl = {}
|
|||
---@field ['master.center_ignores_reserved'] boolean
|
||||
---@field ['master.center_master_fallback'] string
|
||||
---@field ['master.drop_at_cursor'] boolean
|
||||
---@field ['master.focus_master_on_close'] boolean
|
||||
---@field ['master.mfact'] number|boolean
|
||||
---@field ['master.new_on_active'] string
|
||||
---@field ['master.new_on_top'] boolean
|
||||
|
|
|
|||
|
|
@ -651,6 +651,7 @@ std::vector<SP<IValue>> Values::getConfigValues() {
|
|||
MS<Bool>("master:drop_at_cursor", "when enabled, dragging and dropping windows will put them at the cursor position.", true),
|
||||
MS<Bool>("master:always_keep_position", "whether to keep the master window in its configured position when there are no slave windows", false,
|
||||
{.refresh = Supplementary::REFRESH_LAYOUTS}),
|
||||
MS<Bool>("master:focus_master_on_close", "when enabled, closing a window focuses the master window", false),
|
||||
|
||||
/*
|
||||
* scrolling:
|
||||
|
|
|
|||
|
|
@ -1247,7 +1247,11 @@ void CMasterAlgorithm::calculateWorkspace() {
|
|||
}
|
||||
|
||||
SP<ITarget> CMasterAlgorithm::getNextCandidate(SP<ITarget> old) {
|
||||
const auto MIDDLE = old->position().middle();
|
||||
const auto FOCUS_MASTER = CConfigValue<Config::BOOL>("master:focus_master_on_close");
|
||||
const auto MIDDLE = old->position().middle();
|
||||
|
||||
if (const auto NODE = getMasterNode(); *FOCUS_MASTER && NODE)
|
||||
return NODE->pTarget.lock();
|
||||
|
||||
if (const auto NODE = getClosestNode(MIDDLE); NODE)
|
||||
return NODE->pTarget.lock();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue