Skip to content

Commit 3dda409

Browse files
committed
Account for display scale when repositioning the stack
1 parent 7707b9a commit 3dda409

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/WindowManager.vala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,9 @@ namespace Gala {
167167

168168
/**
169169
* Tells the window manager to move the Notifications Stack down
170-
* by the given number of pixels, to make room for menus.
170+
* by the given number of points, to make room for menus.
171171
*
172-
* @param offset The amount of pixels by which to move the notifications stack
172+
* @param offset The number of points by which to move the notifications stack
173173
*/
174174
public abstract void offset_notifications (int32 offset);
175175

src/NotificationStack.vala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public class Gala.NotificationStack : Object {
9090

9191
int notification_x_pos = area.x + area.width - window_rect.width;
9292

93-
move_window (notification, notification_x_pos, stack_y + TOP_OFFSET + stack_y_offset + ADDITIONAL_MARGIN * scale);
93+
move_window (notification, notification_x_pos, stack_y + TOP_OFFSET + (stack_y_offset + ADDITIONAL_MARGIN) * scale);
9494
notifications.insert (0, notification);
9595
}
9696

@@ -106,7 +106,7 @@ public class Gala.NotificationStack : Object {
106106

107107
private void update_positions (bool animate, float add_y = 0.0f) {
108108
var scale = Utils.get_ui_scaling_factor ();
109-
var y = stack_y + TOP_OFFSET + stack_y_offset + add_y + ADDITIONAL_MARGIN * scale;
109+
var y = stack_y + TOP_OFFSET + add_y + (stack_y_offset + ADDITIONAL_MARGIN) * scale;
110110
var i = notifications.size;
111111
var delay_step = i > 0 ? 150 / i : 0;
112112
var iterator = 0;

0 commit comments

Comments
 (0)