Commit dde64e0e authored by Guido Günther's avatar Guido Günther

Remove old desktop_shell code, weston_desktop_shell is the way to go

parent 8e3fd02c
<protocol name="desktop">
<interface name="desktop_shell" version="3">
<description summary="create desktop widgets and helpers">
Traditional user interfaces can rely on this interface to define the
foundations of typical desktops. Currently it's possible to set up
background, panels and locking surfaces.
</description>
<request name="set_background">
<arg name="output" type="object" interface="wl_output"/>
<arg name="surface" type="object" interface="wl_surface"/>
</request>
<request name="set_panel">
<arg name="output" type="object" interface="wl_output"/>
<arg name="surface" type="object" interface="wl_surface"/>
</request>
<request name="set_lock_surface">
<arg name="surface" type="object" interface="wl_surface"/>
</request>
<request name="unlock"/>
<request name="set_grab_surface">
<description summary="set grab surface">
The surface set by this request will receive a fake
pointer.enter event during grabs at position 0, 0 and is
expected to set an appropriate cursor image as described by
the grab_cursor event sent just before the enter event.
</description>
<arg name="surface" type="object" interface="wl_surface"/>
</request>
<request name="desktop_ready" since="2">
<description summary="desktop is ready to be shown">
Tell the server, that enough desktop elements have been drawn
to make the desktop look ready for use. During start-up, the
server can wait for this request with a black screen before
starting to fade in the desktop, for instance. If the client
parts of a desktop take a long time to initialize, we avoid
showing temporary garbage.
</description>
</request>
<!-- We'll fold most of wl_shell into this interface and then
they'll share the configure event. -->
<event name="configure">
<arg name="edges" type="uint"/>
<arg name="surface" type="object" interface="wl_surface"/>
<arg name="width" type="int"/>
<arg name="height" type="int"/>
</event>
<event name="prepare_lock_surface">
<description summary="tell the client to create, set the lock surface">
Tell the shell we want it to create and set the lock surface, which is
a GUI asking the user to unlock the screen. The lock surface is
announced with 'set_lock_surface'. Whether or not the shell actually
implements locking, it MUST send 'unlock' request to let the normal
desktop resume.
</description>
</event>
<event name="grab_cursor">
<description summary="tell client what cursor to show during a grab">
This event will be sent immediately before a fake enter event on the
grab surface.
</description>
<arg name="cursor" type="uint"/>
</event>
<enum name="cursor">
<entry name="none" value="0"/>
<entry name="resize_top" value="1"/>
<entry name="resize_bottom" value="2"/>
<entry name="arrow" value="3"/>
<entry name="resize_left" value="4"/>
<entry name="resize_top_left" value="5"/>
<entry name="resize_bottom_left" value="6"/>
<entry name="move" value="7"/>
<entry name="resize_right" value="8"/>
<entry name="resize_top_right" value="9"/>
<entry name="resize_bottom_right" value="10"/>
<entry name="busy" value="11"/>
</enum>
<!-- version 3 additions -->
<enum name="panel_position">
<entry name="top" value="0"/>
<entry name="bottom" value="1"/>
<entry name="left" value="2"/>
<entry name="right" value="3"/>
</enum>
<request name="set_panel_position" since="3">
<arg name="position" type="uint"/>
<description summary="set panel position">
Tell the shell which side of the screen the panel is
located. This is so that new windows do not overlap the panel
and maximized windows maximize properly.
</description>
</request>
</interface>
<interface name="screensaver" version="1">
<description summary="interface for implementing screensavers">
Only one client can bind this interface at a time.
</description>
<request name="set_surface">
<description summary="set the surface type as a screensaver">
A screensaver surface is normally hidden, and only visible after an
idle timeout.
</description>
<arg name="surface" type="object" interface="wl_surface"/>
<arg name="output" type="object" interface="wl_output"/>
</request>
</interface>
</protocol>
......@@ -23,8 +23,6 @@ maynard_SOURCES = \
maynard-resources.h \
weston-desktop-shell-client-protocol.h \
weston-desktop-shell-protocol.c \
desktop-shell-client-protocol.h \
desktop-shell-protocol.c \
shell-helper-client-protocol.h \
shell-helper-protocol.c
maynard_LDADD = $(GTK_LIBS) -lm
......@@ -32,8 +30,6 @@ maynard_LDADD = $(GTK_LIBS) -lm
BUILT_SOURCES = \
weston-desktop-shell-client-protocol.h \
weston-desktop-shell-protocol.c \
desktop-shell-client-protocol.h \
desktop-shell-protocol.c \
shell-helper-client-protocol.h \
shell-helper-protocol.c \
maynard-resources.c \
......
......@@ -28,7 +28,6 @@
#include <gtk/gtk.h>
#include <gdk/gdkwayland.h>
#include "desktop-shell-client-protocol.h"
#include "weston-desktop-shell-client-protocol.h"
#include "shell-helper-client-protocol.h"
......@@ -52,7 +51,6 @@ struct element {
struct desktop {
struct wl_display *display;
struct wl_registry *registry;
struct desktop_shell *shell;
struct weston_desktop_shell *wshell;
struct wl_output *output;
struct shell_helper *helper;
......@@ -142,10 +140,7 @@ shell_configure (struct desktop *desktop,
- grid_width,
((height - window_height) / 2) + MAYNARD_CLOCK_HEIGHT);
if (desktop->shell)
desktop_shell_desktop_ready (desktop->shell);
else
weston_desktop_shell_desktop_ready (desktop->wshell);
weston_desktop_shell_desktop_ready (desktop->wshell);
/* TODO: why does the panel signal leave on drawing for
* startup? we don't want to have to have this silly
......@@ -153,16 +148,6 @@ shell_configure (struct desktop *desktop,
g_timeout_add_seconds (1, connect_enter_leave_signals, desktop);
}
static void
desktop_shell_configure (void *data,
struct desktop_shell *desktop_shell,
uint32_t edges,
struct wl_surface *surface,
int32_t width, int32_t height)
{
shell_configure(data, edges, surface, width, height);
}
static void
weston_desktop_shell_configure (void *data,
struct weston_desktop_shell *weston_desktop_shell,
......@@ -173,13 +158,6 @@ weston_desktop_shell_configure (void *data,
shell_configure(data, edges, surface, width, height);
}
static void
desktop_shell_prepare_lock_surface (void *data,
struct desktop_shell *desktop_shell)
{
desktop_shell_unlock (desktop_shell);
}
static void
weston_desktop_shell_prepare_lock_surface (void *data,
struct weston_desktop_shell *weston_desktop_shell)
......@@ -187,13 +165,6 @@ weston_desktop_shell_prepare_lock_surface (void *data,
weston_desktop_shell_unlock (weston_desktop_shell);
}
static void
desktop_shell_grab_cursor (void *data,
struct desktop_shell *desktop_shell,
uint32_t cursor)
{
}
static void
weston_desktop_shell_grab_cursor (void *data,
struct weston_desktop_shell *weston_desktop_shell,
......@@ -201,12 +172,6 @@ weston_desktop_shell_grab_cursor (void *data,
{
}
static const struct desktop_shell_listener shell_listener = {
desktop_shell_configure,
desktop_shell_prepare_lock_surface,
desktop_shell_grab_cursor
};
static const struct weston_desktop_shell_listener wshell_listener = {
weston_desktop_shell_configure,
weston_desktop_shell_prepare_lock_surface,
......@@ -490,21 +455,13 @@ panel_create (struct desktop *desktop)
gdk_wayland_window_set_use_custom_surface (gdk_window);
panel->surface = gdk_wayland_window_get_wl_surface (gdk_window);
if (desktop->shell)
{
desktop_shell_set_user_data (desktop->shell, desktop);
desktop_shell_set_panel (desktop->shell, desktop->output, panel->surface);
desktop_shell_set_panel_position (desktop->shell,
DESKTOP_SHELL_PANEL_POSITION_LEFT);
}
else
{
weston_desktop_shell_set_user_data (desktop->wshell, desktop);
weston_desktop_shell_set_panel (desktop->wshell, desktop->output,
panel->surface);
weston_desktop_shell_set_panel_position (desktop->wshell,
DESKTOP_SHELL_PANEL_POSITION_LEFT);
}
weston_desktop_shell_set_user_data (desktop->wshell, desktop);
weston_desktop_shell_set_panel (desktop->wshell, desktop->output,
panel->surface);
weston_desktop_shell_set_panel_position (desktop->wshell,
WESTON_DESKTOP_SHELL_PANEL_POSITION_LEFT);
shell_helper_set_panel (desktop->helper, panel->surface);
gtk_widget_show_all (panel->window);
......@@ -606,18 +563,10 @@ background_create (struct desktop *desktop)
gdk_wayland_window_set_use_custom_surface (gdk_window);
background->surface = gdk_wayland_window_get_wl_surface (gdk_window);
if (desktop->shell)
{
desktop_shell_set_user_data (desktop->shell, desktop);
desktop_shell_set_background (desktop->shell, desktop->output,
background->surface);
}
else
{
weston_desktop_shell_set_user_data (desktop->wshell, desktop);
weston_desktop_shell_set_background (desktop->wshell, desktop->output,
background->surface);
}
weston_desktop_shell_set_user_data (desktop->wshell, desktop);
weston_desktop_shell_set_background (desktop->wshell, desktop->output,
background->surface);
desktop->background = background;
......@@ -783,14 +732,7 @@ registry_handle_global (void *data,
{
struct desktop *d = data;
if (!strcmp (interface, "desktop_shell"))
{
d->shell = wl_registry_bind (registry, name,
&desktop_shell_interface, MIN(version, 3));
desktop_shell_add_listener (d->shell, &shell_listener, d);
desktop_shell_set_user_data (d->shell, d);
}
else if (!strcmp (interface, "weston_desktop_shell"))
if (!strcmp (interface, "weston_desktop_shell"))
{
d->wshell = wl_registry_bind (registry, name,
&weston_desktop_shell_interface, MIN(version, 1));
......@@ -873,7 +815,7 @@ main (int argc,
desktop = malloc (sizeof *desktop);
desktop->output = NULL;
desktop->shell = NULL;
desktop->wshell = NULL;
desktop->helper = NULL;
desktop->seat = NULL;
desktop->pointer = NULL;
......@@ -893,15 +835,13 @@ main (int argc,
/* Wait until we have been notified about the compositor,
* shell, and shell helper objects */
if (!desktop->output || (!desktop->shell && !desktop->wshell) ||
!desktop->helper)
if (!desktop->output || !desktop->wshell || !desktop->helper)
wl_display_roundtrip (desktop->display);
if (!desktop->output || (!desktop->shell && !desktop->wshell) ||
!desktop->helper)
if (!desktop->output || !desktop->wshell || !desktop->helper)
{
fprintf (stderr, "could not find output, shell or helper modules\n");
fprintf (stderr, "output: %p, shell: %p, wshell: %p, helper: %p\n",
desktop->output, desktop->shell, desktop->wshell, desktop->helper);
fprintf (stderr, "output: %p, wshell: %p, helper: %p\n",
desktop->output, desktop->wshell, desktop->helper);
return -1;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment