Codebergdnkl
foot
master
1#include "quirks.h"
3#include <stdlib.h>
4#include <stdbool.h>
5#include <string.h>
7#define LOG_MODULE "quirks"
8#define LOG_ENABLE_DBG 0
9#include "log.h"
10#include "util.h"
12static bool
13is_weston(void)
14{
15 static bool is_weston = false;
16 static bool initialized = false;
18 if (!initialized) {
19 initialized = true;
20 is_weston = getenv("WESTON_CONFIG_FILE") != NULL;
21 if (is_weston)
22 LOG_WARN("applying wl_subsurface_set_desync() workaround for weston");
23 }
25 return is_weston;
26}
28void
29quirk_weston_subsurface_desync_on(struct wl_subsurface *sub)
30{
31 if (!is_weston())
32 return;
34 wl_subsurface_set_desync(sub);
35}
37void
38quirk_weston_subsurface_desync_off(struct wl_subsurface *sub)
39{
40 if (!is_weston())
41 return;
43 wl_subsurface_set_sync(sub);
44}
46void
47quirk_weston_csd_on(struct terminal *term)
48{
49 if (term->window->csd_mode != CSD_YES)
50 return;
51 if (term->window->is_fullscreen)
52 return;
54 for (int i = 0; i < ALEN(term->window->csd.surface); i++)
55 quirk_weston_subsurface_desync_on(term->window->csd.surface[i].sub);
56}
58void
59quirk_weston_csd_off(struct terminal *term)
60{
61 if (term->window->csd_mode != CSD_YES)
62 return;
63 if (term->window->is_fullscreen)
64 return;
66 for (int i = 0; i < ALEN(term->window->csd.surface); i++)
67 quirk_weston_subsurface_desync_off(term->window->csd.surface[i].sub);
68}
70#if 0
71static bool
72is_sway(void)
73{
74 static bool is_sway = false;
75 static bool initialized = false;
77 if (!initialized) {
78 initialized = true;
79 is_sway = getenv("SWAYSOCK") != NULL;
80 if (is_sway)
81 LOG_WARN("applying wl_surface_damage_buffer() workaround for Sway");
82 }
84 return is_sway;
85}
86#endif
Diagnostics5 git calls · 601 ms
CallStatusSizeTime0601 ms
discover200178 B3 ms
git.upload-pack discover http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=ls-refs git.upstream.dur_ms=3 git.response.bytes=178 git.server.agent=git/2.56.1-Linux git.server.object_format=sha1 git.server.caps=agent ls-refs fetch server-option object-format git.server.fetch=shallow wait-for-done filter git.protocol.version=2 git.pkt.frames=9 git.pkt.data=7 git.pkt.flush=2 git.pkt.delim=0 git.pkt.bytes=178 git.pkt.payload.max=35
ls-refs20010 KiB578 ms
git.upload-pack ls-refs http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=ls-refs git.upstream.dur_ms=557 git.response.bytes=10322 git.response.cache=EXPIRED git.response.duration_ms=578 git.protocol.version=2 git.pkt.frames=108 git.pkt.data=107 git.pkt.flush=1 git.pkt.delim=0 git.pkt.bytes=10322 git.pkt.payload.max=106 git.ls_refs.count=107 git.ls_refs.head=refs/heads/master
fetchcombine:blob:none+tree:2 · deepen 12008.6 KiB · hit2 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=2 git.response.bytes=8830 git.response.cache=HIT git.response.duration_ms=2 git.fetch.filter=combine:blob:none+tree:2 git.fetch.wants=c0d2c3e95d74cb60526ff28aec9f34ee3df545e0 git.fetch.haves.count=0 git.fetch.deepen=1 git.fetch.thin_pack=false git.fetch.ofs_delta=true git.protocol.version=2 git.pkt.frames=7 git.pkt.data=5 git.pkt.flush=1 git.pkt.delim=1 git.pkt.bytes=8830 git.pkt.payload.max=8730 git.sideband.band1.bytes=8730 git.sideband.band2.bytes=0 git.sideband.band3.bytes=0 git.pack.objects=14 git.pack.bytes=8730 git.fetch.wide.objects=14 git.fetch.wide.extra_bytes=9909 git.fetch.wide.blobs=0
fetchtree:0 · deepen 102009.3 KiB · hit2 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=2 git.response.bytes=9489 git.response.cache=HIT git.response.duration_ms=2 git.fetch.filter=tree:0 git.fetch.wants=c0d2c3e95d74cb60526ff28aec9f34ee3df545e0 git.fetch.haves.count=0 git.fetch.deepen=10 git.fetch.thin_pack=false git.fetch.ofs_delta=true git.protocol.version=2 git.pkt.frames=7 git.pkt.data=5 git.pkt.flush=1 git.pkt.delim=1 git.pkt.bytes=9489 git.pkt.payload.max=9389 git.sideband.band1.bytes=9389 git.sideband.band2.bytes=0 git.sideband.band3.bytes=0 git.pack.objects=10 git.pack.bytes=9389 git.pack.ofs_delta=0 git.pack.ref_delta=0 git.pack.chain.max=0 git.pack.trailer=de930681b6073ba5b599a0f956bfbd114762ad5a git.pack.full=10Open pack map
fetch200575 B · hit21 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=21 git.response.bytes=575 git.response.cache=HIT git.response.duration_ms=21 git.fetch.wants=67cb587e6260f55a625c1ca78716c35dcd58b39a git.fetch.haves.count=0 git.fetch.deepen=0 git.fetch.thin_pack=false git.fetch.ofs_delta=true git.protocol.version=2 git.pkt.frames=4 git.pkt.data=3 git.pkt.flush=1 git.pkt.delim=0 git.pkt.bytes=575 git.pkt.payload.max=548 git.sideband.band1.bytes=548 git.sideband.band2.bytes=0 git.sideband.band3.bytes=0
Each row is one HTTP round trip ply made to the git server for this page, on one timeline. discover asks what the server speaks, ls-refs lists branch tips, fetch brings objects by id. A hit was served by Workers Cache. Tap a row for its wire details.
- Remote
- https://codeberg.org/dnkl/foot
- Ref
- refs/heads/master
- Commit
- c0d2c3e95d74cb60526ff28aec9f34ee3df545e0
- cf-ray
- a5e1b61e58f45b65
- Request
- 9a0e8a2b…
- Protocol
- v2 · sha1
- Agent
- git/2.56.1-Linux
- Filter
- advertised
- Fetch
- shallow wait-for-done filter
- Capabilities
- agent ls-refs fetch server-option object-format