Commit graph

132 commits

Author SHA1 Message Date
S. Christoffer Eliesen 6750975b9f arrange_windows_r: Round pixels to match reality, fixes calculations.
If the width or height of a container can't be evenly distributed to its
children, then the layout algorithm still thought it got it right (due
to using decimals) which caused a gap of one or more pixels for some
window arrangements.

This is fixed by this patch by first rounding off the width and height
(so that decimals are never introduced) and then adjusting the last
view in a container to fill the remaining pixels (which now is counted
correctly due to the decimals being removed).

Also, due to the way gaps are implemented, an odd sized gap can never be
aligned properly, so just adjust to closest even number.
2015-12-28 14:58:17 +01:00
S. Christoffer Eliesen 831f6680f4 arrange_windows_r: Bring parent coordinates into layout calculations.
This brings consistency into the algorithm (instead of resetting and
then fetching again).
2015-12-28 01:14:48 +01:00
Mikkel Oscar Lyderik cf64000e21 Focus new sibling added to container
This makes sure that the window being added to a container gets focus.
2015-12-25 22:32:42 +01:00
Mikkel Oscar Lyderik 5d07c61330 Trigger workspace init event (floating)
Triggers workspace init event when moving a floating window to a new
workspace.

This is a follow up on #391 which didn't handle floating windows.
2015-12-25 18:02:12 +01:00
Mikkel Oscar Lyderik 50b04884b6 Trigger ipc_event_workspace in all cases
This makes sure that the workspace IPC event is triggered when needed.

Fixes #382 while making sure that the IPC event is only triggered once.
2015-12-21 23:07:52 +01:00
S. Christoffer Eliesen f4b9c3856a layout: Fix edge_gaps off with top/left panels.
Since x/y won't be zero when there's a top or left panel in place, we
need to take those coordinates into account too.
2015-12-20 21:23:20 +01:00
S. Christoffer Eliesen e45fd9b6c5 extensions: Track panels by wl_resource, position per panel.
Track each panel separately via its wl_resource. `set_panel_position`
might be called before `set_panel`, so reuse panel config.

Place the position in panel_config so that each panel has its own
position.
2015-12-20 12:54:34 +01:00
S. Christoffer Eliesen f0b3ee6d84 layout: arrange_windows: Partially fix swaybar irregularties. 2015-12-18 23:53:42 +01:00
S. Christoffer Eliesen 0ad5059b6f layout: arrange_windows: Fix/better debug output. 2015-12-18 23:53:42 +01:00
S. Christoffer Eliesen ed730db11b layout: Keep output at the correct size, workspace can be smaller.
If the output is not at the correct size then that info must be queried
from wlc. The output size is used by e.g. seamless mouse to detect
output edges.

With this patch the output size is now correct and the workspace size is
adjusted according to any panels.

Without this patch seamless mouse would fail to detect outputs
above/below each other if there was a panel in between because the
output would offically end where the panel started, not at the actual
screen edge.
2015-12-18 14:03:11 +01:00
Drew DeVault f6da4dda4b Bring unmanaged windows to front on output arrange
Fixes #312
2015-12-16 19:20:34 -05:00
Mikkel Oscar Lyderik 3891a7c73f Don't reset x,y position before use.
The x and y position is calculated based on the position of the bar, we
don't want to reset these values when we need them.
2015-12-13 22:49:58 +01:00
Drew DeVault 2f89b7084d Correctly handle moving between fullscreen views
If focus would move in an output with a fullscreen view, it always
leaves the output. If focus would enter an output with a fullscreen
view, it always focuses the fullscreened view.
2015-12-13 08:18:12 -05:00
Drew DeVault 6655534feb Fullscreen on top of bar 2015-12-13 07:52:57 -05:00
Drew DeVault ef91764bc7 Fix output adjustment for panels 2015-11-29 13:59:12 -05:00
Drew DeVault e59cffcea2 Support desktop shell panels in compositor 2015-11-29 12:03:13 -05:00
S. Christoffer Eliesen e31a899841 layout: get_swayc_in_direction_under: Handle floating views. 2015-11-24 21:34:41 +01:00
S. Christoffer Eliesen b5ddad4bf6 layout: swap_container: Handle floating views. 2015-11-24 21:34:41 +01:00
S. Christoffer Eliesen ed1b0bffbc layout: replace_child: Handle floating views. 2015-11-24 21:34:41 +01:00
S. Christoffer Eliesen 8aef255d5f layout: add_sibling: Handle floating views properly.
This should fix #241.
2015-11-24 21:34:24 +01:00
S. Christoffer Eliesen 236f26f62e output: Support multiple adjacent outputs.
When querying for an adjacent output we now need an absolute position in
order to know which adjacent output that matches. (The position is
either the current mouse position or the center of the currently focused
container, depending on context.)

If two outputs have one edge each that at least partially align with
each other they now count as adjacent.

Seamless mouse is affected by this and now properly moves and positions
itself between outputs with "uneven" placement (as long as they have at
least some part of the edge adjacent to each other).

When focusing or moving a container in a specified direction the center
of the current focused container decides where to look for an adjacent
output. So if e.g. an output has two adjacent outputs to the right and a
"focus right" command is issued then it's the placement of the currently
focused container that decides which output actually gets focused.

Also, if an output has at least one output adjacent in some direction
but the entire edge is not covered (ie. it has "holes" with no outputs),
then the algorithm will choose the output that is closest to the
currently focused container (this does not apply to seamless mouse, the
pointer will just stop at the edge in that case).
2015-11-16 21:32:18 +01:00
Drew DeVault 250097d32b Fix gaps for views being incorrect 2015-11-12 08:02:39 -05:00
S. Christoffer Eliesen abc5fbfaec Learn "gaps edge_gaps <on|off|toggle>".
When yes, the old behaviour of adding half the inner gap around each
view is used.

When no, don't add any gap when an edge of the view aligns with the
workspace. The result is inner gap only between views, not against the
workspace edge.

The algorithm is not perfect because it means the extra space is
distributed amongst edge-aligned views only, but it's simple, looks good
and it works.
2015-11-04 13:21:10 +01:00
S. Christoffer Eliesen af31a3f04a commands: Learn 'move workspace to output <direction|name>'. 2015-11-03 22:38:53 +01:00
S. Christoffer Eliesen 3c250e78be layout: get_swayc_in_direction: Properly find adjacent outputs. 2015-10-29 16:20:48 +01:00
S. Christoffer Eliesen fede354a3d layout: Don't reset container size if it's a floating window. 2015-10-28 20:06:48 +01:00
S. Christoffer Eliesen 5a70853253 log: Add swayc_log, use at a few key places.
swayc_log works just like sway_log, but appends type and name from given
container to the log output.
2015-10-25 13:14:28 +01:00
taiyu 4944996170 Merge branch 'master' of https://github.com/taiyu-len/sway
merge
2015-09-22 09:41:32 -07:00
taiyu 6c33f8122a #184 2015-09-22 09:41:01 -07:00
taiyu 9fd2d635a1 container_move check 2015-09-18 11:34:57 -07:00
taiyu 0de29d8247 prevent views from disappearing 2015-09-07 15:22:15 -07:00
taiyu dbeca88dee default gap value 2015-09-04 16:14:59 -07:00
taiyu 79da7f112a #151 fix 2015-08-29 06:51:37 -07:00
Luminarys 167409702f Fixed move scratchpad and added in scratchpad show 2015-08-29 00:33:33 -05:00
Luminarys 7eefecf479 Added in scratchpad adding 2015-08-28 23:39:12 -05:00
taiyu 63e735270c move v3 2015-08-28 19:35:29 -07:00
taiyu 28c22c8f80 style 2015-08-28 11:14:59 -07:00
taiyu c9de300888 layout fix for a certain case 2015-08-28 11:11:26 -07:00
taiyu 076cf78d7c dont move floating contaienrs 2015-08-28 11:04:58 -07:00
taiyu 1820b3f0bb move function redone 2015-08-28 11:03:10 -07:00
taiyu 5678d824e4 update visibility + container info functions 2015-08-27 23:18:28 -07:00
taiyu 4df64127e9 slight fix 2015-08-26 16:50:47 -07:00
taiyu 274e56a602 fixed move_container bug, log prints before aborting 2015-08-26 16:27:01 -07:00
taiyu 357af228d6 some function documentation, fixed gaps on config reload 2015-08-26 13:35:22 -07:00
taiyu 1fa7a91bfb move_container_to fixup 2015-08-26 11:01:26 -07:00
taiyu 225c2fbe5b fixed segfault on exit + a little fixup of that floatfocus pr 2015-08-25 13:29:33 -07:00
minus 03e4a97dbe added "move container to workspace"
makes the previous commit actually testable
2015-08-25 18:25:36 +02:00
taiyu dbad30a409 add limit to swayc_in_direction 2015-08-24 01:11:21 -07:00
taiyu 51ab3c9180 merge 2015-08-23 12:34:18 -07:00
taiyu f53ce887e8 fixed container resize oddity 2015-08-22 22:14:59 -07:00