-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Fix timeout created by most recent gtk-layer-shell release when creating bars for multiple monitors. #4984
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
base: master
Are you sure you want to change the base?
Fix timeout created by most recent gtk-layer-shell release when creating bars for multiple monitors. #4984
Changes from all commits
efd245b
8b5b1ee
09b6df3
d9b5d24
e2d608e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -91,16 +91,38 @@ void waybar::Client::handleOutputDone(void* data, struct zxdg_output_v1* /*xdg_o | |
| output.xdg_output.reset(); | ||
| spdlog::debug("Output detection done: {} ({})", output.name, output.identifier); | ||
|
|
||
| auto configs = client->getOutputConfigs(output); | ||
| client->pending_outputs_.push_back(&output); | ||
|
|
||
| if (!client->bars_scheduled_) { | ||
| client->bars_scheduled_ = true; | ||
|
|
||
| Glib::signal_idle().connect_once([client]() { | ||
| client->createBarsBatch(); | ||
| }, Glib::PRIORITY_HIGH_IDLE); | ||
| } | ||
| } | ||
| } catch (const std::exception& e) { | ||
| spdlog::warn("caught exception in zxdg_output_v1_listener::done: {}", e.what()); | ||
| } | ||
| } | ||
|
|
||
| void waybar::Client::createBarsBatch() { | ||
| pending_outputs_.remove_if([this](auto* output) { return std::none_of(outputs_.begin(), outputs_.end(), [&output](const auto& o) { return &o == output; }); }); | ||
| for (auto* output : pending_outputs_) { | ||
| try { | ||
| auto configs = getOutputConfigs(*output); | ||
| if (!configs.empty()) { | ||
| for (const auto& config : configs) { | ||
| client->bars.emplace_back(std::make_unique<Bar>(&output, config)); | ||
| bars.emplace_back(std::make_unique<Bar>(output, config)); | ||
| } | ||
|
Comment on lines
+109
to
117
|
||
| } | ||
| } catch (const std::exception& e) { | ||
| spdlog::warn("Error creating bar: {}", e.what()); | ||
| } | ||
| } catch (const std::exception& e) { | ||
| spdlog::warn("caught exception in zxdg_output_v1_listener::done: {}", e.what()); | ||
| } | ||
|
|
||
| pending_outputs_.clear(); | ||
| bars_scheduled_ = false; | ||
| } | ||
|
|
||
| void waybar::Client::handleOutputName(void* data, struct zxdg_output_v1* /*xdg_output*/, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this fixes potential use-after-free but I could be wrong.