mirror of
https://github.com/swaywm/sway.git
synced 2024-11-14 06:24:20 +01:00
5c4f52f953
Panels were explicitly rendered by calling wlc_surface_render in handle_output_pre_render. Calling wlc_surface_render does not set the surface's geometry (like wlc_view_set_geometry does). Sway did not call wlc_view_set_geometry for panels, so wlc defaulted their geometry to be at the origin. This is not correct for bars unless their location is top. Furthermore, for a surface to receive pointer events, its mask has to be set to visible. This causes wlc to render these surfaces, causing panels and backgrounds to be rendered twice. This commit makes panels and surfaces visible, sets the correct geometries and removes the code that explicitly rendered them.
48 lines
1.1 KiB
C
48 lines
1.1 KiB
C
#ifndef _SWAY_EXTENSIONS_H
|
|
#define _SWAY_EXTENSIONS_H
|
|
|
|
#include <wayland-server.h>
|
|
#include <wlc/wlc-wayland.h>
|
|
#include "wayland-desktop-shell-server-protocol.h"
|
|
#include "list.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;
|
|
};
|
|
|
|
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;
|
|
// used to determine if client is a panel
|
|
struct wl_client *client;
|
|
// wlc handle for this panel's surface, not set until panel is created
|
|
wlc_handle handle;
|
|
};
|
|
|
|
struct desktop_shell_state {
|
|
list_t *backgrounds;
|
|
list_t *panels;
|
|
list_t *lock_surfaces;
|
|
bool is_locked;
|
|
};
|
|
|
|
struct swaylock_state {
|
|
bool active;
|
|
wlc_handle output;
|
|
wlc_resource surface;
|
|
};
|
|
|
|
extern struct desktop_shell_state desktop_shell;
|
|
|
|
void register_extensions(void);
|
|
|
|
#endif
|