mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-28 07:58:00 -04:00
wayland: add helper functions wayl_win_csd_{titlebar,borders}_visible()
This commit is contained in:
parent
7a0e7c6c01
commit
f9103d4381
3 changed files with 36 additions and 20 deletions
20
wayland.c
20
wayland.c
|
|
@ -747,9 +747,10 @@ xdg_surface_configure(void *data, struct xdg_surface *xdg_surface,
|
|||
csd_destroy(win);
|
||||
|
||||
if (enable_csd && new_width > 0 && new_height > 0) {
|
||||
new_height -= win->term->conf->csd.title_height;
|
||||
if (wayl_win_csd_titlebar_visible(win))
|
||||
new_height -= win->term->conf->csd.title_height;
|
||||
|
||||
if (!win->is_maximized) {
|
||||
if (wayl_win_csd_borders_visible(win)) {
|
||||
new_height -= 2 * win->term->conf->csd.border_width_visible;
|
||||
new_width -= 2 * win->term->conf->csd.border_width_visible;
|
||||
}
|
||||
|
|
@ -1763,6 +1764,21 @@ wayl_win_set_urgent(struct wl_window *win)
|
|||
#endif
|
||||
}
|
||||
|
||||
bool
|
||||
wayl_win_csd_titlebar_visible(const struct wl_window *win)
|
||||
{
|
||||
return win->csd_mode == CSD_YES &&
|
||||
!win->is_fullscreen;
|
||||
}
|
||||
|
||||
bool
|
||||
wayl_win_csd_borders_visible(const struct wl_window *win)
|
||||
{
|
||||
return win->csd_mode == CSD_YES &&
|
||||
!win->is_fullscreen &&
|
||||
!win->is_maximized;
|
||||
}
|
||||
|
||||
bool
|
||||
wayl_win_subsurface_new_with_custom_parent(
|
||||
struct wl_window *win, struct wl_surface *parent,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue