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

10
view.c
View file

@ -6,8 +6,11 @@
* See the LICENSE file accompanying this file.
*/
#define _POSIX_C_SOURCE 200809L
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <wayland-server.h>
#include <wlr/types/wlr_box.h>
#include <wlr/types/wlr_output.h>
@ -18,6 +21,13 @@
#include "server.h"
#include "view.h"
char *
view_get_title(struct cg_view *view)
{
const char *title = view->get_title(view);
return strndup(title, strlen(title));
}
void
view_activate(struct cg_view *view, bool activate)
{