Skip to content

Commit

Permalink
Remove blurry rounded corners (#2018)
Browse files Browse the repository at this point in the history
  • Loading branch information
lenemter authored Aug 12, 2024
1 parent e0624ac commit 6f5d323
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 6 deletions.
15 changes: 11 additions & 4 deletions src/Background/BackgroundManager.vala
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public class Gala.BackgroundManager : Meta.BackgroundGroup, Gala.BackgroundManag
public WindowManager wm { get; construct; }
public int monitor_index { get; construct; }
public bool control_position { get; construct; }
public bool rounded_corners { get; construct; }
public Meta.BackgroundActor newest_background_actor {
get {
return (new_background_actor != null) ? new_background_actor : background_actor;
Expand All @@ -23,8 +24,8 @@ public class Gala.BackgroundManager : Meta.BackgroundGroup, Gala.BackgroundManag
private Meta.BackgroundActor? background_actor;
private Meta.BackgroundActor? new_background_actor = null;

public BackgroundManager (WindowManager wm, int monitor_index, bool control_position = true) {
Object (wm: wm, monitor_index: monitor_index, control_position: control_position);
public BackgroundManager (WindowManager wm, int monitor_index, bool control_position = true, bool rounded_corners = true) {
Object (wm: wm, monitor_index: monitor_index, control_position: control_position, rounded_corners: rounded_corners);
}

construct {
Expand Down Expand Up @@ -91,7 +92,10 @@ public class Gala.BackgroundManager : Meta.BackgroundGroup, Gala.BackgroundManag
var background = new_content.background.get_data<unowned Background> ("delegate");

if (background.is_loaded) {
new_content.rounded_clip_radius = Utils.scale_to_int (6, wm.get_display ().get_monitor_scale (monitor_index));
if (rounded_corners) {
new_content.rounded_clip_radius = Utils.scale_to_int (6, wm.get_display ().get_monitor_scale (monitor_index));
}

swap_background_actor (animate);
return;
}
Expand All @@ -101,8 +105,11 @@ public class Gala.BackgroundManager : Meta.BackgroundGroup, Gala.BackgroundManag
background.disconnect (handler);
background.set_data<ulong> ("background-loaded-handler", 0);

if (rounded_corners) {
new_content.rounded_clip_radius = Utils.scale_to_int (6, wm.get_display ().get_monitor_scale (monitor_index));
}

swap_background_actor (animate);
new_content.rounded_clip_radius = Utils.scale_to_int (6, wm.get_display ().get_monitor_scale (monitor_index));
});
background.set_data<ulong> ("background-loaded-handler", handler);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Widgets/MultitaskingView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ namespace Gala {
brightness_effect = new Clutter.BrightnessContrastEffect ();
update_brightness_effect ();

var blurred_bg = new BackgroundManager (wm, display.get_primary_monitor ());
var blurred_bg = new BackgroundManager (wm, display.get_primary_monitor (), true, false);
blurred_bg.add_effect (new BlurEffect (blurred_bg, 18));
blurred_bg.add_effect (brightness_effect);

Expand Down
3 changes: 2 additions & 1 deletion src/Widgets/WorkspaceClone.vala
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ namespace Gala {
Object (
wm: wm,
monitor_index: wm.get_display ().get_primary_monitor (),
control_position: false
control_position: false,
rounded_corners: true
);
}

Expand Down

0 comments on commit 6f5d323

Please sign in to comment.