mirror of
https://github.com/cage-kiosk/cage.git
synced 2025-10-29 05:40:19 -04:00
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:
parent
443d955dfd
commit
c00ac5c462
7 changed files with 53 additions and 1 deletions
|
|
@ -14,6 +14,12 @@
|
|||
#include "server.h"
|
||||
#include "view.h"
|
||||
|
||||
static char *
|
||||
get_title(struct cg_view *view)
|
||||
{
|
||||
return view->xdg_surface->toplevel->title;
|
||||
}
|
||||
|
||||
static void
|
||||
activate(struct cg_view *view, bool activate)
|
||||
{
|
||||
|
|
@ -109,6 +115,7 @@ handle_xdg_shell_surface_new(struct wl_listener *listener, void *data)
|
|||
view->destroy.notify = handle_xdg_shell_surface_destroy;
|
||||
wl_signal_add(&xdg_surface->events.destroy, &view->destroy);
|
||||
|
||||
view->get_title = get_title;
|
||||
view->activate = activate;
|
||||
view->maximize = maximize;
|
||||
view->get_geometry = get_geometry;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue