Skip to content
Open
Show file tree
Hide file tree
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
22 changes: 20 additions & 2 deletions protocol/pantheon-desktop-shell-v1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@

<request name="add_blur">
<description summary="add blur">
Tell the window manager to add background blur.
Tell the window manager to add background blur. Deprecated.
</description>

<arg name="left" type="uint"/>
Expand All @@ -119,7 +119,7 @@

<request name="remove_blur">
<description summary="remove blur">
Tell the window manager to remove blur that was set in set_blur_region.
Tell the window manager to remove blur that was set in set_blur_region. Deprecated.
</description>
</request>
</interface>
Expand Down Expand Up @@ -159,5 +159,23 @@

<arg name="dim" type="uint" summary="1 to dim, 0 to not dim"/>
</request>

<request name="add_blur">
<description summary="add blur">
Tell the window manager to add background blur.
</description>

<arg name="left" type="uint"/>
<arg name="right" type="uint"/>
<arg name="top" type="uint"/>
<arg name="bottom" type="uint"/>
<arg name="clip_radius" type="uint"/>
</request>

<request name="remove_blur">
<description summary="remove blur">
Tell the window manager to remove blur that was set in set_blur_region.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Tell the window manager to remove blur that was set in set_blur_region.
Tell the window manager to remove blur that was set in add_blur.

</description>
</request>
</interface>
</protocol>
2 changes: 2 additions & 0 deletions protocol/pantheon-desktop-shell.vapi
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ namespace Pantheon.Desktop {
public MakeCentered make_centered;
public Focus focus;
public MakeModal make_modal;
public AddBlur add_blur;
public RemoveBlur remove_blur;
}

[CCode (has_target = false, has_typedef = false)]
Expand Down
44 changes: 40 additions & 4 deletions src/PantheonShell.vala
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ namespace Gala {
set_size,
set_hide_mode,
request_visible_in_multitasking_view,
add_blur,
remove_blur,
add_blur_old,
remove_blur_old,
};

wayland_pantheon_widget_interface = {
Expand All @@ -54,6 +54,8 @@ namespace Gala {
make_centered,
focus_extended_behavior,
make_modal,
add_blur,
remove_blur,
};

PanelSurface.quark = GLib.Quark.from_string ("-gala-wayland-panel-surface-data");
Expand Down Expand Up @@ -313,7 +315,7 @@ namespace Gala {
ShellClientsManager.get_instance ().request_visible_in_multitasking_view (window);
}

internal static void add_blur (Wl.Client client, Wl.Resource resource, uint left, uint right, uint top, uint bottom, uint clip_radius) {
internal static void add_blur_old (Wl.Client client, Wl.Resource resource, uint left, uint right, uint top, uint bottom, uint clip_radius) {
unowned PanelSurface? panel_surface = resource.get_user_data<PanelSurface> ();
if (panel_surface.wayland_surface == null) {
warning ("Window tried to set blur region but wayland surface is null.");
Expand All @@ -330,7 +332,7 @@ namespace Gala {
BlurManager.get_instance ().add_blur (window, left, right, top, bottom, clip_radius);
}

internal static void remove_blur (Wl.Client client, Wl.Resource resource) {
internal static void remove_blur_old (Wl.Client client, Wl.Resource resource) {
unowned PanelSurface? panel_surface = resource.get_user_data<PanelSurface> ();
if (panel_surface.wayland_surface == null) {
warning ("Window tried to remove blur but wayland surface is null.");
Expand Down Expand Up @@ -392,6 +394,40 @@ namespace Gala {
ShellClientsManager.get_instance ().make_modal (window, dim == 1);
}

internal static void add_blur (Wl.Client client, Wl.Resource resource, uint left, uint right, uint top, uint bottom, uint clip_radius) {
unowned ExtendedBehaviorSurface? eb_surface = resource.get_user_data<ExtendedBehaviorSurface> ();
if (eb_surface.wayland_surface == null) {
warning ("Window tried to set blur region but wayland surface is null.");
return;
}

Meta.Window? window;
eb_surface.wayland_surface.get ("window", out window, null);
if (window == null) {
warning ("Window tried to set blur region but wayland surface had no associated window.");
return;
}

BlurManager.get_instance ().add_blur (window, left, right, top, bottom, clip_radius);
}

internal static void remove_blur (Wl.Client client, Wl.Resource resource) {
unowned ExtendedBehaviorSurface? eb_surface = resource.get_user_data<ExtendedBehaviorSurface> ();
if (eb_surface.wayland_surface == null) {
warning ("Window tried to remove blur but wayland surface is null.");
return;
}

Meta.Window? window;
eb_surface.wayland_surface.get ("window", out window, null);
if (window == null) {
warning ("Window tried to remove blur but wayland surface had no associated window.");
return;
}

BlurManager.get_instance ().remove_blur (window);
}

internal static void destroy_panel_surface (Wl.Client client, Wl.Resource resource) {
resource.destroy ();
}
Expand Down
Loading