{
struct wayland_input *input = data;
+ if (!input->output)
+ return;
+
if (input->output->frame) {
frame_pointer_leave(input->output->frame, input);
int32_t fx, fy;
enum theme_location location;
+ if (!input->output)
+ return;
+
if (input->output->frame) {
location = frame_pointer_motion(input->output->frame, input,
wl_fixed_to_int(x),
enum frame_button_state fstate;
enum theme_location location;
+ if (!input->output)
+ return;
+
if (input->output->frame) {
fstate = state == WL_POINTER_BUTTON_STATE_PRESSED ?
FRAME_BUTTON_PRESSED : FRAME_BUTTON_RELEASED;
return;
}
- if (frame_status(input->output->frame) & FRAME_STATUS_CLOSE)
- wl_display_terminate(input->compositor->base.wl_display);
+ if (frame_status(input->output->frame) & FRAME_STATUS_CLOSE) {
+ wayland_output_destroy(&input->output->base);
+ input->output = input->keyboard_focus = NULL;
+
+ if (wl_list_empty(&input->compositor->base.output_list))
+ wl_display_terminate(input->compositor->base.wl_display);
+
+ return;
+ }
if (frame_status(input->output->frame) & FRAME_STATUS_REPAINT)
weston_output_schedule_repaint(&input->output->base);
focus = input->keyboard_focus;
if (!focus)
- return; /* This shouldn't happen */
+ return;
focus->keyboard_count--;
if (!focus->keyboard_count && focus->frame) {