struct
{
+ unsigned int id;
struct tizen_policy *proto;
Eina_Hash *hash_noti_lv;
Eina_Hash *hash_scr_mode;
} devmgr;
struct
{
+ unsigned int id;
struct tizen_display_policy *proto;
Eina_Hash *hash_brightness;
} display_policy;
EINA_FALSE,
NULL, NULL, NULL,
-1, NULL,
- { NULL, NULL, NULL }, /* tizen_policy protocol */
+ { 0, NULL, NULL, NULL }, /* tizen_policy protocol */
{ NULL, NULL, NULL, NULL, NULL, 0 }, /* screenshooter protocol */
{ NULL, -1 }, /* tizen_input_device_manager protocol */
- { NULL, NULL }, /* display_policy protocol */
+ { 0, NULL, NULL }, /* display_policy protocol */
{ NULL, -1, EINA_FALSE } /* tizen_gesture protocol */
},
{
static void
_cb_wl_reg_global(void *data,
struct wl_registry *reg,
- unsigned int name,
+ unsigned int id,
const char *interface,
unsigned int version)
{
{
struct tizen_policy *proto;
proto = wl_registry_bind(reg,
- name,
+ id,
&tizen_policy_interface,
7);
if (!proto) return;
_eflutil.wl.policy.hash_noti_lv = eina_hash_pointer_new(free);
_eflutil.wl.policy.hash_scr_mode = eina_hash_pointer_new(free);
_eflutil.wl.policy.proto = proto;
+ _eflutil.wl.policy.id = id;
}
else if (strcmp(interface, "wl_output") == 0)
{
_eflutil.wl.shot.output_list = eina_list_append(_eflutil.wl.shot.output_list, output);
- output->output = wl_registry_bind(reg, name, &wl_output_interface, version);
+ output->output = wl_registry_bind(reg, id, &wl_output_interface, version);
wl_output_add_listener(output->output, &output_listener, output);
}
else if (strcmp(interface, "tizen_input_device_manager") == 0)
{
- _eflutil.wl.devmgr.devicemgr = wl_registry_bind(reg, name, &tizen_input_device_manager_interface, version);
+ _eflutil.wl.devmgr.devicemgr = wl_registry_bind(reg, id, &tizen_input_device_manager_interface, version);
tizen_input_device_manager_add_listener(_eflutil.wl.devmgr.devicemgr, &_wl_tz_devmgr_listener, NULL);
}
else if (!strcmp(interface, "tizen_display_policy"))
{
- _eflutil.wl.display_policy.proto = wl_registry_bind(reg, name, &tizen_display_policy_interface, version);
+ _eflutil.wl.display_policy.proto = wl_registry_bind(reg, id, &tizen_display_policy_interface, version);
if (!_eflutil.wl.display_policy.proto) return;
tizen_display_policy_add_listener(_eflutil.wl.display_policy.proto,
NULL);
_eflutil.wl.display_policy.hash_brightness = eina_hash_pointer_new(free);
+ _eflutil.wl.display_policy.id = id;
}
else if (strcmp(interface, "tizen_gesture") == 0)
{
- _eflutil.wl.gesture.proto = wl_registry_bind(reg, name, &tizen_gesture_interface, version);
+ _eflutil.wl.gesture.proto = wl_registry_bind(reg, id, &tizen_gesture_interface, version);
tizen_gesture_add_listener(_eflutil.wl.gesture.proto, &_wl_tz_gesture_listener, NULL);
}
}
static void
_cb_wl_reg_global_remove(void *data,
struct wl_registry *reg,
- unsigned int name)
+ unsigned int id)
{
- _eflutil.wl.policy.proto = NULL;
- eina_hash_free(_eflutil.wl.policy.hash_noti_lv);
- eina_hash_free(_eflutil.wl.policy.hash_scr_mode);
-
- _eflutil.wl.display_policy.proto = NULL;
- eina_hash_free(_eflutil.wl.display_policy.hash_brightness);
+ /* unset each global id number to 0 since global id is started
+ * from number 1 on server side display structure
+ */
+ if (id == _eflutil.wl.policy.id)
+ {
+ _eflutil.wl.policy.id = 0;
+ _eflutil.wl.policy.proto = NULL;
+ eina_hash_free(_eflutil.wl.policy.hash_noti_lv);
+ eina_hash_free(_eflutil.wl.policy.hash_scr_mode);
+ }
+ else if (id == _eflutil.wl.display_policy.id)
+ {
+ _eflutil.wl.display_policy.id = 0;
+ _eflutil.wl.display_policy.proto = NULL;
+ eina_hash_free(_eflutil.wl.display_policy.hash_brightness);
+ }
}
/* LCOV_EXCL_STOP */