Commit graph

146 commits

Author SHA1 Message Date
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
Mikkel Oscar Lyderik ec7ff769c7 Tabbed and stacked layout 2016-04-25 00:00:49 +02:00
Mikkel Oscar Lyderik f39034a55f Use correct format string for x86_64 and i686
Fix #587
2016-04-17 16:51:33 +02:00
Chang Liu 91d2a505b2 Plug two memory leaks
Plug two memory leaks introduced in the border drawing code.
2016-04-12 12:35:50 +12:00
Mikkel Oscar Lyderik cfea40dce3 Don't init desired width/height on new_view
When creating a new view, wlc usually returns an initial geometry with
size 1x1. Setting those values as desired width/height causes a problem
for some windows (QT5) because they don't request a new geometry for
instance when made floating, so the floating window becomes 1x1.

To fix this problem we can just omit setting the desired width/height on
new_view and instead let the clients request a certain size if they feel
like it. e.i. gnome-calculator.

Fix #578
2016-04-09 23:20:26 +02:00
Eric Engestrom 3e8081514d Fix spelling mistakes 2016-04-02 16:00:05 +01:00
Mikkel Oscar Lyderik 258e31ccdf Fix pointer related crash when stacked/tabbed
Fix #564
2016-03-31 16:39:42 +02:00
Mikkel Oscar Lyderik 7be476c115 Add cmds new_window and new_float
Makes it possible to set default layout style for new windows and new
floating windows.

Close #556
2016-03-31 12:42:20 +02:00
Mikkel Oscar Lyderik 5a13cb0ed1 Implement borders
The borders are implemented as a surface/buffer attached to each view
which is sent to and rendered by wlc in the view_pre_render callback.

All the drawing logic is handled in sway/border.c and all the logic for
calculating the geometry of the border/view is handled in
`update_geometry` in sway/layout.c (same place as gaps are calculated).
2016-03-30 00:47:58 +02:00
Drew DeVault b903f7f655 Implement some more on borders
Note that this segfaults ALL THE TIME in wlc code. Paging @Cloudef for
help, I'm at a loss.
2016-03-30 00:47:58 +02:00
Mikkel Oscar Lyderik 2935e24cf5 Implement 'smart_gaps' feature from i3-gaps 2016-03-20 12:29:47 +01:00
Mikkel Oscar Lyderik 8ddafeeaae Fix assigning workspaces to outputs
It's possible to assign workspaces to certain outputs using the command:

    workspace <name> output <output>

However, this did not work in some cases where the workspace was
assigned before the given output was made available to sway.

This patch fixes those cases.
2016-03-04 16:44:49 +01:00
Mikkel Oscar Lyderik bad4e22f3b Make sway spawn only one bar per bar config 2016-02-27 22:12:35 +01:00
Mikkel Oscar Lyderik ee32bc3aef Send workspace ICP event on ws destroy/empty.
There is no 'destroy' change type in the i3 IPC so this uses `empty` to
notify about empty workspaces (which will be destroyed from sway right
after).
2016-02-25 12:59:22 +01:00
Mikkel Oscar Lyderik 016a77424a Prefer named output config over wildcard config.
This makes sure that a named output config is applied before the
general wildcard config when a new output is created. This ensures that
the config:

    output * ...
    output NAME ...

behaves the same way as:

    output NAME ...
    output * ...
2016-02-12 13:45:47 +01:00
Mikkel Oscar Lyderik fa0526f3df Fix rendering of view when moving to new workspace
This is a possible fix for #384.

To be honest I don't fully understand why this bug is happening, but I
have narrowed it down to the view stack in wlc and how sway orders views
in very specific situations (those described in #384).

Anyway this should fix the problem by eliminating the call to
`wlc_view_bring_to_front` which isn't really needed anyway since sending
all invisible views to the back is the same as bringing all visible
views to the front (rotating the view stack).
2016-01-21 22:28:26 +01:00