Commit graph

1165 commits

Author SHA1 Message Date
Zandr Martin e75217cfb1
fix get_workspaces json reply 2016-09-17 22:00:11 -05:00
Zandr Martin 87080bb9cc
take four! 2016-09-17 16:36:55 -05:00
Zandr Martin e18b7cdfa9
add global current_focus pointer 2016-09-17 15:54:45 -05:00
Ryan Dwyer e4cb4d1b5c Fix swaybar when running on named outputs.
When using a bar on a named output, load_swaybars() requires the
output to be active (ie. in the root container), but this is not the case if
the bar is added to the last output. To fix this, load_swaybars() is now
called after the output has been added to the root container.

After fixing that, swaybar would segfault due to using the wrong index
variable when loading outputs and config.
2016-09-17 17:25:45 +10:00
Zandr Martin 64f61873a9 document workspace_auto_back_and_forth command 2016-09-16 21:53:46 -05:00
D.B 873dfc07f3 Use indicator border color only when needed.
Indicator border color is now used only when a container is the only
child. Reason for the change? i3 does it this way. Sway container
borders are now a bit more similar to i3 ones.
2016-09-10 16:11:33 +02:00
Zandr Martin 511eed90cd
squash commits, move enum into resize.c 2016-09-07 06:48:41 -05:00
Mikkel Oscar Lyderik 84d504ebdf Make it possible to move views between outputs
This patch makes it possible to move views between outputs using the
`move left|right|up|down` commands.

It behaves similar to i3 with one important difference. The focus will
always follow the view being moved, unlike i3 where the focus doesn't
always follow the view to a new output (I assume that's a bug in i3).
2016-09-05 12:14:23 -04:00
Drew DeVault af44154119 Fix constant scale factor in font code 2016-09-05 11:52:52 -04:00
Drew DeVault 0913eff915 Add support for * input configs
Closes #852
2016-09-05 10:18:38 -04:00
Zandr Martin 65ace5dec5
merge in latest commits 2016-09-02 14:11:48 -05:00
Zandr Martin 79ffea328c
Merge branch 'master' of git://github.com/SirCmpwn/sway into commands-refactor 2016-09-02 13:46:19 -05:00
Zandr Martin b374c35758
refactor commands.c 2016-09-01 21:39:08 -05:00
Lukas Lihotzki 6addaca9fa Correct hide_edge_borders command
`vertical` and `horizontal` should be swapped.

If border_left and border_right were set to 0, the vertical borders
instead of the horizontal borders would be hidden.

i3 handles this command equally.
2016-09-02 01:16:03 +02:00
Drew DeVault 38ca94e0ed Tweak how swaylock surfaces are handled
Fixes #875
2016-09-01 08:34:52 -04:00
Drew DeVault 416417a54c Reorganize includes 2016-09-01 08:18:37 -04:00
Zandr Martin a9c0993218 document orientation command 2016-08-31 21:07:20 -05:00
Hummer12007 db1c105e77 Fix a format string 2016-08-22 18:56:49 +03:00
James Murphy 8af49eb696 Avoid dereferencing null configuration
Fixes: https://github.com/SirCmpwn/sway/issues/865
2016-08-20 16:24:08 +00:00
Götz Christ aecd33d25d Add input example section to config
Also improve sway-input(5) description to be more consistent with sway-bar(5).
2016-08-18 18:00:58 -05:00
Guillaume Brogi 7bbf7e15a0 Update man page
The man page mentioned that "indicator" wasn't implemented, this isn't
the case anymore.
2016-08-12 00:13:48 +02:00
Guillaume Brogi 6173c84117 Rerender after every split command 2016-08-12 00:12:56 +02:00
Guillaume Brogi fc492a4da8 Add support for indicator color 2016-08-11 23:57:38 +02:00
D.B ce98569fbc Handle output disabling during runtime
Output now gets disabled if disable command is invoked via bindsym or
IPC.
2016-08-10 18:52:49 +02:00
Manuel Mendez 631ba506d6 document all xkb settings handled by wlc 2016-08-09 10:41:06 -04:00
Drew DeVault b8642ce681 Merge pull request #843 from thejan2009/bug/move-container-819
Fix container move when workspace is focused
2016-08-07 12:04:08 -04:00
D.B 41b5c6d1a9 Sort workspaces when moving workspace to output
This should fix #839
2016-08-07 17:32:18 +02:00
D.B 61781bbef0 Fix container move when workspace is focused
Fixes #819. If workspace is focused and command 'move container to
workspace/output' is issued, workspace child containers are wrapped in a
new container and moved according to command.
2016-08-07 17:07:30 +02:00
D.B 9c91952aec Display class in tab title if app_id is null
This is a feature that can't work the same as i3, because there is no
real window classes in wayland. This way, we avoid null titles as much
as possible.
2016-08-07 08:37:26 +02:00
Drew DeVault aca9f6b2a2 Merge pull request #840 from minus7/man-inputs
added get_inputs hint to man 5 sway-input
2016-08-05 13:58:14 -04:00
minus 2f50be3d88 added get_inputs hint to man 5 sway-input 2016-08-05 19:55:00 +02:00
D.B aa292db8d1 Fix switch to prev ws on handle_view_created
Switching back to original workspace should be done only if workspace
was switched while appending new view.
2016-08-05 10:43:54 +02:00
Tony Crisci 4ab35df157 ipc: log sending of events
Log the sending of the events in the debug log. This makes ipc server events
easier to verify.
2016-08-04 21:48:20 -04:00
Tony Crisci e1e15bb43e ipc: recursive workspace containers in event
Recursively describe workspace containers in the workspace event. This is for
compatability with i3 and i3ipc libraries.
2016-08-04 21:26:39 -04:00
Tony Crisci 50901a0892 ipc: always include nodes in views
This is for i3 (and i3ipc library) compatability.
2016-08-04 21:19:52 -04:00
Mykyta Holubakha e1b1d94a4e Arrange windows after swapping containers
Fixes #833
2016-08-05 02:07:03 +03:00
D.B 132017d242 Fix 'workspace back_and_forth' and workspace_auto_back_and_forth clash
When workspace_auto_back_and_forth is enabled, workspaces get switched
twice with previously mentioned command, which is not the expected
behavior.

Removes one redundant creation of previous workspace.
2016-08-04 21:31:46 +02:00
Tony Crisci 81eb9ea12c Simplify focus setting
Merge the main rendering paths of all containers to make focus setting a bit
simpler and easier to follow.
2016-08-03 23:24:53 -04:00
Tony Crisci c98e91f01f Use uintptr_t for ipc container id
This is for compatability with i3.
2016-08-03 20:34:47 -04:00
minus b246799548 fixed uninitialized bar.wrap_scroll 2016-08-02 22:02:39 +02:00
Zandr Martin 9fa92951fe
remove unmanaged nodes from get_tree 2016-08-02 13:24:21 -05:00
Drew DeVault 31ce010861 Fix segfault in border.c 2016-08-02 07:35:25 -04:00
Tony Crisci 4344fe5011 bugfix: focus container on output when focused
Focus the container on the output (not the output itself) when an output is
focused.

This is intended to fix a bug where borders are not updated correctly when
switching the vt away/back to sway.
2016-08-01 23:56:34 -04:00
Tony Crisci 2f65100bee Remove dead global locked_view_focus
The value of `locked_view_focus` is always false. Remove dead code associated
with this variable to simplify things.
2016-08-01 22:25:08 -04:00
Drew DeVault 2d907ef1f6 Merge pull request #811 from acrisci/feature/focus-container
Implement focus handling for containers
2016-08-01 07:27:12 -04:00
Zandr Martin b18c169036
cache floating container size when fullscreening 2016-07-31 21:45:27 -05:00
Tony Crisci fe608c80ae Update view border when workspace is focused
When a workspace is focused, update the borders of all its child containers to
be focused to indicate the workspace container is focused.
2016-07-31 21:42:51 -04:00
Tony Crisci d731d6a846 Bugfix: descend focus stack on new window focus
When switching back to a workspace after new window creation, it is now
necessary to descend the focus stack into the focused container of the
workspace to determine which container should get the focus. This is because
the `set_focused_container()` function no longer automatically descends into
the focus stack to find the correct view to focus.
2016-07-31 21:25:40 -04:00
Tony Crisci b39249508f Refactor functions to update container borders
Replace `update_view_border()` with `update_container_border()`. The latter
should handle both the case where the container is a view or if the container
has children.
2016-07-31 20:32:40 -04:00
Tony Crisci f78d07d39b Implement focus handling for containers
The previous implementation of focus handling assumed that only views can be
focused. Containers can also be focused with a command like `focus parent` or
`focus child`.

Change `set_focused_container()` to handle the case of the given container
being a container with children and update borders accordingly.
2016-07-31 18:10:33 -04:00
Zandr Martin 53f6b1f3b0
document kill command 2016-07-31 08:54:15 -05:00
D.B 9977b01928 Update container geometry on layout switch
Deeply nested containers which had their layouts changed didn't update
their actual_geometry, this messed up their child containers. Those got
width and height of 0, which was then decreased for stacked/tabbed
containers by title height. Underflow ensued, these containers suddenly
had height 4294967273. In short, not updating actual_geometry didn't
play nicely with nested containers.
2016-07-31 10:22:18 +02:00
Zandr Martin 98aa59fdda
implement solid color rendering for swaybg 2016-07-30 18:50:13 -05:00
Zandr Martin e6af5f8bdb
Merge branch 'master' of git://github.com/SirCmpwn/sway into x11-pids 2016-07-30 08:44:21 -05:00
D.B c33e0ee629 revert border hiding to more recent version 2016-07-30 15:22:53 +02:00
D.B 8d0048c8d5 properly hide top border inside tabbed/stacked
When titlebar is hidden, top border of the topmost view inside
tabbed/stacked container will not be drawn. This is changed in layout.c

On the other hand, top border should be drawn sometimes, for example
when titlebar is hidden on a view that is not the topmost inside
tabbed/stacked container. This is changed in border.c
2016-07-30 15:12:34 +02:00
Zandr Martin c0683a0444
remove outdated (when wlc commit merged) comment 2016-07-29 20:20:14 -05:00
Zandr Martin d0a0d5e03c
update handler to get pid from wlc for all views 2016-07-29 16:40:38 -05:00
Drew DeVault 3f83968d30 Fix swaybg sizing on hidpi outputs 2016-07-29 09:14:26 -04:00
Drew DeVault 9b24af1c22 Document scale factor configuration in sway(5) 2016-07-29 08:00:23 -04:00
Drew DeVault 9661272224 Merge remote-tracking branch 'origin/hidpi' 2016-07-29 07:35:43 -04:00
Zandr Martin a3980d456d
third try for #678 2016-07-28 17:43:43 -05:00
Drew DeVault cad085ed9d Update IPC JSON responses for HiDPI setups 2016-07-28 14:42:39 -04:00
Drew DeVault 11e7ca044c Update hidpi support to latest wlc API 2016-07-28 14:36:49 -04:00
Drew DeVault 6ea02f3064 Initial pass on HiDPI support 2016-07-28 14:36:49 -04:00
Mykyta Holubakha cf8ef2aea2 Initialize client's subscribed events 2016-07-28 13:38:02 +00:00
Drew DeVault d07eaed79f Merge pull request #793 from thejan2009/workspace_layout_first_window_fix
bugfix: invisible windows on empty workspace with tabbed/stacked layout
2016-07-28 07:42:43 -04:00
Drew DeVault ee67c5bee3 Merge pull request #791 from acrisci/feature/focus-child
Implement `focus child` command
2016-07-28 07:26:37 -04:00
Drew DeVault d03266a77a Merge pull request #792 from acrisci/feature/render-focused-stack-children-focused
Render focused stack/tab children focused
2016-07-28 07:26:13 -04:00
D.B 33c1df38bd Close all focused container's child views on kill
Previously, cmd_kill only closed a focused view, while containers were
not affected. Now it closes all views that are children of the focused
container.
2016-07-28 10:31:18 +02:00
D.B a46cf77549 bugfix: windows on empty workspaces with layout tabbed/stacked would spawn with 0x0 geometry 2016-07-28 05:56:36 +02:00
Tony Crisci badfcf7c76 Render focused stack/tab children focused
Whenever a stacked or tabbed container has focused, paint the titlebars of all
its child windows to be focused as well to indicate the parent stack/tab
container has the focus.
2016-07-27 23:16:58 -04:00
Tony Crisci 88b7cbe314 Implement focus child command
The `focus child` command focuses the child container within the selected
container.
2016-07-27 22:48:46 -04:00
Tony Crisci 8a03f138bf bugfix: set focus to workspace of an output
In `move_focus()`, when given an output, set the focus to the workspace of that
output instead of the output itself.

This fixes a bug that did not allow users to switch between outputs introduced
in afc6ad6.

It also fixes other issues before that commit when a workspace with children
was selected and the user tried to switch focus in the direction of another
output.
2016-07-27 22:06:16 -04:00
Tony Crisci afc6ad6419 bugfix: cmd focus parent don't set focus above ws
In the `focus parent` command, do not set focus above the workspace level.
These containers are not meant to be focused.

This prevents a crash on repeated `focus parent` commands.
2016-07-27 21:30:45 -04:00
Tony Crisci 0d461ad988 Put ipc command result json in an array
For compatibility with i3, put the command result into an array.

Returning multiple command results is still unsupported.
2016-07-23 23:13:09 -04:00
D.B 80858c1f57 don't passthrough a floating_scroll event to focused window 2016-07-23 16:58:37 +02:00
Drew DeVault 643bd8f158 Merge pull request #779 from thejan2009/smart-gaps-outer
Hide outer gaps too when smart_gaps is on
2016-07-23 10:55:18 -04:00
D.B f16cb1464f properly hide bottom and right borders 2016-07-22 06:00:27 +02:00
Zandr Martin 3137615838
fix regression in hide_edge_borders 2016-07-21 21:15:46 -05:00
D.B d61b59cad1 outer gap 0 with smart_gaps on 2016-07-21 22:58:13 +02:00
D.B 03b0180c30 rename ws to workspace for clarity 2016-07-21 22:21:49 +02:00
D.B b893f07ce1 calculate borders for hiding from workspace geometry 2016-07-21 22:21:49 +02:00
Mykyta Holubakha a2bc6f3bfd Arrange backgrounds only when required 2016-07-21 22:47:35 +03:00
Mykyta Holubakha f022628a2e Handle transient_for 2016-07-21 21:53:36 +03:00
Mykyta Holubakha f52daa26c9 Unite describe_view and describe_window 2016-07-21 21:51:20 +03:00
Mykyta Holubakha e5c7b019ff Fix dispatching and assigning events 2016-07-21 21:51:20 +03:00
Mykyta Holubakha 2029fef6b8 More progress on window events 2016-07-21 21:51:20 +03:00
Mykyta Holubakha 976e48d79f Initial work on window events 2016-07-21 21:51:20 +03:00
Drew DeVault 095353d91d Remove arrange_windows from post-render
Fixes #741
2016-07-21 08:27:25 -04:00
minus 50b09937b2 clean up apply_input_config 2016-07-18 20:12:49 +02:00
Drew DeVault 5a1d95ac2a Move backgrounds to back after arrange_windows
Fixes #769
2016-07-18 09:12:48 -04:00
Drew DeVault c0e4522202 Merge pull request #764 from deklov/move-position-bug-02
Do not crash when handling the command 'move position'
2016-07-18 08:50:53 -04:00
D.B 5d250f3da6 Construct titles of nested tabbed/stacked containers from app_id instead of title 2016-07-18 12:35:50 +02:00
David Eklov d9eb49f3b1 Add missing entry to list of accepted arguments for the move command 2016-07-17 22:52:39 -05:00
David Eklov d202ca2fd7 Do not crash when handling the command 'move position'
Sway expected 'move position' to be 'move position mouse'. If mouse is not
present in the command, Sway crashes.
2016-07-17 22:50:15 -05:00
Drew DeVault 2530f952c9 Fix clang warning 2016-07-17 12:59:39 -04:00
Drew DeVault ff363aa7f7 Fix bug with views behind backgrounds on ws switch 2016-07-17 12:57:40 -04:00
Drew DeVault 6d971af5c3 Turn swaybg into a shell surface 2016-07-17 11:55:05 -04:00
Drew DeVault 3bb880bf20 Implement configurable wrapping on bar ws scroll 2016-07-17 11:26:38 -04:00
Drew DeVault a9767ad2f7 Allow users to customize the cursor on clients
This also sets the default size to 16 and documents all of the other
environment variables in use in sway(1).
2016-07-17 11:26:30 -04:00
Hummer12007 cf7c6c5822 Fix a memory leak 2016-07-17 00:00:51 +03:00
D.B ad7605675e refactor swayc_tabbed_stacked_parent into _ancestor and _parent and use where needed 2016-07-16 15:34:43 +02:00
David Eklov 5c4f52f953 Set panels' geometries correctly and don't render them explicitly
Panels were explicitly rendered by calling wlc_surface_render in
handle_output_pre_render. Calling wlc_surface_render does not set the
surface's geometry (like wlc_view_set_geometry does). Sway did not call
wlc_view_set_geometry for panels, so wlc defaulted their geometry to be at
the origin. This is not correct for bars unless their location is top.

Furthermore, for a surface to receive pointer events, its mask has to be
set to visible. This causes wlc to render these surfaces, causing panels
and backgrounds to be rendered twice.

This commit makes panels and surfaces visible, sets the correct geometries
and removes the code that explicitly rendered them.
2016-07-14 17:18:01 -05:00
David Eklov 4bb45abc46 Don't treat backgrounds as shell surfaces
This code had some issues. Remove it now so that we can start clean and fix
it later.
2016-07-14 17:15:31 -05:00
Mykyta Holubakha c503bf1342 Suspend destruction of wss when creating views 2016-07-15 00:22:53 +03:00
Mykyta Holubakha a2bb280172 Spawn new views to target ws's focused container 2016-07-15 00:22:53 +03:00
Mykyta Holubakha ea7917784d Fix build on x86 2016-07-12 09:43:48 +00:00
D.B ee67cd0ba1 Fix tabbed/stacked corner case #742
Tabbed/stacked containers are now created only if a view is present on
the workspace. If a view is created on previously empty tabbed/stacked
workspace, it gets wrapped in a container.
2016-07-07 22:28:57 +02:00
Zandr Martin c65d6e6e95
get_tree json fixes
- null pointer check against container names
- use actual json null values instead of "null" strings
- add "visible" property to all containers
2016-07-05 07:23:44 -05:00
David Eklov 51204b33c1 Enable backgrounds and panels to be shell surfaces
Prior to this commit all windows (e.g. shell surfaces) were handled the same
way in handle_view_created. Since backgrounds and panels have to be treated
differently, they could not be shell surfaces. This changes checks whether
a client is a background or a panel in handle_view_created and exists to
let them be dealt with elsewhere.
2016-07-04 21:58:07 -05:00
Zandr Martin 2f54057623
I think this fixes #678 2016-07-04 17:45:37 -05:00
Zandr Martin e07b8c8d7c Merge branch 'master' into get-tree-command 2016-07-04 13:53:49 -05:00
Zandr Martin f8a94f2f4b
fix typo in ipc-json.c 2016-07-04 13:46:19 -05:00
Zandr Martin 15a324b0d3
implement get_tree command 2016-07-04 13:34:44 -05:00
Zandr Martin d5e4fff345
resize command updates (#713) 2016-07-03 12:11:21 -05:00
Zandr Martin aced6daa19
match i3 syntax for resize set 2016-07-03 07:05:10 -05:00
Drew DeVault 7144fb9fc3 Spawn windows as floating if they have a parent
Fixes #604
2016-06-30 08:30:03 -04:00
David Eklov 26842ff383 Add get_log_level() to encapsulate v (current log level)
This patch also makes all global variable in log.c static.
2016-06-27 18:56:50 -05:00
Mykyta Holubakha bfdda1505e Check if found ws is focused in new view handler
Fixes #714, by preventing change of focus from a window to the whole ws
2016-06-21 20:38:06 +03:00
Drew DeVault 71f710cf0f Minor fix to warning messages 2016-06-19 10:01:15 -04:00
Hummer12007 7870a197fc Added a null check in tabbed_stacked_parent
This fixes a segfault, when trying to get parent of the workspace/root container/(?), as it is not assuered that the view's parent node is not null in the loop
2016-06-18 20:40:39 +03:00
Zandr Martin a6f4bf60f2 Merge branch 'master' into set-size-command 2016-06-11 17:10:38 -05:00
Zandr Martin 889618d3ee
implement resize command for absolute dimensions 2016-06-11 17:02:16 -05:00
Zandr Martin 9ecb43ea3b
couple small fixes 2016-06-11 15:29:04 -05:00
Zandr Martin 2298143d09
cleanup + add timeouts for pid_workspace list 2016-06-11 12:43:34 -05:00
Zandr Martin 66caee645c Merge branch 'master' into assign-command 2016-06-11 09:33:24 -05:00
Zandr Martin beaa03344e
clean up pid/workspace stuff 2016-06-11 09:20:09 -05:00
Drew DeVault cb0cc32265 Many improvements to man pages 2016-06-10 09:32:14 -04:00
Zandr Martin b00feb25ea
trigger bg change on config reload 2016-06-10 07:12:25 -05:00
Zandr Martin 03d79b41c7
semi-working (only non-client/server wayland apps) 2016-06-10 06:08:59 -05:00
thuck 3710cd6963 Fix segfault when using include with *
This should fix the issue #681
2016-06-06 22:20:27 +02:00
Zandr Martin 0f1859ed25 messy, unfinished version 2016-06-06 06:58:53 -05:00
Denis Doria cdd8664198 Merge branch 'master' into variables_corner_cases 2016-06-06 09:17:01 +02:00
Roosembert Palacios 230591fa4e
Common: Readline: Ignore newline on '\' escaped line ends.
Escape line return when reading from a file with the '\' character.
Similar to shell scripts.

Signed-off-by: Roosembert Palacios <roosembert.palacios@epfl.ch>
2016-06-06 00:17:27 +02:00
Roosembert Palacios e8c0ef98b1
Sway: Configuration: Support for escaping line breaks.
Escape line return in configuration file with the '\' character. Similar
to shell scripts.

Signed-off-by: Roosembert Palacios <roosembert.palacios@epfl.ch>
2016-06-05 23:36:27 +02:00
Zandr Martin d4eb964fd1 document assign command 2016-06-05 09:03:13 -05:00
Denis Doria 3c3e98b1a3 Merge branch 'master' into variables_corner_cases 2016-06-05 07:49:33 +02:00
Drew DeVault fdefd17391 Merge pull request #695 from zandrmartin/document-client-commands
add documentation for client commands
2016-06-04 12:08:17 -04:00
Zandr Martin 3746542462 add documentation for client commands 2016-06-04 10:43:23 -05:00
wdbw 4f9af09f23 Add missing layout modes in sway(5) 2016-06-04 17:20:27 +02:00
Denis Doria 29eb3bf746 Put w to uppercase just to keep consistency between warnings 2016-06-03 11:28:10 +02:00
Denis Doria bf2298e0a5 Includes $ for variables without it 2016-06-03 11:26:47 +02:00
thuck f55b5a4982 Fix identation issue 2016-06-03 00:36:41 +02:00
thuck 431013db72 Merge branch 'master' of https://github.com/SirCmpwn/sway into variables_corner_cases 2016-06-03 00:19:26 +02:00
thuck e4f80877be Fix output command when varible not set
This should fix the corner case where a variable is not assigned, but used anyway.
This should solve partially the issue #681.
2016-06-03 00:05:10 +02:00
thuck 1ab3e1023e Including error message when variable do not start with $ 2016-06-02 23:23:04 +02:00
Zandr Martin 9ccc92705e implement stable sort for lists
also change sort_workspaces() to use it
2016-06-02 15:48:14 -05:00
Denis Doria 2256a9b784 Sync master
Merge branch 'master' of https://github.com/SirCmpwn/sway into floating_size_conf
2016-06-02 17:36:51 +02:00
Denis Doria b692a6d31a Initial implementation for floating_maximum_size 2016-06-02 17:35:02 +02:00