struct shell_surface;
-struct wl_shell {
+struct desktop_shell {
struct weston_compositor *compositor;
struct wl_listener lock_listener;
struct weston_surface *surface;
struct wl_listener surface_destroy_listener;
struct shell_surface *parent;
- struct wl_shell *shell;
+ struct desktop_shell *shell;
enum shell_surface_type type;
int32_t saved_x, saved_y;
get_shell_surface(struct weston_surface *surface);
static void
-shell_configuration(struct wl_shell *shell)
+shell_configuration(struct desktop_shell *shell)
{
char *config_file;
char *path = NULL;
shsurf->type = SHELL_SURFACE_TRANSIENT;
}
-static struct wl_shell *
+static struct desktop_shell *
shell_surface_get_shell(struct shell_surface *shsurf)
{
return shsurf->shell;
}
static int
-get_output_panel_height(struct wl_shell *wlshell,struct weston_output *output)
+get_output_panel_height(struct desktop_shell *shell,
+ struct weston_output *output)
{
struct shell_surface *priv;
int panel_height = 0;
if (!output)
return 0;
- wl_list_for_each(priv, &wlshell->panels, link) {
+ wl_list_for_each(priv, &shell->panels, link) {
if (priv->output == output) {
panel_height = priv->surface->geometry.height;
break;
{
struct shell_surface *shsurf = resource->data;
struct weston_surface *es = shsurf->surface;
- struct wl_shell *wlshell = NULL;
+ struct desktop_shell *shell = NULL;
uint32_t edges = 0, panel_height = 0;
/* get the default output, if the client set it as NULL
shsurf->saved_y = es->geometry.y;
shsurf->saved_position_valid = true;
- wlshell = shell_surface_get_shell(shsurf);
- panel_height = get_output_panel_height(wlshell, es->output);
+ shell = shell_surface_get_shell(shsurf);
+ panel_height = get_output_panel_height(shell, es->output);
edges = WL_SHELL_SURFACE_RESIZE_TOP|WL_SHELL_SURFACE_RESIZE_LEFT;
wl_shell_surface_send_configure(&shsurf->resource, edges,
shell_stack_fullscreen(struct shell_surface *shsurf)
{
struct weston_surface *surface = shsurf->surface;
- struct wl_shell *shell = shell_surface_get_shell(shsurf);
+ struct desktop_shell *shell = shell_surface_get_shell(shsurf);
wl_list_remove(&surface->layer_link);
wl_list_remove(&shsurf->fullscreen.black_surface->layer_link);
}
static void
-launch_screensaver(struct wl_shell *shell)
+launch_screensaver(struct desktop_shell *shell)
{
if (shell->screensaver.binding)
return;
}
static void
-terminate_screensaver(struct wl_shell *shell)
+terminate_screensaver(struct desktop_shell *shell)
{
if (shell->screensaver.process.pid == 0)
return;
}
static void
-show_screensaver(struct wl_shell *shell, struct shell_surface *surface)
+show_screensaver(struct desktop_shell *shell, struct shell_surface *surface)
{
struct wl_list *list;
}
static void
-hide_screensaver(struct wl_shell *shell, struct shell_surface *surface)
+hide_screensaver(struct desktop_shell *shell, struct shell_surface *surface)
{
wl_list_remove(&surface->surface->layer_link);
wl_list_init(&surface->surface->layer_link);
struct wl_resource *output_resource,
struct wl_resource *surface_resource)
{
- struct wl_shell *shell = resource->data;
+ struct desktop_shell *shell = resource->data;
struct shell_surface *shsurf = surface_resource->data;
struct weston_surface *surface = shsurf->surface;
struct shell_surface *priv;
struct wl_resource *output_resource,
struct wl_resource *surface_resource)
{
- struct wl_shell *shell = resource->data;
+ struct desktop_shell *shell = resource->data;
struct shell_surface *shsurf = surface_resource->data;
struct weston_surface *surface = shsurf->surface;
struct shell_surface *priv;
static void
handle_lock_surface_destroy(struct wl_listener *listener, void *data)
{
- struct wl_shell *shell =
- container_of(listener, struct wl_shell, lock_surface_listener);
+ struct desktop_shell *shell =
+ container_of(listener, struct desktop_shell, lock_surface_listener);
fprintf(stderr, "lock surface gone\n");
shell->lock_surface = NULL;
struct wl_resource *resource,
struct wl_resource *surface_resource)
{
- struct wl_shell *shell = resource->data;
+ struct desktop_shell *shell = resource->data;
struct shell_surface *surface = surface_resource->data;
if (reset_shell_surface_type(surface))
}
static void
-resume_desktop(struct wl_shell *shell)
+resume_desktop(struct desktop_shell *shell)
{
struct shell_surface *tmp;
desktop_shell_unlock(struct wl_client *client,
struct wl_resource *resource)
{
- struct wl_shell *shell = resource->data;
+ struct desktop_shell *shell = resource->data;
shell->prepare_event_sent = false;
}
static void
-activate(struct wl_shell *shell, struct weston_surface *es,
+activate(struct desktop_shell *shell, struct weston_surface *es,
struct weston_input_device *device)
{
struct weston_surface *surf, *prev;
uint32_t button, uint32_t axis, int32_t state, void *data)
{
struct weston_input_device *wd = (struct weston_input_device *) device;
- struct wl_shell *shell = data;
+ struct desktop_shell *shell = data;
struct weston_surface *focus;
struct weston_surface *upper;
static void
lock(struct wl_listener *listener, void *data)
{
- struct wl_shell *shell =
- container_of(listener, struct wl_shell, lock_listener);
+ struct desktop_shell *shell =
+ container_of(listener, struct desktop_shell, lock_listener);
struct weston_input_device *device;
struct shell_surface *shsurf;
struct weston_output *output;
static void
unlock(struct wl_listener *listener, void *data)
{
- struct wl_shell *shell =
- container_of(listener, struct wl_shell, unlock_listener);
+ struct desktop_shell *shell =
+ container_of(listener, struct desktop_shell, unlock_listener);
if (!shell->locked || shell->lock_surface) {
weston_compositor_wake(shell->compositor);
}
static void
-map(struct wl_shell *shell, struct weston_surface *surface,
+map(struct desktop_shell *shell, struct weston_surface *surface,
int32_t width, int32_t height, int32_t sx, int32_t sy)
{
struct weston_compositor *compositor = shell->compositor;
}
static void
-configure(struct wl_shell *shell, struct weston_surface *surface,
+configure(struct desktop_shell *shell, struct weston_surface *surface,
GLfloat x, GLfloat y, int32_t width, int32_t height)
{
enum shell_surface_type surface_type = SHELL_SURFACE_NONE;
shell_surface_configure(struct weston_surface *es, int32_t sx, int32_t sy)
{
struct shell_surface *shsurf = get_shell_surface(es);
- struct wl_shell *shell = shsurf->shell;
+ struct desktop_shell *shell = shsurf->shell;
if (!weston_surface_is_mapped(es)) {
map(shell, es, es->buffer->width, es->buffer->height, sx, sy);
}
}
-static int launch_desktop_shell_process(struct wl_shell *shell);
+static int launch_desktop_shell_process(struct desktop_shell *shell);
static void
desktop_shell_sigchld(struct weston_process *process, int status)
{
uint32_t time;
- struct wl_shell *shell =
- container_of(process, struct wl_shell, child.process);
+ struct desktop_shell *shell =
+ container_of(process, struct desktop_shell, child.process);
shell->child.process.pid = 0;
shell->child.client = NULL; /* already destroyed by wayland */
}
static int
-launch_desktop_shell_process(struct wl_shell *shell)
+launch_desktop_shell_process(struct desktop_shell *shell)
{
const char *shell_exe = LIBEXECDIR "/weston-desktop-shell";
static void
bind_shell(struct wl_client *client, void *data, uint32_t version, uint32_t id)
{
- struct wl_shell *shell = data;
+ struct desktop_shell *shell = data;
wl_client_add_object(client, &wl_shell_interface,
&shell_implementation, id, shell);
static void
unbind_desktop_shell(struct wl_resource *resource)
{
- struct wl_shell *shell = resource->data;
+ struct desktop_shell *shell = resource->data;
if (shell->locked)
resume_desktop(shell);
bind_desktop_shell(struct wl_client *client,
void *data, uint32_t version, uint32_t id)
{
- struct wl_shell *shell = data;
+ struct desktop_shell *shell = data;
struct wl_resource *resource;
resource = wl_client_add_object(client, &desktop_shell_interface,
struct wl_resource *shell_surface_resource,
struct wl_resource *output_resource)
{
- struct wl_shell *shell = resource->data;
+ struct desktop_shell *shell = resource->data;
struct shell_surface *surface = shell_surface_resource->data;
struct weston_output *output = output_resource->data;
static void
unbind_screensaver(struct wl_resource *resource)
{
- struct wl_shell *shell = resource->data;
+ struct desktop_shell *shell = resource->data;
shell->screensaver.binding = NULL;
free(resource);
bind_screensaver(struct wl_client *client,
void *data, uint32_t version, uint32_t id)
{
- struct wl_shell *shell = data;
+ struct desktop_shell *shell = data;
struct wl_resource *resource;
resource = wl_client_add_object(client, &screensaver_interface,
}
struct switcher {
- struct wl_shell *shell;
+ struct desktop_shell *shell;
struct weston_surface *current;
struct wl_listener listener;
struct wl_keyboard_grab grab;
uint32_t key, uint32_t button, uint32_t axis,
int32_t state, void *data)
{
- struct wl_shell *shell = data;
+ struct desktop_shell *shell = data;
struct switcher *switcher;
switcher = malloc(sizeof *switcher);
debug_repaint_binding(struct wl_input_device *device, uint32_t time,
uint32_t key, uint32_t button, uint32_t axis, int32_t state, void *data)
{
- struct wl_shell *shell = data;
+ struct desktop_shell *shell = data;
struct weston_compositor *compositor = shell->compositor;
struct weston_surface *surface;
static void
shell_destroy(struct wl_listener *listener, void *data)
{
- struct wl_shell *shell =
- container_of(listener, struct wl_shell, destroy_listener);
+ struct desktop_shell *shell =
+ container_of(listener, struct desktop_shell, destroy_listener);
if (shell->child.client)
wl_client_destroy(shell->child.client);
WL_EXPORT int
shell_init(struct weston_compositor *ec)
{
- struct wl_shell *shell;
+ struct desktop_shell *shell;
shell = malloc(sizeof *shell);
if (shell == NULL)