Skip to content

Commit d794bc6

Browse files
committed
Use separate variable for stack offset
1 parent 6caef64 commit d794bc6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/NotificationStack.vala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,14 @@ public class Gala.NotificationStack : Object {
2222

2323
// we need to keep a small offset to the top, because we clip the container to
2424
// its allocations and the close button would be off for the first notification
25-
private int TOP_OFFSET = 2;
25+
private const int TOP_OFFSET = 2;
2626
private const int ADDITIONAL_MARGIN = 12;
2727
private const int MARGIN = 12;
2828

2929
private const int WIDTH = 300;
3030

3131
private int stack_y;
32+
private int stack_y_offset;
3233
private int stack_width;
3334

3435
public Meta.Display display { get; construct; }
@@ -105,7 +106,7 @@ public class Gala.NotificationStack : Object {
105106

106107
private void update_positions (bool animate, float add_y = 0.0f) {
107108
var scale = Utils.get_ui_scaling_factor ();
108-
var y = stack_y + TOP_OFFSET + add_y + ADDITIONAL_MARGIN * scale;
109+
var y = stack_y + TOP_OFFSET + stack_y_offset + add_y + ADDITIONAL_MARGIN * scale;
109110
var i = notifications.size;
110111
var delay_step = i > 0 ? 150 / i : 0;
111112
var iterator = 0;
@@ -147,7 +148,7 @@ public class Gala.NotificationStack : Object {
147148
}
148149

149150
public void offset_notifications (int32 offset) {
150-
TOP_OFFSET = 2 + offset;
151+
stack_y_offset = offset;
151152
update_positions (true);
152153
}
153154

0 commit comments

Comments
 (0)