Set Cage's window title to toplevel's title

When using the Wayland or X11 backend, Cage is drawn inside a window.
This commit sets this window's title to that of the currently focused
toplevel window inside Cage.

Fixes #29.
This commit is contained in:
Jente Hidskes 2019-01-24 14:14:15 +01:00
parent 443d955dfd
commit c00ac5c462
7 changed files with 53 additions and 1 deletions

2
view.h
View file

@ -41,6 +41,7 @@ struct cg_view {
// TODO: allow applications to go to fullscreen from maximized?
// struct wl_listener request_fullscreen;
char *(*get_title)(struct cg_view *view);
void (*activate)(struct cg_view *view, bool activate);
void (*maximize)(struct cg_view *view, int output_width, int output_height);
void (*get_geometry)(struct cg_view *view, int *width_out, int *height_out);
@ -52,6 +53,7 @@ struct cg_view {
bool (*is_parent)(struct cg_view *parent, struct cg_view *child);
};
char *view_get_title(struct cg_view *view);
void view_activate(struct cg_view *view, bool activate);
void view_for_each_surface(struct cg_view *view, wlr_surface_iterator_func_t iterator, void *data);
struct wlr_surface *view_wlr_surface_at(struct cg_view *view, double sx, double sy,