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

Move tearing to hyprwayland-scanner #5657

Merged
merged 9 commits into from
Apr 20, 2024
Merged

Move tearing to hyprwayland-scanner #5657

merged 9 commits into from
Apr 20, 2024

Conversation

vaxerski
Copy link
Member

@vaxerski vaxerski commented Apr 20, 2024

This moves tearing to use hyprwayland-scanner instead of wayland-scanner generated headers.

Code becomes considerably cleaner and easier to manage.

Requires hyprwayland-scanner installed, obviously.

TODO:

Later, I'll move all other protocols to this, but for now it's a "testing period"

@vaxerski
Copy link
Member Author

merging, wee :D

@vaxerski vaxerski merged commit ea95449 into main Apr 20, 2024
17 checks passed
@nonetrix
Copy link

nonetrix commented Apr 20, 2024

Not sure if related, but after updating to this commit I cannot build on FreeBSD even after compiling and installing hyprwayland-scanner, I am just getting the following:

FAILED: CMakeFiles/Hyprland.dir/src/protocols/GlobalShortcuts.cpp.o
/usr/local/bin/clang++15 -DHAS_EXECINFO -DHyprland_EXPORTS -DLEGACY_RENDERER -DUSES_SYSTEMD -DWLR_USE_UNSTABLE -I/home/noah/.local/share/src/Hyprland/. -I/home/noah/.local/share/src/Hyprland/src -I/home/noah/.local/share/src/Hyprland/subprojects/wlroots-hyprland/include -I/home/noah/.local/share/src/Hyprland/subprojects/wlroots-hyprland/build/include -I/home/noah/.local/share/src/Hyprland/subprojects/udis86 -I/home/noah/.local/share/src/Hyprland/protocols -I/home/noah/.local/share/src/Hyprland/subprojects/udis86/libudis86 -isystem /usr/local/include -isystem /usr/local/include/libepoll-shim -isystem /usr/local/include/pango-1.0 -isystem /usr/local/include/cairo -isystem /usr/local/include/fribidi -isystem /usr/local/include/harfbuzz -isystem /usr/local/include/freetype2 -isystem /usr/local/include/libpng16 -isystem /usr/local/include/glib-2.0 -isystem /usr/local/lib/glib-2.0/include -isystem /usr/local/include/pixman-1 -isystem /usr/local/include/libdrm -fexperimental-library -O3 -DNDEBUG -std=gnu++2b -O3 -Wall -Wextra -Wno-unused-parameter -Wno-unused-value -Wno-missing-field-initializers -Wno-narrowing -Wno-pointer-arith -pthread -D_THREAD_SAFE -Winvalid-pch -Xclang -include-pch -Xclang /home/noah/.local/share/src/Hyprland/build/CMakeFiles/Hyprland.dir/cmake_pch.hxx.pch -Xclang -include -Xclang /home/noah/.local/share/src/Hyprland/build/CMakeFiles/Hyprland.dir/cmake_pch.hxx -MD -MT CMakeFiles/Hyprland.dir/src/protocols/GlobalShortcuts.cpp.o -MF CMakeFiles/Hyprland.dir/src/protocols/GlobalShortcuts.cpp.o.d -o CMakeFiles/Hyprland.dir/src/protocols/GlobalShortcuts.cpp.o -c /home/noah/.local/share/src/Hyprland/src/protocols/GlobalShortcuts.cpp
In file included from <built-in>:455:
In file included from /home/noah/.local/share/src/Hyprland/build/CMakeFiles/Hyprland.dir/cmake_pch.hxx:5:
In file included from /home/noah/.local/share/src/Hyprland/src/pch/pch.hpp:1:
In file included from /home/noah/.local/share/src/Hyprland/src/protocols/../Compositor.hpp:3:
In file included from /usr/include/c++/v1/memory:898:
In file included from /usr/include/c++/v1/__memory/shared_ptr.h:31:
/usr/include/c++/v1/__memory/unique_ptr.h:686:30: error: no matching constructor for initialization of 'SShortcutClient'
  return unique_ptr<_Tp>(new _Tp(_VSTD::forward<_Args>(__args)...));
                             ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/noah/.local/share/src/Hyprland/src/protocols/GlobalShortcuts.cpp:56:34: note: in instantiation of function template specialization 'std::make_unique<SShortcutClient, wl_client *&>' requested here
    m_vClients.emplace_back(std::make_unique<SShortcutClient>(client));
                                 ^
/home/noah/.local/share/src/Hyprland/src/protocols/GlobalShortcuts.hpp:12:8: note: candidate constructor (the implicit copy constructor) not viable: cannot convert argument of incomplete type 'wl_client *' to 'const SShortcutClient' for 1st argument
struct SShortcutClient {
       ^
/home/noah/.local/share/src/Hyprland/src/protocols/GlobalShortcuts.hpp:12:8: note: candidate constructor (the implicit move constructor) not viable: cannot convert argument of incomplete type 'wl_client *' to 'SShortcutClient' for 1st argument
/home/noah/.local/share/src/Hyprland/src/protocols/GlobalShortcuts.hpp:12:8: note: candidate constructor (the implicit default constructor) not viable: requires 0 arguments, but 1 was provided
1 error generated.
[89/122] Building CXX object CMakeFiles/Hyprland.dir/src/managers/input/InputMethodPopup.cpp.o
In file included from <built-in>:455:
In file included from /home/noah/.local/share/src/Hyprland/build/CMakeFiles/Hyprland.dir/cmake_pch.hxx:5:
In file included from /home/noah/.local/share/src/Hyprland/src/pch/pch.hpp:1:
In file included from /home/noah/.local/share/src/Hyprland/src/managers/input/../../Compositor.hpp:3:
In file included from /usr/include/c++/v1/memory:898:
In file included from /usr/include/c++/v1/__memory/shared_ptr.h:31:
/usr/include/c++/v1/__memory/unique_ptr.h:65:5: warning: delete called on non-final 'CFractionalScaleProtocol' that has virtual functions but non-virtual destructor [-Wdelete-non-abstract-non-virtual-dtor]
    delete __ptr;
    ^
/usr/include/c++/v1/__memory/unique_ptr.h:297:7: note: in instantiation of member function 'std::default_delete<CFractionalScaleProtocol>::operator()' requested here
      __ptr_.second()(__tmp);
      ^
/usr/include/c++/v1/__memory/unique_ptr.h:263:75: note: in instantiation of member function 'std::unique_ptr<CFractionalScaleProtocol>::reset' requested here
  _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 ~unique_ptr() { reset(); }
                                                                          ^
/home/noah/.local/share/src/Hyprland/src/managers/input/../../protocols/FractionalScale.hpp:67:41: note: in instantiation of member function 'std::unique_ptr<CFractionalScaleProtocol>::~unique_ptr' requested here
    inline UP<CFractionalScaleProtocol> fractional;
                                        ^
1 warning generated.
[95/122] Building CXX object CMakeFiles/Hyprland.dir/src/protocols/FractionalScale.cpp.o
In file included from <built-in>:455:
In file included from /home/noah/.local/share/src/Hyprland/build/CMakeFiles/Hyprland.dir/cmake_pch.hxx:5:
In file included from /home/noah/.local/share/src/Hyprland/src/pch/pch.hpp:1:
In file included from /home/noah/.local/share/src/Hyprland/src/helpers/../desktop/../managers/../Compositor.hpp:3:
In file included from /usr/include/c++/v1/memory:898:
In file included from /usr/include/c++/v1/__memory/shared_ptr.h:31:
/usr/include/c++/v1/__memory/unique_ptr.h:65:5: warning: delete called on non-final 'CFractionalScaleProtocol' that has virtual functions but non-virtual destructor [-Wdelete-non-abstract-non-virtual-dtor]
    delete __ptr;
    ^
/usr/include/c++/v1/__memory/unique_ptr.h:297:7: note: in instantiation of member function 'std::default_delete<CFractionalScaleProtocol>::operator()' requested here
      __ptr_.second()(__tmp);
      ^
/usr/include/c++/v1/__memory/unique_ptr.h:263:75: note: in instantiation of member function 'std::unique_ptr<CFractionalScaleProtocol>::reset' requested here
  _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 ~unique_ptr() { reset(); }
                                                                          ^
/home/noah/.local/share/src/Hyprland/src/protocols/FractionalScale.hpp:67:41: note: in instantiation of member function 'std::unique_ptr<CFractionalScaleProtocol>::~unique_ptr' requested here
    inline UP<CFractionalScaleProtocol> fractional;
                                        ^
/home/noah/.local/share/src/Hyprland/src/protocols/FractionalScale.hpp:31:30: warning: private field 'scale' is not used [-Wunused-private-field]
    float                    scale       = 1.F;
                             ^
2 warnings generated.
[97/122] Building CXX object CMakeFiles/Hyprland.dir/src/protocols/TearingControl.cpp.o
In file included from <built-in>:455:
In file included from /home/noah/.local/share/src/Hyprland/build/CMakeFiles/Hyprland.dir/cmake_pch.hxx:5:
In file included from /home/noah/.local/share/src/Hyprland/src/pch/pch.hpp:1:
In file included from /home/noah/.local/share/src/Hyprland/src/helpers/../desktop/../managers/../Compositor.hpp:3:
In file included from /usr/include/c++/v1/memory:898:
In file included from /usr/include/c++/v1/__memory/shared_ptr.h:31:
/usr/include/c++/v1/__memory/unique_ptr.h:65:5: warning: delete called on non-final 'CTearingControlProtocol' that has virtual functions but non-virtual destructor [-Wdelete-non-abstract-non-virtual-dtor]
    delete __ptr;
    ^
/usr/include/c++/v1/__memory/unique_ptr.h:297:7: note: in instantiation of member function 'std::default_delete<CTearingControlProtocol>::operator()' requested here
      __ptr_.second()(__tmp);
      ^
/usr/include/c++/v1/__memory/unique_ptr.h:263:75: note: in instantiation of member function 'std::unique_ptr<CTearingControlProtocol>::reset' requested here
  _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX23 ~unique_ptr() { reset(); }
                                                                          ^
/home/noah/.local/share/src/Hyprland/src/protocols/TearingControl.hpp:54:40: note: in instantiation of member function 'std::unique_ptr<CTearingControlProtocol>::~unique_ptr' requested here
    inline UP<CTearingControlProtocol> tearing;
                                       ^
1 warning generated.
[102/122] Building CXX object CMakeFiles/Hyprland.dir/src/protocols/Screencopy.cpp.o
ninja: build stopped: subcommand failed.
gmake: *** [Makefile:5: legacyrenderer] Error 1

More my fault for trying FreeBSD wondering if it's improved any (it hasn't).... Using Clang instead of GCC too because it wouldn't build with GCC, but also using export CXXFLAGS=-fexperimental-library

@vaxerski
Copy link
Member Author

CI passes, likely on your end.

@jbeich
Copy link
Contributor

jbeich commented Apr 21, 2024

@nonetrix, Clang 15 is too old, see hyprwm/hyprland-wiki@44a506dbaae1. For example, FreeBSD 14.0 has Clang 16 as /usr/bin/clang++ (or /usr/bin/c++) and libc++ 16 as /usr/include/c++/v1 but you're using /usr/local/bin/clang++15 likely with libc++ 16 (llvm15 package doesn't ship libc++).

I can't reproduce on FreeBSD -CURRENT with base Clang/libc++ 18 while building Hyprland via Meson (like downstream package). CMake also seems to work.

@nonetrix
Copy link

Huh not sure why I was able to build before then

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.

4 participants