Since hide-cursor doesn't hide the cursor but disables the pointer,
better rename it to something much more appropriate.
While doing that, move also move the ini entry retrieval where is also
more suitable, along side the other parts that do that. Shouldn't be
any functional change while doing that.
Bug-AGL: SPEC-4658
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I8d1aab849b9a96177d17bb639c8e1e209205f7e7
-compositor_init_config(struct weston_compositor *compositor,
- struct weston_config *config)
+compositor_init_config(struct ivi_compositor *ivi)
{
struct xkb_rule_names xkb_names;
struct weston_config_section *section;
{
struct xkb_rule_names xkb_names;
struct weston_config_section *section;
+ struct weston_compositor *compositor = ivi->compositor;
+ struct weston_config *config = ivi->config;
int repaint_msec;
bool vt_switching;
bool require_input;
int repaint_msec;
bool vt_switching;
bool require_input;
/* agl-compositor.ini [core] */
section = weston_config_get_section(config, "core", NULL, NULL);
/* agl-compositor.ini [core] */
section = weston_config_get_section(config, "core", NULL, NULL);
+ weston_config_section_get_bool(section, "disable-cursor",
+ &ivi->disable_cursor, false);
+ weston_config_section_get_bool(section, "activate-by-default",
+ &ivi->activate_by_default, true);
+
weston_config_section_get_bool(section, "require-input", &require_input, true);
compositor->require_input = require_input;
weston_config_section_get_bool(section, "require-input", &require_input, true);
compositor->require_input = require_input;
if (!backend)
backend = choose_default_backend();
}
if (!backend)
backend = choose_default_backend();
}
- /* from [core] */
- weston_config_section_get_bool(section, "hide-cursor",
- &ivi.hide_cursor, false);
- weston_config_section_get_bool(section, "activate-by-default",
- &ivi.activate_by_default, true);
display = wl_display_create();
loop = wl_display_get_event_loop(display);
display = wl_display_create();
loop = wl_display_get_event_loop(display);
- if (compositor_init_config(ivi.compositor, ivi.config) < 0)
+ if (compositor_init_config(&ivi) < 0)
goto error_compositor;
if (load_backend(&ivi, backend, &argc, argv) < 0) {
goto error_compositor;
if (load_backend(&ivi, backend, &argc, argv) < 0) {
/* remove the POINTER capability such that the client will not install
* a cursor surface */
/* remove the POINTER capability such that the client will not install
* a cursor surface */
- if (shseat->hide_cursor && !shseat->new_caps_sent && resources) {
+ if (shseat->disable_cursor && !shseat->new_caps_sent && resources) {
caps &= ~WL_SEAT_CAPABILITY_POINTER;
wl_resource_for_each(resource, &pointer->seat->base_resource_list) {
wl_seat_send_capabilities(resource, caps);
caps &= ~WL_SEAT_CAPABILITY_POINTER;
wl_resource_for_each(resource, &pointer->seat->base_resource_list) {
wl_seat_send_capabilities(resource, caps);
}
static struct ivi_shell_seat *
}
static struct ivi_shell_seat *
-ivi_shell_seat_create(struct weston_seat *seat, bool hide_cursor)
+ivi_shell_seat_create(struct weston_seat *seat, bool disable_cursor)
{
struct ivi_shell_seat *shseat;
{
struct ivi_shell_seat *shseat;
- shseat->hide_cursor = hide_cursor;
+ shseat->disable_cursor = disable_cursor;
shseat->new_caps_sent = false;
shseat->seat_destroy_listener.notify = ivi_shell_seat_handle_destroy;
shseat->new_caps_sent = false;
shseat->seat_destroy_listener.notify = ivi_shell_seat_handle_destroy;
struct ivi_compositor *ivi =
container_of(listener, struct ivi_compositor, seat_created_listener);
struct ivi_compositor *ivi =
container_of(listener, struct ivi_compositor, seat_created_listener);
- weston_log("Cursor is %s\n", ivi->hide_cursor ? "set" : "not set");
- ivi_shell_seat_create(seat, ivi->hide_cursor);
+ weston_log("Cursor is %s\n", ivi->disable_cursor ? "set" : "not set");
+ ivi_shell_seat_create(seat, ivi->disable_cursor);
struct weston_seat *seat;
wl_list_for_each(seat, &ec->seat_list, link) {
struct weston_seat *seat;
wl_list_for_each(seat, &ec->seat_list, link) {
- weston_log("Seat %p, cursor is %s\n", seat, ivi->hide_cursor ?
+ weston_log("Seat %p, cursor is %s\n", seat, ivi->disable_cursor ?
- ivi_shell_seat_create(seat, ivi->hide_cursor);
+ ivi_shell_seat_create(seat, ivi->disable_cursor);
}
ivi->seat_created_listener.notify = ivi_shell_handle_seat_created;
}
ivi->seat_created_listener.notify = ivi_shell_handle_seat_created;
struct wl_listener heads_changed;
bool init_failed;
struct wl_listener heads_changed;
bool init_failed;
bool activate_by_default;
bool keep_pending_surfaces;
bool activate_by_default;
bool keep_pending_surfaces;
struct weston_seat *seat;
struct weston_surface *focused_surface;
struct weston_seat *seat;
struct weston_surface *focused_surface;
bool new_caps_sent;
struct wl_listener seat_destroy_listener;
bool new_caps_sent;
struct wl_listener seat_destroy_listener;