Commit graph

161 commits

Author SHA1 Message Date
Drew DeVault
0ba6554c4f Move sway's internal tree code to sway/tree/ 2017-11-11 11:00:18 -05:00
Drew DeVault
a82aa2a20d Fix use-after free introduced by cbe7364 2017-10-09 12:04:06 -04:00
Drew DeVault
5ecedc7199 Remove destroyed views from scratchpad
Fixes #1363
2017-10-08 10:57:41 -04:00
Calvin Lee
3c93e2cf1b Prevent race condition in the kill command
When killing views with `close_views` a use-after-free can sometimes
occur because parent views are killed before their children. This commit
makes `container_map` run functions on child containers before their
parent, fixing the race.

Fixes #1302
2017-08-06 16:56:39 +02:00
Scott Anderson
c29e5bbde8 Use WLC v2 pointer interface 2017-07-12 16:39:14 +12:00
Drew DeVault
76fcfa1e7f Force focus on unmanaged views during pointer test 2017-06-14 18:13:41 -04:00
Calvin Lee
2445d27960 Impliment i3-style marks
This commit adds three commands to sway: `show_marks`, `mark` and
`unmark`. Marks are displayed right-aligned in the window border as i3
does. Marks may be found using criteria.

Fixes #1007
2017-04-03 11:48:37 -06:00
Jarkko Oranen
d7350915d9 The default layout of a workspace should follow the output
Hardcoding it to L_HORIZ does not make sense to me,
as you get the unexpected behaviour that windows will be
arranged horizontally until you switch the layout.
2017-03-19 16:57:05 +02:00
Drew DeVault
9aed9d9359 UnGNUify the codebase 2017-03-10 23:41:24 -05:00
Drew DeVault
74d4f1bec9 Further indentation corrections 2017-03-10 21:41:14 -05:00
Zandr Martin
c6f971d108
use absolute view geometry to calculate position 2017-02-14 14:03:56 -05:00
Mykyta Holubakha
e714fbcbec Add window instance support 2017-01-19 03:14:59 +02:00
wil
063c79874a Indent cleanups 2017-01-08 14:49:47 +01:00
wil
a0aa8d9780 cleanup in auto layouts
- added L_AUTO_FIRST/LAST instead of using explicit layouts.
- when switching between auto layout that don't share the same major axis, invert the
  width/height of their child views to preserve their relative proportions.
2016-12-29 20:31:30 +01:00
wil
97f7d47413 Added Awesome/Monad type "auto" layouts 2016-12-29 20:31:30 +01:00
Nicolas Cornu
0f0bbbff4d Put floating views in center, fallback on top left
Sometimes views are created before we got its size
2016-12-18 10:43:10 +01:00
Drew DeVault
10c8b73075 Handle calloc failures 2016-12-15 19:01:41 -05:00
Drew DeVault
a2b9149656 Add remaining sway allocation failure handling 2016-12-15 19:01:41 -05:00
D.B
35b8d185ac fix layout switching (was broken because of workspace_layout)
For workspace containers, swayc_change_layout also changes ->layout alongside
->workspace_layout when it's a sensible thing to do. There is an additional test
for 'layout toggle' command which ensures that containers will be tiled
horizontally after toggling from tabbed or stacked.
2016-12-04 08:31:34 -05:00
D.B
6fb4b6737a add workspace_layout to container
Add swayc_change_layout function, which changes either layout or
workspace_layout, depending on the container type.
2016-12-04 08:31:34 -05:00
Drew DeVault
56a7e5fbce Revert "Merge pull request #952 from SirCmpwn/revert-948-floating-titlebar-click"
This reverts commit 857eea8b63, reversing
changes made to ce713efcd2.
2016-10-12 21:54:19 -04:00
Drew DeVault
4cba91803e Revert "Fixes dealing with workspace_layout and related bugs [rfc]" 2016-10-12 21:26:06 -04:00
Drew DeVault
f30f60dad8 Revert "also check floating cons in container_find" 2016-10-12 12:19:02 -04:00
Drew DeVault
ce713efcd2 Merge pull request #945 from thejan2009/workspace_layout
Fixes dealing with workspace_layout and related bugs [rfc]
2016-10-11 08:24:38 -04:00
D.B
571321a1d8 add workspace_layout, ensure ws is always L_HORIZ
Add swayc_change_layout function, which changes either layout or
workspace_layout, depending on the container type. Workspace being
always L_HORIZ makes this much more i3-compatible.
2016-10-11 09:16:59 +02:00
D.B
24c3b86065 also check floating cons in container_find 2016-10-11 06:22:54 +02:00
Nicolas Cornu
37065cd0c4 add click on title_bar to focus a container 2016-10-06 20:23:46 +02:00
Zandr Martin
7d947fdb95
add unique IDs to containers 2016-09-21 21:05:09 -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
Drew DeVault
416417a54c Reorganize includes 2016-09-01 08:18:37 -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
D.B
d61b59cad1 outer gap 0 with smart_gaps on 2016-07-21 22:58:13 +02: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
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
15a324b0d3
implement get_tree command 2016-07-04 13:34:44 -05: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
Denis Doria
b692a6d31a Initial implementation for floating_maximum_size 2016-06-02 17:35:02 +02:00
Denis Doria
f1d5b89d3e Initial work for floating view with sane values 2016-05-31 14:59:33 +02:00
Zandr Martin
d291a29f30 enforce workspace output assignents
when creating a new output, move to that output all extant workspaces
that are assigned to that output.

(unrelated) remove comment that was no longer applicable, fix spacing in
an assignment
2016-05-28 18:18:46 -05:00
Zandr Martin
c6c3a8e758 Implement sort_workspaces() function for outputs.
This seems to have resolved issue #669 for me.
2016-05-27 17:37:56 -05:00
Drew DeVault
5b0af661b0 Revert "sway/container.c: fix segfault where view is assigned prematurely" 2016-05-14 14:34:25 +00:00
Daniel Lockyer
2fb4e5401c sway/container.c: fix segfault where view is assigned prematurely 2016-05-09 17:41:26 +01:00
Mikkel Oscar Lyderik
856ac7d5cc Remove unused function 2016-04-25 00:00:49 +02:00
Mikkel Oscar Lyderik
5a22c0f1c0 Don't send invisble view to back 2016-04-25 00:00:49 +02:00
Mikkel Oscar Lyderik
5492277f0c Disable inner gaps when in tabbed/stacked mode 2016-04-25 00:00:49 +02:00
Mikkel Oscar Lyderik
3e1f78ab26 Add support for nested tabbed/stacked containers 2016-04-25 00:00:49 +02:00
Mikkel Oscar Lyderik
e226b20bd8 Reapply prev layout when exiting tabbed/stacked 2016-04-25 00:00:49 +02:00
Mikkel Oscar Lyderik
d26658fb35 Correctly determine default layout 2016-04-25 00:00:49 +02:00
Mikkel Oscar Lyderik
8d700fe008 Fix problems with floating windows
Makes any tabbed/stacked layout a container to separate from floating
windows which may be attached to a workspace.
2016-04-25 00:00:49 +02:00