gl defaults to 4 and not all formats is divisible with 4 meaning its
going to pad out ouf bounds and cause issues. check if the stride is
divisible with 4 otherwise set it to 1, aka disable it.
GL_UNPACK_ALIGNMENT only takes 1,2,4,8 but formats like RGB888 has
bytesPerBlock 3.
* shader: begin the shader refactor
make SShader a class and rename it to CShader, move createprogram,
compileshader, logshadererror to CShader.
* shader: move uniform creation to CShader
move uniform creation to CShader, reduces tons of duplicated effort,
however forcing uniform names to be same in all shaders.
* shader: move to array based frag handling
use an array with an enum so it gets easier dealing with multiple
shaders, move creating program to a for loop and array, reduces line of
code a lot.
* shader: use shared ptr for frags
with smart pointers we can now rename useProgram to useShader and return
the shader directly, means only place we have to decide the shader frag
is when calling useShader. easier for future shader splitting to reduce
branching.
* shader: move unneded public members to private
move structs and uniforms to private add a get/set for initialtime
and add a getUniformLocation to make the code tell what its doing,
instead of direct array getting when all we wanted to get was its value,
also limits the setting of uniformLocations to the createProgram as it should
be.
* shader: fix style nits
set first enum member to 0 , remove extra {}
* shader: dont show a failed notif on success
the logic got inverted in the refactor here.
* shader: split CM shader to rgba/rgbx variants
split shader to rgba/rgbx variants, use bool, and reduce branching.
* shader: split up blurprepare CM and non CM
split up blurprepare, remove skipcm, move gain to gain.glsl.
remove ternary operator and reduce branching by using step() and mix()
use vec3 for gain, make brightness a cheap mulitplication with max.
* shader: split up border to CM/noncm variants
splitup border shader to CM/noncm variant, move common used things to
border.glsl , there is room for optimisations here but its a complex
shader im putting it for future PR.
* shader: touchup blurfinish
make brightness a cheap multiplication instead of branching.
mod is redundant, fract in hash already returns a value in [0.0, 1.0]
* fix: track explicit workspace assignments to prevent X11 configure overwrites
Instead of only checking for special workspaces, track when workspaces are
explicitly assigned via window rules or user actions (movetoworkspace).
This prevents onX11ConfigureRequest from overwriting any explicit workspace
assignment based on window position.
Changes:
- Add m_workspaceExplicitlyAssigned flag to CWindow
- Set flag when window rules assign workspace
- Set flag when user moves window via dispatcher
- Check flag in onX11ConfigureRequest instead of just special workspace
- Add debug logging for explicit workspace assignments
* fix: simplify X11 configure request handling for special workspaces
X11 apps send configure requests with positions based on XWayland's
monitor layout, which could incorrectly move windows off special
workspaces.
Skip workspace reassignment when the window is on a special workspace
or staying on the same monitor, but always run z-order, fullscreen flag,
and damage logic since the configure request may include geometry changes.
* fix: handle fullscreen windows on special workspaces
inFullscreenMode() only checked m_activeWorkspace, missing fullscreen
windows on special workspaces. This caused crashes and incorrect
behavior when fullscreen windows were on special workspaces.
Changes:
- inFullscreenMode() now checks special workspace first since it
renders on top of regular workspaces
- Added getFullscreenWindow() helper to safely get fullscreen window
from either active or special workspace
- Updated callers (shouldSkipScheduleFrameOnMouseEvent, Renderer,
getFSImageDescription) to use the new helper
- Reset m_aboveFullscreen for layer surfaces when opening, closing,
or stealing special workspaces between monitors
* test: add special workspace fullscreen detection tests
Add tests for the new special workspace fullscreen handling introduced
in the previous commit. The tests cover:
1. Fullscreen detection on special workspace - verifies that a window
made fullscreen on a special workspace is correctly detected
2. Special workspace fullscreen precedence - verifies that when both
regular and special workspaces have fullscreen windows, the special
workspace window can be focused when the special workspace is opened
3. Toggle special workspace behavior - verifies that toggling the
special workspace off properly hides it and returns focus to the
regular workspace's fullscreen window
These tests exercise the key code paths modified in the fix:
- inFullscreenMode() checking special workspace first
- getFullscreenWindow() helper returning correct window
- Layer surface m_aboveFullscreen reset on special workspace toggle
* format: add internal formats for drm formats
cross referenced with weston and added internal formats and types for a
lot of missing ones. also added a isFormatYUV helper.
* framebuffer: ensure we use right internalformat
ensure we use the right internal format to avoid internal driver
blitting, also since we only attach the GL_STENCIL_ATTACHMENT we might
just aswell only use the GL_STENCIL_INDEX8 to not confuse drivers that
we want a depth aswell.
* texture: use external on yuv or non linear mods
using external makes us use the gpu's internal detiler.
and this is makes intel a lot happier then having to format convert it
to a linear format internally.
* shaders: add external support to CM frag
add external support to CM frag, and correct ext.frag typo.
* formats: remove duplicates and fix a typo in cm.frag
remove duplicate formats and a typo in cm.frag
* formats: add swizzle logic to all formats
add swizzle logic from weston for all formats and use it in shm texture
paths.
* format: more format changes
use monitor drm format instead of forcing something different.
* shader: remove external from cm.frag
drivers want this resolved at compiletime cant use both
samplerExternalOES and sampler2d and then runtime branch it.
* screencopy: swizzle textures in screencopy
swizzle textures in screencopy, to get the right colors when copying.
* screencopy: restore old behaviour
try restore old behaviour before the gles3 format changes.
glReadPixels had the wrong format, so i went to far trying to mitigate
it. should be like before now.
* Add parent-death handling for BSDs
prctl() is a system call specific to Linux. So we cannot use it on BSDs.
FreeBSD has a system call procctl() which is similar to prctl(). We can
use it with PROC_PDEATHSIG_CTL.
OpenBSD, NetBSD, and DragonFly BSD do not appear to have a similar
mechanism. So intead of relying on a system call, we need to manually
poll ppid to see if the parent process has died.
With the changes, the spawned Hyprland process is terminated when the
launcher process exits, matching Linux behavior as closely as possible
on BSD platforms.
* Remove ppid polling on OpenBSD, NetBSD, and DragonFly BSD
* framebuffer: dont release if format or size changes
we dont have to release and recreate both the texture and framebuffer if
size or format changes, we can just bind the texture and call glTexImage2D
with the new format and size.
* framebuffer: set the alloced viewport size
if monitor size mismatch with the allocated m_size its going to set a
mismatched viewport and cause rendering issues. and if they are
mismatching there is a missing alloc call.
* renderbuffer: cleanup unneded binds
the renderbuffer is attached to the fbo and trying to rebind it in
bind() is causing unnecessery state changes, just bind the fbo.
add safeguard in the destructor, the constructor can return early on
failure and leave m_rbo empty or m_image as EGL_NO_IMAGE_KHR.
* hyprerror: fix horizontal overflow and damage box
* hyprerror: remove redundant m_queued preservation logic
The logic to save and restore m_queued into a temporary string 'q' was redundant because m_queued is explicitly cleared at the end of createQueued() (line 164). Restoring it to a non-empty state would cause createQueued() to be called every frame in draw(), which is not the intended behavior for the static error bar.
* Fixes style