cursor:sync_gsettings_theme is set to default true and if enabled it
will now sync xcursor theme loading with gsettings if it can, meaning
CSD clients will now also change to the appropiate theme upon start and
hyprctl setcursor THEME SIZE .
* framebuffer: avoid gluint overflow
GLuint was being initialized to -1 and rolling over to unsigned int max,
its defined behaviour but very unnecessery. add a bool and use it for
checking if allocated or not.
* opengl: avoid gluint rollover
-1 rolls over to unsigned int max, use 0xFF instead.
* core: big uint64_t to int type conversion
there were a few uint64_t to int implicit conversions overflowing int
and causing UB, make all monitor/workspaces/windows use the new
typedefs. also fix the various related 64 to 32 implicit conversions
going around found with -Wshorten-64-to-32
avoid adding ill formed Inherit lines to inherit vector and later
scanning them, it wont change anything in practice but makes the inherit
theme parsing more in line with what its supposed todo. also check for
return values of the various string functions so we dont end up erasing
the wrong thing.
When both flip directions use more space than is available, pick the
direction that has more space available instead of just the opposite
of what was initially requested.
* cursormgr: reduce duplicated code
add a few functions such as setCursorBuffer and setAnimationTimer to
reduce duplicated code and also avoid future mishaps of forgetting to
clear buffer or disarm timer. and generally reduce spaghetti even tho
pasta can be delicious.
* xcursormgr: implent inherited themes
implent index.theme parsing and inherited themes.
* cursormgr: ensure a fallback xcursor exist
ensure a xcursor fallback exist otherwise it wont load the proper theme
if we at launch have hyprcursor enabled and then set it to false in
config and reload. also use the env var when using hyprctl setcursor
incase its empty.
* xcursor: bootleg xcursors into its own manager
implent XCursorManager and load themes based on librarypath and its
dir, now we catch all supplied theme files. and also implent animated
cursors. also refactor a bit of spaghetti regarding xcursors in
CursorManager.
* hyprcursor: fix buffer leak
animated cursors are creating a new buffer for each image, ensure we
drop the buffers so it continously doesnt build up in infinity.
* cursormgr: use eventloopmgr for animation
use EvenloopManager for timers instead of adding it directly to
m_sWLEventLoop and using its related wl_* functions.
src/Compositor.cpp:2295:74: error: no member named 'bit_floor' in namespace 'std'
2295 | const eFullscreenMode CURRENT_EFFECTIVE_MODE = (eFullscreenMode)std::bit_floor((uint8_t)PWINDOW->m_sFullscreenState.internal);
| ~~~~~^
src/Compositor.cpp:2296:74: error: no member named 'bit_floor' in namespace 'std'
2296 | const eFullscreenMode EFFECTIVE_MODE = (eFullscreenMode)std::bit_floor((uint8_t)state.internal);
| ~~~~~^
src/desktop/Window.cpp:1242:34: error: no member named 'bit_floor' in namespace 'std'
1242 | return (eFullscreenMode)std::bit_floor((uint8_t)m_sFullscreenState.internal) == MODE;
| ~~~~~^
there were a bunch of missing cursors, rework the shape loading add a
function to get legacyname from new wayland names. also bootleg add a
cursor if no theme can be found and no shape. to atleast show
something.
* bezier: dont loop on float values
Using a floating-point loop variable with a fixed increment can cause precision
errors over time due to the nature of floating-point arithmetic.
and cause undesired effects.
ex
iteration 1 = 0.10000000149011611938
iteration 2 = 0.20000000298023223877
eventually..
iteration 8 = 0.80000001192092895508
iteration 9 = 0.89999997615814208984
* hyprctl: close sockets on destruction
store socketpath and close the fd and unlink the socket path on exit.
* eventloopmgr: close the timerfd
close the timerfd on exit.
* debug: make logging thread safe
instead of opening and closing the logfile on each write open it on init
and close it on compositor exit. also add a mutex so accidently using
logging from a thread like the watchdog or similiar doesnt cause issues.
* xwl: clean up fd logic
check if the fd is actually opened before closing, and close the
pipesource FD on exit.
* protocols: avoid undefined behaviour in C macro
to safely use wl_container_of with a class the class has to be no
virtual functions, no inheritance, and uniform access control (e.g all
public)
work around this by putting this into a destroywrapper struct.
* opengl: clean memory on destruction
add a destructor and free the allocated memory and close the fd
Emits `SModifiersEvent` in `updateModifiers()`
Before the patch:
Changing layout with `hyprctl switchxkblayout ...` results in:
* active keymap in `hyprctl devices` is changed
* no event
* no layout is actually changed UNTIL you press one of the mod keys
(Alt | Shift | Super | Ctrl)
After:
* active keymap in `hyprctl devices` changed
* activelayout IPC event emitted
* layout is changed
This fixes https://github.com/hyprwm/Hyprland/issues/7044
XWayland does not use the regular commit(null) method to unmap, which results in buffers never being released.
release the buffers if present and un-released in the unmap() handler
ref #6584