Implement showing window icons in titlebar (#4439)

This feature defaults to off, and can be turned on for individual windows,
or (with for_window) for all new windows. See the userguide change.

This commit is partially based on work by:

• Marius Muja
• mickael9
• Esteve Varela Colominas
• Bernardo Menicagli
This commit is contained in:
Michael Stapelberg
2021-06-13 08:35:52 +02:00
committed by GitHub
parent eaa5e636f9
commit abbf6a85d7
23 changed files with 392 additions and 27 deletions

View File

@ -15,6 +15,7 @@
#include <xcb/randr.h>
#include <pcre.h>
#include <sys/time.h>
#include <cairo/cairo.h>
#include "queue.h"
@ -471,6 +472,9 @@ struct Window {
double min_aspect_ratio;
double max_aspect_ratio;
/** Window icon, as Cairo surface */
cairo_surface_t *icon;
/** The window has a nonrectangular shape. */
bool shaped;
/** The window has a nonrectangular input shape. */
@ -656,6 +660,11 @@ struct Con {
/** The format with which the window's name should be displayed. */
char *title_format;
/** Whether the window icon should be displayed, and with what padding. -1
* means display no window icon (default behavior), 0 means display without
* any padding, 1 means display with 1 pixel of padding and so on. */
int window_icon_padding;
/* a sticky-group is an identifier which bundles several containers to a
* group. The contents are shared between all of them, that is they are
* displayed on whichever of the containers is currently visible */