Skip to content

Commit

Permalink
OSD Windows: Use the monitor work-area to place windows on screen
Browse files Browse the repository at this point in the history
Was using the entire monitor size to place this. Use the monitors available
work area instead. This will ensure the OSD's are placed the same distance
above the panel regardless of the panel size.
  • Loading branch information
JosephMcc committed Sep 29, 2024
1 parent a312d61 commit 1f511ac
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions data/theme/cinnamon-sass/widgets/_osd.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ $ws_dot_inactive: $ws_indicator_height / 6;
@extend %osd_base;
@extend %title_4;

margin-bottom: 4em;
margin-bottom: 1em;
border-radius: 9999px;
font-weight: bold;
spacing: $base_padding * 2;
Expand Down Expand Up @@ -59,7 +59,7 @@ $ws_dot_inactive: $ws_indicator_height / 6;
@extend %title_4;

min-width: 140px;
margin-bottom: 4em;
margin-bottom: 1em;
border-radius: 9999px;
font-weight: bold;
padding: $base_padding * 2 $base_padding * 6 0 $base_padding * 6;
Expand Down
5 changes: 4 additions & 1 deletion js/ui/osdWindow.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ class OsdWindow extends Clutter.Actor {
});

this._monitorIndex = monitorIndex;
let constraint = new Layout.MonitorConstraint({ index: monitorIndex });
let constraint = new Layout.MonitorConstraint({
index: monitorIndex,
work_area: true,
});
this.add_constraint(constraint);

this._hbox = new St.BoxLayout({
Expand Down
5 changes: 4 additions & 1 deletion js/ui/workspaceOsd.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ class WorkspaceOsd extends Clutter.Actor {

this.set_offscreen_redirect(Clutter.OffscreenRedirect.ALWAYS);

let constraint = new Layout.MonitorConstraint({ index: monitorIndex });
let constraint = new Layout.MonitorConstraint({
index: monitorIndex,
work_area: true,
});
this.add_constraint(constraint);

Main.uiGroup.add_actor(this);
Expand Down

0 comments on commit 1f511ac

Please sign in to comment.