Commit graph

546 commits

Author SHA1 Message Date
Brian Ashworth
a7f7d4a488 Write to swaynag pipe fd directly on config errors 2018-08-03 10:37:35 -04:00
Brian Ashworth
f9a6407111 Show swaynag on config errors 2018-08-03 10:37:35 -04:00
Ryan Dwyer
81e8f31cc6 Implement scratchpad
Implements the following commands:

* move scratchpad
* scratchpad show
* [criteria] scratchpad show

Also fixes these:

* Fix memory leak when executing command with criteria
(use `list_free(views)` instead of `free(views)`)
* Fix crash when running `move to` with no further arguments
2018-07-23 08:24:32 +10:00
Ryan Dwyer
9fbe13b9be Implement floating_modifier and mouse operations for floating views
This implements the following:

* `floating_modifier` configuration directive
* Drag a floating window by its title bar
* Hold mod + drag a floating window from anywhere
* Resize a floating view by dragging the border
* Resize a floating view by holding mod and right clicking anywhere on
the view
* Resize a floating view and keep aspect ratio by holding shift while
resizing using either method
* Mouse cursor turns into resize when hovering floating border or corner
2018-07-22 23:10:19 +10:00
Ryan Dwyer
c2ed3d8bd6 Implement force_display_urgency_hint
The directive sets the timeout before an urgent view becomes normal
again after switching to it from another workspace.

Also:

* When an xwayland surface removes the urgent hint while the timer is
active, we now ignore the request. This happens as soon as the view
receives focus, so it was effectively making the timer pointless.
* The timeout is now only applied when switching to it from another
workspace.
2018-07-21 10:28:07 +10:00
Ryan Dwyer
08736255a3 Defer the focus commands 2018-07-19 16:41:02 +10:00
Ryan Dwyer
75c699db62 Implement default_floating_border command and adjust CSD behaviour 2018-07-17 10:14:33 +10:00
Drew DeVault
d6bd314dff
Merge pull request #2276 from RyanDwyer/urgency
Implement urgency base functionality
2018-07-16 15:39:08 -07:00
Ryan Dwyer
fc2484095a Implement no_focus command 2018-07-16 22:18:12 +10:00
Ryan Dwyer
315d5311b2 Implement urgency base functionality
Introduces a command to manually set urgency, as well as rendering of
urgent views, sending the IPC event, removing urgency after focused for
one second, and matching urgent views via criteria.
2018-07-16 08:19:25 +10:00
Ryan Dwyer
a120d4c79f Make focus part of transactions
Rather than maintain copies of the entire focus stack, this PR
transactionises the focus by introducing two new properties to the
container state and using those when rendering.

* `bool focused` means this container has actual focus. Only one
container should have this equalling true in its current state.
* `struct sway_container *focus_inactive_child` points to the immediate
child that was most recently focused (eg. for tabbed and stacked
containers).
2018-07-15 22:08:26 +10:00
Ryan Dwyer
2032f85d94 Simplify transactions by utilising a dirty flag on containers
This PR changes the way we handle transactions to a more simple method.
The new method is to mark containers as dirty from low level code
(eg. arranging, or container_destroy, and eventually seat_set_focus),
then call transaction_commit_dirty which picks up those containers and
runs them through a transaction. The old methods of using transactions
(arrange_and_commit, or creating one manually) are now no longer
possible.

The highest-level code (execute_command and view implementation
handlers) will call transaction_commit_dirty, so most other code just
needs to set containers as dirty. This is done by arranging, but can
also be done by calling container_set_dirty.
2018-07-14 23:14:55 +10:00
Ryan Dwyer
f2d1cf3ceb Implement floating_minimum_size and floating_maximum_size 2018-07-11 22:16:48 +10:00
emersion
63b4bf5000
Update for swaywm/wlroots#1126 2018-07-09 22:54:30 +01:00
Dominique Martinet
fe72e3b349 cmd_results_to_json: return copied string and properly free the json
The only user of this function would copy the string right away
to get rid of the const flag anyway, and freeing a const string
afterwards might work but is not meant to be done according to the
json-c API.
2018-07-05 13:11:02 +09:00
Dominique Martinet
557a14a6fe config_commands_command: make alloc failure check more permanent
policy is accessed again later

Found through static analysis
2018-07-02 08:03:41 +09:00
Nate Symer
6a910b9ba5 Implement gaps (PR #2047) 2018-06-09 09:34:56 -04:00
Brian Ashworth
212e4ef395 Remove strip quoting and fix strncpy-overlap 2018-06-07 20:37:08 -04:00
Brian Ashworth
067fe9d047 Support runtime var expansion and set at runtime 2018-06-05 10:08:00 -04:00
Brian Ashworth
8bfa2def88 Address first round of review for generic blocks 2018-06-02 08:07:44 -04:00
Brian Ashworth
7c810dc344 Make command block implementation generic 2018-06-02 08:07:44 -04:00
Ryan Dwyer
1f2e399ade Implement floating 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
Brian Ashworth
46da1dc32b Implement focus_wrapping 2018-05-27 23:20:21 -04:00
Brian Ashworth
569f4e0e4c Implement swap command 2018-05-26 11:05:02 -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
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
Brian Ashworth
3db7fc2bb2 Implement hide_edge_borders 2018-05-11 18:44:56 -04: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
Drew DeVault
00e62c214d Fix alphabetization of command list 2018-05-03 09:24:13 -04:00
Ryan Dwyer
b667298a0a Render titles 2018-05-03 15:12:00 +10:00
Drew DeVault
7f574c538d Fix alphabetization of commands array 2018-05-01 07:46:57 -04:00
Ryan Dwyer
630ba30e3c 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-05-01 07:46:57 -04:00
emersion
ff61df17ff
Add map_from_region command 2018-04-26 10:53:47 +01: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
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
Drew DeVault
21eb63cc9e
Merge branch 'master' into fullscreen 2018-04-19 08:56:03 -04: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
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
1edb2bd892 Implement cursor event simulation with sway commands. 2018-04-10 12:40:50 -04:00
Drew DeVault
0e3ddf255e Add input "identifier" map_to_output "identifier" 2018-04-08 15:09:12 -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
Drew DeVault
f77986338f Implement resize command 2018-04-05 00:03:20 -04:00
Tony Crisci
fc9398a42e Implement opacity command 2018-04-04 21:57:05 -04:00
Tony Crisci
d434da5632 Merge branch 'wlroots' into split-containers 2018-04-02 16:09:27 -04:00
Tony Crisci
2187684bd0 Merge branch 'wlroots' into split-containers 2018-04-02 14:06:04 -04:00
Tony Crisci
5e024278a6 Merge branch 'wlroots' into seat-fixes 2018-04-02 13:23:43 -04:00
Tony Crisci
a82c107c76 80col 2018-04-02 11:44:42 -04:00
Drew DeVault
b2d871cfe2 Partially implement move command
Works:

- move [container|window] to workspace <name>
    - Note, this should be able to move C_CONTAINER but this is untested
- move [workspace] to output [left|right|up|down|<name>]

Not implemented yet:

- move [left|right|up|down]
- move scratchpad
- move position
2018-04-02 11:12:18 -04:00
Tony Crisci
0828c77251 rename input-manager functions 2018-04-02 08:49:38 -04:00
Tony Crisci
e677c5b204 rename seat functions 2018-04-02 08:45:37 -04:00
Tony Crisci
7706d83160 basic split containers 2018-03-31 15:37:16 -04:00
Drew DeVault
9b38ef950f Implement focus_follows_mouse
Also contains two other small changes:

- Clicking any button will focus the container clicked (not just left)
- Remove seamless_mouse (doesn't make sense on wlroots)
2018-03-31 13:05:45 -04:00
Drew DeVault
ae6d459000 Implement mouse warping 2018-03-31 13:05:45 -04:00
Drew DeVault
69eb021767 Add default_orientation command 2018-03-30 10:43:55 -04:00
Drew DeVault
8efee109ad Implement modes 2018-03-29 22:11:08 -04:00
Drew DeVault
5c9cdbcdd2 Add swaybg_command 2018-03-29 22:11:08 -04:00
Drew DeVault
bf7a4cd0eb Add bar configuration commands 2018-03-29 22:11:08 -04:00
Tony Crisci
2154b7c7d6 add config handlers 2018-02-24 13:34:47 -05:00
Tony Crisci
5b219a1598 separate config directives and commands 2018-02-24 13:20:34 -05:00
Tony Crisci
ac8269d536 take seat param for handle_command and rename 2018-02-24 12:50:24 -05:00
Tony Crisci
66d1e0b313 basic layout command 2018-02-22 18:37:14 -05:00
Tony Crisci
52670c636c basic focus (without direction) 2018-02-14 16:47:23 -05:00
Tony Crisci
a7d49da239 separate seat get focus and seat get focus inactive 2018-02-07 18:17:57 -05:00
Tony Crisci
5151502298 basic focus overhaul 2018-02-04 14:08:54 -05:00
Drew DeVault
b28602aa74 Implement workspaces 2018-01-30 23:09:21 -05:00
Dominique Martinet
869be4378d commands: add 'reload' command 2018-01-22 07:25:23 +01:00
Tony Crisci
5505d84ac2 criteria cleanup 2018-01-21 14:11:41 -05:00
Tony Crisci
1156523ccf run all commands with focused container context 2018-01-21 08:46:31 -05:00
Tony Crisci
6a1d71b8b8 basic command criteria 2018-01-20 16:21:45 -05:00
Tony Crisci
c353e01c85 add kill command 2018-01-20 14:10:11 -05:00
Tony Crisci
cc3c713889 seat config handler context 2018-01-20 11:44:34 -05:00
Tony Crisci
9e0595f26b input config handler context 2018-01-20 11:34:57 -05:00
Dominique Martinet
67985e9031 sway: change all sway_log to wlr_log 2018-01-05 23:39:46 +01:00
Dominique Martinet
c83900593d config: add 'set' command 2018-01-05 15:36:20 +01:00
Dominique Martinet
f5b33cb4b6 fix typos in comments/messages; add shutting down message 2018-01-05 00:07:34 +01:00
Dominique Martinet
afca73b6fc apply_input_config: restore previous current_input_config
This is important for freeing the proper one at end of block
2018-01-05 00:07:34 +01:00
Tony Crisci
ba69f06695 binding config 2017-12-27 12:31:06 -05:00
Tony Crisci
88bcd43ebf seat fallback config 2017-12-17 10:39:22 -05:00
Tony Crisci
f16aa3c0ad rename config apply cmds 2017-12-16 12:14:24 -05:00
Tony Crisci
9fa70ce426 Merge branch 'wlroots' into feature/input 2017-12-16 07:33:23 -05:00
Tony Crisci
9eecbb5d8a xkb config 2017-12-15 05:22:51 -05:00
Tony Crisci
92fef27eaa basic configuration 2017-12-14 11:11:56 -05:00
Tony Crisci
c173d30b92 seat configuration 2017-12-12 10:55:20 -05:00
Tony Crisci
163edc5a90 sway input device 2017-12-12 08:29:37 -05:00
Tony Crisci
462a451328 input config 2017-12-11 07:55:01 -05:00
emersion
c25ad5e7c4
Merge branch 'wlroots' into output-config 2017-12-06 19:11:46 +01:00
emersion
aaae59026f
Add output config 2017-12-06 12:36:06 +01:00
emersion
9aeda82477
Add include command 2017-12-05 18:47:57 +01:00
emersion
90f7f1a0e6
Add minimal config subsystem 2017-12-05 10:40:55 +01:00
emersion
514c819ff9
Add exec and exec_always commands 2017-12-04 22:43:49 +01:00
Drew DeVault
b379b40071 Invoke command handlers once parsed 2017-11-22 21:39:35 -05:00
Drew DeVault
d7d21bb0f8 Add initial command subsystem (untested)
Need to spin up the IPC server to test this
2017-11-22 21:20:41 -05:00
Drew DeVault
733993a651 Move everything to sway/old/ 2017-11-18 11:22:02 -05:00
Drew DeVault
7c448b4081 Fire up the wlroots backend and run the event loop 2017-11-11 09:08:50 -05:00