double min_aspect, max_aspect;
Ecore_Window icon_window;
Ecore_Window window_group;
- uint64_t transient_for;
+ Ecore_Window transient_for;
Ecore_Window client_leader;
#ifndef HAVE_WAYLAND_ONLY
Ecore_X_Window_State_Hint initial_state;
{
E_Comp *comp;
struct wl_resource *res;
- E_Pixmap *ep;
- uint64_t win;
+ E_Pixmap *ep = NULL;
pid_t pid;
if (!(comp = wl_resource_get_user_data(resource))) return;
_e_comp_wl_surface_destroy);
wl_client_get_credentials(client, &pid, NULL, NULL);
- win = e_comp_wl_id_get(id, pid);
- /* check for existing pixmap */
- if (!(ep = e_pixmap_find(E_PIXMAP_TYPE_WL, win)))
+ if (pid == getpid()) //internal!
+ ep = e_pixmap_find(E_PIXMAP_TYPE_WL, (uintptr_t)id);
+ if (!ep)
{
/* try to create new pixmap */
- if (!(ep = e_pixmap_new(E_PIXMAP_TYPE_WL, win)))
+ if (!(ep = e_pixmap_new(E_PIXMAP_TYPE_WL, res)))
{
ERR("Could not create new pixmap");
wl_resource_destroy(res);
return;
}
}
-
- DBG("\tUsing Pixmap: %d", id);
+ DBG("\tUsing Pixmap: %p", ep);
/* set reference to pixmap so we can fetch it later */
wl_resource_set_user_data(res, ep);
static void
_e_comp_wl_client_cb_new(void *data EINA_UNUSED, E_Client *ec)
{
- uint64_t win;
+ Ecore_Window win;
/* make sure this is a wayland client */
if (e_pixmap_type_get(ec->pixmap) != E_PIXMAP_TYPE_WL) return;
static void
_e_comp_wl_client_cb_pre_frame(void *data EINA_UNUSED, E_Client *ec)
{
- uint64_t parent;
+ Ecore_Window parent;
if (e_pixmap_type_get(ec->pixmap) != E_PIXMAP_TYPE_WL) return;
if (!ec->comp_data->need_reparent) return;
EAPI double e_comp_wl_idle_time_get(void);
EAPI void e_comp_wl_output_init(const char *id, const char *make, const char *model, int x, int y, int w, int h, int pw, int ph, unsigned int refresh, unsigned int subpixel, unsigned int transform);
-static inline uint64_t
-e_comp_wl_id_get(uint32_t id, pid_t pid)
-{
- return ((uint64_t)id << 32) + pid;
-}
-
# endif
#endif
E_Comp_Data *cdata;
pid_t pid;
E_Client *ec;
- uint64_t sid;
Eina_Bool got_mouse = EINA_FALSE;
int cursor_w = 0, cursor_h = 0;
e_pointer_object_set(e_comp->pointer, NULL, x, y);
return;
}
- wl_client_get_credentials(client, &pid, NULL, NULL);
- sid = e_comp_wl_id_get(wl_resource_get_id(surface_resource), pid);
- if (!(ec = e_pixmap_find_client(E_PIXMAP_TYPE_WL, sid)))
+ if (!(ec = e_pixmap_find_client(E_PIXMAP_TYPE_WL, (uintptr_t)surface_resource)))
{
Eina_List *l;
- ec = e_client_new(NULL, e_pixmap_new(E_PIXMAP_TYPE_WL, sid), 1, 0);
+ ec = e_client_new(NULL, e_pixmap_new(E_PIXMAP_TYPE_WL, surface_resource), 1, 0);
+ if (!ec) return;
ec->lock_focus_out = ec->layer_block = ec->visible = ec->override = 1;
ec->new_client = 0;
e_comp->new_clients--;
typedef struct _E_Win_Info
{
- uint64_t id; // native window id
+ Ecore_Window id; // native window id
+ uint32_t res_id;
+ int pid;
const char *name; // name of client window
int x, y, w, h; // geometry
int layer; // value of E_Layer
static Eina_Bool _e_info_client_eldbus_message_with_args(const char *method, E_Info_Message_Cb cb, const char *signature, ...);
static E_Win_Info *
-_e_win_info_new(Ecore_Window id, Eina_Bool alpha, const char *name, int x, int y, int w, int h, int layer, int visible)
+_e_win_info_new(Ecore_Window id, uint32_t res_id, int pid, Eina_Bool alpha, const char *name, int x, int y, int w, int h, int layer, int visible)
{
E_Win_Info *win = NULL;
EINA_SAFETY_ON_NULL_RETURN_VAL(win, NULL);
win->id = id;
+ win->res_id = res_id;
+ win->pid = pid;
win->name = eina_stringshare_add(name);
win->x = x;
win->y = y;
res = eldbus_message_error_get(msg, &name, &text);
EINA_SAFETY_ON_TRUE_GOTO(res, finish);
- res = eldbus_message_arguments_get(msg, "a(usiiiiibb)", &array);
+ res = eldbus_message_arguments_get(msg, "a(uuisiiiiibb)", &array);
EINA_SAFETY_ON_FALSE_GOTO(res, finish);
while (eldbus_message_iter_get_and_next(array, 'r', &ec))
int x, y, w, h, layer;
Eina_Bool visible, alpha;
Ecore_Window id;
+ uint32_t res_id;
+ int pid;
E_Win_Info *win = NULL;
res = eldbus_message_iter_arguments_get(ec,
- "usiiiiibb",
+ "uuisiiiiibb",
&id,
+ &res_id,
+ &pid,
&win_name,
&x,
&y,
continue;
}
- win = _e_win_info_new(id, alpha, win_name, x, y, w, h, layer, visible);
+ win = _e_win_info_new(id, res_id, pid, alpha, win_name, x, y, w, h, layer, visible);
e_info_client.win_list = eina_list_append(e_info_client.win_list, win);
}
return;
printf("%d Top level windows\n", eina_list_count(e_info_client.win_list));
- printf("-------------------------[ topvwins ]------------------------------\n");
- printf("No PID w h x y Depth Title map state\n");
- printf("-------------------------------------------------------------------\n");
+ printf("--------------------------------------[ topvwins ]-----------------------------------------------------\n");
+ printf("No Win_ID Resource_ID PID w h x y Depth Title map_state\n");
+ printf("-------------------------------------------------------------------------------------------------------\n");
if (!e_info_client.win_list)
{
{
if (!win) return;
i++;
- printf("%3d %"PRIu64" %5d %5d %5d %5d %5d ", i, win->id, win->w, win->h, win->x, win->y, win->alpha? 32:24);
- printf("%15s %11s\n", win->name?:"No Name", win->vis? "Viewable":"NotViewable");
+ printf("%3d 0x%08x %5d %5d %5d %5d %5d %5d %5d ", i, win->id, win->res_id, win->pid, win->w, win->h, win->x, win->y, win->alpha? 32:24);
+ printf("%30s %11s\n", win->name?:"No Name", win->vis? "Viewable":"NotViewable");
}
E_FREE_LIST(e_info_client.win_list, _e_win_info_free);
E_Client *ec;
Evas_Object *o;
- eldbus_message_iter_arguments_append(iter, "a(usiiiiibb)", &array_of_ec);
+ eldbus_message_iter_arguments_append(iter, "a(uuisiiiiibb)", &array_of_ec);
// append clients.
for (o = evas_object_top_get(e_comp->evas); o; o = evas_object_below_get(o))
{
Eldbus_Message_Iter* struct_of_ec;
Ecore_Window win;
+ uint32_t res_id;
+ pid_t pid;
ec = evas_object_data_get(o, "E_Client");
if (!ec) continue;
win = e_client_util_win_get(ec);
- eldbus_message_iter_arguments_append(array_of_ec, "(usiiiiibb)", &struct_of_ec);
+ if (ec->pixmap)
+ res_id = e_pixmap_res_id_get(ec->pixmap);
+#ifdef HAVE_WAYLAND_ONLY
+ if (ec->comp_data)
+ {
+ E_Comp_Wl_Client_Data *cdata = ec->comp_data;
+ if (cdata->surface)
+ wl_client_get_credentials(wl_resource_get_client(cdata->surface), &pid, NULL, NULL);
+ }
+#endif
+ eldbus_message_iter_arguments_append(array_of_ec, "(uuisiiiiibb)", &struct_of_ec);
eldbus_message_iter_arguments_append
- (struct_of_ec, "usiiiiibb",
+ (struct_of_ec, "uuisiiiiibb",
win,
+ res_id,
+ pid,
e_client_util_name_get(ec) ?: "NO NAME",
ec->x, ec->y, ec->w, ec->h, ec->layer,
ec->visible, ec->argb);
{
E_Client *ec = evas_object_data_get(o, "E_Client");
char fname[PATH_MAX];
- uint64_t win;
+ Ecore_Window win;
void *data = NULL;
int w = 0, h = 0;
Ecore_Evas *ee = NULL;
if (e_client_util_ignored_get(ec)) continue;
win = e_client_util_win_get(ec);
- snprintf(fname, sizeof(fname), "%s/%llu.png", dir, win);
+ snprintf(fname, sizeof(fname), "%s/0x%08x.png", dir, win);
#ifdef HAVE_WAYLAND_ONLY
E_Comp_Wl_Buffer *buffer = e_pixmap_resource_get(ec->pixmap);
}
static const Eldbus_Method methods[] = {
- { "get_window_info", NULL, ELDBUS_ARGS({"a(usiiiiibb)", "array of ec"}), _e_info_server_cb_window_info_get, 0 },
+ { "get_window_info", NULL, ELDBUS_ARGS({"a(uuisiiiiibb)", "array of ec"}), _e_info_server_cb_window_info_get, 0 },
{ "dump_topvwins", ELDBUS_ARGS({"s", "directory"}), NULL, _e_info_server_cb_topvwins_dump, 0 },
{ "eina_log_levels", ELDBUS_ARGS({"s", "eina log levels"}), NULL, _e_info_server_cb_eina_log_levels, 0 },
{ "eina_log_path", ELDBUS_ARGS({"s", "eina log path"}), NULL, _e_info_server_cb_eina_log_path, 0 },
E_Client *client;
E_Pixmap_Type type;
- uint64_t win;
+ Ecore_Window win;
uint32_t res_id;
Ecore_Window parent;
Ecore_X_Window xwin;
#endif
#if defined(HAVE_WAYLAND_CLIENTS) || defined(HAVE_WAYLAND_ONLY)
- uint64_t id;
+ uintptr_t id;
#endif
if (!pixmaps[type]) return NULL;
break;
case E_PIXMAP_TYPE_WL:
#if defined(HAVE_WAYLAND_CLIENTS) || defined(HAVE_WAYLAND_ONLY)
- id = va_arg(*l, uint64_t);
+ id = va_arg(*l, uintptr_t);
return eina_hash_find(pixmaps[type], &id);
#endif
break;
Ecore_X_Window xwin;
#endif
#if defined(HAVE_WAYLAND_CLIENTS) || defined(HAVE_WAYLAND_ONLY)
- uint64_t id;
+ uintptr_t id;
#endif
EINA_SAFETY_ON_TRUE_RETURN_VAL((type != E_PIXMAP_TYPE_WL) && (type != E_PIXMAP_TYPE_X), NULL);
break;
case E_PIXMAP_TYPE_WL:
#if defined(HAVE_WAYLAND_CLIENTS) || defined(HAVE_WAYLAND_ONLY)
- id = va_arg(l, uint64_t);
+ id = va_arg(l, uintptr_t);
if (pixmaps[type])
{
cp = eina_hash_find(pixmaps[type], &id);
}
}
else
- pixmaps[type] = eina_hash_int64_new((Eina_Free_Cb)_e_pixmap_free);
+ pixmaps[type] = eina_hash_pointer_new((Eina_Free_Cb)_e_pixmap_free);
cp = _e_pixmap_new(type);
cp->win = id;
eina_hash_add(pixmaps[type], &id, cp);
return cp->res_id;
}
-EAPI uint64_t
+EAPI Ecore_Window
e_pixmap_window_get(E_Pixmap *cp)
{
EINA_SAFETY_ON_NULL_RETURN_VAL(cp, 0);
EAPI E_Client *e_pixmap_find_client(E_Pixmap_Type type, ...);
EAPI E_Client *e_pixmap_find_client_by_res_id(uint32_t res_id);
EAPI uint32_t e_pixmap_res_id_get(E_Pixmap *cp);
-EAPI uint64_t e_pixmap_window_get(E_Pixmap *cp);
+EAPI Ecore_Window e_pixmap_window_get(E_Pixmap *cp);
EAPI Ecore_Window e_pixmap_parent_window_get(E_Pixmap *cp);
EAPI Eina_Bool e_pixmap_native_surface_init(E_Pixmap *cp, Evas_Native_Surface *ns);
EAPI void e_pixmap_image_clear(E_Pixmap *cp, Eina_Bool cache);
{
E_Client *ec;
Ecore_Window win;
+#if defined(HAVE_WAYLAND_CLIENTS) || defined(HAVE_WAYLAND_ONLY)
+ uintptr_t wl_win_id;
+#endif
E_Pixmap_Type type = E_PIXMAP_TYPE_X;
win = elm_win_window_id_get(o);
-#ifdef HAVE_WAYLAND_CLIENTS
+#if defined(HAVE_WAYLAND_CLIENTS) || defined(HAVE_WAYLAND_ONLY)
if (!strncmp(ecore_evas_engine_name_get(ee), "wayland", 7))
{
type = E_PIXMAP_TYPE_WL;
ctx->pointer = e_comp->pointer;
elm_win_borderless_set(o, 1);
- win = e_comp_wl_id_get(win, getpid());
+ wl_win_id = win;
}
#endif
#ifndef HAVE_WAYLAND_ONLY
ctx->pointer = e_pointer_window_new(win, EINA_TRUE);
}
#endif
- ec = e_pixmap_find_client(type, win);
+#if defined(HAVE_WAYLAND_CLIENTS) || defined(HAVE_WAYLAND_ONLY)
+ if (type == E_PIXMAP_TYPE_WL)
+ ec = e_pixmap_find_client(type, wl_win_id);
+ else
+#endif
+ ec = e_pixmap_find_client(type, win);
if (ec)
ctx->client = ec;
else
if ((!title) || (!title[0]))
title = "E";
ecore_evas_title_set(ee, title);
- cp = e_pixmap_new(type, win);
+#if defined(HAVE_WAYLAND_CLIENTS) || defined(HAVE_WAYLAND_ONLY)
+ if (type == E_PIXMAP_TYPE_WL)
+ cp = e_pixmap_new(type, wl_win_id);
+ else
+#endif
+ cp = e_pixmap_new(type, win);
EINA_SAFETY_ON_NULL_RETURN_VAL(cp, EINA_TRUE);
ctx->client = e_client_new(e_comp, cp, 0, 1);
{
E_Pixmap *pp;
E_Client *pc;
- uint64_t pwin = 0;
+ Ecore_Window pwin = 0;
if (!parent_resource)
{
}
/* set toplevel client properties */
- ec->borderless = !ec->internal;
+ if (!ec->internal)
+ ec->borderless = !ec->internal;
ec->lock_border = EINA_TRUE;
- ec->border.changed = ec->changes.border = !ec->borderless;
+ if (!ec->internal)
+ ec->border.changed = ec->changes.border = !ec->borderless;
ec->netwm.type = E_WINDOW_TYPE_NORMAL;
ec->comp_data->set_win_type = EINA_TRUE;
if ((!ec->lock_user_maximize) && (ec->maximized))
ec->comp_data->popup.y = y;
}
- ec->borderless = !ec->internal_elm_win;
+ if (!ec->internal)
+ ec->borderless = !ec->internal_elm_win;
ec->lock_border = EINA_TRUE;
- ec->border.changed = ec->changes.border = !ec->borderless;
+ if (!ec->internal)
+ ec->border.changed = ec->changes.border = !ec->borderless;
ec->changes.icon = !!ec->icccm.class;
ec->netwm.type = E_WINDOW_TYPE_POPUP_MENU;
ec->comp_data->set_win_type = EINA_TRUE;
/* set toplevel client properties */
ec->icccm.accepts_focus = 1;
- ec->borderless = !ec->internal_elm_win;
+ if (!ec->internal)
+ ec->borderless = 1;
ec->lock_border = EINA_TRUE;
- ec->border.changed = ec->changes.border = !ec->borderless;
+ if ((!ec->internal) || (!ec->borderless))
+ ec->border.changed = ec->changes.border = !ec->borderless;
ec->netwm.type = E_WINDOW_TYPE_NORMAL;
ec->comp_data->set_win_type = EINA_TRUE;
cdata->shell.unmap = _e_xdg_shell_surface_unmap;
ec->override = 1;
- ec->borderless = !ec->internal_elm_win;
+ if (!ec->internal)
+ ec->borderless = !ec->internal_elm_win;
ec->lock_border = EINA_TRUE;
- ec->border.changed = ec->changes.border = !ec->borderless;
+ if (!ec->internal)
+ ec->border.changed = ec->changes.border = !ec->borderless;
ec->changes.icon = !!ec->icccm.class;
ec->netwm.type = E_WINDOW_TYPE_POPUP_MENU;
ec->comp_data->set_win_type = EINA_TRUE;