Commit graph

1595 commits

Author SHA1 Message Date
alexei-zebra
ab7f542d61
Add display settings for the wayland window frame
The frame the native wayland backend draws gets three switches in the
display tab: a narrow 24px bar instead of the 48px one, the shadow with
the outer resize area, and redrawing the content while the window is
resized (off keeps the previous behaviour of stretching the last frame).

The settings are applied at runtime: the bar geometry is rebuilt and the
surface is resized together with the toplevel geometry, no restart needed.
The narrow bar drops the insets and the gap of its controls, so that they
sit flush against the window edge.

The switches are hidden outside of the wayland backend, which reports its
name through Window::getBackendName().
2026-10-10 12:23:42 +03:00
alexei-zebra
b5416d1219
Fix the issues found while reviewing the Wayland frame work
A review of the branch turned up a number of defects, gaps and leftovers;
this commit addresses all of them.

Defects:
- the shadow uniform array held seven entries while eight locations were
  written, so the last one landed outside the object;
- CursorShape::LAST stayed in the middle of the enum after the new corner
  shapes were appended, which made the GLFW cursor table read out of
  bounds; the extra shapes are now mapped onto the ones GLFW knows, and
  the table is only filled for those;
- GlStateGuard asked glIsEnabled for an attribute pname, so it always got
  GL_INVALID_ENUM and never restored the vertex attribute arrays;
- the early returns in wayland_window_initialize left the global window
  and input pointers dangling when falling back to GLFW;
- the icon textures were listed nowhere, so none of them ever loaded;
- a shader failure disabled the shadow after the surface had already been
  sized for it, and VOXEL_DECORATIONS outlived the switch cleanup.

Behavior:
- the keyboard now releases every pressed key when it loses focus, and a
  repeat rate of zero means no repeat;
- the fourth UTF-8 lead byte is decoded with the right mask, control
  characters no longer reach text fields, and a vanished clipboard offer
  clears the cached text;
- compositor side decorations disable ours again instead of leaving two
  titles, the window destructor releases the rest of the state, and the
  content inset is computed before the GUI acts so the HUD and the
  container never disagree for a frame; the HUD clamps it;
- the window controls fall back to minimize, maximize and close, and the
  icons are drawn from textures only.

Cleanups: one monotonic timer instead of three, one vertex shader shared
by both renderers with a link check, one button layout parser, the inset
rule moved into Screen, the scissor stack moved into the base Window
(about 110 duplicated lines), named shadow and evdev constants, trimmed
includes, a README note about the Wayland dependencies, and the long
lines introduced by this branch wrapped.
2026-10-10 12:23:42 +03:00
alexei-zebra
c269d6efb3
Give the Wayland window an Adwaita-like frame
The engine-drawn title bar grew to 48 px with 24x24 window controls,
12 px away from the edge and from each other, all sharing one hover
highlight. The controls use textures now (gui/cross, gui/minimize_w,
gui/maximize_w and gui/restore_w when maximized) with the vector icons
kept as a fallback, and the title is centred in the bar, clamped to the
free space between the button groups.

The bar now sits inside invisible margins that carry a drop shadow, so
the window is resizable from outside the visible frame: the surface is
content plus twice SHADOW_MARGIN and xdg_surface.set_window_geometry
tells the compositor which part is the window. The shadow follows
Adwaita's window shadow: a Gaussian blur of 7 px (sigma 3.5) expanded by
1 px, rgba(0,0,0,0.5) focused and 0.3 in the backdrop, plus a 1 px
hairline, symmetric on all four sides - a 16 px wide frame would show a
fatter tail than the reference. Margins exist only while the window is
decorated by us and not maximized or fullscreen.

The engine composes the frame itself: it renders exactly as before, then
the backend copies the frame into a texture, clears the surface, draws
the shadow and puts the content in place with alpha forced to 1, which
keeps the frame opaque without touching a single render pass. Only
frames the engine actually drew are cached, and the EGL window is
resized before its surface size is asked for, so no frame is composed
from a buffer the compositor just replaced - that was the one frame
blink after a resize.

Resize cursors match GNOME: directional shapes for edges and corners
(w/e/n/s/ne/nw/se/sw) instead of the double-headed diagonals, with the
extra CursorShape values appended so the existing GLFW indices stay.

Measured: window 1123x751 opens as saved, fullscreen round trip returns
the same size with the settings untouched, the shadow alpha profile is
0.20/0.10/0.03 at 1/4/7 px from the edge against Adwaita's 0.21/0.095/
0.055, all four sides equal, menu layout baseline unchanged (706),
no errors in the log.
2026-10-10 12:23:41 +03:00
ostermine
d8017ff995 fix reload_module ignoring pack environment
reload_module loaded the new module code with the global environment,
while require runs modules in their pack environment. After reload,
PACK_ID and other pack globals were nil in the module.
2026-10-10 00:52:23 +03:00
MihailRis
76e5e5b6f8 fix vca 'configure' directive parsing 2026-10-05 22:11:21 +03:00
MihailRis
f6a7a99a74 revert "update shadows.glsl"
This reverts commit 19a952a3be.
2026-10-03 11:10:56 +03:00
MihailRis
ef4207aed0 fixes 2026-10-02 17:44:48 +03:00
MihailRis
fc16c1ebcd Merge branch 'main' into vca-fixes 2026-10-01 21:53:30 +03:00
MihailRis
e4eae0416e fix the 2026-09-29 18:59:28 +03:00
MihailRis
dd577dd080 cleanup 2026-09-29 18:44:19 +03:00
MihailRis
d3de449b7b fix absolute bezier keyframes 2026-09-29 18:41:02 +03:00
MihailRis
ea63d29221 fix custom curves 2026-09-29 18:39:46 +03:00
MihailRis
19a952a3be update shadows.glsl 2026-09-28 01:47:23 +03:00
MihailRis
ffba11e87f update clouds shader 2026-09-28 01:40:48 +03:00
MihailRis
8726a95a9b fix 2026-09-27 23:23:21 +03:00
MihailRis
2b8d97a2ca feat: color temperature compensation 2026-09-27 23:21:45 +03:00
MihailRis
771c72324c update advanced shading 2026-09-27 23:13:45 +03:00
MihailRis
0151fdfbf7 implement actual animation blending in core:animator 2026-09-27 02:14:36 +03:00
MihailRis
c3ca6be056 add missing local 2026-09-26 23:13:54 +03:00
MihailRis
6b36992119 make VCA animation line intensity multiplier implicit 2026-09-26 23:09:40 +03:00
MihailRis
cbe2a27e34 update en_US.txt, ru_RU.txt 2026-09-26 19:21:00 +03:00
MihailRis
cdc5302dd1 add 'Fog' settings to ui 2026-09-26 19:18:29 +03:00
MihailRis
e467c85adc add 'enable-fog' setting 2026-09-26 19:13:08 +03:00
MihailRis
f5de330f3f fix abs function is not available in VCA expressions 2026-09-26 18:07:45 +03:00
MihailRis
0dfc87700d cleanup 2026-09-25 23:58:42 +03:00
MihailRis
e485aedc8e add 'period' keyframes-based line parameter 2026-09-25 23:56:32 +03:00
MihailRis
5310de45f0 fix: cos function is not available in VCA expressions 2026-09-25 23:32:59 +03:00
MihailRis
8b4cfd1099 disable codegen trace 2026-09-23 22:27:12 +03:00
MihailRis
c573d01cb7 add 'texture' vca directive 2026-09-23 22:26:54 +03:00
MihailRis
b9b17358a1 fix file.remove_ext 2026-09-20 22:01:18 +03:00
MihailRis
60f184ae43 fix file.ext 2026-09-20 21:58:36 +03:00
MihailRis
ca9ff7ba7e fix missing default rotation-order value 2026-09-19 15:27:21 +03:00
MihailRis
d40070abab Merge branch 'main' into new-animation-features 2026-09-17 00:14:03 +03:00
MihailRis
ad22763a1f add new skeleton:get_color, skeleton:set_color overloads 2026-09-16 23:40:41 +03:00
MihailRis
ae082abaa2 feat: allow passing rgba color to entity skeletons and block wraps 2026-09-16 23:28:03 +03:00
MihailRis
9f40303661 Merge branch 'main' into new-animation-features 2026-09-15 21:04:28 +03:00
MihailRis
85cc55c63b
Merge pull request #972 from MihailRis/upgrade-http-in-vc
upgrade http requests
2026-09-14 22:42:33 +03:00
MihailRis
a773dfbd0e remove _http_error_callbacks 2026-09-14 19:56:34 +03:00
MihailRis
afc8ff2a0f fix http error event 2026-09-14 18:36:18 +03:00
MihailRis
ef3a5cf278 feat: http response as table 2026-09-14 12:41:12 +03:00
boolean-false
28b849229c fix: validate content pack dependency versions 2026-09-14 01:47:10 +07:00
MihailRis
946728e54e fix 2026-09-10 20:38:50 +03:00
MihailRis
9226f362a7 cleanup network.* functions 2026-09-10 20:01:00 +03:00
MihailRis
21bd5ba1b2 update animation api 2026-09-10 19:09:49 +03:00
MihailRis
aa6ac5f5bd add animation.stop 2026-09-10 00:14:15 +03:00
MihailRis
48ca3ab5f9 move animation code generation to separate module 2026-09-10 00:11:04 +03:00
MihailRis
894101a46a cleanup network library 2026-09-09 23:57:58 +03:00
MihailRis
1c7bf2de01 add network.request 2026-09-09 23:53:03 +03:00
MihailRis
3ed80d0c95 feat: custom curves 2026-09-09 19:26:17 +03:00
MihailRis
6b07f062d7 add some temporary solution (don't look) 2026-09-08 20:00:23 +03:00