mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-12 04:27:51 -05:00
quirks: add shortcut for flipping all CSD surfaces sync/desync state
This commit is contained in:
parent
c90d70b2bf
commit
e077290c56
3 changed files with 28 additions and 20 deletions
22
quirks.c
22
quirks.c
|
|
@ -7,6 +7,8 @@
|
|||
#define LOG_ENABLE_DBG 0
|
||||
#include "log.h"
|
||||
|
||||
#define ALEN(v) (sizeof(v) / sizeof(v[0]))
|
||||
|
||||
static bool
|
||||
is_weston(void)
|
||||
{
|
||||
|
|
@ -53,3 +55,23 @@ quirk_weston_subsurface_desync_off(struct wl_subsurface *sub)
|
|||
|
||||
wl_subsurface_set_sync(sub);
|
||||
}
|
||||
|
||||
void
|
||||
quirk_weston_csd_on(struct terminal *term)
|
||||
{
|
||||
if (term->window->use_csd != CSD_YES)
|
||||
return;
|
||||
|
||||
for (int i = 0; i < ALEN(term->window->csd.surface); i++)
|
||||
quirk_weston_subsurface_desync_on(term->window->csd.sub_surface[i]);
|
||||
}
|
||||
|
||||
void
|
||||
quirk_weston_csd_off(struct terminal *term)
|
||||
{
|
||||
if (term->window->use_csd != CSD_YES)
|
||||
return;
|
||||
|
||||
for (int i = 0; i < ALEN(term->window->csd.surface); i++)
|
||||
quirk_weston_subsurface_desync_off(term->window->csd.sub_surface[i]);
|
||||
}
|
||||
|
|
|
|||
6
quirks.h
6
quirks.h
|
|
@ -2,5 +2,11 @@
|
|||
|
||||
#include <wayland-client.h>
|
||||
|
||||
#include "terminal.h"
|
||||
|
||||
void quirk_weston_subsurface_desync_on(struct wl_subsurface *sub);
|
||||
void quirk_weston_subsurface_desync_off(struct wl_subsurface *sub);
|
||||
|
||||
/* Shortcuts to call desync_{on,off} on all CSD subsurfaces */
|
||||
void quirk_weston_csd_on(struct terminal *term);
|
||||
void quirk_weston_csd_off(struct terminal *term);
|
||||
|
|
|
|||
20
terminal.c
20
terminal.c
|
|
@ -1627,26 +1627,6 @@ term_restore_cursor(struct terminal *term)
|
|||
term->cursor.lcf = term->saved_cursor.lcf;
|
||||
}
|
||||
|
||||
static void
|
||||
quirk_weston_csd_on(struct terminal *term)
|
||||
{
|
||||
if (term->window->use_csd != CSD_YES)
|
||||
return;
|
||||
|
||||
for (int i = 0; i < ALEN(term->window->csd.surface); i++)
|
||||
quirk_weston_subsurface_desync_on(term->window->csd.sub_surface[i]);
|
||||
}
|
||||
|
||||
static void
|
||||
quirk_weston_csd_off(struct terminal *term)
|
||||
{
|
||||
if (term->window->use_csd != CSD_YES)
|
||||
return;
|
||||
|
||||
for (int i = 0; i < ALEN(term->window->csd.surface); i++)
|
||||
quirk_weston_subsurface_desync_off(term->window->csd.sub_surface[i]);
|
||||
}
|
||||
|
||||
void
|
||||
term_visual_focus_in(struct terminal *term)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue