:desktop-card {:x N :y N} is written when the card is dropped (and kept on later saves),
and restored at startup; the existing clamp keeps it on screen if the resolution changed.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
61796b9f69
commit
69a163bc08
3 files changed
+74
-4
No files matched your search
@@ -900,3 +900,25 @@ test "the layout mode and recent apps are saved to state.edn and restored; other
|
||||
assert_eq(c.layout_mode, @wm.LayoutMode::Tiling)
|
||||
}
|
||||
}
|
||||
|
||||
///|
|
||||
test "the desktop card position is saved when dropped and restored" {
|
||||
if @sys.getenv("MOON_PLASMA_TEST_CONFIG") == "1" {
|
||||
write_state_edn("{:note \"keep\"}\n")
|
||||
let a = new_comp("card-a")
|
||||
a.shell.persist = true
|
||||
ignore(a.compose_frame())
|
||||
assert_true(a.shell.desk_press(a.shell.screen_w - 100, 40))
|
||||
ignore(a.shell.pointer_move(300, 200))
|
||||
assert_true(a.shell.pointer_up())
|
||||
let text = read_state_edn()
|
||||
assert_true(text.contains(":desktop-card"))
|
||||
assert_true(text.contains(":note \"keep\""))
|
||||
let b = new_comp("card-b")
|
||||
b.shell.persist = true
|
||||
b.restore_state()
|
||||
assert_true(b.shell.desk_set)
|
||||
assert_eq(b.shell.desk_x, a.shell.desk_x)
|
||||
assert_eq(b.shell.desk_y, a.shell.desk_y)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user