Commit Graph

408 Commits (0aa306890b66047aacb4863df0cfdfd6f46361e6)

Author SHA1 Message Date
Yaroslav Molochko 04c58c7325 Implement variable border widths for pixel/normal
fixes #325
2012-09-24 22:20:29 +02:00
Sascha Kruse b741c49212 testcase for propagating urgency 2012-09-22 19:31:46 +02:00
Michael Stapelberg 1e143feab1 Close empty workspaces after cross-output move (+test) (Thanks chrysn)
fixes #795
2012-09-22 19:03:19 +02:00
Michael Stapelberg 11378b7012 t/506-focus-right: also verify that focus up/down is a no-op (Thanks swh) 2012-09-22 17:30:44 +02:00
Michael Stapelberg 19883108a9 Make get_output_next() work with non-aligned RandR setups (+test) (Thanks Feh, swh, Moritz)
A good visualization of the new algorithm is this:

           +--------+
           |        |
+--------+=|   S1   |========================
|        | |        |
|   S0   | +--------+
|        |         +--------+
+--------+=========|        |================
                   |   S2   | +--------+
                   |        | |        |
                   +--------+ |   S3   |
                              |        |
                              +--------+

When focus is on S0, 'focus output right' will first match S1 (the
closest output which overlaps in the highlighted area), then S2, but not
S3 (since S3 does not overlap into the highlighted area).

fixes #669
fixes #771
2012-09-22 16:54:59 +02:00
Michael Stapelberg 2fba607e4d tests: Bugfix: use exit_gracefully() in t/200-urgency-timer 2012-09-22 14:51:38 +02: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 66d786762a tests: rename double t/198, add boilerplate 2012-09-22 14:20:19 +02:00
Michael Stapelberg 9dbbe400a1 tests: fix t/113-urgent.t after previous commit 2012-09-22 14:19:20 +02:00
Simon Elsbrock 28104a480c implement delayed urgency hint reset
If there is a client with an urgency hint on another workspace and
switching to this workspace would cause the urgency to be reset (by
moving the focusing to the client), delay the reset by some time. This
gives the user the chance to see it.

This commit adds the possibility to configure the urgency delay timer
duration using the 'force_display_urgency_hint' directive. Also,
documentation and a testcase was added to allow for automated checks of
the intended behavior.

fixes #482
2012-09-22 14:12:09 +02:00
chrysn e15e37f922 fixes #776
this implements both the "move container to workspace back_and_forth" command
and movements to the same workspace when auto_back_and_forth is set.

it includes documentation and test suite additions by michael.

it also simplifies the workspace_show_by_name function (making use of
workspace_get accepting NULL pointers).
2012-09-22 13:35:31 +02:00
Michael Stapelberg 7a2e105931 tests: add testcase for the 'mode' IPC event 2012-09-22 13:20:53 +02:00
Michael Stapelberg 77134c0dbf tests: add missing boilerplate 2012-09-22 12:56:01 +02:00
Michael Stapelberg cd4dd365e8 Allow changing the layout of workspaces by storing it (Thanks mhcerri)
Before commit 4976fa3350, setting the
layout of workspaces to something else than the default would just mess
up the parent container of the workspace (the content container).

After that commit, it would create an unnecessary split container when
you change the layout _before_ opening any containers. To avoid this, we
now store the layout (similar to how the 'workspace_layout'
configuration directive works) and apply it when the first container is
attached to the workspace.

Fixes #796
2012-09-16 22:53:41 +02:00
Michael Stapelberg 794783defb Merge branch 'master' into next 2012-09-14 13:18:04 +02:00
Michael Stapelberg 15499bf8e7 Bugfix: Don’t focus the wrong workspace when moving to scratchpad (+test) (Thanks loblik)
The problem was that scratchpad_move() didn’t check whether the source
workspace was focused. Therefore, 'move scratchpad' only worked reliably
interactively , but not when used with criteria.
2012-09-14 13:17:32 +02:00
Michael Stapelberg 338199913b add boilerplate to all testcases with documentation references 2012-09-10 14:09:01 +02:00
Michael Stapelberg 6bfbec9da3 tests: make cmp_float a real test instruction 2012-09-10 13:24:11 +02:00
Michael Stapelberg d644dbff64 bugfix: forgot to mark split containers as split = true (+test) (Thanks szalik)
When the workspace layout (formerly orientation) was forced to change
due to a move command, the split container we created was not marked as
split = true, which caused tree_flatten() to errnously kill the contents
of it and thus one window ended up unmanaged.

Also, the logic in tree_flatten() was inverted due to commit de94f6da.

fixes #790
2012-09-05 22:26:52 +02:00
Michael Stapelberg 4976fa3350 con_set_layout: always use the parent container, handle workspaces properly
Previously, in case 'layout stacked' (for example) had been called
interactively, con_set_layout would be called with focused->parent,
while with for_window, it’d be called on the actual matching container.

This difference in behavior was the cause for the inability to use
'for_window [class="XTerm"] layout tabbed', which now works \o/, but
more on that below.

The change also allows us to handle the case of the user selecting a
CT_WORKSPACE container properly, that is, by using the special case and
creating a new split container on the workspace which gets all the
contents, but a new layout.

Now, before you are enthusiastic about the change and try to use
for_window magic in your config file, keep in mind: The 'layout' command
acts on the parent split container. That is, when using a line such as
this one:

    for_window [class="XTerm"] layout tabbed

…and opening an XTerm when on a workspace with one single other window,
the whole workspace will be set tabbed (just as previously when you
opened an XTerm and sent 'layout tabbed' manually).

Therefore, to open XTerm in its own tabbed split container, you need to
split before:

    for_window [class="XTerm"] split v, layout tabbed

The comma here is important! It says that the second command should not
be treated as an entirely unrelated command, but it should also relate
the matching window (while it does work with a ';', that is prone to
race-conditions and should be avoided).

fixes #358
2012-09-05 00:22:38 +02:00
Michael Stapelberg 232d6ccce9 tests: introduce is_num_children test
This makes it clearer what the tests are actually doing and kills quite
a bit of useless repetitions
2012-09-04 22:24:13 +02:00
Michael Stapelberg 6d8f61205d accept slashes in RandR output names (+test) (Thanks dbp)
fixes #785
2012-08-28 13:26:12 +02:00
Michael Stapelberg 82b73c20c9 testcase for the previous commit 2012-08-22 17:57:58 +02:00
Michael Stapelberg 7cadc40846 testcase for the previous commit 2012-08-22 17:16:18 +02:00
Michael Stapelberg 4622cde7b7 Merge branch 'master' into next 2012-08-22 16:02:02 +02:00
Joel Stemmer 1089b0b201 fix resizing floating windows by height
When resizing floating windows, changing the height was not correctly
handled. This commit fixes that and adds testcases for shrinking and
growing the width and height of floating windows.
2012-08-22 16:01:40 +02:00
Michael Stapelberg 68a23b9577 Bugfix: only honor _NET_ACTIVE_WINDOW for visible windows (+test) (Thanks Tucos)
fixes #774
2012-08-12 16:08:53 +02:00
Michael Stapelberg dd743f3b55 add testcase for previous bugfix (floating window size) 2012-08-12 00:36:44 +02:00
Michael Stapelberg 6ba0944430 scratchpad: fix moving scratchpad window
From the source:

    When starting i3 initially (and after each change to the connected
    outputs), this function fixes the resolution of the __i3
    pseudo-output. When that resolution is not set to a function which
    shares a common divisor with every active output’s resolution,
    floating point calculation errors will lead to the scratchpad window
    moving when shown repeatedly.

fixes #632
2012-08-08 18:45:40 +02:00
Michael Stapelberg 78f5f2204d ipc: implement GET_VERSION to find out the i3 version
This is useful for third-party scripts which require certain features
and want to error out cleanly when they are run with an old i3 version.

Additionally, i3 --version might be different from what’s actually
running (an old version of the binary), so i3-msg -t get_version will be
the best way to figure out the i3 version you are actually running from
this commit on.
2012-08-05 14:30:05 +02:00
Michael Stapelberg 2f22fae119 i3-migrate-config-to-v4: use layout toggle split (Thanks eeemsi) 2012-08-04 12:46:37 +02:00
Michael Stapelberg de94f6da1a Introduce splith/splitv layouts, remove orientation
With this commit, the "default" layout is replaced by the splith and
splitv layouts. splith is equivalent to default with orientation
horizontal and splitv is equivalent to default with orientation
vertical.

The "split h" and "split v" commands continue to work as before, they
split the current container and you will end up in a split container
with layout splith (after "split h") or splitv (after "split v").

To change a splith container into a splitv container, use either "layout
splitv" or "layout toggle split". The latter command is used in the
default config as mod+l (previously "layout default"). In case you have
"layout default" in your config file, it is recommended to just replace
it by "layout toggle split", which will work as "layout default" did
before when pressing it once, but toggle between horizontal/vertical
when pressing it repeatedly.

The rationale behind this commit is that it’s cleaner to have all
parameters that influence how windows are rendered in the layout itself
rather than having a special parameter in combination with only one
layout. This enables us to change existing split containers in all cases
without breaking existing features (see ticket #464). Also, users should
feel more confident about whether they are actually splitting or just
changing an existing split container now.

As a nice side-effect, this commit brings back the "layout toggle"
feature we once had in i3 version 3 (see the userguide).

AFAIK, it is safe to use in-place restart to upgrade into versions
after this commit (switching to an older version will break your layout,
though).

Fixes #464
2012-08-04 03:13:24 +02:00
Michael Stapelberg cc7f16007a Display i3-nagbar when commands lead to an error
e.g. pressing Mod1+x when having the following in your configfile:

    bindsym Mod1+x some invalid command

will lead to an i3-nagbar instance popping up, offering you to view the
error log (which will contain parser errors from this commit on).
2012-08-02 17:45:09 +02:00
Michael Stapelberg ac7278eb1a resizing: traverse containers up properly (+test) (Thanks oblique)
In certain situations (when you have a h-split within a h-split) you
couldn’t properly resize previously. This commit makes the resize
command properly traverse up the containers.

fixes #754
2012-07-22 21:37:26 +02:00
Michael Stapelberg a65394646c tests: t/504: ensure cursor position
Otherwise, the cursor might be at (1025, 0) due to previous testcases
and we wouldn’t start up on the correct workspace.
2012-06-29 23:21:32 +02:00
Michael Stapelberg f0f45aa84d tests: t/166-assign.t: use wait_for_window
While it’s generally intended that wait_for_window is not called within
this testcase, in the first test instruction it was a mistake. The
window in fact gets mapped and therefore we should call wait_for_window.
2012-06-29 23:20:46 +02:00
Michael Stapelberg daee3218c9 tests: make t/166-assign.t more robust
…by using the new syntax which will not trigger i3-nagbar. Checking for
i3-nagbar is inherently prone to race conditions since i3-nagbar does
not communicate in any way that it’s there.
2012-06-29 21:28:10 +02:00
Michael Stapelberg 19946ee14d tests: make t/159-socketpath more robust
…by getting the socket path from i3 and then checking that it conforms
to what we expect. Previously we monitored /tmp, which can go wrong in
various ways, especially since i3’s directory within /tmp is not
predictable (by design).
2012-06-29 21:23:28 +02:00
Michael Stapelberg a15fe0e332 Merge branch 'master' into next 2012-06-10 17:57:25 +02:00
Michael Stapelberg f0b56c5e98 parser: reorder v/h/vertical/horizontal
This eliminates an error message upon split horizontal which did not
occur in older i3 versions. The command itself worked just fine.
2012-06-10 17:56:28 +02:00
Pavel Löbl 2afecaf355 Add a new command 'move to workspace current'
Added a new command 'move to workspace current' which can be used
with criteria to move a window to the current workspace.
2012-06-03 19:42:56 +02:00
Fernando Tarlá Cardoso Lemos fffc53c246 Restrict "move to workspace" commands in fullscreen. 2012-06-03 16:24:53 +02:00
Fernando Tarlá Cardoso Lemos 4452bfb942 Prevent moving out of fullscreen containers. 2012-06-03 16:24:53 +02:00
Fernando Tarlá Cardoso Lemos 8bf4e9e059 Restrict directional focus in fullscreen.
This reuses the same fullscreen focus logic to ensure that focus
doesn't escape a fullscreen container.
2012-06-03 16:24:53 +02:00
Fernando Tarlá Cardoso Lemos 250c260eaa Allow focus child/parent when in fullscreen.
This is now restricted according to the already defined fullscreen
focus constraints. Test case 157 was removed, as we don't prevent
level up/down in fullscreen anymore. Those commands are properly
tested in fullscreen by test case 156.

Fixes: #612
2012-06-03 16:24:53 +02:00
Fernando Tarlá Cardoso Lemos da1e232757 Refined the fullscreen focus constraints.
Basically, a focus change can't escape a fullscreen container. The
only exception is per-output fullscreen containers, as you should
be able to focus a container in a different workspace in this case.

This is an improvement on 4eab046e, now considering the difference
between global and per-output fullscreen and taking the tree
structure into account to determine what escaping the fullscreen
container means. It only affects targeted focus commands in the
form "for_window [...] focus", but it lays the foundation for
forthcoming fixes to all other focus commands.
2012-06-03 16:24:53 +02:00
Michael Stapelberg 1103f94c34 Merge branch 'master' into next 2012-05-28 23:37:26 +02:00
Fernando Tarlá Cardoso Lemos 485871ffdd Get rid of references to level up/down.
In v4 syntax, that's focus parent/child.
2012-05-28 23:37:15 +02:00
Michael Stapelberg ed957d60a7 Merge branch 'master' into next 2012-05-09 21:08:28 +02:00
Fernando Tarlá Cardoso Lemos 4eab046e8f Allow focus w/ target when in fs in some cases.
If the target is in a different workspace, there's no reason why
we wouldn't allow the user to focus it. We already allow this when
focusing a workspace, for example.
2012-05-09 21:08:19 +02:00