E_API void
e_client_mouse_down(E_Client *ec, int button, Evas_Point *output, E_Binding_Event_Mouse_Button *ev)
{
- Eina_Bool did_act = EINA_FALSE;
E_Client *pfocus;
int player;
ec->mouse.current.my = output->y;
pfocus = e_client_focused_get();
player = ec->layer;
- if ((!did_act) || (((pfocus == e_client_focused_get()) || (ec == e_client_focused_get())) && (ec->layer >= player)))
- e_focus_event_mouse_down(ec);
if ((button >= 1) && (button <= 3))
{
ec->mouse.last_down[button - 1].mx = output->x;
}
}
-static void
+static Eina_Bool
_drm_read_pixels(E_Comp_Wl_Output *output, void *pixels)
{
Ecore_Drm_Device *dev;
- Ecore_Drm_Fb *fb;
+ Ecore_Drm_Fb *fb = NULL;
const Eina_List *drm_devs, *l;
int i = 0, bstride;
unsigned char *s, *d = pixels;
if (fb) break;
}
- if (!fb) return;
+ EINA_SAFETY_ON_NULL_RETURN_VAL(fb, EINA_FALSE);
bstride = output->w * sizeof(int);
memcpy(d, s, (output->w * sizeof(int)));
d += bstride;
}
+
+ return EINA_TRUE;
}
E_API void
struct wl_shm_buffer *shm_buffer;
int stride;
void *pixels = NULL, *d;
+ Eina_Bool res;
output = wl_resource_get_user_data(output_resource);
buffer = e_comp_wl_buffer_get(buffer_resource, NULL);
+ if (!output) return;
+
if (!buffer)
{
wl_resource_post_no_memory(resource);
return;
}
+ EINA_SAFETY_ON_NULL_RETURN(e_comp_wl->screenshooter.read_pixels);
+
if ((buffer->w < output->w) || (buffer->h < output->h))
{
ERR("Buffer size less than output");
return;
}
- if (e_comp_wl->screenshooter.read_pixels)
- e_comp_wl->screenshooter.read_pixels(output, pixels);
+ res = e_comp_wl->screenshooter.read_pixels(output, pixels);
+ if (!res)
+ {
+ free(pixels);
+ return;
+ }
shm_buffer = wl_shm_buffer_get(buffer->resource);
if (!shm_buffer)
{
struct wl_global *global;
struct wl_client *client;
- void (*read_pixels)(E_Comp_Wl_Output *output, void *pixels);
+ Eina_Bool (*read_pixels)(E_Comp_Wl_Output *output, void *pixels);
} screenshooter;
Eina_List *outputs;
E_OBJECT_TYPE_CHECK(zone, E_ZONE_TYPE);
desk = e_desk_current_get(zone);
+ EINA_SAFETY_ON_NULL_RETURN(desk);
+
if (desk->deskshow_toggle)
{
/* uniconify raises windows and changes stacking order
E_API void
e_dpms_update(void)
{
- unsigned int standby = 0, suspend = 0, off = 0;
- int enabled;
-
- enabled = 0;
- if (_e_dpms_enabled != enabled) _e_dpms_enabled = enabled;
- if (!enabled) return;
-
- if (_e_dpms_timeout_standby != standby) _e_dpms_timeout_standby = standby;
- if (_e_dpms_timeout_suspend != suspend) _e_dpms_timeout_suspend = suspend;
- if (_e_dpms_timeout_off != off) _e_dpms_timeout_off = off;
+ /* do nothing */
+ ;
}
E_API void
e_icon_fdo_icon_set(Evas_Object *obj, const char *icon)
{
E_Smart_Data *sd;
- const char *path = NULL;
- int len;
if (!icon) return EINA_FALSE;
if (evas_object_smart_smart_get(obj) != _e_smart) SMARTERR(0);
eina_stringshare_replace(&sd->fdo, icon);
if (!sd->fdo) return EINA_FALSE;
- //path = efreet_icon_path_find(e_config->icon_theme, sd->fdo, sd->size);
- //if (!path)
- // {
- // if (e_util_strcmp(e_config->icon_theme, "hicolor"))
- // path = efreet_icon_path_find("hicolor", sd->fdo, sd->size);
- if (!path) return EINA_FALSE;
- // }
-
- len = strlen(icon);
- if ((len > 4) && (!strcasecmp(icon + len - 4, ".edj")))
- return e_icon_file_edje_set(obj, path, "icon");
-
- /* smart code here */
- _e_icon_obj_prepare(obj, sd);
- sd->loading = 0;
- if (sd->size != 0)
- evas_object_image_load_size_set(sd->obj, sd->size, sd->size);
- if (sd->preload) evas_object_hide(sd->obj);
- evas_object_image_file_set(sd->obj, path, NULL);
- if (evas_object_image_load_error_get(sd->obj) != EVAS_LOAD_ERROR_NONE)
- return EINA_FALSE;
- if (sd->preload)
- {
- sd->loading = 1;
- evas_object_image_preload(sd->obj, 0);
- }
- else if (evas_object_visible_get(obj))
- evas_object_show(sd->obj);
- _e_icon_smart_reconfigure(sd);
- return EINA_TRUE;
+ return EINA_FALSE;
}
E_API void
_e_icon_fdo_reload(void *data)
{
E_Smart_Data *sd = data;
- const char *path = NULL;
sd->fdo_reload_timer = NULL;
sd->size = MAX(sd->w, sd->h);
- //path = efreet_icon_path_find(e_config->icon_theme, sd->fdo, sd->size);
- //if (!path)
- // {
- // if (e_util_strcmp(e_config->icon_theme, "hicolor"))
- // path = efreet_icon_path_find("hicolor", sd->fdo, sd->size);
- if (!path) return EINA_FALSE;
- // }
-
- /* smart code here */
- evas_object_image_load_size_set(sd->obj, sd->size, sd->size);
- evas_object_image_file_set(sd->obj, path, NULL);
- if (sd->preload)
- {
- sd->loading = 1;
- evas_object_image_preload(sd->obj, 0);
- }
return EINA_FALSE;
}
return _e_util_icon_add(path, evas, 64);
}
-#if 0
-E_API Evas_Object *
-e_util_desktop_icon_add(Efreet_Desktop *desktop, unsigned int size, Evas *evas)
-{
- if ((!desktop) || (!desktop->icon)) return NULL;
- return e_util_icon_theme_icon_add(desktop->icon, size, evas);
-}
-#endif
-
E_API Evas_Object *
e_util_icon_theme_icon_add(const char *icon_name, unsigned int size, Evas *evas)
{
if (!icon_name) return NULL;
if (icon_name[0] == '/') return _e_util_icon_add(icon_name, evas, size);
- else
- {
- Evas_Object *obj;
- const char *path = NULL;
-
- //path = efreet_icon_path_find(e_config->icon_theme, icon_name, size);
- if (path)
- {
- obj = _e_util_icon_add(path, evas, size);
- return obj;
- }
- }
return NULL;
}
(zone->desk_y_current * zone->desk_x_count) + dx;
if (((dx < 0) || (dx >= zone->desk_x_count * zone->desk_y_count))) return;
dx = dx % (zone->desk_x_count * zone->desk_y_count);
- while (dx < 0)
- dx += (zone->desk_x_count * zone->desk_y_count);
e_zone_desk_linear_flip_to(zone, dx);
}