Commit Graph

147 Commits (9571200baa387eb0b4b0e8afd9d540175a95adc5)

Author SHA1 Message Date
Deiz f0f906a52e Initialize workspace rect to the output's upon creation
The comment immediately following implied that this was the intended
behaviour. Not doing so means that compound commands that both move a
window to a new workspace as well as do something that depends on the
workspace's geometry (e.g. 'move position center' or 'floating enable'
on a tiled window) would use the workspace's calloc'd 0x0+0x0 geometry.
2015-04-28 15:09:58 -04:00
Deiz 884214f14f Update copyright notices and get rid of ranges
The script used to make these changes can be found at:

   https://gist.github.com/Deiz/32322020f76d23e2bf8f
2015-04-20 17:50:21 -04:00
Deiz 48d2acd8f6 Fix percents when attaching a window to a ws creates a new split con
Fixes #1484 and includes a test case.
2015-03-27 22:20:28 -04:00
Ingo Bürk eb73059c61 Refactor functions for easy reuse 2015-03-04 09:22:25 +01:00
Tony Crisci 823b46a544 Include workspace con in workspace event
Send the affected workspace in the "current" property for each workspace
event for any type of workspace event that affects a particular
workspace.

fixes #1411
2014-12-22 09:47:31 +01:00
Michael Stapelberg ea2552e852 Bugfix: use the command parser to properly extract workspace names
fixes #1377
2014-10-01 22:50:48 +02:00
Tony Crisci 682fb0a291 Implement the window::urgent event
The window::urgent event is emitted when a container becomes urgent or
loses its urgent status.
2014-06-24 09:04:45 +02:00
Tony Crisci a9c094b731 Implement EWMH desktop names
Maintain the _NET_DESKTOP_NAMES property on the root window.

http://standards.freedesktop.org/wm-spec/latest/ar01s03.html#idm140251368131760

> _NET_DESKTOP_NAMES
>
> _NET_DESKTOP_NAMES, UTF8_STRING[]
>
> The names of all virtual desktops. This is a list of NULL-terminated
> strings in UTF-8 encoding [UTF8]. This property MAY be changed by a
> Pager or the Window Manager at any time.
2014-06-24 09:04:05 +02:00
Tony Crisci 4205973135 feature: implement ewmh desktop viewport property
Set and update the _NET_DESKTOP_VIEWPORT property

http://standards.freedesktop.org/wm-spec/wm-spec-latest.html#idm140146176862048

> _NET_DESKTOP_VIEWPORT x, y, CARDINAL[][2]/32
> Array of pairs of cardinals that define the top left corner of each
> desktop's viewport.
2014-06-23 21:29:57 +02:00
Tony Crisci c936232545 Consistently parse workspace numbers
Use ws_name_to_number() to parse workspace numbers where this
transformation takes place.
2014-06-23 21:16:18 +02:00
Tony Crisci b47f480728 Implement EWMH number of desktops property
_NET_NUMBER_OF_DESKTOPS:

> This property SHOULD be set and updated by the Window Manager to
> indicate the number of virtual desktops.

We interpret this property as the number of noninternal workspaces.
2014-06-19 11:21:03 +02:00
Michael Stapelberg 4c06e7a573 clang-format-3.5 **/*.h **/*.c
This should be the last commit that formats a big bunch of files. From
here on, whenever I merge patches, I’ll run clang-format like described
in the title.
2014-06-19 11:20:32 +02:00
Michael Stapelberg 9200094203 format **/*.c with clang-format-3.5
This has multiple effects:

1) The i3 codebase is now consistently formatted. clang-format uncovered
   plenty of places where inconsistent code made it into our code base.

2) When writing code, you don’t need to think or worry about our coding
   style. Write it in yours, then run clang-format-3.5

3) When submitting patches, we don’t need to argue about coding style.

The basic idea is that we don’t want to care about _how_ we write the
code, but _what_ it does :). The coding style that we use is defined in
the .clang-format config file and is based on the google style, but
adapted in such a way that the number of modifications to the i3 code
base is minimal.
2014-06-15 19:07:02 +02:00
Tony Crisci f41e81bd96 Feature: Workspace assignment by number
Workspace assignments with bare numbers assign all workspaces with that
number to the specified output.

Workspace assignment by number is overridden by workspace assignment by
name.
2014-05-20 20:15:55 +02:00
Michael Stapelberg ff94d28b85 improve error messages for i3-internal workspace names 2014-05-03 15:02:51 +02:00
Alexander Berntsen bc79884a9e Make all workspaces starting with "__" internal
Workspaces won't work properly if they start with "__", so reserve that
namespace altogether. Disallow renaming workspaces to reserved namespace
and using reserved namespace in configuration.

Fixes #1209.
2014-05-03 15:00:15 +02:00
Tony Crisci 7639337716 Bugfix: `move <direction>` sends workspace focus
Make sure the command `move <direction>` properly sends the workspace
focus ipc event required for i3bar to be properly updated and redrawn.

Make `ipc_send_workspace_focus_event publicly available from ipc.h for
more flexible event sending.
2014-01-13 23:36:31 +01:00
Sebastian Ullrich 431e98dc35 Respect workspace numbers when looking for a free workspace name
This prevents a ws '1' appearing on a new output when there's
already a ws '1: www' on an existing output
2013-08-18 17:47:53 +02:00
Michael Stapelberg c4d4418745 Merge branch 'master' into next 2013-06-29 20:58:51 +02:00
Eika Enge 625d5bdba6 Bugfix: Ignore spaces in front of default workspace name 2013-06-29 20:58:15 +02:00
haptix@web.de 2926ddb69f ipc: use correct workspace in workspace change event
fixes #990
2013-04-02 22:27:04 +02:00
Michael Stapelberg 61a5b9ddd4 Revert "don't use con_is_internal"
This reverts commit c6948c59f5.

Given that master and next now both contain con_is_internal, we can use
it again.
2012-12-14 21:44:20 +01:00
Michael Stapelberg 2bf7793d4d Merge branch 'next' 2012-12-12 00:18:23 +01:00
Michael Stapelberg 305b6ddf2f set LC_NUMERIC=C when dumping nodes in the workspace event
Otherwise the resulting JSON might be invalid because it uses the
locale-specific comma separator, e.g. "16,666" instead of "16.666".
2012-11-13 09:49:08 +01:00
Francesco Mazzoli 1055973f66 refactor, name changes
We need to send the workspace event earlier, because otherwise 'old'
might already be destroyed (if it was empty).
2012-11-13 09:40:06 +01:00
Francesco Mazzoli 464d387044 take care of non-existant old workspaces 2012-11-13 09:33:03 +01:00
Francesco Mazzoli 74d596e0fc more informative `workspace' events
Add a `current' and `old' properties to the `focus' change type,
containing the current and old workspace respectively.  These additions
are not necessary anywhere else because `focus' is always triggered when
changing ws.
2012-11-13 09:33:00 +01:00
Simon Elsbrock c6948c59f5 bugfix: don't use con_is_internal
fixes #872
2012-11-12 19:49:01 +01:00
Michael Stapelberg dece12bf18 Merge branch 'master' into next 2012-11-10 09:01:24 +01:00
Michael Stapelberg 81393c93c2 bugfix: fix workspace back_and_forth after displaying a scratchpad window
fixes #868
2012-11-10 09:01:04 +01:00
Deiz fdcba7b91a Replace the discrete 'split' Con property with a simple function. 2012-10-04 17:48:08 +02:00
Michael Stapelberg 13147978c5 Merge branch 'master' into next 2012-10-03 15:08:31 +02:00
Sascha Kruse 507898484f set workspace_layout in create_workspace_on_output
fixes #835
2012-10-03 15:08:21 +02:00
Deiz e89a25f81f Implement moving workspaces as if they're regular containers 2012-09-29 00:17:36 +02:00
Michael Stapelberg 43d486441d Bugfix: with one ws per output, don’t crash on cross-output moves (Thanks moju)
fixes #827
2012-09-28 23:04:37 +02:00
Michael Stapelberg c31b3b296a Bugfix: Correctly clear the urgency hint when the window is underneath a split-con (+test)
Previously, when you had an urgent container in a stack on some
invisible workspace (say urxvt) and you switched to it, the urgency hint
was not properly cleared.
2012-09-25 15:40:08 +02:00
Deiz a080794e59 Replace duplicate "__" workspace prefix checks with a single function. 2012-09-23 15:47:35 +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 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 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 884627ef20 use I3__FILE__ for DLOG, leave __FILE__ as is
See also commit 0e752070ac, which broke
source code listings in gdb unless you cd into i3/src. This should give
us best of both :-).
2012-08-12 12:19:47 +02:00
Michael Stapelberg 0e752070ac explicitly set filenames to $(basename __FILE__)
This makes the debug log a bit more readable, especially since commit
48f1e383ca
2012-08-07 09:55:52 +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 ecd238b65e ignore "current" when searching for named workspaces 2012-06-03 19:44:42 +02:00
Michael Stapelberg ec4e6d1cdf Fix stray workspaces "number 1" being created when having workspace number 1 in your config 2012-05-16 06:24:16 +02:00
Michael Stapelberg a9b57a44a9 Remove set but never read variable
This was due to the changes in commit d25e77ce75
2012-05-09 19:56:21 +02:00
Michael Stapelberg 1bb165a29a tests: warp the pointer to in multi-monitor tests to avoid flaky tests 2012-04-09 14:48:57 +02:00
Michael Stapelberg 373b4ad74a Implement 'rename workspace <old_name> to <new_name>' 2012-04-08 20:40:00 +02:00
Michael Stapelberg 206b96202c Use (void) instead of () for functions without args (Thanks fernandotcl)
See also:
http://article.gmane.org/gmane.linux.kernel/1268792

The C compiler will handle (void) as "no arguments" and () as "variadic
function" (equivalent to (...)) which might lead to subtle errors, such
as the one which was fixed with commit 0ea64ae4.
2012-03-31 10:53:04 +02:00