Commit f6a61224 authored by hirono's avatar hirono Committed by Commit bot

Add new wayland request to enter screen locking mode.

The CL adds a new wayland request 'pin_with_trusted_flag' that replaces the
existing request 'pin'. The new request takes a trusted flag so that trusted
apps can be allowed to enforce users to stay in pinned mode.

The CL also adds new window state 'trusted_pinned' which will be used in further implementation to specify pinned state invoked by trusted apps.

BUG=b/29325086
TEST=None

Review-Url: https://codereview.chromium.org/2276443002
Cr-Commit-Position: refs/heads/master@{#414334}
parent 26470a9d
......@@ -184,6 +184,10 @@ enum zwp_remote_shell_v1_state_type {
* pinned window state
*/
ZWP_REMOTE_SHELL_V1_STATE_TYPE_PINNED = 5,
/**
* trusted pinned window state
*/
ZWP_REMOTE_SHELL_V1_STATE_TYPE_TRUSTED_PINNED = 6,
};
#endif /* ZWP_REMOTE_SHELL_V1_STATE_TYPE_ENUM */
......@@ -548,6 +552,7 @@ zwp_remote_surface_v1_add_listener(struct zwp_remote_surface_v1 *zwp_remote_surf
#define ZWP_REMOTE_SURFACE_V1_UNSET_SYSTEM_MODAL 15
#define ZWP_REMOTE_SURFACE_V1_SET_RECTANGULAR_SHADOW_BACKGROUND_OPACITY 16
#define ZWP_REMOTE_SURFACE_V1_ACTIVATE 17
#define ZWP_REMOTE_SURFACE_V1_PIN_WITH_TRUSTED_FLAG 18
/**
* @ingroup iface_zwp_remote_surface_v1
......@@ -621,6 +626,10 @@ zwp_remote_surface_v1_add_listener(struct zwp_remote_surface_v1 *zwp_remote_surf
* @ingroup iface_zwp_remote_surface_v1
*/
#define ZWP_REMOTE_SURFACE_V1_ACTIVATE_SINCE_VERSION 10
/**
* @ingroup iface_zwp_remote_surface_v1
*/
#define ZWP_REMOTE_SURFACE_V1_PIN_WITH_TRUSTED_FLAG_SINCE_VERSION 11
/** @ingroup iface_zwp_remote_surface_v1 */
static inline void
......@@ -934,6 +943,24 @@ zwp_remote_surface_v1_activate(struct zwp_remote_surface_v1 *zwp_remote_surface_
ZWP_REMOTE_SURFACE_V1_ACTIVATE, serial);
}
/**
* @ingroup iface_zwp_remote_surface_v1
*
* Request that surface is pinned.
*
* This is only a request that the window should be pinned.
* The compositor may choose to ignore this request. The client should
* listen to set_pinned events to determine if the window was
* pinned or not. If trusted flag is non-zero, the app can prevent users
* from exiting the pinned mode.
*/
static inline void
zwp_remote_surface_v1_pin_with_trusted_flag(struct zwp_remote_surface_v1 *zwp_remote_surface_v1, int32_t trusted)
{
wl_proxy_marshal((struct wl_proxy *) zwp_remote_surface_v1,
ZWP_REMOTE_SURFACE_V1_PIN_WITH_TRUSTED_FLAG, trusted);
}
#define ZWP_NOTIFICATION_SURFACE_V1_DESTROY 0
/**
......
......@@ -187,6 +187,10 @@ enum zwp_remote_shell_v1_state_type {
* pinned window state
*/
ZWP_REMOTE_SHELL_V1_STATE_TYPE_PINNED = 5,
/**
* trusted pinned window state
*/
ZWP_REMOTE_SHELL_V1_STATE_TYPE_TRUSTED_PINNED = 6,
};
#endif /* ZWP_REMOTE_SHELL_V1_STATE_TYPE_ENUM */
......@@ -570,15 +574,31 @@ struct zwp_remote_surface_v1_interface {
struct wl_resource *resource,
wl_fixed_t opacity);
/**
* activate surface
*
* Make surface active.
* make the surface active
*
* Make the surface active and bring it to the front.
* @param serial the serial of the user event
* @since 10
*/
void (*activate)(struct wl_client *client,
struct wl_resource *resource,
uint32_t serial);
struct wl_resource *resource,
uint32_t serial);
/**
* set window mode as pinned with taking a trasted flag.
*
* Request that surface is pinned.
*
* This is only a request that the window should be pinned. The
* compositor may choose to ignore this request. The client should
* listen to set_pinned events to determine if the window was
* pinned or not. If trusted flag is non-zero, the app can prevent
* users from exiting the pinned mode.
* @param trusted whether the app can enforce users to stay in the pinned mode.
* @since 11
*/
void (*pin_with_trusted_flag)(struct wl_client *client,
struct wl_resource *resource,
int32_t trusted);
};
#define ZWP_REMOTE_SURFACE_V1_SET_FULLSCREEN 0
......
......@@ -65,7 +65,7 @@ static const struct wl_message zwp_remote_shell_v1_events[] = {
};
WL_EXPORT const struct wl_interface zwp_remote_shell_v1_interface = {
"zwp_remote_shell_v1", 10,
"zwp_remote_shell_v1", 11,
3, zwp_remote_shell_v1_requests,
4, zwp_remote_shell_v1_events,
};
......@@ -89,6 +89,7 @@ static const struct wl_message zwp_remote_surface_v1_requests[] = {
{ "unset_system_modal", "8", types + 0 },
{ "set_rectangular_shadow_background_opacity", "9f", types + 0 },
{ "activate", "10u", types + 0 },
{ "pin_with_trusted_flag", "11i", types + 0 },
};
static const struct wl_message zwp_remote_surface_v1_events[] = {
......@@ -105,8 +106,8 @@ static const struct wl_message zwp_remote_surface_v1_events[] = {
};
WL_EXPORT const struct wl_interface zwp_remote_surface_v1_interface = {
"zwp_remote_surface_v1", 10,
18, zwp_remote_surface_v1_requests,
"zwp_remote_surface_v1", 11,
19, zwp_remote_surface_v1_requests,
10, zwp_remote_surface_v1_events,
};
......
......@@ -38,7 +38,7 @@
reset.
</description>
<interface name="zwp_remote_shell_v1" version="10">
<interface name="zwp_remote_shell_v1" version="11">
<description summary="remote_shell">
The global interface that allows clients to turn a wl_surface into a
"real window" which is remotely managed but can be stacked, activated
......@@ -63,6 +63,7 @@
<entry name="maximized" value="3" summary="maximized window state"/>
<entry name="fullscreen" value="4" summary="fullscreen window state"/>
<entry name="pinned" value="5" summary="pinned window state"/>
<entry name="trusted_pinned" value="6" summary="trusted pinned window state"/>
</enum>
<enum name="error">
......@@ -167,7 +168,7 @@
</event>
</interface>
<interface name="zwp_remote_surface_v1" version="10">
<interface name="zwp_remote_surface_v1" version="11">
<description summary="A desktop window">
An interface that may be implemented by a wl_surface, for
implementations that provide a desktop-style user interface
......@@ -504,6 +505,22 @@
</description>
<arg name="serial" type="uint" summary="the serial of the user event"/>
</request>
<!-- Version 11 additions -->
<request name="pin_with_trusted_flag" since="11">
<description summary="set window mode as pinned with taking a trasted flag.">
Request that surface is pinned.
This is only a request that the window should be pinned.
The compositor may choose to ignore this request. The client should
listen to set_pinned events to determine if the window was
pinned or not. If trusted flag is non-zero, the app can prevent users
from exiting the pinned mode.
</description>
<arg name="trusted" type="int" summary="whether the app can enforce users
to stay in the pinned mode."/>
</request>
</interface>
<!-- Version 6 additions -->
......
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