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

Restack refactoring #2961

Merged
merged 7 commits into from May 15, 2023
Merged

Restack refactoring #2961

merged 7 commits into from May 15, 2023

Conversation

patrick96
Copy link
Member

@patrick96 patrick96 commented May 15, 2023

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

Refactors the restacking algorithms and adds new ones.

The restacking algorithms now only have to provide the sibling window and stacking mode.

New strategies

  • ewmh: Tries to put the bar window above the _NET_SUPPORTING_WM_CHECK window
  • bottom: Puts the bar window at the bottom of the window stack (same as the old generic strategy)

The generic strategy is now a best effort strategy which simply tries out other strategy until it finds a suitable one. Currently it first tries ewmh, then bottom.

Additionally, the bspwm strategy also first tries ewmh before falling back to searching for the dedicated root windows for each monitor.

Related Issues & Documents

Fixes #2873

May also work for #2543

Documentation (check all applicable)

  • This PR requires changes to the Wiki documentation (describe the changes)
  • This PR requires changes to the documentation inside the git repo (please add them to the PR).
  • Does not require documentation changes

Add the new strategies as well as the changes to the strategy to the wiki.
Also mention that generic is best-effort, it may change in the future, and all its component strategies are available on their own.

Aim is to clean up restacking logic and remove some duplicated code
Restacking algorithms now only need to provide the sibling window and
stacking mode.
For now this is the same as the generic one
Positions the bar window above the _NET_SUPPORTING_WM_CHECK window

The generic restacking strategy now first tries the ewmh strategy, the
the bottom strategy.
@codecov
Copy link

codecov bot commented May 15, 2023

Codecov Report

Merging #2961 (2dd8e43) into master (f78ec80) will decrease coverage by 0.18%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master    #2961      +/-   ##
==========================================
- Coverage   12.88%   12.71%   -0.18%     
==========================================
  Files         162      160       -2     
  Lines       12049    12512     +463     
==========================================
+ Hits         1553     1591      +38     
- Misses      10496    10921     +425     
Flag Coverage Δ
unittests 12.71% <0.00%> (-0.18%) ⬇️

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

Impacted Files Coverage Δ
include/utils/bspwm.hpp 0.00% <ø> (ø)
include/utils/i3.hpp 0.00% <ø> (ø)
src/components/bar.cpp 0.00% <0.00%> (ø)
src/utils/bspwm.cpp 0.00% <0.00%> (ø)
src/utils/i3.cpp 0.00% <0.00%> (ø)
src/utils/restack.cpp 0.00% <0.00%> (ø)
src/x11/ewmh.cpp 0.00% <0.00%> (ø)

... and 91 files with indirect coverage changes

@patrick96 patrick96 added this to the 3.7.0 milestone May 15, 2023
@patrick96 patrick96 merged commit ea3eb6e into polybar:master May 15, 2023
8 of 9 checks passed
@patrick96 patrick96 deleted the bspwm-restack branch May 15, 2023 12:44
const unsigned int value_mask = XCB_CONFIG_WINDOW_SIBLING | XCB_CONFIG_WINDOW_STACK_MODE;
const unsigned int value_list[2]{*children.begin(), XCB_STACK_MODE_BELOW};
m_connection.configure_window_checked(m_opts.x_data.window, value_mask, value_list);
restack_util::restack_relative(m_connection, m_opts.x_data.window, *children.begin(), XCB_STACK_MODE_BELOW);
Copy link

@andro404-MC andro404-MC Jul 14, 2023

Choose a reason for hiding this comment

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

Probably the cause of #2972

@patrick96 patrick96 mentioned this pull request Nov 5, 2023
24 tasks
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.

[Bug]: Workspaces not clickable on BSPWM
2 participants