Skip to content

Commit

Permalink
PanelWindow: Update size on scale change (#602)
Browse files Browse the repository at this point in the history
  • Loading branch information
leolost2605 authored Mar 10, 2025
1 parent b07e3ef commit 0568a7f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/PanelWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ public class Wingpanel.PanelWindow : Gtk.Window {
key_controller.key_pressed.connect (on_key_pressed);

panel.size_allocate.connect (update_panel_dimensions);

notify["scale-factor"].connect (on_scale_changed);
}

private void on_realize () {
Expand Down Expand Up @@ -158,6 +160,16 @@ public class Wingpanel.PanelWindow : Gtk.Window {
}
}

private void on_scale_changed () {
if (desktop_panel != null) {
desktop_panel.set_size (-1, get_actual_height ());
} else {
init_x ();
}

update_panel_dimensions ();
}

private int get_actual_height () {
if (!Services.DisplayConfig.is_logical_layout ()) {
return get_allocated_height () * get_scale_factor ();
Expand Down

0 comments on commit 0568a7f

Please sign in to comment.