mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-20 05:33:47 -04:00
commit
8e161ed4e9
5 changed files with 42 additions and 20 deletions
|
|
@ -39,6 +39,9 @@
|
||||||
from `1.0` to `3.0`.
|
from `1.0` to `3.0`.
|
||||||
* `shift`+`insert` now pastes from the primary selection by
|
* `shift`+`insert` now pastes from the primary selection by
|
||||||
default. This is in addition to middle-clicking with the mouse.
|
default. This is in addition to middle-clicking with the mouse.
|
||||||
|
* **csd.preferred** can now be set to `none` to disable window
|
||||||
|
decorations. Note that some compositors will render SSDs despite
|
||||||
|
this option being used (https://codeberg.org/dnkl/foot/issues/163).
|
||||||
|
|
||||||
|
|
||||||
### Deprecated
|
### Deprecated
|
||||||
|
|
|
||||||
6
config.c
6
config.c
|
|
@ -813,8 +813,12 @@ parse_section_csd(const char *key, const char *value, struct config *conf,
|
||||||
conf->csd.preferred = CONF_CSD_PREFER_SERVER;
|
conf->csd.preferred = CONF_CSD_PREFER_SERVER;
|
||||||
else if (strcmp(value, "client") == 0)
|
else if (strcmp(value, "client") == 0)
|
||||||
conf->csd.preferred = CONF_CSD_PREFER_CLIENT;
|
conf->csd.preferred = CONF_CSD_PREFER_CLIENT;
|
||||||
|
else if (strcmp(value, "none") == 0)
|
||||||
|
conf->csd.preferred = CONF_CSD_PREFER_NONE;
|
||||||
else {
|
else {
|
||||||
LOG_AND_NOTIFY_ERR("%s:%d: csd.preferred: expected either 'server' or 'client'", path, lineno);
|
LOG_AND_NOTIFY_ERR(
|
||||||
|
"%s:%d: csd.preferred: expected either "
|
||||||
|
"'server', 'client' or 'none'", path, lineno);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
2
config.h
2
config.h
|
|
@ -140,7 +140,7 @@ struct config {
|
||||||
} bindings;
|
} bindings;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
enum { CONF_CSD_PREFER_SERVER, CONF_CSD_PREFER_CLIENT } preferred;
|
enum { CONF_CSD_PREFER_NONE, CONF_CSD_PREFER_SERVER, CONF_CSD_PREFER_CLIENT } preferred;
|
||||||
|
|
||||||
int title_height;
|
int title_height;
|
||||||
int border_width;
|
int border_width;
|
||||||
|
|
|
||||||
|
|
@ -238,10 +238,15 @@ values here are in AARRGGBB format. I.e. they contain an alpha
|
||||||
component.
|
component.
|
||||||
|
|
||||||
*preferred*
|
*preferred*
|
||||||
Which type of window decorations to prefer: *client* (CSD) or
|
Which type of window decorations to prefer: *client* (CSD),
|
||||||
*server* (SSD). Note that this is only a hint to the
|
*server* (SSD) or *none*.
|
||||||
compositor. Depending on the compositor's configuration and
|
|
||||||
capabilities, it may not have any effect. Default: _server_.
|
Note that this is only a hint to the compositor. Depending on
|
||||||
|
compositor support, and how it has been configured, it may
|
||||||
|
instruct foot to use CSDs even though this option has been set to
|
||||||
|
*server*, or render SSDs despite *client* or *none* being set.
|
||||||
|
|
||||||
|
Default: _server_.
|
||||||
|
|
||||||
*size*
|
*size*
|
||||||
Height, in pixels (subject to output scaling), of the
|
Height, in pixels (subject to output scaling), of the
|
||||||
|
|
|
||||||
38
wayland.c
38
wayland.c
|
|
@ -635,22 +635,29 @@ xdg_toplevel_decoration_configure(void *data,
|
||||||
{
|
{
|
||||||
struct wl_window *win = data;
|
struct wl_window *win = data;
|
||||||
|
|
||||||
switch (mode) {
|
if (win->term->conf->csd.preferred == CONF_CSD_PREFER_NONE) {
|
||||||
case ZXDG_TOPLEVEL_DECORATION_V1_MODE_CLIENT_SIDE:
|
/* User explicitly disabled window decorations */
|
||||||
LOG_INFO("using CSD decorations");
|
LOG_INFO("window decorations disabled");
|
||||||
win->use_csd = CSD_YES;
|
|
||||||
csd_instantiate(win);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE:
|
|
||||||
LOG_INFO("using SSD decorations");
|
|
||||||
win->use_csd = CSD_NO;
|
win->use_csd = CSD_NO;
|
||||||
csd_destroy(win);
|
csd_destroy(win);
|
||||||
break;
|
} else {
|
||||||
|
switch (mode) {
|
||||||
|
case ZXDG_TOPLEVEL_DECORATION_V1_MODE_CLIENT_SIDE:
|
||||||
|
LOG_INFO("using CSD decorations");
|
||||||
|
win->use_csd = CSD_YES;
|
||||||
|
csd_instantiate(win);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
case ZXDG_TOPLEVEL_DECORATION_V1_MODE_SERVER_SIDE:
|
||||||
LOG_ERR("unimplemented: unknown XDG toplevel decoration mode: %u", mode);
|
LOG_INFO("using SSD decorations");
|
||||||
break;
|
win->use_csd = CSD_NO;
|
||||||
|
csd_destroy(win);
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
LOG_ERR("unimplemented: unknown XDG toplevel decoration mode: %u", mode);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (win->is_configured && win->use_csd == CSD_YES) {
|
if (win->is_configured && win->use_csd == CSD_YES) {
|
||||||
|
|
@ -1184,7 +1191,6 @@ wayl_win_init(struct terminal *term)
|
||||||
|
|
||||||
xdg_toplevel_set_app_id(win->xdg_toplevel, conf->app_id);
|
xdg_toplevel_set_app_id(win->xdg_toplevel, conf->app_id);
|
||||||
|
|
||||||
/* Request server-side decorations */
|
|
||||||
if (wayl->xdg_decoration_manager != NULL) {
|
if (wayl->xdg_decoration_manager != NULL) {
|
||||||
win->xdg_toplevel_decoration = zxdg_decoration_manager_v1_get_toplevel_decoration(
|
win->xdg_toplevel_decoration = zxdg_decoration_manager_v1_get_toplevel_decoration(
|
||||||
wayl->xdg_decoration_manager, win->xdg_toplevel);
|
wayl->xdg_decoration_manager, win->xdg_toplevel);
|
||||||
|
|
@ -1200,6 +1206,10 @@ wayl_win_init(struct terminal *term)
|
||||||
|
|
||||||
zxdg_toplevel_decoration_v1_add_listener(
|
zxdg_toplevel_decoration_v1_add_listener(
|
||||||
win->xdg_toplevel_decoration, &xdg_toplevel_decoration_listener, win);
|
win->xdg_toplevel_decoration, &xdg_toplevel_decoration_listener, win);
|
||||||
|
} else if (conf->csd.preferred == CONF_CSD_PREFER_NONE) {
|
||||||
|
/* No decoration manager - and user specifically do *not* want CSDs */
|
||||||
|
win->use_csd = CSD_NO;
|
||||||
|
LOG_INFO("no decoration manager available - user has disabled CSDs");
|
||||||
} else {
|
} else {
|
||||||
/* No decoration manager - thus we *must* draw our own decorations */
|
/* No decoration manager - thus we *must* draw our own decorations */
|
||||||
win->use_csd = CSD_YES;
|
win->use_csd = CSD_YES;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue