From: Kristian Høgsberg Date: Tue, 22 Oct 2013 19:40:54 +0000 (-0700) Subject: compositor: Remove redundant and not well-defined focus field X-Git-Tag: 1.3.91~254 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=10ddd97ecffe16a6a5e7329f0be4f0ba381dd8b2;p=platform%2Fupstream%2Fweston.git compositor: Remove redundant and not well-defined focus field It was never clear what this field really did. --- diff --git a/src/compositor-drm.c b/src/compositor-drm.c index 2f33946..60b4cba 100644 --- a/src/compositor-drm.c +++ b/src/compositor-drm.c @@ -2364,7 +2364,6 @@ session_notify(struct wl_listener *listener, void *data) if (ec->base.session_active) { weston_log("activating session\n"); - compositor->focus = 1; compositor->state = ec->prev_state; drm_compositor_set_modes(ec); weston_compositor_damage_all(compositor); @@ -2373,7 +2372,6 @@ session_notify(struct wl_listener *listener, void *data) weston_log("deactivating session\n"); udev_input_disable(&ec->input); - compositor->focus = 0; ec->prev_state = compositor->state; weston_compositor_offscreen(compositor); @@ -2672,8 +2670,6 @@ drm_compositor_create(struct wl_display *display, ec->base.destroy = drm_destroy; ec->base.restore = drm_restore; - ec->base.focus = 1; - ec->prev_state = WESTON_COMPOSITOR_ACTIVE; for (key = KEY_F1; key < KEY_F9; key++) diff --git a/src/compositor-fbdev.c b/src/compositor-fbdev.c index 29de1b8..dc650f0 100644 --- a/src/compositor-fbdev.c +++ b/src/compositor-fbdev.c @@ -816,7 +816,6 @@ session_notify(struct wl_listener *listener, void *data) if (compositor->base.session_active) { weston_log("entering VT\n"); - compositor->base.focus = 1; compositor->base.state = compositor->prev_state; wl_list_for_each(output, &compositor->base.output_list, link) { @@ -834,7 +833,6 @@ session_notify(struct wl_listener *listener, void *data) fbdev_output_disable(output); } - compositor->base.focus = 0; compositor->prev_state = compositor->base.state; weston_compositor_offscreen(&compositor->base); @@ -906,7 +904,6 @@ fbdev_compositor_create(struct wl_display *display, int *argc, char *argv[], compositor->base.destroy = fbdev_compositor_destroy; compositor->base.restore = fbdev_restore; - compositor->base.focus = 1; compositor->prev_state = WESTON_COMPOSITOR_ACTIVE; compositor->use_pixman = !param->use_gl; diff --git a/src/compositor-rpi.c b/src/compositor-rpi.c index db29104..cd24a08 100644 --- a/src/compositor-rpi.c +++ b/src/compositor-rpi.c @@ -671,7 +671,6 @@ session_notify(struct wl_listener *listener, void *data) if (compositor->base.session_active) { weston_log("activating session\n"); - compositor->base.focus = 1; compositor->base.state = compositor->prev_state; weston_compositor_damage_all(&compositor->base); wl_list_for_each(seat, &compositor->base.seat_list, link) { @@ -685,7 +684,6 @@ session_notify(struct wl_listener *listener, void *data) evdev_remove_devices(seat); } - compositor->base.focus = 0; compositor->prev_state = compositor->base.state; weston_compositor_offscreen(&compositor->base); @@ -762,7 +760,6 @@ rpi_compositor_create(struct wl_display *display, int *argc, char *argv[], compositor->base.destroy = rpi_compositor_destroy; compositor->base.restore = rpi_restore; - compositor->base.focus = 1; compositor->prev_state = WESTON_COMPOSITOR_ACTIVE; compositor->single_buffer = param->renderer.single_buffer; diff --git a/src/compositor.c b/src/compositor.c index 59a5abd..3a028bc 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -1042,7 +1042,7 @@ weston_compositor_repick(struct weston_compositor *compositor) { struct weston_seat *seat; - if (!compositor->focus) + if (!compositor->session_active) return; wl_list_for_each(seat, &compositor->seat_list, link) diff --git a/src/compositor.h b/src/compositor.h index 891e7e4..5128875 100644 --- a/src/compositor.h +++ b/src/compositor.h @@ -591,8 +591,6 @@ struct weston_compositor { struct weston_plane primary_plane; uint32_t capabilities; /* combination of enum weston_capability */ - uint32_t focus; - struct weston_renderer *renderer; pixman_format_code_t read_format; diff --git a/src/evdev.c b/src/evdev.c index eb7631a..ad7a3f6 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -400,7 +400,7 @@ evdev_device_data(int fd, uint32_t mask, void *data) int len; ec = device->seat->compositor; - if (!ec->focus) + if (!ec->session_active) return 1; /* If the compositor is repainting, this function is called only once diff --git a/src/input.c b/src/input.c index 272fec0..9648f62 100644 --- a/src/input.c +++ b/src/input.c @@ -963,9 +963,7 @@ notify_pointer_focus(struct weston_seat *seat, struct weston_output *output, if (output) { move_pointer(seat, x, y); - compositor->focus = 1; } else { - compositor->focus = 0; /* FIXME: We should call weston_pointer_set_focus(seat, * NULL) here, but somehow that breaks re-entry... */ } diff --git a/tests/weston-test.c b/tests/weston-test.c index bc5b6e9..a825d12 100644 --- a/tests/weston-test.c +++ b/tests/weston-test.c @@ -122,8 +122,6 @@ move_pointer(struct wl_client *client, struct wl_resource *resource, struct weston_seat *seat = get_seat(test); struct weston_pointer *pointer = seat->pointer; - test->compositor->focus = 1; - notify_motion(seat, 100, wl_fixed_from_int(x) - pointer->x, wl_fixed_from_int(y) - pointer->y); @@ -138,8 +136,6 @@ send_button(struct wl_client *client, struct wl_resource *resource, struct weston_test *test = wl_resource_get_user_data(resource); struct weston_seat *seat = get_seat(test); - test->compositor->focus = 1; - notify_button(seat, 100, button, state); } @@ -172,8 +168,6 @@ send_key(struct wl_client *client, struct wl_resource *resource, struct weston_test *test = wl_resource_get_user_data(resource); struct weston_seat *seat = get_seat(test); - test->compositor->focus = 1; - notify_key(seat, 100, key, state, STATE_UPDATE_AUTOMATIC); }