mirror of
https://github.com/swaywm/sway.git
synced 2026-04-28 06:46:26 -04:00
Support for swaybg as a shell surface
This is a lot of work for a small payoff - the mouse cursor is now
correctly rendered over the background.
Containers can now specify a custom arrange function which will be
called during arrange_windows instead of the usual path for that
container type. For backgrounds, the function sends it to the back and
sets its geometry to the size of the screen.
This requires some changes I'm not too happy with in arrange_windows
with respect to how containers figure out the arrangemnet of their
children (special cases are undesirable).
Also, if anyone runs a debug build as their actual WM, you should know
that I've made it so swaybg is invoked as `./bin/swaybg` in debug builds
now.
This PR also includes a bunch of unrelated refactoring. This is a pretty
significant change and I can only test it under the x backend, so I'd
appreciate it if you kind folks would review+test it yourselves and
leave some 👍 if you like it.
This commit is contained in:
parent
2597321236
commit
802233f3d0
11 changed files with 133 additions and 68 deletions
|
|
@ -77,6 +77,9 @@ struct sway_container {
|
|||
bool is_focused;
|
||||
bool sticky; // floating view always visible on its output
|
||||
|
||||
// Custom arrange function
|
||||
void (*arrange)(struct sway_container *, double width, double height);
|
||||
|
||||
// Attributes that mostly views have.
|
||||
char *name;
|
||||
char *class;
|
||||
|
|
|
|||
|
|
@ -5,40 +5,43 @@
|
|||
#include <wlc/wlc-wayland.h>
|
||||
#include "wayland-desktop-shell-server-protocol.h"
|
||||
#include "list.h"
|
||||
#include "container.h"
|
||||
|
||||
struct background_config {
|
||||
wlc_handle output;
|
||||
wlc_resource surface;
|
||||
// we need the wl_resource of the surface in the destructor
|
||||
struct wl_resource *wl_surface_res;
|
||||
wlc_handle output;
|
||||
wlc_handle handle;
|
||||
wlc_resource surface;
|
||||
// we need the wl_resource of the surface in the destructor
|
||||
struct wl_resource *wl_surface_res;
|
||||
};
|
||||
|
||||
struct panel_config {
|
||||
// wayland resource used in callbacks, is used to track this panel
|
||||
struct wl_resource *wl_resource;
|
||||
wlc_handle output;
|
||||
wlc_resource surface;
|
||||
// we need the wl_resource of the surface in the destructor
|
||||
struct wl_resource *wl_surface_res;
|
||||
enum desktop_shell_panel_position panel_position;
|
||||
// wayland resource used in callbacks, is used to track this panel
|
||||
struct wl_resource *wl_resource;
|
||||
wlc_handle output;
|
||||
wlc_resource surface;
|
||||
// we need the wl_resource of the surface in the destructor
|
||||
struct wl_resource *wl_surface_res;
|
||||
enum desktop_shell_panel_position panel_position;
|
||||
};
|
||||
|
||||
struct desktop_shell_state {
|
||||
list_t *backgrounds;
|
||||
list_t *panels;
|
||||
list_t *lock_surfaces;
|
||||
bool is_locked;
|
||||
struct wlc_size panel_size;
|
||||
list_t *backgrounds;
|
||||
list_t *panels;
|
||||
list_t *lock_surfaces;
|
||||
bool is_locked;
|
||||
struct wlc_size panel_size;
|
||||
};
|
||||
|
||||
struct swaylock_state {
|
||||
bool active;
|
||||
wlc_handle output;
|
||||
wlc_resource surface;
|
||||
bool active;
|
||||
wlc_handle output;
|
||||
wlc_resource surface;
|
||||
};
|
||||
|
||||
extern struct desktop_shell_state desktop_shell;
|
||||
|
||||
void register_extensions(void);
|
||||
void arrange_background_view(swayc_t *view, double width, double height);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -16,4 +16,6 @@ void get_absolute_position(swayc_t *container, struct wlc_point *point);
|
|||
// given wlc_point.
|
||||
void get_absolute_center_position(swayc_t *container, struct wlc_point *point);
|
||||
|
||||
struct output_config *config_for_output(wlc_handle output);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue