summaryrefslogtreecommitdiff
path: root/hyprtester/src/tests/main/window.cpp
diff options
context:
space:
mode:
authorNikolai Nechaev <nikolay_nechaev@mail.ru>2026-03-10 19:04:21 +0900
committerGitHub <noreply@github.com>2026-03-10 10:04:21 +0000
commit8a12d6cf7e3b11ea46e6d76f219b1d1cdde9e797 (patch)
treea0a2b62059f89f45aef0f20616768460748e95fd /hyprtester/src/tests/main/window.cpp
parente32eeb1d454b029a24ca71f410896bf52839085d (diff)
algo/dwindle: Respect `force_split` when moving windows to workspaces (#13038)
Respect `dwindle:force_split` not only when mapping new windows, but also when moving windows to workspaces. Fixes #13009.
Diffstat (limited to 'hyprtester/src/tests/main/window.cpp')
-rw-r--r--hyprtester/src/tests/main/window.cpp23
1 files changed, 6 insertions, 17 deletions
diff --git a/hyprtester/src/tests/main/window.cpp b/hyprtester/src/tests/main/window.cpp
index 9dadf3d5..a42ffd38 100644
--- a/hyprtester/src/tests/main/window.cpp
+++ b/hyprtester/src/tests/main/window.cpp
@@ -47,17 +47,6 @@ static std::string spawnKittyActivating(const std::string& class_ = "kitty_activ
return tmpFilename;
}
-static std::string getWindowAttribute(const std::string& winInfo, const std::string& attr) {
- auto pos = winInfo.find(attr);
- if (pos == std::string::npos) {
- NLog::log("{}Wrong window attribute", Colors::RED);
- ret = 1;
- return "Wrong window attribute";
- }
- auto pos2 = winInfo.find('\n', pos);
- return winInfo.substr(pos, pos2 - pos);
-}
-
static std::string getWindowAddress(const std::string& winInfo) {
auto pos = winInfo.find("Window ");
auto pos2 = winInfo.find(" -> ");
@@ -92,7 +81,7 @@ static void testSwapWindow() {
// Test swapwindow by direction
{
getFromSocket("/dispatch focuswindow class:kitty_A");
- auto pos = getWindowAttribute(getFromSocket("/activewindow"), "at:");
+ auto pos = Tests::getWindowAttribute(getFromSocket("/activewindow"), "at:");
NLog::log("{}Testing kitty_A {}, swapwindow with direction 'r'", Colors::YELLOW, pos);
OK(getFromSocket("/dispatch swapwindow r"));
@@ -104,7 +93,7 @@ static void testSwapWindow() {
// Test swapwindow by class
{
getFromSocket("/dispatch focuswindow class:kitty_A");
- auto pos = getWindowAttribute(getFromSocket("/activewindow"), "at:");
+ auto pos = Tests::getWindowAttribute(getFromSocket("/activewindow"), "at:");
NLog::log("{}Testing kitty_A {}, swapwindow with class:kitty_B", Colors::YELLOW, pos);
OK(getFromSocket("/dispatch swapwindow class:kitty_B"));
@@ -118,7 +107,7 @@ static void testSwapWindow() {
getFromSocket("/dispatch focuswindow class:kitty_B");
auto addr = getWindowAddress(getFromSocket("/activewindow"));
getFromSocket("/dispatch focuswindow class:kitty_A");
- auto pos = getWindowAttribute(getFromSocket("/activewindow"), "at:");
+ auto pos = Tests::getWindowAttribute(getFromSocket("/activewindow"), "at:");
NLog::log("{}Testing kitty_A {}, swapwindow with address:0x{}(kitty_B)", Colors::YELLOW, pos, addr);
OK(getFromSocket(std::format("/dispatch swapwindow address:0x{}", addr)));
@@ -141,7 +130,7 @@ static void testSwapWindow() {
{
getFromSocket("/dispatch focuswindow class:kitty_B");
auto addr = getWindowAddress(getFromSocket("/activewindow"));
- auto ws = getWindowAttribute(getFromSocket("/activewindow"), "workspace:");
+ auto ws = Tests::getWindowAttribute(getFromSocket("/activewindow"), "workspace:");
NLog::log("{}Sending address:0x{}(kitty_B) to workspace \"swapwindow2\"", Colors::YELLOW, addr);
OK(getFromSocket("/dispatch movetoworkspacesilent name:swapwindow2"));
@@ -222,8 +211,8 @@ static void testGroupRules() {
static bool isActiveWindow(const std::string& class_, char fullscreen = '0', bool log = true) {
std::string activeWin = getFromSocket("/activewindow");
- auto winClass = getWindowAttribute(activeWin, "class:");
- auto winFullscreen = getWindowAttribute(activeWin, "fullscreen:").back();
+ auto winClass = Tests::getWindowAttribute(activeWin, "class:");
+ auto winFullscreen = Tests::getWindowAttribute(activeWin, "fullscreen:").back();
if (winClass.substr(strlen("class: ")) == class_ && winFullscreen == fullscreen)
return true;
else {