Skip to content

Commit 1cfce45

Browse files
committed
comments ; fix autohide windows not properly hiding on the right side
1 parent 4fe2bfe commit 1cfce45

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

src/dock/dock.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -148,14 +148,9 @@ class WfDock::impl
148148

149149
void add_child(Gtk::Widget& widget)
150150
{
151+
// create a box if the last one is full or there is none
151152
if (((int)(out_box.get_children().size()) == 0) ||
152-
((int)((out_box.*first_or_last_child)()->get_children().size()) == entries_per_line)) // create a
153-
// new box
154-
// if the
155-
// last one
156-
// is full,
157-
// or there
158-
// is none
153+
((int)((out_box.*first_or_last_child)()->get_children().size()) == entries_per_line))
159154
{
160155
Gtk::Box new_box;
161156
prepare_new_layer(new_box);

src/util/wf-autohide-window.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,15 +181,16 @@ void WayfireAutohidingWindow::update_position()
181181
return;
182182
}
183183

184-
/* When the position changes, show an animation from the new edge. */
185-
if (anchor == GTK_LAYER_SHELL_EDGE_LEFT or anchor == GTK_LAYER_SHELL_EDGE_LEFT)
184+
// need different measurements depending on position
185+
if (anchor == GTK_LAYER_SHELL_EDGE_LEFT or anchor == GTK_LAYER_SHELL_EDGE_RIGHT)
186186
{
187187
get_allocated_height_or_width = &Gtk::Widget::get_allocated_width;
188188
} else
189189
{
190190
get_allocated_height_or_width = &Gtk::Widget::get_allocated_height;
191191
}
192192

193+
/* When the position changes, show an animation from the new edge. */
193194
autohide_animation.animate(-(this->*get_allocated_height_or_width)(), 0);
194195
start_draw_timer();
195196
m_show_uncertain();

0 commit comments

Comments
 (0)