Commit Graph

53 Commits

Author SHA1 Message Date
Mike Blumenkrantz c597ed69fd prevent leak on tiling insert failure
CID 1379940
2017-08-25 14:47:10 -04:00
Marcel Hollerbach de21e6ddb8 tiling: fix insertion in the tree
the problem here was that in the initial case the function got the
previous state of the tree wrong, so the insertion of a second client
ended up in a unpossible state of the tree, this should not happen
anymore now.

The insertion is now also way more stable, since in a errorcase the
client is not just not placed in the tree but associated with a window
tree, its just not placing the client in the window tree at all.
2017-08-12 22:30:33 +02:00
Marcel Hollerbach f1fb4a0c83 tiling: only use the insert function
this brings all possible bugs due to insertion to one single function
2017-08-12 22:30:33 +02:00
Marcel Hollerbach 1277ef9747 tiling: drop move requests from tiled clients 2017-03-10 21:44:08 +01:00
Marcel Hollerbach 44b5aec991 tiling: refactor the window tree
there are two functions to insert a client, they should perform the same
operations on the parameters.
2017-03-09 19:31:56 +01:00
Marcel Hollerbach 35e729f941 tiling: make windows placable by dragging them arround
If someone starts to drag a client arround, then the client will shrink
into a icon, that now is always at the position of the mouse cursor, if
the drag ends, the client will be placed in the client currently below
it. The client will be placed in a place where the mouse cursor was
currently closer to.
2017-03-09 13:59:48 +01:00
Marcel Hollerbach fe50e1edf0 tiling: do not pass parent as relative
otherwise the client does not get into the list of parent
2017-03-04 09:19:47 +01:00
Marcel Hollerbach fa0d585aa5 tiling: insert a client in the place where it is currently placed
With this patch we are inserting a client in the tiling tree where it is
currently placed in floating mode.
2017-02-25 17:02:06 +01:00
Carsten Haitzler 898a057509 tiling module - fix some warnings with casts and alignment
alignment warnings are anal and seem to not like casting allocated
structs nicely ... but they are noise that hides real issues, so
silence these as these casts/ptrs are ok after inspection.
2017-02-12 16:25:35 +09:00
Carsten Haitzler 3903d44666 e - BLOODY BUILD AGAIN - DAMN FLOAT WARNINGS...
i swear ... all of this shit over a warning that CAUSED more bugs than
it eveer fixed? sersiously...

ARGH!
2017-01-07 14:05:17 +09:00
Mike Blumenkrantz 0bbdd76469 resolve misc module float-equal warnings
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
2017-01-06 12:57:34 -05:00
Mike Blumenkrantz 6f1f165d32 resolve certain double/float comparisons in with increased correctness
ref 03d0f1d2dc

Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
2017-01-06 12:57:28 -05:00
Carsten Haitzler 03d0f1d2dc e - fix float warnings cmp where they actually may cause issues 2016-12-28 19:55:20 +09:00
Marcel Hollerbach 8f85fe79df Tiling: Fixed break out method
Summary:
This fixes the case when par is NULL, this means we should insert a
parent node between the 2 nodes and root. (T1790)

Example:

Each Number is a Window,

12
Focus on 2

Press Win+Up should end up in this:

2
1

This patch also makes the bahavior for 2 windows more
consistent

12
Focus on 2

Pressing Win+Right,

21

It Will just swap the nodes,

This is the same behavior then in higher levels.

Reviewers: tasn

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1643
2014-11-25 12:32:43 +00:00
Carsten Haitzler 9d5483963a e - tiling module - silence warning (real possibility of an issue)
grand_parent couldbe used in an uninitialized state - this is right.
it'd be garbage (not NULL). set to NULL always to be safe
2014-11-25 17:11:18 +09:00
Tom Hacohen c702763df7 Tiling: Fix up previous tiling commit (make it safer).
This is the second time recently I forgot to merge commits. :(
2014-11-03 14:45:03 +00:00
Marcel Hollerbach ca1a531c78 tiling: Fix issue with window-moving and windows not breaking out.
Summary:
The module is now working like it is described in T1773.

What the patch really does:
If a join request can not be done cause there is no node in the
direction to join, the join will try to break out the node into the
grand-grand-parent, this means a node can break out of his parent
without walking done each parent.

Issue as described in the original ticket:
Each number represents a different window:

122
134
155

Focus on 3, press Win+Left

I'd expect it to become:
132
134
135

But instead, nothing happens.

Fixes T1773

Reviewers: tasn

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1632
2014-11-03 14:35:46 +00:00
Tom Hacohen d8b473b5c3 tiling: fix coding conventions and style.
Should have been squashed into the previous commit. :(
Anyhow, this fixes conventions and some potentially
dangerous style choices.
2014-10-29 08:25:04 +00:00
Marcel Hollerbach 4c0f0c638f tiling: Implemented tiling window position manipulation
Summary:
This implements the possibility to "break out" a node in the tree which
means that the node will be appended or prependen to the parent in the
grandparent.

The other function "joins" the node to the node before or after.
Basically it will be added as a child, and if necessarry the client
of this node will be added in a new Window Tree and also added as a child.

With the new actions you can move the focused window right/left/up/down
with keybindings.

If the window will "break out" or "join" depends on the parent split type.

Sample:
1|4|6
2|4|6
3|5|6

(Same Number means same Window)

1 is focused.
Left Key is pressed.

1 is in a vertical split so the window will "break out".
Result:
2|1|4|6
2|1|5|6

Now another key:
Down Key is pressed.

1 is in a vertical split so the window will "join".
Result:
1|2|4|6
3 3|5|6

@feature

Fixes T1350

Reviewers: tasn

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D1382
2014-10-29 08:15:19 +00:00
Tom Hacohen 37462c7cb7 Tiling: Respect min size hints (set to floating if doesn't fit).
This fix floats all the windows that don't fit because of their min size
restrictions.
It can be made better, at the moment it is very simple. An example
broken case would be the following:
Assume we have 3 windows, A, B and C.
B and C both hand a min width of half the screen.

First we create A, then B. Everything works as they share the screen,
but when we add C, both B's and C's restrictions "fail" so they are both
set to float although in reality, floating C is enough. This can be
fixed by doing a live scan of the tree every time a window is floated,
though it's not essential at the moment.

Fixes T952.
2014-08-28 16:33:54 +01:00
Mike Blumenkrantz a4619ea492 tiling should not resize deleted clients 2014-07-19 15:47:21 -04:00
Marcel Hollerbach b0f9480eee tiling: this should fix swapping the windows with padding!
Summary: add the padding to the if clause

Test Plan: Set a padding and press WIN+Arrow keys

Reviewers: tasn

Reviewed By: tasn

CC: cedric

Differential Revision: https://phab.enlightenment.org/D1117
2014-07-03 20:38:33 +01:00
Mike Blumenkrantz 360707e9b1 fix tiling memory corruption
CID 1186206
2014-04-04 15:04:28 -04:00
Stefan Schmidt 22278399d3 tiling: Free allocated memory on error path.
We don't use new_node in this code path. Free before returning.

CID 1186205
2014-03-27 16:06:06 +01:00
Tom Hacohen 0831537efa Tiling2: When adding clients, add them relative to the current one.
This fixes clients to be added relative to the current one, and not at
the end of the current children list.

This fixes T944.
2014-02-21 09:15:17 +00:00
Tom Hacohen f4a7b6512a Tiling2: Fixed formattign, again.
Fixes T919.
2014-02-21 09:15:10 +00:00
Tom Hacohen d83e18f21e Tiling2: Implemented window padding.
Thanks to cippp for the feature request + some code.
2014-02-21 09:15:10 +00:00
Tom Hacohen ee587a37b0 Tiling2: Fixed coding conventions using efl_indent. 2014-02-21 09:15:09 +00:00
Tom Hacohen 792022196f Tiling2: Add "floating" as a split mode.
This lets people just create floating windows, without the need to toggle.
2014-02-21 09:15:09 +00:00
Tom Hacohen 1e3f71af71 Tiling2: Fixed adjacent node swapping.
Really swap adjacent nodes, not just nodes having a border on the
same line, but never touching.
Also, it's now weighted, so the best matching node will be chosen, not
the first matching.
2014-02-21 09:15:08 +00:00
Tom Hacohen 507a6db1e1 Tiling2: Improve debug output in tree dump. 2014-02-21 09:15:08 +00:00
Tom Hacohen 163c6377b3 Tiling2: Added weight correction code.
Total weight should always be 1.0.
This may go off sometimes because of the nature of floating point.
Always correct it when reapply tree.
2014-02-21 09:15:07 +00:00
Tom Hacohen 6795380282 Tiling2: Added support for swapping windows. 2014-02-21 09:15:07 +00:00
Tom Hacohen 6fb54d58ac Tiling2: Fixed a bug in the tree walker. 2014-02-21 09:15:07 +00:00
Tom Hacohen b5434d1de5 Tiling2: Restrict allowed resizes of windows. 2014-02-21 09:15:07 +00:00
Tom Hacohen ae8acb24b2 Tiling2: Fixed resizing of clients at "forbidden" borders.
For example, leftmost window's left border.
2014-02-21 09:15:07 +00:00
Tom Hacohen ceb1cc414e Tiling2: Better handle parent == NULL case. 2014-02-21 09:15:07 +00:00
Tom Hacohen 4b2a53d1d4 Tiling2: Fix a bug with reordering of windows in some cases. 2014-02-21 09:15:06 +00:00
Tom Hacohen 6b606cde41 Tiling2: Added resizing support.
There are still some bugs.
2014-02-21 09:15:06 +00:00
Tom Hacohen 8dd65b90f3 Tiling2: Create a move/resize function that will update extra. 2014-02-21 09:15:06 +00:00
Tom Hacohen 592dfb9dd2 Tiling2: Fixed buy with deleting last vertical split. 2014-02-21 09:15:06 +00:00
Tom Hacohen e9779f70bf Tiling2: Bug fixing. Things seem to work now. 2014-02-21 09:15:06 +00:00
Tom Hacohen 1a2ffcd06e Tiling2: Changed add to return new root and fixed top-level vertical. 2014-02-21 09:15:06 +00:00
Tom Hacohen 1114b54c71 Tiling2: Added a useful debugging function. 2014-02-21 09:15:06 +00:00
Tom Hacohen 0c5afecfc9 Tiling2: More bug fixing. 2014-02-21 09:15:06 +00:00
Tom Hacohen f7f204353d Tiling2: Handle more delete cases. 2014-02-21 09:15:06 +00:00
Tom Hacohen 38e13e2648 Tiling2: Fixed a few bugs. 2014-02-21 09:15:06 +00:00
Tom Hacohen 21ac77185b Tiling2: Get rid of split_type, use levels instead and bug fixes. 2014-02-21 09:15:06 +00:00
Tom Hacohen f64763ab6e Tiling2: Fixed tree update bugs. 2014-02-21 09:15:05 +00:00
Tom Hacohen 9831904a88 Tiling2: Fixed a bug in tree-walker. 2014-02-21 09:15:05 +00:00