Skip to content

[Bug] Upload RGBA textures instead of RGB_888 — fixes Cogl texture crash (#20) - #21

Merged
maifeeulasad merged 1 commit into
dev-maifeefrom
fix/rgba-texture
Sep 5, 2026
Merged

maifeeulasad merged 1 commit into
dev-maifeefrom
fix/rgba-texture

Conversation

@maifeeulasad

Copy link
Copy Markdown
Owner

Fixes #20.

Problem

Cogl-ERROR: Failed to create texture 2d due to size/format constraints
trace trap (core dumped)

Clutter.Image.set_data was called with Cogl.PixelFormat.RGB_888 for any pixbuf without an alpha channel (icons, wallpaper.jpg, assets). 24-bit RGB_888 textures are unsupported by many GPU drivers/GLES backends, which raises a fatal Cogl g_error — uncatchable, so it aborts the process. This is a long-standing Komorebi crash (christianloopp#362, christianloopp#354, christianloopp#240; same Cogl message in Cinnamon #4867 / RH#1645866).

Fix

Always upload 32-bit RGBA:

  • New Utilities.ensureRGBA() — returns the pixbuf if it already has alpha, else add_alpha().
  • All four set_data sites now go through it and use Cogl.PixelFormat.RGBA_8888:
    • Icon.setIcon
    • BackgroundWindow wallpaper image
    • AssetActor (×2)
  • Removed a dead null-deref branch in AssetActor.setAsset() (!assetVisible did pixbuf = null then pixbuf.get_pixels()).

Verification

Static only (no Vala toolchain here): no RGB_888 left in code (only comments), braces balanced, all set_data sites use ensureRGBA + RGBA_8888. Please rebuild — this should clear the texture trap and launch the desktop.

🤖 Generated with Claude Code

Clutter.Image.set_data was called with Cogl.PixelFormat.RGB_888 for
pixbufs without alpha. Many GPU drivers / GLES backends cannot create
24-bit textures and abort fatally with "Failed to create texture 2d due
to size/format constraints" (uncatchable Cogl g_error) -> core dump.

- Add Utilities.ensureRGBA(): returns a 32-bit RGBA pixbuf (add_alpha
  when needed).
- Route all four set_data sites (Icon, wallpaper, two in AssetActor)
  through it and always use Cogl.PixelFormat.RGBA_8888.
- Remove dead null-deref branch in AssetActor.setAsset() (!assetVisible
  did pixbuf = null then pixbuf.get_pixels()).

Known upstream crash: christianloopp#362, christianloopp#354/christianloopp#240.

Fixes #20

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@maifeeulasad
maifeeulasad merged commit a88330e into dev-maifee Sep 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Crash: Cogl 'Failed to create texture 2d due to size/format constraints' (RGB_888 unsupported)

1 participant