diff --git a/docs/changelog.rst b/docs/changelog.rst index f8f17c873..2fd790fe8 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -145,6 +145,9 @@ Detailed list of changes - Fix cursor blink animation when :opt:`background_opacity` is less than one (:iss:`8401`) +- Wayland: panel kitten: Add a :code:`center` mode for creating panels to ease + creation of centered popups in Wayland (:pull:`8411`) + 0.39.1 [2025-02-01] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/kittens/panel/main.py b/kittens/panel/main.py index 1339a39f0..71146d934 100644 --- a/kittens/panel/main.py +++ b/kittens/panel/main.py @@ -79,10 +79,11 @@ The value :code:`background` means make the panel the "desktop wallpaper". This is only supported on Wayland, not X11 and note that when using sway if you set a background in your sway config it will cover the background drawn using this kitten. +Additionally, there are two Wayland only values: :code:`center` and :code:`none`. The value :code:`center` anchors the panel to all sides and covers the entire -display by default. The panel can be shrinked using the margin parameters. +display by default. The panel can be shrunk using the margin parameters. The value :code:`none` anchors the panel to the top left corner and should be -placed using the margin parameters, works only on Wayland. +placed using the margin parameters. --layer @@ -134,7 +135,7 @@ type=int default=-1 On a Wayland compositor that supports the wlr layer shell protocol, request a given exclusive zone for the panel. Please refer to the wlr layer shell documentation for more details on the meaning of exclusive and its value. -If :option:`--edge` is set to anything else than :code:`center` or :code:`none`, this flag will not have any +If :option:`--edge` is set to anything other than :code:`center` or :code:`none`, this flag will not have any effect unless the flag :option:`--override-exclusive-zone` is also set. If :option:`--edge` is set to :code:`background`, this option has no effect. diff --git a/kitty/glfw.c b/kitty/glfw.c index 5bd31e7d6..c1f16a667 100644 --- a/kitty/glfw.c +++ b/kitty/glfw.c @@ -1041,9 +1041,7 @@ edge_spacing(GLFWEdge which) { case GLFW_EDGE_BOTTOM: edge = "bottom"; break; case GLFW_EDGE_LEFT: edge = "left"; break; case GLFW_EDGE_RIGHT: edge = "right"; break; - case GLFW_EDGE_CENTER: - case GLFW_EDGE_NONE: - return 0; + case GLFW_EDGE_CENTER: case GLFW_EDGE_NONE: return 0; } if (!edge_spacing_func) { log_error("Attempt to call edge_spacing() without first setting edge_spacing_func");