Skip to content
Closed
Show file tree
Hide file tree
Changes from 3 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
2 changes: 1 addition & 1 deletion data/Application.css
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ dock {
0 1px 3px alpha(black, 0.10),
0 3px 9px alpha(black, 0.15);
margin: 9px;
margin-top: 0;
margin-top: 32px; /* Keep enough room so that icons don't clip when bouncing */
}

launcher {
Expand Down
21 changes: 20 additions & 1 deletion src/MainWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@
*/

public class Dock.MainWindow : Gtk.ApplicationWindow {
private const int WINDOW_BOTTOM_MARGIN = 9;

private static Settings settings = new Settings ("io.elementary.dock");

private Pantheon.Desktop.Shell? desktop_shell;
private Pantheon.Desktop.Panel? panel;

private int height = 0;

class construct {
set_css_name ("dock");
}
Expand Down Expand Up @@ -51,6 +55,21 @@ public class Dock.MainWindow : Gtk.ApplicationWindow {

private static Wl.RegistryListener registry_listener;
private void init_panel () {
get_surface ().layout.connect_after (() => {
var new_height = get_height ();
if (new_height == height) {
return;
}

height = new_height;

if (panel != null) {
panel.set_size (-1, height + WINDOW_BOTTOM_MARGIN);
} else {
update_panel_x11 ();
}
});

registry_listener.global = registry_handle_global;
unowned var display = Gdk.Display.get_default ();
if (display is Gdk.Wayland.Display) {
Expand Down Expand Up @@ -78,7 +97,7 @@ public class Dock.MainWindow : Gtk.ApplicationWindow {

var prop = xdisplay.intern_atom ("_MUTTER_HINTS", false);

var value = "anchor=8:hide-mode=%d".printf (settings.get_enum ("autohide-mode"));
var value = "anchor=8:hide-mode=%d:size=-1,%d".printf (settings.get_enum ("autohide-mode"), height);

xdisplay.change_property (window, prop, X.XA_STRING, 8, 0, (uchar[]) value, value.length);
}
Expand Down