From 9d3255fe9f6bc4ce015d6ec59d55c582a0a8edbf Mon Sep 17 00:00:00 2001 From: Alex Date: Fri, 17 May 2019 14:41:12 +0200 Subject: [PATCH] fix: remove redundant roundtrip --- src/bar.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/bar.cpp b/src/bar.cpp index 6c6de20c..57050995 100644 --- a/src/bar.cpp +++ b/src/bar.cpp @@ -20,7 +20,6 @@ waybar::Bar::Bar(struct waybar_output* w_output, const Json::Value& w_config) height_ = 0; width_ = 1; } - window.set_size_request(width_, height_); auto gtk_window = window.gobj(); auto gtk_widget = GTK_WIDGET(gtk_window); @@ -43,8 +42,6 @@ waybar::Bar::Bar(struct waybar_output* w_output, const Json::Value& w_config) auto height = config["height"].isUInt() ? config["height"].asUInt() : height_; auto width = config["width"].isUInt() ? config["width"].asUInt() : width_; - window.signal_configure_event().connect_notify(sigc::mem_fun(*this, &Bar::onConfigure)); - std::size_t anchor = ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP; if (config["position"] == "bottom") { anchor = ZWLR_LAYER_SURFACE_V1_ANCHOR_BOTTOM; @@ -70,9 +67,11 @@ waybar::Bar::Bar(struct waybar_output* w_output, const Json::Value& w_config) setMarginsAndZone(height, width); wl_surface_commit(surface); - wl_display_roundtrip(client->wl_display); setupWidgets(); + + window.set_size_request(width_, height_); + window.signal_configure_event().connect_notify(sigc::mem_fun(*this, &Bar::onConfigure)); } void waybar::Bar::setMarginsAndZone(uint32_t height, uint32_t width) {