Commit graph

258 commits

Author SHA1 Message Date
frsfnrrg d77681ea3d Share common code between bindsym and bindcode commands 2018-06-01 18:52:36 -04:00
Drew DeVault 96446fdbf7
Merge pull request #2027 from RyanDwyer/implement-floating
Implement floating
2018-06-01 15:41:49 -07:00
Brian Ashworth edf37f27e1 Fix cmd_workspace crash when a surface has focus 2018-06-01 14:07:55 -04:00
Ryan Dwyer 70c2c50445 Fix changing borders on floating views 2018-06-01 23:14:58 +10:00
Ryan Dwyer f7cadf2333 Adjust move command to account for changed coordinate system 2018-06-01 23:14:58 +10:00
Ryan Dwyer 5d69a56209 Prevent splitting a floating view 2018-06-01 23:14:58 +10:00
Ryan Dwyer aaba7642b3 Replace is_floating boolean with function 2018-06-01 23:14:58 +10:00
Ryan Dwyer 1f2e399ade Implement floating 2018-06-01 23:14:58 +10:00
Drew DeVault 1132efe42e Send frame done to floating views
Also centers them on the screen when initially floated

In the future we'll need a more sophisticated solution than that
2018-06-01 23:14:58 +10:00
Drew DeVault f3ab895916 Implement floating enable 2018-06-01 23:14:58 +10:00
Brian Ashworth d76729af22 Implement config parser for workspace_layout 2018-05-28 22:55:06 -04:00
Brian Ashworth c81d0ef1e8 Support i3's legacy force_focus_wrapping command 2018-05-28 11:09:46 -04:00
emersion 1071785f56
Merge pull request #2060 from RedSoxFan/focus-wrapping
Implement focus_wrapping
2018-05-28 10:30:11 +01:00
Brian Ashworth 46da1dc32b Implement focus_wrapping 2018-05-27 23:20:21 -04:00
Ryan Dwyer 7c7d24600b Fix ancestor typos 2018-05-28 12:45:42 +10:00
frsfnrrg a78a5684ea Implement bindsym/bindcode --locked
Adds the --locked flag to bindsym and bindcode commands.

When a keyboard's associated seat has an exclusive client
(i.e, a screenlocker), then bindings are only executed if
they have the locked flag. When there is no such client,
this restriction is lifted.
2018-05-27 13:28:02 -04:00
Brian Ashworth 569f4e0e4c Implement swap command 2018-05-26 11:05:02 -04:00
Ryan Dwyer db38b9bbf3 Clean up container title functions
* Add and use lenient_strcat and lenient_strncat functions
* Rename `concatenate_child_titles` function as that's no longer what it
does
* Rename `container_notify_child_title_changed` because we only need to
notify that the tree structure has changed, not titles
* Don't notify parents when a child changes its title
* Update ancestor titles when changing a container's layout
	* Eg. create nested tabs and change the inner container to stacking
* No need to store tree presentation in both container->name and
formatted_title
2018-05-25 21:07:59 +10:00
Ryan Dwyer 664169fbf1 Implement stacked layout 2018-05-22 08:27:24 +10:00
Ryan Dwyer c08f9bf257 Implement tabbed layout 2018-05-21 20:16:56 +10:00
Brian Ashworth 82cd55a670 Fix border commands from changing focus 2018-05-20 23:12:33 -04:00
Ryan Dwyer 0e2cc0af30 Implement show_marks 2018-05-17 08:29:14 +10:00
Ryan Dwyer 4d1edfcba9 Change unmark implemention to match i3's 2018-05-15 11:24:16 +10:00
Ryan Dwyer 22d38600d0 Implement marks 2018-05-15 11:18:27 +10:00
emersion 95a10dd4f3
Kill wl_shell 2018-05-14 13:26:10 +01:00
Ryan Dwyer 1e9aaa54a8 Revert "Revert "Merge pull request #1943 from RyanDwyer/criteria-improvements""
This reverts commit 32a572cecf.

This reimplements the criteria overhaul in preparation for fixing a
known bug.
2018-05-14 11:38:09 +10:00
Drew DeVault 61aa0937a7
Merge pull request #1824 from snaggen/idle
DPMS and lock handling
2018-05-13 10:11:10 -04:00
Mattias Eriksson 8fbafbfab5 Idle handling for dpms/lockscreen et al
Swayidle handles idle events and allows
for dpms and lockscreen handling. It also
handles systemd sleep events, and can
raise a lockscreen on sleep

Fixes #541
2018-05-13 00:30:09 +02:00
Drew DeVault 32a572cecf Revert "Merge pull request #1943 from RyanDwyer/criteria-improvements"
This reverts commit 3e1bf721c6, reversing
changes made to 2217518bd5.
2018-05-12 08:52:54 -04:00
Drew DeVault 3e1bf721c6
Merge pull request #1943 from RyanDwyer/criteria-improvements
Overhaul criteria implementation
2018-05-11 20:39:43 -04:00
Brian Ashworth 3db7fc2bb2 Implement hide_edge_borders 2018-05-11 18:44:56 -04:00
Drew DeVault 2217518bd5
Merge pull request #1956 from ggreer/move-focus
cmd_move_container: Focus a window on the source workspace.
2018-05-11 07:34:14 -04:00
Geoff Greer 87fa84df13 cmd_move_container: Focus a window on the source workspace.
In Sway 0.15, moving a window to another workspace would cause a window on the source workspace to be focused. This restores that behavior, allowing you to quickly move a lot of windows to another workspace.
2018-05-10 23:44:35 -07:00
Geoff Greer 0a79983f94 Allow setting border widths for normal borders using default_border.
In Sway 0.15, `default_border normal 1` would set 1px wide borders. This recreates that behavior.
2018-05-10 23:35:37 -07:00
Ryan Dwyer 3b0c26d149 Overhaul criteria implementation
The criteria struct now uses properties for each token type rather than
the list_t list of tokens. The reason for this is that different token
types have different data types: pcre, string and number to name a few.
This solution should be more flexible moving forward. A bonus of this is
that criteria is now easier to understand when looking at the struct
definition.

The criteria parser has been rewritten because the previous one didn't
support valueless pairs (eg. [class="foo" floating]).

Criteria now has types. Types at the moment are CT_COMMAND,
CT_ASSIGN_WORKSPACE and CT_ASSIGN_OUTPUT. i3 uses types as well.
Previously the assign command was creating a criteria with 'move to
workspace <name>' as its command, but this caused the window to appear
briefly on the focused workspace before being moved to the assigned
workspace. It now creates the view directly in the assigned workspace.

Each view will only execute a given criteria once. This is achieved by
storing a list of executed criteria in the view. This is the same
strategy used by i3.

Escaping now works properly. Previously you could do things like
[class="Fire\"fox"] and the stored value would be 'Fire\"fox', but it
should be (and now is) 'Fire"fox'.

The public functions in criteria.c are now all prefixed with criteria_.

Xwayland views now listen to the set_title, set_class and
set_window_type events and criteria will be run when these happen. XDG
shell has none of these events so it continues to update the title in
handle_commit.

Each view type's get_prop function has been split into get_string_prop
and get_int_prop because some properties like the X11 window ID and
window type are numeric.

The following new criteria tokens are now supported:

* id (X11 window ID)
* instance
* tiling
* workspace
2018-05-11 09:38:53 +10:00
Rostislav Pehlivanov b592351eef Revert "exec_always: Search for executables in /usr/lib/sway"
This reverts commit 7709340727.
2018-05-06 00:20:49 +01:00
Rostislav Pehlivanov 2c0c3dc7cc Revert "Make the LIBDIR path configurable"
This reverts commit 1670b46bf6.
2018-05-06 00:19:52 +01:00
Rostislav Pehlivanov 0cdc47ab1e Revert "Meson: Replace option instlibdir with libexecdir"
This reverts commit 830c4ef74c.
2018-05-06 00:19:43 +01:00
Rostislav Pehlivanov cf602687c6 Revert "command/exec_always: Use wlr_log for logging errors in the child process"
This reverts commit 177c67e6b8.
2018-05-06 00:19:29 +01:00
Ryan Dwyer 556ff5f50e Implement pango support
Implements support for the pango: prefix in the font command.

Closes #1903.
2018-05-06 08:25:22 +10:00
Ryan Dwyer 1daf69477e Fix PATH setenv() in exec_always 2018-05-06 08:16:34 +10:00
emersion 786727d8bb
Merge branch 'master' into usr-lib 2018-05-05 20:03:46 +01:00
Nicolas Braud-Santoni 177c67e6b8 command/exec_always: Use wlr_log for logging errors in the child process 2018-05-05 17:22:46 +02:00
Nicolas Braud-Santoni 830c4ef74c Meson: Replace option instlibdir with libexecdir
Derive a value from it, called `rundir` rather than writing join_paths(libexecdir,
'sway') all over the place.
2018-05-05 17:22:46 +02:00
Nicolas Braud-Santoni 1670b46bf6 Make the LIBDIR path configurable 2018-05-05 17:22:46 +02:00
Nicolas Braud-Santoni 7709340727 exec_always: Search for executables in /usr/lib/sway 2018-05-05 17:22:46 +02:00
Ryan Dwyer 5d6d24e71a Move code for re-arranging after font height change into a common place 2018-05-05 22:29:37 +10:00
Ryan Dwyer d10a0a8c41 Fix memory leak in title_format command 2018-05-05 22:29:37 +10:00
Ryan Dwyer 228c478e8d Implement title_format
This implements the title_format command, with a new placeholder %shell
which gets substituted with the view type (xwayland, xdg_shell_v6 or
wl_shell).

Example config:

    for_window [title=".*"] title_format %title (class=%class instance=%instance shell=%shell)
2018-05-05 22:29:37 +10:00
emersion 29224e7aec
Fix segfault when running the resize command without arguments 2018-05-03 14:04:39 +01:00