Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
d5aabf7
Added many configuration options to the dock and the panel, still a d…
AKArien Feb 9, 2026
471facf
removed addition of wireplumber widget of pr 307
AKArien Feb 9, 2026
9938ad3
remove whatever that was and uncrustify
AKArien Feb 9, 2026
baaf2c0
uncrustify
AKArien Nov 3, 2025
68eb5ae
uncrustify it better be final this time
AKArien Nov 3, 2025
ad09fe5
comments ; fix autohide windows not properly hiding on the right side
AKArien Nov 3, 2025
8098ae0
update comments
AKArien Nov 4, 2025
097c618
uuh
AKArien Feb 9, 2026
a843f5b
reverted changes made by uncrustify on some comments
AKArien Feb 9, 2026
94b99ca
actually took the latest master this time oops
AKArien Feb 9, 2026
1f8e7d9
reverted more changes from overzaelous uncrustify
AKArien Jan 8, 2026
aebcb3a
dropped attempts at rotating stuff
AKArien Feb 9, 2026
812319d
squash
AKArien Feb 9, 2026
d6e1016
adjusted metadata to be more better
AKArien Jan 9, 2026
ddac8a7
stuff missed
AKArien Jan 9, 2026
3845c7b
clean up update_orientation
AKArien Feb 10, 2026
3067676
restored launchers spacing and added tray spacing
AKArien Feb 10, 2026
cfb6b00
fixed metadata
AKArien Feb 10, 2026
bba81fe
drop fucky logic for multiple rows
AKArien Feb 10, 2026
384f107
let’s try a constraint layout
AKArien Feb 10, 2026
168c336
Revert "let’s try a constraint layout"
AKArien Feb 10, 2026
57d8b5b
unified span_full_edge (and added to dock) and maybe other things
AKArien Feb 10, 2026
e3d3ebe
use a flowbox fuck
AKArien Feb 10, 2026
e7291bf
unified dock and panel minimal sizes
AKArien Feb 11, 2026
bdf39ce
adjust config loading to use .value and revert non-changes
AKArien Feb 11, 2026
001697c
clean up panel
AKArien Feb 11, 2026
1e00c12
clean up wf-autohide-window + uncrustify
AKArien Feb 11, 2026
eae249c
restore differences between h and v align for panel boxes
AKArien Feb 11, 2026
2381091
fix long formatting, change full_span name, uncrustify
AKArien Feb 11, 2026
9e7a4b4
don’t go in rows with 0 per line, cleanups
AKArien Feb 11, 2026
41e8910
uncrustify
AKArien Feb 11, 2026
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
39 changes: 36 additions & 3 deletions metadata/dock.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,20 @@
<default>true</default>
</option>
<option name="autohide_duration" type="int">
<_short>Autohide duration</_short>
<_short>Autohide animation duration</_short>
<_long>Time (in milliseconds) the dock takes to expand and retract</_long>
<default>300</default>
</option>
<option name="autohide_show_delay" type="int">
<_short>Autohide show delay</_short>
<_long>Amount of time (in milliseconds) the cursor needs to be in the zone before showing.</_long>
<default>300</default>
</option>
<option name="autohide_hide_delay" type="int">
<_short>Autohide hide delay</_short>
<_long>Amount of time (in milliseconds) the cursor needs to be out of the zone before hiding.</_long>
<default>500</default>
</option>
<option name="position" type="string">
<_short>Position</_short>
<default>bottom</default>
Expand All @@ -26,11 +37,33 @@
<value>bottom</value>
<_name>Bottom</_name>
</desc>
<desc>
<value>left</value>
<_name>Left</_name>
</desc>
<desc>
<value>right</value>
<_name>Right</_name>
</desc>
</option>
<option name="max_per_line" type="int">
<_short>Max icons per line</_short>
<_long>If greater than 0, the dock will have a maximum number of entries per line, after which a new line is created.</_long>
<default>0</default>
</option>
<option name="dock_height" type="int">
<_short>Dock height</_short>
<option name="minimal_height" type="int">
<_short>Minimal height</_short>
<default>100</default>
</option>
<option name="minimal_width" type="int">
<_short>Minimal width</_short>
<default>100</default>
</option>
<option name="full_span" type="bool">
<_short>Anchor to edges</_short>
<_long>Wether the dock should extend all the way to the left and right; or top and bottom depending on orientation.</_long>
<default>false</default>
</option>
<option name="icon_height" type="int">
<_short>Dock icons height</_short>
<default>72</default>
Expand Down
50 changes: 47 additions & 3 deletions metadata/panel.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,59 @@
<default></default>
</option>
<option name="widgets_left" type="string">
<_short>Widgets Left</_short>
<_short>Widgets Left/Top</_short>
<_long>Widgets placed in the left zone of the bar, or top if the bar is vertical.</_long>
<default>menu spacing4 launchers window-list</default>
</option>
<option name="widgets_center" type="string">
<_short>Widgets Center</_short>
<default>none</default>
</option>
<option name="widgets_right" type="string">
<_short>Widgets Right</_short>
<_short>Widgets Right/Bottom</_short>
<_long>Widgets placed in the right zone of the bar, or bottom if the bar is vertical.</_long>
<default>volume network battery clock</default>
</option>
<option name="minimal_height" type="int">
<_short>Minimal Height</_short>
<default>32</default>
<_long>Minimum height the panel takes.</_long>
</option>
<option name="minimal_width" type="int">
<_short>Minimal Width</_short>
<_long>Minimum width the panel takes.</_long>
<default>32</default>
</option>
<option name="full_span" type="bool">
<_short>Anchor to edges</_short>
<_long>Wether the pannel should extend all the way to the left and right; or top and bottom depending on orientation.</_long>
<default>true</default>
</option>
<option name="force_center" type="bool">
<_short>Force center by widgets</_short>
<_long>If on, the widgets on the left and right of the panel always take the same amount of space and the widgets in center are forced in the middle of the screen.
This will lead to unused space on the side that has the least space taken up by the widgets.</_long>
<default>false</default>
</option>
<option name="autohide" type="bool">
<_short>Autohide</_short>
<default>false</default>
</option>
<option name="autohide_duration" type="int">
<_short>Autohide Duration</_short>
<_short>Autohide animation duration</_short>
<_long>Time (in milliseconds) the panel takes to expand and retract</_long>
<default>300</default>
</option>
<option name="autohide_show_delay" type="int">
<_short>Autohide show delay</_short>
<_long>Amount of time (in milliseconds) the cursor needs to be in the zone before showing.</_long>
<default>300</default>
</option>
<option name="autohide_hide_delay" type="int">
<_short>Autohide hide delay</_short>
<_long>Amount of time (in milliseconds) the cursor needs to be out of the zone before hiding.</_long>
<default>500</default>
</option>
<option name="position" type="string">
<_short>Panel Position</_short>
<default>top</default>
Expand All @@ -44,6 +74,14 @@
<value>bottom</value>
<_name>Bottom</_name>
</desc>
<desc>
<value>left</value>
<_name>Left</_name>
</desc>
<desc>
<value>right</value>
<_name>Right</_name>
</desc>
</option>
<option name="edge_offset" type="int">
<_short>Edge offset</_short>
Expand Down Expand Up @@ -80,6 +118,7 @@
<option name="launchers_spacing" type="int">
<_short>Launchers Spacing</_short>
<default>4</default>
<min>0</min>
</option>
<option name="launchers_size" type="int">
<_short>Launchers Icon Size</_short>
Expand Down Expand Up @@ -388,6 +427,11 @@
<default>0</default>
<min>0</min>
</option>
<option name="tray_spacing" type="int">
<_short>Space between tray icons</_short>
<default>5</default>
<min>0</min>
</option>
<option name="tray_menu_on_middle_click" type="bool">
<_short>Middle Button Activates Menu</_short>
<_long>Mouse right button activates a tray item's secondary action instead of the item's menu.</_long>
Expand Down
8 changes: 8 additions & 0 deletions src/dock/dock-app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ class WfDockApp::impl
zwlr_foreign_toplevel_manager_v1 *toplevel_manager = NULL;
};

void WfDockApp::on_config_reload()
{
for (auto& d : priv->docks)
{
d.second->handle_config_reload();
}
}

void WfDockApp::on_activate()
{
WayfireShellApp::on_activate();
Expand Down
78 changes: 54 additions & 24 deletions src/dock/dock.cpp
Original file line number Diff line number Diff line change
@@ -1,28 +1,25 @@
#include <gtkmm/window.h>
#include <gdkmm/frameclock.h>
#include <glibmm/main.h>
#include <gtkmm.h>
#include <glibmm.h>
#include <gdk/wayland/gdkwayland.h>

#include <gtk-utils.hpp>
#include <wf-shell-app.hpp>
#include <gtk4-layer-shell.h>
#include <wf-autohide-window.hpp>
#include <limits>

#include "dock.hpp"
#include "wf-shell-app.hpp"
#include "wf-autohide-window.hpp"
#include "../util/gtk-utils.hpp"
#include <css-config.hpp>


class WfDock::impl
{
WayfireOutput *output;
std::unique_ptr<WayfireAutohidingWindow> window;
wl_surface *_wl_surface;
Gtk::Box out_box;
Gtk::Box box;
Gtk::FlowBox box;

WfOption<std::string> css_path{"dock/css_path"};
WfOption<int> dock_height{"dock/dock_height"};
WfOption<std::string> position{"dock/position"};
WfOption<int> entries_per_line{"dock/max_per_line"};

public:
impl(WayfireOutput *output)
Expand All @@ -32,20 +29,20 @@ class WfDock::impl
new WayfireAutohidingWindow(output, "dock"));
window->set_auto_exclusive_zone(false);
gtk_layer_set_layer(window->gobj(), GTK_LAYER_SHELL_LAYER_TOP);
gtk_layer_set_anchor(window->gobj(), GTK_LAYER_SHELL_EDGE_LEFT, true);
gtk_layer_set_anchor(window->gobj(), GTK_LAYER_SHELL_EDGE_RIGHT, true);

gtk_layer_set_margin(window->gobj(), GTK_LAYER_SHELL_EDGE_TOP, 0);
gtk_layer_set_margin(window->gobj(), GTK_LAYER_SHELL_EDGE_BOTTOM, 0);
gtk_layer_set_margin(window->gobj(), GTK_LAYER_SHELL_EDGE_LEFT, 0);
gtk_layer_set_margin(window->gobj(), GTK_LAYER_SHELL_EDGE_RIGHT, 0);
out_box.append(box);
out_box.add_css_class("out-box");

box.add_css_class("box");
window->set_child(out_box);

window->add_css_class("wf-dock");
window->set_child(box);
update_layout();

out_box.set_halign(Gtk::Align::CENTER);
window->add_css_class("wf-dock");

if ((std::string)css_path != "")
if (css_path.value() != "")
{
auto css = load_css_from_path(css_path);
if (css)
Expand All @@ -58,12 +55,40 @@ class WfDock::impl
window->present();
_wl_surface = gdk_wayland_surface_get_wl_surface(
window->get_surface()->gobj());
}

box.add_tick_callback([=] (Glib::RefPtr<Gdk::FrameClock> fc)
void update_layout()
{
if (position.value() == "bottom")
{
// this is not great, but we lack better options without doing a
// layout with boxes in boxes (ugly) or some sort of custom layout manager
box.set_orientation(Gtk::Orientation::HORIZONTAL);
box.set_direction(Gtk::TextDirection::LTR);
} else if (position.value() == "left")
{
box.set_orientation(Gtk::Orientation::VERTICAL);
box.set_direction(Gtk::TextDirection::LTR);
} else if (position.value() == "right")
{
set_clickable_region();
return true;
});
box.set_orientation(Gtk::Orientation::VERTICAL);
box.set_direction(Gtk::TextDirection::RTL);
} else // top
{
box.set_orientation(Gtk::Orientation::HORIZONTAL);
box.set_direction(Gtk::TextDirection::LTR);
}

// 0 means no overflowing, so we just set the limits really high
if (entries_per_line == 0)
{
box.set_min_children_per_line(std::numeric_limits<int>::max());
box.set_max_children_per_line(std::numeric_limits<int>::max());
} else
{
box.set_min_children_per_line(entries_per_line);
box.set_max_children_per_line(entries_per_line);
}
}

void add_child(Gtk::Widget& widget)
Expand All @@ -82,7 +107,7 @@ class WfDock::impl
}

/* Sets the central section as clickable and transparent edges as click-through
* Gets called regularly to ensure css size changes all register */
* Gets called regularly to ensure css size changes all register */
void set_clickable_region()
{
auto surface = window->get_surface();
Expand All @@ -106,6 +131,11 @@ WfDock::WfDock(WayfireOutput *output) :
{}
WfDock::~WfDock() = default;

void WfDock::handle_config_reload()
{
pimpl->update_layout();
}

void WfDock::add_child(Gtk::Widget& w)
{
return pimpl->add_child(w);
Expand Down
5 changes: 3 additions & 2 deletions src/dock/dock.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class WfDock
WfDock(WayfireOutput *output);
~WfDock();

void handle_config_reload();
void add_child(Gtk::Widget& widget);
void rem_child(Gtk::Widget& widget);

Expand All @@ -33,11 +34,11 @@ class WfDockApp : public WayfireShellApp

static WfDockApp& get();

/* Starts the program. get() is valid afterward the first (and the only)
* call to run() */
/* Starts the program. get() is valid afterward the first (and the only) call to run() */
static void create(int argc, char **argv);
virtual ~WfDockApp();

void on_config_reload() override;
void on_activate() override;
void handle_new_output(WayfireOutput *output) override;
void handle_output_removed(WayfireOutput *output) override;
Expand Down
Loading
Loading