desktop/group: respect direction when moving window out of group (#13490)
This commit is contained in:
parent
75a815fbf2
commit
fe0a202137
6 changed files with 78 additions and 10 deletions
|
|
@ -64,16 +64,16 @@ static void test13349() {
|
|||
|
||||
{
|
||||
auto str = getFromSocket("/activewindow");
|
||||
EXPECT_CONTAINS(str, "at: 22,547");
|
||||
EXPECT_CONTAINS(str, "size: 931,511");
|
||||
EXPECT_CONTAINS(str, "at: 497,22");
|
||||
EXPECT_CONTAINS(str, "size: 456,1036");
|
||||
}
|
||||
|
||||
OK(getFromSocket("/dispatch movewindow r"));
|
||||
|
||||
{
|
||||
auto str = getFromSocket("/activewindow");
|
||||
EXPECT_CONTAINS(str, "at: 967,547");
|
||||
EXPECT_CONTAINS(str, "size: 931,511");
|
||||
EXPECT_CONTAINS(str, "at: 967,22");
|
||||
EXPECT_CONTAINS(str, "size: 456,1036");
|
||||
}
|
||||
|
||||
// clean up
|
||||
|
|
|
|||
|
|
@ -201,6 +201,59 @@ static bool test() {
|
|||
NLog::log("{}Expecting 0 windows", Colors::YELLOW);
|
||||
EXPECT(Tests::windowCount(), 0);
|
||||
|
||||
// test movewindoworgroup: direction should be respected when extracting from group
|
||||
NLog::log("{}Test movewindoworgroup respects direction out of group", Colors::YELLOW);
|
||||
OK(getFromSocket("/keyword group:groupbar:enabled 0"));
|
||||
{
|
||||
auto kittyE = Tests::spawnKitty();
|
||||
if (!kittyE) {
|
||||
NLog::log("{}Error: kitty did not spawn", Colors::RED);
|
||||
return false;
|
||||
}
|
||||
|
||||
// group kitty, and new windows should be auto-grouped
|
||||
OK(getFromSocket("/dispatch togglegroup"));
|
||||
|
||||
auto kittyF = Tests::spawnKitty();
|
||||
if (!kittyF) {
|
||||
NLog::log("{}Error: kitty did not spawn", Colors::RED);
|
||||
return false;
|
||||
}
|
||||
EXPECT(Tests::windowCount(), 2);
|
||||
|
||||
// both windows should be grouped at the same position
|
||||
{
|
||||
auto str = getFromSocket("/clients");
|
||||
EXPECT_COUNT_STRING(str, "at: 22,22", 2);
|
||||
}
|
||||
|
||||
// move active window out of group to the right
|
||||
NLog::log("{}Test movewindoworgroup r", Colors::YELLOW);
|
||||
OK(getFromSocket("/dispatch movewindoworgroup r"));
|
||||
|
||||
// the group should stay at x=22, the extracted window should be to the right
|
||||
{
|
||||
auto str = getFromSocket("/clients");
|
||||
EXPECT_COUNT_STRING(str, "at: 22,22", 1);
|
||||
}
|
||||
|
||||
// move it back into the group
|
||||
OK(getFromSocket("/dispatch moveintogroup l"));
|
||||
|
||||
// move active window out of group downward
|
||||
NLog::log("{}Test movewindoworgroup d", Colors::YELLOW);
|
||||
OK(getFromSocket("/dispatch movewindoworgroup d"));
|
||||
|
||||
// the group should stay at y=22, the extracted window should be below
|
||||
{
|
||||
auto str = getFromSocket("/clients");
|
||||
EXPECT_COUNT_STRING(str, "at: 22,22", 1);
|
||||
}
|
||||
|
||||
Tests::killAllWindows();
|
||||
EXPECT(Tests::windowCount(), 0);
|
||||
}
|
||||
|
||||
return !ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue