Skip to content

Conversation

@timakro
Copy link
Contributor

@timakro timakro commented Mar 26, 2021

What type of PR is this? (check all applicable)

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update
  • Other: Replace this with a description of the type of this PR

Description

Previously wm-restack only supported bspwm and i3. Both have a special
top-level window that polybar detects and places itself directly above.
This patch adds wm-restack=generic which simply lowers polybar to the
very bottom of the stack. This option was tested and confirmed to work
with xmonad which doesn't have a special top-level window and therefore
doesn't require special handling like bspwm and i3.

Related Issues & Documents

Fixes #2205
Closes #1657

Documentation (check all applicable)

  • This PR requires changes to the Wiki documentation (describe the changes)

I suggest the following changes to the configuration page on the wiki:

; Restack the bar window. Fixes the issue where the
; bar is being drawn on top of fullscreen windows.
;
; Currently supported options:
;   generic (works in xmonad, may work with other WMs)
;   bspwm
;   i3 (requires: `override-redirect = true`)
; wm-restack =
  • This PR requires changes to the documentation inside the git repo (please add them to the PR).
  • Does not require documentation changes

@codecov
Copy link

codecov bot commented Mar 26, 2021

Codecov Report

Merging #2404 (1fdaec1) into master (93ab639) will decrease coverage by 0.02%.
The diff coverage is 0.00%.

❗ Current head 1fdaec1 differs from pull request most recent head bd59b12. Consider uploading reports for the commit bd59b12 to get more accurate results
Impacted file tree graph

@@            Coverage Diff            @@
##           master   #2404      +/-   ##
=========================================
- Coverage    9.86%   9.83%   -0.03%     
=========================================
  Files         147     147              
  Lines       10466   10492      +26     
=========================================
  Hits         1032    1032              
- Misses       9434    9460      +26     
Flag Coverage Δ
unittests 9.83% <0.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
include/cairo/context.hpp 0.00% <0.00%> (ø)
src/components/bar.cpp 0.00% <0.00%> (ø)
src/components/renderer.cpp 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 93ab639...bd59b12. Read the comment docs.

Copy link
Member

@patrick96 patrick96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! This also implemented #1657 I think.

Everything seems to work from my testing and looks like this should work in most WMs. It even works in i3 even though there the polybar window isn't always a direct child of the root.

This just needs one small change and then we're good to go.
Thanks a lot 🎉

@timakro timakro force-pushed the pr-generic-wm-restack branch from b0bc9f6 to 45a89ea Compare April 1, 2021 19:56
Previously wm-restack only supported bspwm and i3. Both have a special
top-level window that polybar detects and places itself directly above.
This patch adds wm-restack=generic which simply lowers polybar to the
very bottom of the stack. This option was tested and confirmed to work
with xmonad which doesn't have a special top-level window and therefore
doesn't require special handling like bspwm and i3.

Fixes polybar#2205
@timakro timakro force-pushed the pr-generic-wm-restack branch from 45a89ea to 2dbe8d6 Compare April 1, 2021 20:05
@patrick96 patrick96 merged commit 2901e1e into polybar:master Apr 1, 2021
@patrick96
Copy link
Member

Thanks!

@ixzh
Copy link

ixzh commented Jun 18, 2021

hi can I ask a question:
with wm-stack=generic, polybar still shown over fullscreen app, I need to open a new window in the current layout, then fullscreen works. Looks like it needs some refreshment. [close a windows or change layout doesn't work, only opening a new window works]

I'm using xmonad on arch.

@patrick96
Copy link
Member

@timakro Can you check this out?

@patrick96
Copy link
Member

@ixzh Just to check, does polybar print any errors and are you using the latest polybar development version?

@ixzh
Copy link

ixzh commented Jun 19, 2021

are you using the latest polybar development version

no error message.

I'm using polybar 3.5.6. should I switch to the git version? I presume it almost works based on the bove behavior, just this extra "refreshement" step.

polybaroverlay.mp4

@patrick96
Copy link
Member

polybar 3.5.6 doesn't have wm-restack = generic, that's an unreleased feature.

@ixzh
Copy link

ixzh commented Jun 19, 2021

polybar 3.5.6 doesn't have wm-restack = generic, that's an unreleased feature.

Run from commandline with warning:

warn: Ignoring unsupported wm-restack option 'generic'

switched to polybar-git version, fullscreen works! Thank you !

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.

Generic/Xmonad-specific window restacker Set bar to bottom of window stack

3 participants