Skip to content

Commit 10581f7

Browse files
committed
Add blur
1 parent 3323bb0 commit 10581f7

File tree

3 files changed

+39
-0
lines changed

3 files changed

+39
-0
lines changed

protocol/pantheon-desktop-shell-v1.xml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,24 @@
9898

9999
<arg name="hide_mode" type="uint" enum="hide_mode" summary="hide mode"/>
100100
</request>
101+
102+
<request name="add_blur">
103+
<description summary="add blur">
104+
Tell the window manager to add background blur.
105+
</description>
106+
107+
<arg name="left" type="uint"/>
108+
<arg name="right" type="uint"/>
109+
<arg name="top" type="uint"/>
110+
<arg name="bottom" type="uint"/>
111+
<arg name="clip_radius" type="uint"/>
112+
</request>
113+
114+
<request name="remove_blur">
115+
<description summary="remove blur">
116+
Tell the window manager to remove blur that was set in set_blur_region.
117+
</description>
118+
</request>
101119
</interface>
102120

103121
<interface name="io_elementary_pantheon_widget_v1" version="1">
@@ -111,5 +129,21 @@
111129
Tell the shell to keep the surface above on all workspaces
112130
</description>
113131
</request>
132+
133+
<request name="make_centered">
134+
<description summary="requests to keep the surface centered">
135+
Request to keep the surface centered. This will cause keyboard focus
136+
to not be granted automatically but having to be requested via focus.
137+
</description>
138+
</request>
139+
140+
<request name="focus">
141+
<description summary="request keyboard focus">
142+
Request keyboard focus, taking it away from any other window.
143+
Keyboard focus must always be manually be requested and is
144+
- in contrast to normal windows - never automatically granted
145+
by the compositor.
146+
</description>
147+
</request>
114148
</interface>
115149
</protocol>

protocol/pantheon-desktop-shell.vapi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ namespace Pantheon.Desktop {
4747
public void focus ();
4848
public void set_size (int width, int height);
4949
public void set_hide_mode (Pantheon.Desktop.HideMode hide_mode);
50+
public void add_blur (uint left, uint right, uint top, uint bottom, uint clip_radius);
51+
public void remove_blur ();
5052
}
5153

5254
[CCode (cheader_filename = "pantheon-desktop-shell-client-protocol.h", cname = "struct io_elementary_pantheon_widget_v1", cprefix = "io_elementary_pantheon_widget_v1_")]

src/MainWindow.vala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ public class Dock.MainWindow : Gtk.ApplicationWindow {
1818

1919
// Matches top margin in Launcher.css
2020
private const int TOP_MARGIN = 64;
21+
private const int MARGIN_BOTTOM = 9;
22+
private const int BORDER_RADIUS = 9;
2123

2224
private Settings transparency_settings;
2325
private static Settings settings = new Settings ("io.elementary.dock");
@@ -95,6 +97,7 @@ public class Dock.MainWindow : Gtk.ApplicationWindow {
9597
panel = desktop_shell.get_panel (wl_surface);
9698
panel.set_anchor (BOTTOM);
9799
panel.set_hide_mode (settings.get_enum ("autohide-mode"));
100+
panel.add_blur (0, 0, 0, MARGIN_BOTTOM, BORDER_RADIUS);
98101
}
99102
}
100103
}

0 commit comments

Comments
 (0)