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

waybar: allow setting layer to overlay #5729

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chayleaf
Copy link

Description

This is undocumented, but this allows showing the bar above all windows, including fullscreen ones.

Checklist

  • Change is backwards compatible.

  • Code formatted with ./format.

  • Code tested through nix-shell --pure tests -A run.all or nix develop --ignore-environment .#all using Flakes.

  • Test cases updated/added. See example.

  • Commit messages are formatted like

    {component}: {description}
    
    {long description}
    

    See CONTRIBUTING for more information and recent commit messages for examples.

  • If this PR adds a new module

    • Added myself as module maintainer. See example.

Maintainer CC

@berbiche

Copy link

stale bot commented Nov 14, 2024

Thank you for your contribution! I marked this pull request as stale due to inactivity. Please read the relevant sections below before commenting.

If you are the original author of the PR

  • GitHub sometimes doesn't notify people who commented / reviewed a PR previously when you (force) push commits. If you have addressed the reviews you can officially ask for a review from those who commented to you or anyone else.
  • If it is unfinished but you plan to finish it, please mark it as a draft.
  • If you don't expect to work on it any time soon, please consider closing it with a short comment encouraging someone else to pick up your work.
  • To get things rolling again, rebase the PR against the target branch and address valid comments.

If you are not the original author of the PR

  • If you want to pick up the work on this PR, please create a new PR and indicate that it supercedes and closes this PR.

@stale stale bot added the status: stale label Nov 14, 2024
@chayleaf
Copy link
Author

this is still ready for merging

@teto
Copy link
Collaborator

teto commented Nov 16, 2024

could you share any reference where it's used ? maybe it's not part of the doc because it's not intended to be used (aka experimental feature ?). Also you should rebase to fix CI

@stale stale bot removed the status: stale label Nov 16, 2024
@chayleaf
Copy link
Author

I don't understand what you mean by examples, the code is just

void from_json(const Json::Value& j, std::optional<bar_layer>& l) {
  if (j == "bottom") {
    l = bar_layer::BOTTOM;
  } else if (j == "top") {
    l = bar_layer::TOP;
  } else if (j == "overlay") {
    l = bar_layer::OVERLAY;
  }
}

void waybar::Bar::setMode(const struct bar_mode& mode) {
  // ...
  if (mode.layer == bar_layer::BOTTOM) {
    gtk_layer_set_layer(gtk_window, GTK_LAYER_SHELL_LAYER_BOTTOM);
  } else if (mode.layer == bar_layer::TOP) {
    gtk_layer_set_layer(gtk_window, GTK_LAYER_SHELL_LAYER_TOP);
  } else if (mode.layer == bar_layer::OVERLAY) {
    gtk_layer_set_layer(gtk_window, GTK_LAYER_SHELL_LAYER_OVERLAY);
  }
  // ...
}

I use this in my personal config on my phone because the bar has UI controls so it's hidden I can't open the menu, so it has to stay on top of all windows.

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.

2 participants