Commit graph

228 commits

Author SHA1 Message Date
Drew DeVault 3e1bf721c6
Merge pull request #1943 from RyanDwyer/criteria-improvements
Overhaul criteria implementation
2018-05-11 20:39:43 -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
Drew DeVault 58a033d816 Convert border_colors.text to float[4] 2018-05-03 08:14:17 -04:00
Ryan Dwyer 55b307cddf Calculate config->font_height based on existing container titles 2018-05-03 15:12:00 +10:00
Ryan Dwyer b667298a0a Render titles 2018-05-03 15:12:00 +10:00
Ryan Dwyer daab8e3503 Support alpha in border colours
The alpha component is merged with the container's opacity.

Completes #1882.
2018-05-02 08:40:38 +10:00
Ryan Dwyer cb07434913 Remove unnecessary pointers 2018-05-01 22:48:57 +10:00
Ryan Dwyer 51df1d4ff8 Update cursor when border is changed 2018-05-01 22:42:08 +10:00
Ryan Dwyer e67f354333 Implement borders
Implements rendering of borders. Title text is still to do.

Implements the following configuration directives:

* client.focused
* client.focused_inactive
* client.unfocused
* client.urgent
* border
* default_border
2018-04-30 21:24:13 +10:00
Ryan Dwyer 167c2e1aa9 Refactor arrange_windows()
Replaces arrange_windows() with arrange_root(), arrange_output(),
arrange_workspace() and arrange_children_of().

Also makes fullscreen views save and restore their dimensions, which
allows it to preserve any custom resize and is also a requirement for
floating views once they are implemented.
2018-04-28 11:26:14 +10:00
emersion ff61df17ff
Add map_from_region command 2018-04-26 10:53:47 +01:00
Ryan Dwyer ae39d7b28c Remove sway_container.workspace_layout
Fixes #1716.
2018-04-26 10:14:18 +10:00
Ryan Dwyer 689a6a5605 Use size_t instead of int and calloc instead of malloc 2018-04-24 20:08:32 +10:00
Ryan Dwyer 72767e1cc3 Implement criteria commands
Implements the following commands:

* for_window [...] <cmdlist>
* assign [...] <workspace>
2018-04-24 20:08:32 +10:00
Ryan Dwyer fbb5198e43 Sort workspaces after rename 2018-04-23 18:54:45 +10:00
Ryan Dwyer d956286b92 Implement rename workspace command
This implements the following commands:

* rename workspace to new_name
* rename workspace old_name to new_name
* rename workspace number n to new_name
2018-04-23 18:54:45 +10:00
emersion 4cf77e1de4
Default to current time when triggering cursor events 2018-04-21 14:07:22 +01:00
Drew DeVault 21eb63cc9e
Merge branch 'master' into fullscreen 2018-04-19 08:56:03 -04:00
Ryan Dwyer 9d3739a6f7 Split repeat commands into separate files. 2018-04-19 13:47:29 +10:00
Ryan Dwyer 5b30391383 Make key repeat configurable
This creates two input commands for configuring the repeat delay and rate.

Example config:

    input "myidentifier" {
        repeat_delay 250
        repeat_rate 25
    }
2018-04-18 23:19:23 +10:00
Ryan Dwyer 72beae209b Fullscreen fixes. 2018-04-18 00:10:32 +10:00
Ryan Dwyer bfd5834f4c Feedback for fullscreen. 2018-04-17 08:11:50 +10:00
Ryan Dwyer 52420cc24d Implement fullscreen. 2018-04-16 20:36:40 +10:00
Dominique Martinet 25af959fe9 Fix gcc string truncation warnings 2018-04-13 22:47:27 +09:00
Danny Bautista c355d680e9 Clean up cursor simulation code. 2018-04-10 15:40:27 -04:00
Danny Bautista 1edb2bd892 Implement cursor event simulation with sway commands. 2018-04-10 12:40:50 -04:00
db 63b2543749 Add workspace_auto_back_and_forth for move cmd 2018-04-09 21:34:56 +02:00
Drew DeVault 07b6be6214
Merge pull request #1769 from acrisci/focus-inactive-fixes
Focus inactive fixes
2018-04-08 16:05:03 -04:00
Drew DeVault 0e3ddf255e Add input "identifier" map_to_output "identifier" 2018-04-08 15:09:12 -04:00
Tony Crisci ae78f6fb93 Merge branch 'wlroots' into focus-inactive-fixes 2018-04-08 12:47:56 -04:00
db 042b80b9fa Add workspace_auto_back_and_forth command
This is the only missing piece - other code regarding this functionality has
already been ported from pre-wlroots source.
2018-04-08 16:44:59 +02:00
Tony Crisci 9db859585e container_create_notify on split 2018-04-07 18:01:18 -04:00