Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implent xcursor manager #7178

Merged
merged 3 commits into from
Aug 5, 2024
Merged

implent xcursor manager #7178

merged 3 commits into from
Aug 5, 2024

Conversation

gulafaran
Copy link
Contributor

@gulafaran gulafaran commented Aug 4, 2024

so the bootleg xcursor has been redone into its own manager now fully supporting animated cursors and also library loading files directly instead of only the xcursor standard names, some themes supply shapes outside the standard names for wayland etc so this makes it miss even less shapes.

also while adding animated xcursors i noticed buffers where never dropped in tickAnimatedCursor for hyprcursor, ensure they are dropped aswell. this bit i have not tested since i dont use hyprcursor.

the xcursor manager still lacks support for inherited themes using index.theme files and the "default" xcursor theme is not working either but isnt on main branch either. that can be figured out in the future.

thought id start here make a PR and work out issues/comments/ideas and then spend time on fixing up the last missing bits.

this could use some testing in swapping between hyprcursor/xcursor using hyprctl and env vars so i havent missed some edgecase

Fixes: #7162
Probably fixes: #6983

Waiting for info: #7173

@Eclextic
Copy link

Eclextic commented Aug 4, 2024

I'm sorry if this is totally off-topic but...

implent

image

Copy link
Member

@vaxerski vaxerski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

additionally the filename should be XCursorManager and not SXCursorManager

src/managers/SXCursorManager.cpp Outdated Show resolved Hide resolved
src/managers/SXCursorManager.cpp Outdated Show resolved Hide resolved
src/managers/SXCursorManager.cpp Outdated Show resolved Hide resolved
src/managers/SXCursorManager.hpp Outdated Show resolved Hide resolved
src/managers/SXCursorManager.hpp Outdated Show resolved Hide resolved
src/managers/SXCursorManager.hpp Outdated Show resolved Hide resolved
src/managers/CursorManager.cpp Outdated Show resolved Hide resolved
src/managers/CursorManager.cpp Outdated Show resolved Hide resolved
@gulafaran
Copy link
Contributor Author

additionally the filename should be XCursorManager and not SXCursorManager

want the class to named XCursorManager too?

@vaxerski
Copy link
Member

vaxerski commented Aug 4, 2024

file: XCursorManager
class: CXCursorManager (Class)

@gulafaran gulafaran force-pushed the cursors branch 3 times, most recently from 8de3d59 to d72a3ce Compare August 4, 2024 21:53
@gulafaran
Copy link
Contributor Author

@vaxerski hmm got any clues? cursor:no_hardware_cursors = true

================================================================
==82623==ERROR: AddressSanitizer: heap-use-after-free on address 0x529000541200 at pc 0x7ffff7945932 bp 0x7fffffff9c30 sp 0x7fffffff93f0
READ of size 16384 at 0x529000541200 thread T0
The XKEYBOARD keymap compiler (xkbcomp) reports:
> Warning:          Unsupported maximum keycode 708, clipping.
>                   X11 cannot support keycodes above 255.
> Warning:          Could not resolve keysym XF86KbdInputAssistPrevgrou
> Warning:          Could not resolve keysym XF86KbdInputAssistNextgrou
Errors from xkbcomp are not fatal to the X server
    #0 0x7ffff7945931 in memcpy (/usr/lib/gcc/x86_64-pc-linux-gnu/14/libasan.so.8+0x145931)
    #1 0x7ffff4b8aa2c  (/usr/lib64/libgallium-24.3.0-devel.so+0x98aa2c) (BuildId: 3fa219a3dfb81a678fd5a762c9ba2dadbc947294)
    #2 0x7ffff4d43117  (/usr/lib64/libgallium-24.3.0-devel.so+0xb43117) (BuildId: 3fa219a3dfb81a678fd5a762c9ba2dadbc947294)
    #3 0x7ffff445c46c  (/usr/lib64/libgallium-24.3.0-devel.so+0x25c46c) (BuildId: 3fa219a3dfb81a678fd5a762c9ba2dadbc947294)
    #4 0x7ffff445debf  (/usr/lib64/libgallium-24.3.0-devel.so+0x25debf) (BuildId: 3fa219a3dfb81a678fd5a762c9ba2dadbc947294)
    #5 0x7ffff4419932  (/usr/lib64/libgallium-24.3.0-devel.so+0x219932) (BuildId: 3fa219a3dfb81a678fd5a762c9ba2dadbc947294)
    #6 0x7ffff441aa0c  (/usr/lib64/libgallium-24.3.0-devel.so+0x21aa0c) (BuildId: 3fa219a3dfb81a678fd5a762c9ba2dadbc947294)
    #7 0x555556c3a364 in CTexture::createFromShm(unsigned int, unsigned char*, unsigned int, Hyprutils::Math::Vector2D const&) /home/tom/dev/Hyprland/src/render/Texture.cpp:80
    #8 0x555556c3c193 in CTexture::CTexture(Hyprutils::Memory::CSharedPointer<Aquamarine::IBuffer>) /home/tom/dev/Hyprland/src/render/Texture.cpp:46
    #9 0x55555637eab1 in Hyprutils::Memory::CSharedPointer<CTexture> Hyprutils::Memory::makeShared<CTexture, Hyprutils::Memory::CSharedPointer<Aquamarine::IBuffer>&>(Hyprutils::Memory::CSharedPointer<Aquamarine::IBuffer>&) /usr/include/hyprutils/memory/SharedPtr.hpp:291
    #10 0x5555563744e2 in CPointerManager::getCurrentCursorTexture() /home/tom/dev/Hyprland/src/managers/PointerManager.cpp:772
    #11 0x555556379176 in CPointerManager::renderSoftwareCursorsFor(Hyprutils::Memory::CSharedPointer<CMonitor>, timespec*, Hyprutils::Math::CRegion&, std::optional<Hyprutils::Math::Vector2D>) /home/tom/dev/Hyprland/src/managers/PointerManager.cpp:515
    #12 0x555556befb4f in CHyprRenderer::renderMonitor(CMonitor*) /home/tom/dev/Hyprland/src/render/Renderer.cpp:1349
    #13 0x55555619d678 in Events::listener_monitorFrame(void*, void*) /home/tom/dev/Hyprland/src/events/Monitors.cpp:84
    #14 0x55555620c8d1 in CMonitor::onConnect(bool)::$_0::operator()(std::any) const /home/tom/dev/Hyprland/src/helpers/Monitor.cpp:40
    #15 0x55555620c788 in void std::__invoke_impl<void, CMonitor::onConnect(bool)::$_0&, std::any>(std::__invoke_other, CMonitor::onConnect(bool)::$_0&, std::any&&) /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/invoke.h:61
    #16 0x55555620c62c in std::enable_if<is_invocable_r_v<void, CMonitor::onConnect(bool)::$_0&, std::any>, void>::type std::__invoke_r<void, CMonitor::onConnect(bool)::$_0&, std::any>(CMonitor::onConnect(bool)::$_0&, std::any&&) /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/invoke.h:111
    #17 0x55555620c4f4 in std::_Function_handler<void (std::any), CMonitor::onConnect(bool)::$_0>::_M_invoke(std::_Any_data const&, std::any&&) /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/std_function.h:290
    #18 0x7ffff6e36fcb in Hyprutils::Signal::CSignalListener::emit(std::any) (/usr/lib64/libhyprutils.so.1+0x7fcb)
    #19 0x7ffff6e3753d in Hyprutils::Signal::CSignal::emit(std::any) (/usr/lib64/libhyprutils.so.1+0x853d)
    #20 0x7ffff7741655 in Aquamarine::CWaylandOutput::sendFrameAndSetCallback() /var/tmp/portage/dev-util/aquamarine-9999/work/aquamarine-9999/src/backend/Wayland.cpp:621
    #21 0x7ffff7741975 in Aquamarine::CWaylandOutput::onFrameDone() /var/tmp/portage/dev-util/aquamarine-9999/work/aquamarine-9999/src/backend/Wayland.cpp:639
    #22 0x7ffff7773cc5 in std::function<void (CCWlCallback*, unsigned int)>::operator()(CCWlCallback*, unsigned int) const /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/std_function.h:591
    #23 0x7ffff7773cc5 in _CWlCallbackDone /var/tmp/portage/dev-util/aquamarine-9999/work/aquamarine-9999/protocols/wayland.cpp:234
    #24 0x7ffff7773cc5 in _CWlCallbackDone /var/tmp/portage/dev-util/aquamarine-9999/work/aquamarine-9999/protocols/wayland.cpp:231
    #25 0x7ffff6c9c549  (/usr/lib64/libffi.so.8+0x8549)
    #26 0x7ffff6c9827d  (/usr/lib64/libffi.so.8+0x427d)
    #27 0x7ffff6c9b9ca in ffi_call (/usr/lib64/libffi.so.8+0x79ca)
    #28 0x7ffff7658c14  (/usr/lib64/libwayland-client.so.0+0x4c14)
    #29 0x7ffff7658f3a  (/usr/lib64/libwayland-client.so.0+0x4f3a)
    #30 0x7ffff765dfd7 in wl_display_dispatch_pending (/usr/lib64/libwayland-client.so.0+0x9fd7)
    #31 0x7ffff773bf5c in Aquamarine::CWaylandBackend::dispatchEvents() /var/tmp/portage/dev-util/aquamarine-9999/work/aquamarine-9999/src/backend/Wayland.cpp:159
    #32 0x555556239252 in std::function<void ()>::operator()() const /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/std_function.h:591
    #33 0x555556439086 in aquamarineFDWrite(int, unsigned int, void*) /home/tom/dev/Hyprland/src/managers/eventLoop/EventLoopManager.cpp:41
    #34 0x7ffff766e6b2  (/usr/lib64/libwayland-server.so.0+0xa6b2)
    #35 0x7ffff766f508 in wl_display_run (/usr/lib64/libwayland-server.so.0+0xb508)
    #36 0x555556438e2b in CEventLoopManager::enterLoop() /home/tom/dev/Hyprland/src/managers/eventLoop/EventLoopManager.cpp:54
    #37 0x555555d2c806 in CCompositor::startCompositor() /home/tom/dev/Hyprland/src/Compositor.cpp:683
    #38 0x5555562b05c2 in main /home/tom/dev/Hyprland/src/main.cpp:158
    #39 0x7ffff662a096  (/usr/lib64/libc.so.6+0x2a096)
    #40 0x7ffff662a156 in __libc_start_main (/usr/lib64/libc.so.6+0x2a156)
    #41 0x555555d20540 in _start (/home/tom/dev/Hyprland/build/Desktop-Debug/Hyprland+0x7cc540)

0x529000541200 is located 0 bytes inside of 16384-byte region [0x529000541200,0x529000545200)
freed by thread T0 here:
    #0 0x7ffff7949fa0 in operator delete(void*) (/usr/lib/gcc/x86_64-pc-linux-gnu/14/libasan.so.8+0x149fa0)
    #1 0x55555614b90c in std::__new_allocator<unsigned int>::deallocate(unsigned int*, unsigned long) /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/new_allocator.h:172
    #2 0x55555614b8c7 in std::allocator<unsigned int>::deallocate(unsigned int*, unsigned long) /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/allocator.h:208
    #3 0x55555614b8c7 in std::allocator_traits<std::allocator<unsigned int> >::deallocate(std::allocator<unsigned int>&, unsigned int*, unsigned long) /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/alloc_traits.h:513
    #4 0x55555614b8c7 in std::_Vector_base<unsigned int, std::allocator<unsigned int> >::_M_deallocate(unsigned int*, unsigned long) /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/stl_vector.h:389
    #5 0x55555614b7ee in std::_Vector_base<unsigned int, std::allocator<unsigned int> >::~_Vector_base() /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/stl_vector.h:368
    #6 0x555556147f92 in std::vector<unsigned int, std::allocator<unsigned int> >::~vector() /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/stl_vector.h:738
    #7 0x5555562d82ec in SXCursorImage::~SXCursorImage() /home/tom/dev/Hyprland/src/managers/XCursorManager.hpp:14
    #8 0x5555562d16a8 in CCursorManager::setXCursor(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) /home/tom/dev/Hyprland/src/managers/CursorManager.cpp:162
    #9 0x5555562d1d65 in CCursorManager::setCursorFromName(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) /home/tom/dev/Hyprland/src/managers/CursorManager.cpp:169
    #10 0x5555562cf470 in CCursorManager::updateTheme() /home/tom/dev/Hyprland/src/managers/CursorManager.cpp:309
    #11 0x5555562d6885 in CCursorManager::CCursorManager()::$_0::operator()(void*, SCallbackInfo&, std::any) const /home/tom/dev/Hyprland/src/managers/CursorManager.cpp:60
    #12 0x5555562d6740 in void std::__invoke_impl<void, CCursorManager::CCursorManager()::$_0&, void*, SCallbackInfo&, std::any>(std::__invoke_other, CCursorManager::CCursorManager()::$_0&, void*&&, SCallbackInfo&, std::any&&) /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/invoke.h:61
    #13 0x5555562d658c in std::enable_if<is_invocable_r_v<void, CCursorManager::CCursorManager()::$_0&, void*, SCallbackInfo&, std::any>, void>::type std::__invoke_r<void, CCursorManager::CCursorManager()::$_0&, void*, SCallbackInfo&, std::any>(CCursorManager::CCursorManager()::$_0&, void*&&, SCallbackInfo&, std::any&&) /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/invoke.h:111
    #14 0x5555562d6444 in std::_Function_handler<void (void*, SCallbackInfo&, std::any), CCursorManager::CCursorManager()::$_0>::_M_invoke(std::_Any_data const&, void*&&, SCallbackInfo&, std::any&&) /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/std_function.h:290
    #15 0x5555562f65fa in std::function<void (void*, SCallbackInfo&, std::any)>::operator()(void*, SCallbackInfo&, std::any) const /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/std_function.h:591
    #16 0x5555562f23ed in CHookSystemManager::emit(std::vector<SCallbackFNPtr, std::allocator<SCallbackFNPtr> >*, SCallbackInfo&, std::any) /home/tom/dev/Hyprland/src/managers/HookSystemManager.cpp:41
    #17 0x555555f14d8c in CConfigManager::performMonitorReload() /home/tom/dev/Hyprland/src/config/ConfigManager.cpp:1363
    #18 0x555555f13110 in CConfigManager::postConfigReload(Hyprlang::CParseResult const&) /home/tom/dev/Hyprland/src/config/ConfigManager.cpp:840
    #19 0x555555f11e80 in CConfigManager::reload() /home/tom/dev/Hyprland/src/config/ConfigManager.cpp:712
    #20 0x555555f17aec in CConfigManager::tick() /home/tom/dev/Hyprland/src/config/ConfigManager.cpp:972
    #21 0x555556411894 in handleTimer(void*) /home/tom/dev/Hyprland/src/managers/ThreadManager.cpp:14
    #22 0x7ffff7669243  (/usr/lib64/libwayland-server.so.0+0x5243)
    #23 0x7ffff766e693  (/usr/lib64/libwayland-server.so.0+0xa693)
    #24 0x7ffff766f508 in wl_display_run (/usr/lib64/libwayland-server.so.0+0xb508)
    #25 0x555556438e2b in CEventLoopManager::enterLoop() /home/tom/dev/Hyprland/src/managers/eventLoop/EventLoopManager.cpp:54
    #26 0x555555d2c806 in CCompositor::startCompositor() /home/tom/dev/Hyprland/src/Compositor.cpp:683
    #27 0x5555562b05c2 in main /home/tom/dev/Hyprland/src/main.cpp:158
    #28 0x7ffff662a096  (/usr/lib64/libc.so.6+0x2a096)
    #29 0x7ffff662a156 in __libc_start_main (/usr/lib64/libc.so.6+0x2a156)
    #30 0x555555d20540 in _start (/home/tom/dev/Hyprland/build/Desktop-Debug/Hyprland+0x7cc540)

previously allocated by thread T0 here:
    #0 0x7ffff7949568 in operator new(unsigned long) (/usr/lib/gcc/x86_64-pc-linux-gnu/14/libasan.so.8+0x149568)
    #1 0x55555614f147 in std::__new_allocator<unsigned int>::allocate(unsigned long, void const*) /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/new_allocator.h:151
    #2 0x55555614ec23 in std::allocator<unsigned int>::allocate(unsigned long) /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/allocator.h:196
    #3 0x55555614ec23 in std::allocator_traits<std::allocator<unsigned int> >::allocate(std::allocator<unsigned int>&, unsigned long) /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/alloc_traits.h:478
    #4 0x55555614ec23 in std::_Vector_base<unsigned int, std::allocator<unsigned int> >::_M_allocate(unsigned long) /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/stl_vector.h:380
    #5 0x5555562de400 in std::_Vector_base<unsigned int, std::allocator<unsigned int> >::_M_create_storage(unsigned long) /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/stl_vector.h:398
    #6 0x5555562de001 in std::_Vector_base<unsigned int, std::allocator<unsigned int> >::_Vector_base(unsigned long, std::allocator<unsigned int> const&) /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/stl_vector.h:334
    #7 0x5555562dddde in std::vector<unsigned int, std::allocator<unsigned int> >::vector(std::vector<unsigned int, std::allocator<unsigned int> > const&) /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/stl_vector.h:602
    #8 0x5555562d7d8c in SXCursorImage::SXCursorImage(SXCursorImage const&) /home/tom/dev/Hyprland/src/managers/XCursorManager.hpp:14
    #9 0x5555562d124f in CCursorManager::setXCursor(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) /home/tom/dev/Hyprland/src/managers/CursorManager.cpp:144
    #10 0x5555562d1d65 in CCursorManager::setCursorFromName(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) /home/tom/dev/Hyprland/src/managers/CursorManager.cpp:169
    #11 0x5555562cf470 in CCursorManager::updateTheme() /home/tom/dev/Hyprland/src/managers/CursorManager.cpp:309
    #12 0x5555562d6885 in CCursorManager::CCursorManager()::$_0::operator()(void*, SCallbackInfo&, std::any) const /home/tom/dev/Hyprland/src/managers/CursorManager.cpp:60
    #13 0x5555562d6740 in void std::__invoke_impl<void, CCursorManager::CCursorManager()::$_0&, void*, SCallbackInfo&, std::any>(std::__invoke_other, CCursorManager::CCursorManager()::$_0&, void*&&, SCallbackInfo&, std::any&&) /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/invoke.h:61
    #14 0x5555562d658c in std::enable_if<is_invocable_r_v<void, CCursorManager::CCursorManager()::$_0&, void*, SCallbackInfo&, std::any>, void>::type std::__invoke_r<void, CCursorManager::CCursorManager()::$_0&, void*, SCallbackInfo&, std::any>(CCursorManager::CCursorManager()::$_0&, void*&&, SCallbackInfo&, std::any&&) /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/invoke.h:111
    #15 0x5555562d6444 in std::_Function_handler<void (void*, SCallbackInfo&, std::any), CCursorManager::CCursorManager()::$_0>::_M_invoke(std::_Any_data const&, void*&&, SCallbackInfo&, std::any&&) /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/std_function.h:290
    #16 0x5555562f65fa in std::function<void (void*, SCallbackInfo&, std::any)>::operator()(void*, SCallbackInfo&, std::any) const /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/std_function.h:591
    #17 0x5555562f23ed in CHookSystemManager::emit(std::vector<SCallbackFNPtr, std::allocator<SCallbackFNPtr> >*, SCallbackInfo&, std::any) /home/tom/dev/Hyprland/src/managers/HookSystemManager.cpp:41
    #18 0x555555f14d8c in CConfigManager::performMonitorReload() /home/tom/dev/Hyprland/src/config/ConfigManager.cpp:1363
    #19 0x555555f13110 in CConfigManager::postConfigReload(Hyprlang::CParseResult const&) /home/tom/dev/Hyprland/src/config/ConfigManager.cpp:840
    #20 0x555555f11e80 in CConfigManager::reload() /home/tom/dev/Hyprland/src/config/ConfigManager.cpp:712
    #21 0x555555f17aec in CConfigManager::tick() /home/tom/dev/Hyprland/src/config/ConfigManager.cpp:972
    #22 0x555556411894 in handleTimer(void*) /home/tom/dev/Hyprland/src/managers/ThreadManager.cpp:14
    #23 0x7ffff7669243  (/usr/lib64/libwayland-server.so.0+0x5243)
    #24 0x7ffff766e693  (/usr/lib64/libwayland-server.so.0+0xa693)
    #25 0x7ffff766f508 in wl_display_run (/usr/lib64/libwayland-server.so.0+0xb508)
    #26 0x555556438e2b in CEventLoopManager::enterLoop() /home/tom/dev/Hyprland/src/managers/eventLoop/EventLoopManager.cpp:54
    #27 0x555555d2c806 in CCompositor::startCompositor() /home/tom/dev/Hyprland/src/Compositor.cpp:683
    #28 0x5555562b05c2 in main /home/tom/dev/Hyprland/src/main.cpp:158
    #29 0x7ffff662a096  (/usr/lib64/libc.so.6+0x2a096)
    #30 0x7ffff662a156 in __libc_start_main (/usr/lib64/libc.so.6+0x2a156)
    #31 0x555555d20540 in _start (/home/tom/dev/Hyprland/build/Desktop-Debug/Hyprland+0x7cc540)

SUMMARY: AddressSanitizer: heap-use-after-free (/usr/lib/gcc/x86_64-pc-linux-gnu/14/libasan.so.8+0x145931) in memcpy

src/managers/CursorManager.cpp Outdated Show resolved Hide resolved
src/managers/CursorManager.cpp Outdated Show resolved Hide resolved
src/managers/CursorManager.cpp Outdated Show resolved Hide resolved
src/managers/XCursorManager.cpp Outdated Show resolved Hide resolved
src/managers/XCursorManager.cpp Outdated Show resolved Hide resolved
@vaxerski
Copy link
Member

vaxerski commented Aug 4, 2024

also you seen #7162?

@vaxerski
Copy link
Member

vaxerski commented Aug 4, 2024

re: asan, buffer is still there while you freed the pixels

@vaxerski
Copy link
Member

vaxerski commented Aug 4, 2024

image
in CCursorBuffer, it should probably either weak ref the xcursor shape or just have a copy

@gulafaran
Copy link
Contributor Author

image in CCursorBuffer, it should probably either weak ref the xcursor shape or just have a copy

think i figured it out with setting current cursor after the buffer been dropped instead of before. but cursor:no_hardware_cursors = true still causes some corruption that isnt seen with it set to false. seems to occur on main too tho #7173

also gotta get some hyprcursor theme installed and fiddle around so there isnt some other edgy pointers trying to jump into mordor. but thats for tomorrow

@vaxerski
Copy link
Member

vaxerski commented Aug 5, 2024

lmk when it's ready for review then

@gulafaran
Copy link
Contributor Author

lmk when it's ready for review then

i have tried bisecting no_hardware_cursors = true , up until 016da23 after that i gave up. either the bug is inside aquamarine as of recent or it has always been there. the bug im seeing is im having two pointer shapes showing at all times. one is permanent and one is changing accordingly. otherwise im not hitting any edgy pointers in my limited testing.

maybe related to the spam of "[WARN] [AQ] Output WAYLAND-1: pending state has a non-released buffer??" that increases in frequency when no_hardware_cursors = true is set.

@vaxerski
Copy link
Member

vaxerski commented Aug 5, 2024

wayland log thing is whatever

@gulafaran
Copy link
Contributor Author

wayland log thing is whatever

i just noticed, since i have hw cursors on main and software on nested session the actual cursor that is showing overlayed is the one from the main session heh

@gulafaran
Copy link
Contributor Author

wayland log thing is whatever

i just noticed, since i have hw cursors on main and software on nested session the actual cursor that is showing overlayed is the one from the main session heh

almost like the hwcursor buffer/surface is being empty and rendered "invisible" with chance of corruption because of uninitialized data? and because im nesting it it gets the data from the main session. if any of that makes any sorts of sense lol

@vaxerski
Copy link
Member

vaxerski commented Aug 5, 2024

can't repro, running this branch with asan no probs

@gulafaran
Copy link
Contributor Author

can't repro, running this branch with asan no probs

cursor.mp4

@vaxerski
Copy link
Member

vaxerski commented Aug 5, 2024

I dont get it, whats wrong? duplicated cursors because no hw

@gulafaran
Copy link
Contributor Author

can't repro, running this branch with asan no probs

cursor.mp4

I dont get it, whats wrong? duplicated cursors because no hw

if nested has no_hardware_cursors = true, the main cursor shows at all time ontop of the nested session. never hides in timeout. and is stuck from the last shape of the main session. so either main session isnt hiding it or the nested session is double rendering something

@vaxerski
Copy link
Member

vaxerski commented Aug 5, 2024

ye thats an aq bug that doesnt really matter

@gulafaran
Copy link
Contributor Author

ye thats an aq bug that doesnt really matter

okay :) then i got no other objections. <3

src/managers/CursorManager.cpp Outdated Show resolved Hide resolved
src/managers/CursorManager.cpp Outdated Show resolved Hide resolved
src/managers/XCursorManager.cpp Show resolved Hide resolved
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.
animated cursors are creating a new buffer for each image, ensure we
drop the buffers so it continously doesnt build up in infinity.
use EvenloopManager for timers instead of adding it directly to
m_sWLEventLoop and using its related wl_* functions.
Copy link
Member

@vaxerski vaxerski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks tom

image

@vaxerski vaxerski merged commit 0e86808 into hyprwm:main Aug 5, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cursor scaling issues after aquamarine Cursor becomes tiny when switching apps (xcursor)
3 participants