mirror of
https://github.com/hyprwm/Hyprland.git
synced 2026-08-24 02:24:14 -05:00
config: allow exit_window_retains_fullscreen to be configurable for groups (#15731)
Co-authored-by: mugen <iorjgiodr3548769uyj@534ytgr89ui0ji.345tu>
This commit is contained in:
@@ -643,7 +643,6 @@ TEST_CASE(groups_disable_when_only) {
|
||||
}
|
||||
|
||||
TEST_CASE(autoGroupTiledIntoFloated) {
|
||||
|
||||
// test that we can auto-group a new tiled window into the focused floated group
|
||||
NLog::log("{}Test that we can auto-group a new tiled window into the focused floated group.", Colors::GREEN);
|
||||
|
||||
@@ -680,3 +679,41 @@ TEST_CASE(autoGroupTiledIntoFloated) {
|
||||
Tests::killAllWindows();
|
||||
ASSERT(Tests::windowCount(), 0);
|
||||
}
|
||||
|
||||
TEST_CASE(groupedExitWindowRetainsFullscreen) {
|
||||
OK(getFromSocket("/eval hl.config({ misc = { exit_window_retains_fullscreen = 3 } })"));
|
||||
|
||||
SPAWN_KITTY("kitty_A");
|
||||
OK(getFromSocket("/dispatch hl.dsp.group.toggle()"));
|
||||
SPAWN_KITTY("kitty_B");
|
||||
|
||||
OK(getFromSocket("/dispatch hl.dsp.window.fullscreen({ mode = 'fullscreen' })"));
|
||||
|
||||
{
|
||||
auto str = getFromSocket("/activewindow");
|
||||
EXPECT_CONTAINS(str, "fullscreen: 2");
|
||||
EXPECT_CONTAINS(str, "fullscreenClient: 2");
|
||||
}
|
||||
|
||||
OK(getFromSocket("/dispatch hl.dsp.window.kill({ window = 'activewindow' })"));
|
||||
Tests::waitUntilWindowsN(1);
|
||||
|
||||
{
|
||||
auto str = getFromSocket("/activewindow");
|
||||
EXPECT_CONTAINS(str, "fullscreen: 0");
|
||||
EXPECT_CONTAINS(str, "fullscreenClient: 0");
|
||||
}
|
||||
|
||||
SPAWN_KITTY("kitty_B");
|
||||
OK(getFromSocket("/dispatch hl.dsp.window.fullscreen({ mode = 'fullscreen' })"));
|
||||
OK(getFromSocket("/eval hl.config({ misc = { exit_window_retains_fullscreen = 2 } })"));
|
||||
|
||||
OK(getFromSocket("/dispatch hl.dsp.window.kill({ window = 'activewindow' })"));
|
||||
Tests::waitUntilWindowsN(1);
|
||||
|
||||
{
|
||||
auto str = getFromSocket("/activewindow");
|
||||
EXPECT_CONTAINS(str, "fullscreen: 2");
|
||||
EXPECT_CONTAINS(str, "fullscreenClient: 2");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -433,7 +433,7 @@ std::vector<SP<IValue>> Values::getConfigValues() {
|
||||
MS<Gradient>("group:col.border_locked_active", "active locked group border color", CHyprColor{0x66775500}, {.refresh = Supplementary::REFRESH_GRADIENTS_GROUPBAR}),
|
||||
MS<Bool>("group:auto_group", "automatically group new windows", true),
|
||||
MS<Int>("group:drag_into_group", "whether dragging a window into a unlocked group will merge them.", 1,
|
||||
{.min = 0, .max = 2, .map = OptionMap{{"disabled", 0}, {"enabled", 1}, {"only when dragging into the groupbar", 2}}}),
|
||||
{.min = 0, .max = 2, .map = OptionMap{{"disabled", 0}, {"enabled", 1}, {"only_into_groupbar", 2}}}),
|
||||
MS<Bool>("group:merge_floated_into_tiled_on_groupbar", "whether dragging a floating window into a tiled window groupbar will merge them", false),
|
||||
MS<Bool>("group:group_on_movetoworkspace", "whether using movetoworkspace[silent] will merge the window into the workspace's solitary unlocked group", false),
|
||||
|
||||
@@ -510,7 +510,8 @@ std::vector<SP<IValue>> Values::getConfigValues() {
|
||||
MS<Bool>("misc:close_special_on_empty", "close the special workspace if the last window is removed", true),
|
||||
MS<Int>("misc:on_focus_under_fullscreen", "if there is a fullscreen or maximized window, decide whether a tiled window requested to focus should replace it.", 2,
|
||||
{.min = 0, .max = 2, .map = OptionMap{{"ignore", 0}, {"take_over", 1}, {"exit_fullscreen", 2}}}),
|
||||
MS<Bool>("misc:exit_window_retains_fullscreen", "if true, closing a fullscreen window makes the next focused window fullscreen", false),
|
||||
MS<Int>("misc:exit_window_retains_fullscreen", "whether closing a fullscreen window makes the next focused window to be fullscreened", 0,
|
||||
{.min = 0, .max = 3, .map = OptionMap{{"disable", 0}, {"enable", 1}, {"only_when_grouped", 2}, {"only_when_nongrouped", 3}}}),
|
||||
MS<Int>("misc:initial_workspace_tracking", "if enabled, windows will open on the workspace they were invoked on.", 1, {.min = 0, .max = 2}),
|
||||
MS<Int>("misc:initial_workspace_token_timeout", "the time in seconds a window has to open on its invoked workspace before the tracking token expires.", 10,
|
||||
{.min = 1, .max = 3600}),
|
||||
|
||||
@@ -2690,7 +2690,7 @@ void CWindow::unmapWindow() {
|
||||
else
|
||||
Desktop::focusState()->fullWindowFocus(candidate, m_self->m_isFloating ? FOCUS_REASON_UNMAP_WINDOW_FLOATING : FOCUS_REASON_UNMAP_WINDOW_TILING);
|
||||
|
||||
if ((*PEXITRETAINSFS || candidate == nextInGroup) && IS_CURRENT_WINDOW_FS)
|
||||
if ((*PEXITRETAINSFS == 1 || (candidate != nextInGroup && *PEXITRETAINSFS == 3) || (candidate == nextInGroup && *PEXITRETAINSFS == 2)) && IS_CURRENT_WINDOW_FS)
|
||||
// set the candidate to the current window's FS state - use the current window's layoutAware FS behaviour
|
||||
Fullscreen::controller()->setFullscreenMode(candidate, CURRENT_WINDOW_FS_MODES.internal, std::nullopt, CURRENT_FS_LAYOUT_HANDLED);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user