diff options
author | Kristian Høgsberg <krh@bitplanet.net> | 2011-12-05 09:51:16 -0500 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2011-12-05 11:16:27 -0500 |
commit | c041f4771d17ae9902f04891179216b6cdb7cedc (patch) | |
tree | 7224243a78939c6fdfc29d2300896a8ba469701c | |
parent | 58bb064afa3bfc706e3b30dd170804235aa272ea (diff) |
menumenu
-rw-r--r-- | protocol/wayland.xml | 17 | ||||
-rw-r--r-- | src/wayland-server.c | 2 | ||||
-rw-r--r-- | src/wayland-server.h | 7 |
3 files changed, 25 insertions, 1 deletions
diff --git a/protocol/wayland.xml b/protocol/wayland.xml index b80f25e..085f526 100644 --- a/protocol/wayland.xml +++ b/protocol/wayland.xml @@ -331,6 +331,21 @@ active? --> <request name="set_fullscreen"/> + <!-- Pop up a menu. Will switch an implicit grab into + owner-events mode, and grab will continue after the implicit + grab ends (button released). Once the implicit grab is over, + the menu grab continues until the window is destroyed or a + mouse button is pressed in any other clients window. A click + in any of the clients surfaces is reported as normal, + however, clicks in other clients surfaces will be discarded + and trigger the callback. --> + <request name="set_menu"> + <arg name="parent" type="object" interface="wl_shell_surface"/> + <arg name="x" type="int"/> + <arg name="y" type="int"/> + <arg name="flags" type="uint"/> + </request> + <!-- The configure event asks the client to resize its surface. The size is a hint, in the sense that the client is free to ignore it if it doesn't resize, pick a smaller size (to @@ -343,6 +358,8 @@ <arg name="width" type="int"/> <arg name="height" type="int"/> </event> + + <event name="menu_done"/> </interface> diff --git a/src/wayland-server.c b/src/wayland-server.c index 421c3f0..97e1c17 100644 --- a/src/wayland-server.c +++ b/src/wayland-server.c @@ -502,7 +502,7 @@ wl_input_device_end_grab(struct wl_input_device *device, uint32_t time) interface = device->grab->interface; interface->end(device->grab, time); - device->grab = NULL; + device->grab = &device->default_grab; wl_list_remove(&device->grab_listener.link); } diff --git a/src/wayland-server.h b/src/wayland-server.h index 8019c56..32fd497 100644 --- a/src/wayland-server.h +++ b/src/wayland-server.h @@ -147,6 +147,11 @@ struct wl_surface { struct wl_grab; struct wl_grab_interface { + void (*enter)(struct wl_grab *grab, + uint32_t time, struct wl_surface *surface, + int32_t x, int32_t y); + void (*leave)(struct wl_grab *grab, + uint32_t time, struct wl_surface *surface); void (*motion)(struct wl_grab *grab, uint32_t time, int32_t x, int32_t y); void (*button)(struct wl_grab *grab, @@ -157,6 +162,7 @@ struct wl_grab_interface { struct wl_grab { const struct wl_grab_interface *interface; struct wl_input_device *input_device; + struct wl_surface *focus; }; struct wl_input_device { @@ -173,6 +179,7 @@ struct wl_input_device { int32_t x, y; struct wl_grab *grab; + struct wl_grab default_grab; struct wl_grab implicit_grab; uint32_t grab_time; int32_t grab_x, grab_y; |