wayland: Add support for delete event

This commit is contained in:
Jasper St. Pierre 2014-02-07 17:16:40 -05:00
parent b14e86fad2
commit c52e710dc8
2 changed files with 32 additions and 0 deletions

View File

@ -1005,6 +1005,24 @@ xdg_surface_focused_unset (void *data,
gdk_synthesize_window_state (window, GDK_WINDOW_STATE_FOCUSED, 0);
}
static void
xdg_surface_delete (void *data,
struct xdg_surface *xdg_surface)
{
GdkWindow *window = GDK_WINDOW (data);
GdkDisplay *display;
GdkEvent *event;
display = gdk_window_get_display (window);
event = gdk_event_new (GDK_DELETE);
event->any.window = window;
event->any.send_event = TRUE;
_gdk_wayland_display_deliver_event (display, event);
}
static const struct xdg_surface_listener xdg_surface_listener = {
xdg_surface_ping,
xdg_surface_configure,
@ -1014,6 +1032,7 @@ static const struct xdg_surface_listener xdg_surface_listener = {
xdg_surface_request_unset_maximized,
xdg_surface_focused_set,
xdg_surface_focused_unset,
xdg_surface_delete,
};
static void

View File

@ -373,6 +373,19 @@
decorations should be updated accordingly.
</description>
</event>
<event name="delete">
<description summary="surface wants to be closed">
The delete event is sent by the compositor when the user
wants the surface to be closed. This should be equivalent to
the user clicking the close button in client-side decorations,
if your application has any...
This is only a request that the user intends to close your
window. The client may choose to ignore this request, or show
a dialog to ask the user to save their data...
</description>
</event>
</interface>
<interface name="xdg_popup" version="1">