Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix fractional scaling #559

Merged
merged 1 commit into from
Aug 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions src/PanelWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,6 @@ public class Wingpanel.PanelWindow : Gtk.Window {

// We just use our monitor because Gala makes sure we are always on the primary one
var monitor_dimensions = get_display ().get_monitor_at_window (get_window ()).get_geometry ();
monitor_dimensions.width /= get_scale_factor ();
monitor_dimensions.height /= get_scale_factor ();
monitor_dimensions.x /= get_scale_factor ();
monitor_dimensions.y /= get_scale_factor ();

monitor_width = monitor_dimensions.width;
monitor_height = monitor_dimensions.height;
Expand Down Expand Up @@ -171,7 +167,7 @@ public class Wingpanel.PanelWindow : Gtk.Window {

var prop = xdisplay.intern_atom ("_MUTTER_HINTS", false);

var value = "anchor=4:hide-mode=0:size=-1,%d".printf (get_allocated_height () * get_scale_factor ());
var value = "anchor=4:hide-mode=0:size=-1,%d".printf (get_allocated_height ());

xdisplay.change_property (window, prop, X.XA_STRING, 8, 0, (uchar[]) value, value.length);
}
Expand All @@ -186,7 +182,7 @@ public class Wingpanel.PanelWindow : Gtk.Window {
desktop_panel = desktop_shell.get_panel (wl_surface);
desktop_panel.set_anchor (TOP);
desktop_panel.set_hide_mode (NEVER);
desktop_panel.set_size (-1, get_allocated_height () * get_scale_factor ());
desktop_panel.set_size (-1, get_allocated_height ());

Idle.add_once (update_panel_dimensions); // Update again since we now can be 100% sure that we are on the primary monitor
}
Expand Down
Loading