Commit Graph

14 Commits

Author SHA1 Message Date
Albert Safin 83c7aff089 Limit workspace numbers within 0..INT32_MAX
Before this commit, large workspace numbers treated oddly:

   $ i3-msg 'rename workspace to 1234567890'
   # displayed in i3bar as `0`

   $ i3-msg 'rename workspace to 4294967200'
   $ i3-msg -t get_workspaces | jq '.[]|select(.focused).num'
   -96 # int32_t overflow

   $ i3-msg 'rename workspace to 99999999999999999999'
   $ i3-msg -t get_workspaces | jq '.[]|select(.focused).num'
   -1 # treated as unnumbered

This commit puts a consistent limit on workspace numbers.  Now
workspaces with numbers beyond INT32_MAX are treated as unnumbered.
2020-02-21 02:07:04 +00:00
Michael Stapelberg 7ad32fd2d1 tests: replace http:// with https:// where appropriate
This was done automatically using:

% sed -i 's,http://build.i3wm.org,https://build.i3wm.org,g' testcases/t/*.t
2017-09-24 10:19:50 +02:00
hwangcc23 cc4be41674 Fix 'rename workspace to tosomething'
This patch fixes the issue #2802 (https://github.com/i3/i3/issues/2802).

1). Revise the state machine for the 'rename workspace' command.
    These scenarios are considered:
    a). 'rename workspace to to bla'
        state transitions: RENAME -> RENAME_WORKSPACE -> RENAME_WORKSPACE_LIKELY_TO -> RENAME_WORKSPACE_LIKELY_TO_NEW_NAME
    b). 'rename workspace to tosomething'
        state transitions: RENAME -> RENAME_WORKSPACE -> RENAME_WORKSPACE_LIKELY_TO
    c). 'rename workspace to to'
        state transitions: RENAME -> RENAME_WORKSPACE -> RENAME_WORKSPACE_LIKELY_TO
    d). 'rename workspace to bla'
        state transitions: RENAME -> RENAME_WORKSPACE -> RENAME_WORKSPACE_LIKELY_TO
    e). 'rename workspace bla to foo'
        state transitions: RENAME -> RENAME_WORKSPACE -> RENAME_WORKSPACE_TO -> RENAME_WORKSPACE_TO_NEW_NAME

2). Add a test case in 117-workspace.t for the scenario b.
2017-06-12 22:21:21 +08:00
Michael Stapelberg f63701ed09 Allow workspace renames which change case
fixes #2211
2016-02-15 08:34:03 +01:00
Michael Stapelberg 6800524f2e GET_TREE: serialize container type into a string
So far, this was blessed for internal use only (by virtue of not being
in the documentation), but we want to expose it for the stored layouts.
2013-12-22 21:52:49 +01:00
Michael Walle ae14fe9141 introduce new command to rename focused workspace
The corresponding command is 'rename workspace to <name>'. As a side-effect
this fixes the command 'rename workspace 1 to to'.

Signed-off-by: Michael Walle <michael@walle.cc>
2012-10-31 09:09:56 +01:00
Sebastian Ullrich 236f9f45e3 Make "[move] workspace number" accept a default ws name after the ws number 2012-09-22 14:34:05 +02:00
Michael Stapelberg 338199913b add boilerplate to all testcases with documentation references 2012-09-10 14:09:01 +02:00
Michael Stapelberg 82e0eaa315 tests: Check that 'workspace number <number>' opens a new workspace 2012-05-09 20:33:11 +02:00
Michael Stapelberg 373b4ad74a Implement 'rename workspace <old_name> to <new_name>' 2012-04-08 20:40:00 +02:00
Michael Stapelberg 72078c704e Implement 'workspace number <number>' to switch to named workspaces 2012-04-08 19:17:46 +02:00
Maik Fischer da403b3667 testcases: use $x in wait_for_(un)map change to wait_for_(un)map($win)
wait_for_unmap currently ignores its $window parameter, since
X11::XCB doesn't provide $event->{window} for unmap events yet.
2011-11-21 23:50:58 +00:00
Maik Fischer 1b1d7941ec testcases: correctly enable lexical pragmata
eval 'package foo; use strict;' enables strict within eval, it does
not leak into the surrounding scope.
Also fix various warnings/compile errors found due to now enabled
strict and warnings.
2011-11-21 23:50:39 +00:00
Michael Stapelberg ae1ab9eb27 tests: rename files (00x-*.t is basic stuff, >=100-*.t are tests using IPC) 2011-10-08 14:38:50 +01:00