fix: remove redundant roundtrip

This commit is contained in:
Alex 2019-05-17 14:41:12 +02:00
parent d2d9db23b5
commit 9d3255fe9f
1 changed files with 3 additions and 4 deletions

View File

@ -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) {