mirror of
https://github.com/swaywm/sway.git
synced 2024-11-10 20:44:01 +01:00
Merge pull request #249 from sce/extra_view_metadata
Extra view metadata
This commit is contained in:
commit
e7c0573a98
@ -75,7 +75,10 @@ struct sway_container {
|
||||
bool is_floating;
|
||||
bool is_focused;
|
||||
|
||||
// Attributes that mostly views have.
|
||||
char *name;
|
||||
char *class;
|
||||
char *app_id;
|
||||
|
||||
int gaps;
|
||||
|
||||
|
@ -50,6 +50,12 @@ static void free_swayc(swayc_t *cont) {
|
||||
if (cont->name) {
|
||||
free(cont->name);
|
||||
}
|
||||
if (cont->class) {
|
||||
free(cont->class);
|
||||
}
|
||||
if (cont->app_id) {
|
||||
free(cont->app_id);
|
||||
}
|
||||
free(cont);
|
||||
}
|
||||
|
||||
@ -214,6 +220,10 @@ swayc_t *new_view(swayc_t *sibling, wlc_handle handle) {
|
||||
// Setup values
|
||||
view->handle = handle;
|
||||
view->name = title ? strdup(title) : NULL;
|
||||
const char *class = wlc_view_get_class(handle);
|
||||
view->class = class ? strdup(class) : NULL;
|
||||
const char *app_id = wlc_view_get_app_id(handle);
|
||||
view->app_id = app_id ? strdup(app_id) : NULL;
|
||||
view->visible = true;
|
||||
view->is_focused = true;
|
||||
// Setup geometry
|
||||
@ -246,6 +256,10 @@ swayc_t *new_floating_view(wlc_handle handle) {
|
||||
// Setup values
|
||||
view->handle = handle;
|
||||
view->name = title ? strdup(title) : NULL;
|
||||
const char *class = wlc_view_get_class(handle);
|
||||
view->class = class ? strdup(class) : NULL;
|
||||
const char *app_id = wlc_view_get_app_id(handle);
|
||||
view->app_id = app_id ? strdup(app_id) : NULL;
|
||||
view->visible = true;
|
||||
|
||||
// Set the geometry of the floating view
|
||||
|
Loading…
Reference in New Issue
Block a user