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

Fixes: Add stretching of modules and modules-center toggling #3881

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions src/bar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,6 @@ auto waybar::Bar::setupWidgets() -> void {
if (config["fixed-center"].isBool() ? config["fixed-center"].asBool() : true) {
box_.set_center_widget(center_);
} else {
spdlog::error("No fixed center_");
box_.pack_start(center_, true, expand_center);
}
}
Expand All @@ -569,13 +568,13 @@ auto waybar::Bar::setupWidgets() -> void {

if (!no_center) {
for (auto const& module : modules_center_) {
center_.pack_start(*module, false, false);
center_.pack_start(*module, module->expandEnabled(), module->expandEnabled());
}
}

std::reverse(modules_right_.begin(), modules_right_.end());
for (auto const& module : modules_right_) {
right_.pack_end(*module, false, false);
right_.pack_end(*module, module->expandEnabled(), module->expandEnabled());
}
}

Expand Down
8 changes: 2 additions & 6 deletions src/modules/dwl/window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,9 @@ Window::~Window() {
}
}

void Window::handle_title(const char *title) {
title_ = Glib::Markup::escape_text(title);
}
void Window::handle_title(const char *title) { title_ = Glib::Markup::escape_text(title); }

void Window::handle_appid(const char *appid) {
appid_ = Glib::Markup::escape_text(appid);
}
void Window::handle_appid(const char *appid) { appid_ = Glib::Markup::escape_text(appid); }

void Window::handle_layout_symbol(const char *layout_symbol) {
layout_symbol_ = Glib::Markup::escape_text(layout_symbol);
Expand Down
8 changes: 2 additions & 6 deletions src/modules/hyprland/window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,20 @@
#include <spdlog/spdlog.h>

#include <algorithm>
#include <shared_mutex>
#include <thread>
#include <vector>

#include "modules/hyprland/backend.hpp"
#include "util/rewrite_string.hpp"
#include "util/sanitize_str.hpp"

#include <shared_mutex>
#include <thread>

namespace waybar::modules::hyprland {

std::shared_mutex windowIpcSmtx;

Window::Window(const std::string& id, const Bar& bar, const Json::Value& config)
: AAppIconLabel(config, "window", id, "{title}", 0, true), bar_(bar) {

std::unique_lock<std::shared_mutex> windowIpcUniqueLock(windowIpcSmtx);

modulesReady = true;
Expand Down Expand Up @@ -51,7 +49,6 @@ Window::~Window() {
}

auto Window::update() -> void {

std::shared_lock<std::shared_mutex> windowIpcShareLock(windowIpcSmtx);

std::string windowName = waybar::util::sanitize_string(workspace_.last_window_title);
Expand Down Expand Up @@ -153,7 +150,6 @@ auto Window::WindowData::parse(const Json::Value& value) -> Window::WindowData {
}

void Window::queryActiveWorkspace() {

std::shared_lock<std::shared_mutex> windowIpcShareLock(windowIpcSmtx);

if (separateOutputs_) {
Expand Down
2 changes: 1 addition & 1 deletion src/util/pipewire/pipewire_backend.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ void PipewireBackend::handleRegistryEventGlobal(uint32_t id, uint32_t permission
if (proxy == nullptr) return;

auto *pNodeInfo = (PrivacyNodeInfo *)pw_proxy_get_user_data(proxy);
new(pNodeInfo) PrivacyNodeInfo{};
new (pNodeInfo) PrivacyNodeInfo{};
pNodeInfo->id = id;
pNodeInfo->data = this;
pNodeInfo->type = mediaType;
Expand Down
Loading