shell_fade_startup(shell);
}
+static void
+desktop_shell_set_panel_position(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t position)
+{
+ struct desktop_shell *shell = wl_resource_get_user_data(resource);
+
+ if (position != DESKTOP_SHELL_PANEL_POSITION_TOP &&
+ position != DESKTOP_SHELL_PANEL_POSITION_BOTTOM &&
+ position != DESKTOP_SHELL_PANEL_POSITION_LEFT &&
+ position != DESKTOP_SHELL_PANEL_POSITION_RIGHT) {
+ wl_resource_post_error(resource,
+ DESKTOP_SHELL_ERROR_INVALID_ARGUMENT,
+ "bad position argument");
+ return;
+ }
+
+ shell->panel_position = position;
+}
+
static const struct desktop_shell_interface desktop_shell_implementation = {
desktop_shell_set_background,
desktop_shell_set_panel,
desktop_shell_set_lock_surface,
desktop_shell_unlock,
desktop_shell_set_grab_surface,
- desktop_shell_desktop_ready
+ desktop_shell_desktop_ready,
+ desktop_shell_set_panel_position
};
static enum shell_surface_type
struct wl_resource *resource;
resource = wl_resource_create(client, &desktop_shell_interface,
- MIN(version, 2), id);
+ MIN(version, 3), id);
if (client == shell->child.client) {
wl_resource_set_implementation(resource,
return -1;
if (wl_global_create(ec->wl_display,
- &desktop_shell_interface, 2,
+ &desktop_shell_interface, 3,
shell, bind_desktop_shell) == NULL)
return -1;
shell->child.deathstamp = weston_compositor_get_time();
+ shell->panel_position = DESKTOP_SHELL_PANEL_POSITION_TOP;
+
setup_output_destroy_handler(ec, shell);
loop = wl_display_get_event_loop(ec->wl_display);
<protocol name="desktop">
- <interface name="desktop_shell" version="2">
+ <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
</description>
</request>
+ <!-- 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>
+
+ <enum name="error">
+ <entry name="invalid_argument" value="0"
+ summary="an invalid argument was provided in a request"/>
+ </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">