Bugfix: Correctly fix the percent values for resizing when making a floating con tiling (Thanks mseed) (+testcase)
This commit is contained in:
parent
b595ff05c5
commit
33c2b4e582
|
@ -164,11 +164,8 @@ void floating_disable(Con *con, bool automatic) {
|
||||||
con->parent = focused;
|
con->parent = focused;
|
||||||
else con->parent = focused->parent;
|
else con->parent = focused->parent;
|
||||||
|
|
||||||
/* XXX: We adjust the percentage value to start with a fair value. Floating
|
/* con_fix_percent will adjust the percent value */
|
||||||
* cons always have 1.0 as percent which doesn’t work so well when
|
con->percent = 0.0;
|
||||||
* re-inserting (the formerly floating con would get 50% of the target
|
|
||||||
* con). */
|
|
||||||
con->percent = (1.0 / con_num_children(con->parent));
|
|
||||||
|
|
||||||
TAILQ_INSERT_TAIL(&(con->parent->nodes_head), con, nodes);
|
TAILQ_INSERT_TAIL(&(con->parent->nodes_head), con, nodes);
|
||||||
TAILQ_INSERT_TAIL(&(con->parent->focus_head), con, focused);
|
TAILQ_INSERT_TAIL(&(con->parent->focus_head), con, focused);
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
#!perl
|
||||||
|
# vim:ts=4:sw=4:expandtab
|
||||||
|
#
|
||||||
|
# Regression test for setting a window to floating, tiling and opening a new window
|
||||||
|
#
|
||||||
|
use Time::HiRes qw(sleep);
|
||||||
|
use i3test;
|
||||||
|
|
||||||
|
my $tmp = get_unused_workspace;
|
||||||
|
cmd "workspace $tmp";
|
||||||
|
|
||||||
|
|
||||||
|
cmd 'open';
|
||||||
|
cmd 'mode toggle';
|
||||||
|
cmd 'mode toggle';
|
||||||
|
cmd 'open';
|
||||||
|
|
||||||
|
does_i3_live;
|
||||||
|
|
||||||
|
done_testing;
|
Loading…
Reference in New Issue