Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix render order of LayoutHints and MultiColumns #186

Merged

Conversation

ankaan
Copy link
Contributor

@ankaan ankaan commented May 24, 2017

Description

Before this fix, when using layoutHintsToCenter together with
MultiColumns, in certain situations XMonad would render the border of
the focused window below a border of unfocused windows. This looks odd
and is here fixed by changing MultiColumns to always place the focused
window in front (even though they should not really overlap) and making
LayoutHints preserve the order returned from the underlying layout,
except for the focused window that is placed on top.

This is a good idea since layoutHintsToCenter requires the focused
window to be on top for good rendering, even if that is not really
required when the underlying layout is used on its own. This way
layoutHintsToCenter requires less of the layout that is modified and
MultiColumns is more compatible with future layout modifiers that are
not so considerate.

Checklist

Before this fix, when using layoutHintsToCenter together with
MultiColumns, in certain situations XMonad would render the border of
the focused window below a border of unfocused windows. This looks odd
and is here fixed by changing MultiColumns to always place the focused
window in front (even though they should not really overlap) and making
LayoutHints preserve the order returned from the underlying layout,
except for the focused window that is placed on top.

This is a good idea since layoutHintsToCenter requires the focused
window to be on top for good rendering, even if that is not really
required when the underlying layout is used on its own. This way
layoutHintsToCenter requires less of the layout that is modified and
MultiColumns is more compatible with future layout modifiers that are
not so considerate.
@mention-bot
Copy link

@ankaan, thanks for your PR! By analyzing the history of the files in this pull request, we identified @aavogt, @pjones and @liskin to be potential reviewers.

@pjones pjones merged commit 12227d3 into xmonad:master May 24, 2017
@pjones
Copy link
Contributor

pjones commented May 24, 2017

Thanks!

ankaan added a commit to ankaan/xmonad-contrib that referenced this pull request Jun 10, 2017
This is an improvement on the pull request "Fix render order of
LayoutHints and MultiColumns" (xmonad#186) and addresses the actual underlying
problem.

It turned out that windows can sometimes overlap also. This happens when
a window is exactly in the center along an axis. There was a special
case in the code for this that was not handled properly.

This change removes this special case and only shrinks at most in one
direction on each axis. This is desirable since it gives us a better
probability that the space will actually be used by another window, but
is basically unnoticable by the user. It also reduced the complexity
slightly while adding code to actually handle the case would have
increased the complexity.

I removed the code that places the focused window on top since it is no
longer required, but I still preserve the window order of the underlying
layout. This interferes even less with the underlying layout.

I also removed some code paths that were no longer necessary due to this
change and generalized some types so that I could debug the code more
easily.
@ankaan ankaan deleted the multicolumns-layouthints-windoworderfix branch June 10, 2017 20:59
ankaan added a commit to ankaan/xmonad-contrib that referenced this pull request Jun 10, 2017
This is an improvement on the pull request "Fix render order of
LayoutHints and MultiColumns" (xmonad#186) and addresses the actual underlying
problem.

It turned out that windows can sometimes overlap also. This happens when
a window is exactly in the center along an axis. There was a special
case in the code for this that was not handled properly.

This change removes this special case and only shrinks at most in one
direction on each axis. This is desirable since it gives us a better
probability that the space will actually be used by another window, but
is basically unnoticeable by the user. It also reduced the complexity
slightly while adding code to actually handle the case would have
increased the complexity.

I removed the code that places the focused window on top since it is no
longer required, but I still preserve the window order of the underlying
layout. This interferes even less with the underlying layout.

I also removed some code paths that were no longer necessary due to this
change and generalized some types so that I could debug the code more
easily.
ankaan added a commit to ankaan/xmonad-contrib that referenced this pull request Jun 11, 2017
This is an improvement on the pull request "Fix render order of
LayoutHints and MultiColumns" (xmonad#186) and addresses the actual underlying
problem.

It turned out that windows can sometimes overlap also. This happens when
a window is exactly in the center along an axis. There is a special
case in the code for this, but it was not handled properly.

I removed the code that places the focused window on top since it is no
longer required, but I still preserve the window order of the underlying
layout. This interferes even less with the underlying layout.

I also removed some code paths that were no longer necessary due to this
change and generalized some types so that I could debug the code more
easily.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants