shell: fix panel centering on CcPanelList

the calculation to center the panel row
was failing when the panel list was not
scrolled to the top.

Fix it by taking the distance from the
row to the CcPanelList, instead of the
GtkScrolledWindow that contains it.

Part of issue #2506
This commit is contained in:
Nelson Benítez León 2023-06-02 23:44:50 +01:00 committed by Felipe Borges
parent 3f3409cbc1
commit 2b3c157c07

View file

@ -914,7 +914,7 @@ cc_panel_list_scroll_to_center_row (CcPanelList *self,
if (!adj)
return;
if (!gtk_widget_compute_point (row, scrolled_window, &GRAPHENE_POINT_INIT (0, 0), &p))
if (!gtk_widget_compute_point (row, GTK_WIDGET (self), &GRAPHENE_POINT_INIT (0, 0), &p))
return;
target_value = p.y + gtk_widget_get_height (row) / 2;