int id, surface_id;
int rotation;
+ const char *title;
+ const char *class_name;
+
Eina_Rectangle allocation;
struct
EAPI void ecore_wl_window_cursor_default_restore(Ecore_Wl_Window *win);
EAPI void ecore_wl_window_parent_set(Ecore_Wl_Window *win, Ecore_Wl_Window *parent);
+
EAPI int ecore_wl_window_id_get(Ecore_Wl_Window *win);
+EAPI void ecore_wl_window_title_set(Ecore_Wl_Window *win, const char *title);
+EAPI void ecore_wl_window_class_name_set(Ecore_Wl_Window *win, const char *class_name);
/**
* Returns a wl_surface with no association to any wl_shell_surface.
win->opaque.w = w;
win->opaque.h = h;
+ win->title = NULL;
+ win->class_name = NULL;
+
eina_hash_add(_windows, _ecore_wl_window_id_str_get(win->id), win);
return win;
}
if (win->surface) wl_surface_destroy(win->surface);
win->surface = NULL;
+ if (win->title) eina_stringshare_del(win->title);
+ if (win->class_name) eina_stringshare_del(win->class_name);
+
/* HMMM, why was this disabled ? */
free(win);
}
win->shell_surface =
wl_shell_get_shell_surface(_ecore_wl_disp->wl.shell,
win->surface);
+ wl_shell_surface_set_title(win->shell_surface, win->title);
+ wl_shell_surface_set_class(win->shell_surface, win->class_name);
}
if (win->shell_surface)
return win->id;
}
+/* @since 1.8 */
+EAPI void
+ecore_wl_window_title_set(Ecore_Wl_Window *win, const char *title)
+{
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!win) return;
+ eina_stringshare_replace(&win->title, title);
+
+ if (win->shell_surface)
+ wl_shell_surface_set_title(win->shell_surface, win->title);
+}
+
+/* @since 1.8 */
+EAPI void
+ecore_wl_window_class_name_set(Ecore_Wl_Window *win, const char *class_name)
+{
+ LOGFN(__FILE__, __LINE__, __FUNCTION__);
+
+ if (!win) return;
+ eina_stringshare_replace(&win->class_name, class_name);
+
+ if (win->shell_surface)
+ wl_shell_surface_set_class(win->shell_surface, win->class_name);
+}
+
/* local functions */
static void
evas_object_text_text_set(sd->text, ee->prop.title);
}
- if ((ee->prop.title) && (wdata->win->shell_surface))
- wl_shell_surface_set_title(wdata->win->shell_surface,
- ee->prop.title);
+ if (ee->prop.title)
+ ecore_wl_window_title_set(wdata->win, ee->prop.title);
}
void
if (n) ee->prop.name = strdup(n);
if (c) ee->prop.clas = strdup(c);
- if ((ee->prop.clas) && (wdata->win->shell_surface))
- wl_shell_surface_set_class(wdata->win->shell_surface,
- ee->prop.clas);
+ if (ee->prop.clas)
+ ecore_wl_window_class_name_set(wdata->win, ee->prop.clas);
}
void
/* einfo->info.surface = ecore_wl_window_surface_get(wdata->win); */
/* evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo); */
/* } */
-
- if ((ee->prop.clas) && (wdata->win->shell_surface))
- wl_shell_surface_set_class(wdata->win->shell_surface,
- ee->prop.clas);
- if ((ee->prop.title) && (wdata->win->shell_surface))
- wl_shell_surface_set_title(wdata->win->shell_surface,
- ee->prop.title);
}
if (wdata->frame)
evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
}
}
-
- if ((ee->prop.clas) && (wdata->win->shell_surface))
- wl_shell_surface_set_class(wdata->win->shell_surface,
- ee->prop.clas);
- if ((ee->prop.title) && (wdata->win->shell_surface))
- wl_shell_surface_set_title(wdata->win->shell_surface,
- ee->prop.title);
}
if (wdata->frame)