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

wl_seat / data_device / xdg_shell: Move to Hyprland impl #5999

Merged
merged 7 commits into from
May 14, 2024

Conversation

vaxerski
Copy link
Member

@vaxerski vaxerski commented May 10, 2024

This is a huge MR because the three are very closely tied.

Not ready yet.

Parts done:

  • wl_seat
    • New grab impl for xdg and hl protos
  • xdg_shell
    • xdg_positioner
  • wl_data_device
    • dnd
  • wlr_data_device
  • primary_selection

TODO:

Bugs:

  • GTK doesn't seem to be able to bind to wl_seat properly
  • xdg_shell popups will crash the entire compositor (because wlroots doesn't realize wlr_seat is gone)
  • xdg_shell popups don't position correctly because missing impl
  • Modkeys don't seem to be working properly
  • XWayland dnd/c+p is completely not supported (this won't happen until a wlr_xwayland rewrite is done)

@vaxerski vaxerski force-pushed the seat-xdg-data-rewrite branch 9 times, most recently from 91d05a7 to 7485b9f Compare May 11, 2024 20:33
@vaxerski vaxerski force-pushed the seat-xdg-data-rewrite branch 6 times, most recently from 5ebda27 to 71a78dd Compare May 12, 2024 14:55
@vaxerski vaxerski marked this pull request as ready for review May 12, 2024 14:56
@vaxerski
Copy link
Member Author

This should be ready for testing, also @fufexan for meson/nix plox

@Ciel-MC
Copy link

Ciel-MC commented May 12, 2024

Uhhhh compile failed

/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/tuple:956:36: error: no matching function for call to 'get'

@vaxerski
Copy link
Member Author

great, post a smaller snippet next time.

@Ciel-MC
Copy link

Ciel-MC commented May 12, 2024

great, post a smaller snippet next time.

As in don't include the file and line number or is it sarcastic and that you want the context? 😭

@vaxerski
Copy link
Member Author

very sarcastic

@Ciel-MC
Copy link

Ciel-MC commented May 12, 2024

Here you go

cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_INSTALL_PREFIX:STRING=/usr/local -S . -B ./build -G Ninja
Not searching for unused variables given on the command line.
-- Gathering git info
-- Setting up wlroots
-- Found WaylandScanner at /usr/bin/wayland-scanner
-- Found wayland-protocols at //usr/share/wayland-protocols
-- Configuring Hyprland in Debug with CMake
-- Checking deps...
-- Setting debug flags
-- Configuration supports execinfo
-- Checking for module 'epoll-shim'
--   Package 'epoll-shim', required by 'virtual:world', not found
-- XWAYLAND Enabled (NO_XWAYLAND not defined) checking deps...
-- SYSTEMD support is requested (NO_SYSTEMD not defined)...
-- Setting precompiled headers
-- Setting link libraries
-- Configuring done (0.2s)
-- Generating done (0.0s)
-- Build files have been written to: /home/ciel/hypr/Hyprland/build
cmake --build ./build --config Debug --target all
[0/2] Re-checking globbed directories...
[1/171] Performing build step for 'wlroots-hyprland'
ninja: Entering directory `build'
ninja: no work to do.
[2/171] Performing install step for 'wlroots-hyprland'
wlroots-hyprland: install not needed
[10/171] Building CXX object hyprctl/CMakeFiles/hyprctl.dir/main.cpp.o
FAILED: hyprctl/CMakeFiles/hyprctl.dir/main.cpp.o 
/usr/bin/clang++ -DHAS_EXECINFO -DHYPRLAND_DEBUG -DUSES_SYSTEMD -DWLR_USE_UNSTABLE -Dhyprctl_EXPORTS -I/home/ciel/hypr/Hyprland/. -I/home/ciel/hypr/Hyprland/src -I/home/ciel/hypr/Hyprland/subprojects/wlroots-hyprland/include -I/home/ciel/hypr/Hyprland/subprojects/wlroots-
hyprland/build/include -I/home/ciel/hypr/Hyprland/subprojects/udis86 -I/home/ciel/hypr/Hyprland/protocols -g -std=gnu++23 -Wall -Wextra -Wno-unused-parameter -Wno-unused-value -Wno-missing-field-initializers -Wno-narrowing -Wno-pointer-arith -pg -no-pie -fno-builtin -MD -
MT hyprctl/CMakeFiles/hyprctl.dir/main.cpp.o -MF hyprctl/CMakeFiles/hyprctl.dir/main.cpp.o.d -o hyprctl/CMakeFiles/hyprctl.dir/main.cpp.o -c /home/ciel/hypr/Hyprland/hyprctl/main.cpp
clang++: warning: argument unused during compilation: '-no-pie' [-Wunused-command-line-argument]
In file included from /home/ciel/hypr/Hyprland/hyprctl/main.cpp:13:
In file included from /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/ranges:43:
In file included from /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/iterator:66:
In file included from /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/streambuf_iterator.h:35:
In file included from /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/streambuf:43:
In file included from /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/ios_base.h:41:
In file included from /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/locale_classes.h:40:
In file included from /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/string:67:
In file included from /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/memory_resource.h:41:
In file included from /usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/uses_allocator_args.h:39:
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/tuple:956:36: error: no matching function for call to 'get'
  956 |             return __convertible<decltype(std::get<_Is>(std::declval<_UTuple>()))...>();
      |                                           ^~~~~~~~~~~~~
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/tuple:955:11: note: in instantiation of function template specialization 'std::tuple<const long &>::__convertible_from_tuple_like()::(anonymous class)::operator()<0UL>' requested here
  955 |           return []<size_t... _Is>(index_sequence<_Is...>) {
      |                  ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/tuple:1136:22: note: in instantiation of function template specialization 'std::tuple<const long &>::__convertible_from_tuple_like<const long &>' requested here
 1136 |         constexpr explicit(!__convertible_from_tuple_like<_UTuple>())
      |                             ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/stl_map.h:514:38: note: while substituting deduced template arguments into function template 'tuple' [with _UTuple = const key_type &]
  514 |                                             std::tuple<const key_type&>(__k),
      |                                                                         ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/regex_automaton.tcc:207:7: note: in instantiation of member function 'std::map<long, long>::operator[]' requested here
  207 |           __m[__u] = __id;
      |              ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/regex_compiler.tcc:241:24: note: in instantiation of member function 'std::__detail::_StateSeq<std::regex_traits<char>>::_M_clone' requested here
  241 |             __e._M_append(__r._M_clone());
      |                               ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/regex_compiler.tcc:135:17: note: (skipping 2 contexts in backtrace; use -ftemplate-backtrace-limit=0 to see all)
  135 |           while (this->_M_quantifier())
      |                        ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/regex_compiler.tcc:91:13: note: in instantiation of member function 'std::__detail::_Compiler<std::regex_traits<char>>::_M_alternative' requested here
   91 |       this->_M_alternative();
      |             ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/regex_compiler.tcc:76:13: note: in instantiation of member function 'std::__detail::_Compiler<std::regex_traits<char>>::_M_disjunction' requested here
   76 |       this->_M_disjunction();
      |             ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/regex.h:809:34: note: in instantiation of member function 'std::__detail::_Compiler<std::regex_traits<char>>::_Compiler' requested here
  809 |         __detail::_Compiler<_Rx_traits> __c(__first, __last, _M_loc, __f);
      |                                         ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/regex.h:473:9: note: in instantiation of member function 'std::basic_regex<char>::_M_compile' requested here
  473 |       { _M_compile(__p, __p + _Rx_traits::length(__p), __f); }
      |         ^
/home/ciel/hypr/Hyprland/hyprctl/main.cpp:215:56: note: in instantiation of member function 'std::basic_regex<char>::basic_regex' requested here
  215 |         commands = "j/" + std::regex_replace(commands, std::regex(";\\s*"), ";j/");
      |                                                        ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/stl_pair.h:122:5: note: candidate template ignored: could not match 'tuple<_Elements...>' against 'const long'
  122 |     get(tuple<_Elements...>& __t) noexcept;
      |     ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/stl_pair.h:126:5: note: candidate template ignored: could not match 'const tuple<_Elements...>' against 'const long'
  126 |     get(const tuple<_Elements...>& __t) noexcept;
      |     ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/stl_pair.h:130:5: note: candidate template ignored: could not match 'tuple<_Elements...>' against 'const long'
  130 |     get(tuple<_Elements...>&& __t) noexcept;
      |     ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/stl_pair.h:134:5: note: candidate template ignored: could not match 'const tuple<_Elements...>' against 'const long'
  134 |     get(const tuple<_Elements...>&& __t) noexcept;
      |     ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/stl_pair.h:138:5: note: candidate template ignored: could not match 'array<_Tp, _Nm>' against 'const long'
  138 |     get(array<_Tp, _Nm>&) noexcept;
      |     ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/stl_pair.h:142:5: note: candidate template ignored: could not match 'array<_Tp, _Nm>' against 'const long'
  142 |     get(array<_Tp, _Nm>&&) noexcept;
      |     ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/stl_pair.h:146:5: note: candidate template ignored: could not match 'const array<_Tp, _Nm>' against 'const long'
  146 |     get(const array<_Tp, _Nm>&) noexcept;
      |     ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/stl_pair.h:150:5: note: candidate template ignored: could not match 'const array<_Tp, _Nm>' against 'const long'
  150 |     get(const array<_Tp, _Nm>&&) noexcept;
      |     ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/stl_pair.h:1250:5: note: candidate template ignored: could not match 'pair<_Tp1, _Tp2>' against 'const long'
 1250 |     get(pair<_Tp1, _Tp2>& __in) noexcept
      |     ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/stl_pair.h:1255:5: note: candidate template ignored: could not match 'pair<_Tp1, _Tp2>' against 'const long'
 1255 |     get(pair<_Tp1, _Tp2>&& __in) noexcept
      |     ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/stl_pair.h:1260:5: note: candidate template ignored: could not match 'const pair<_Tp1, _Tp2>' against 'const long'
 1260 |     get(const pair<_Tp1, _Tp2>& __in) noexcept
      |     ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/stl_pair.h:1265:5: note: candidate template ignored: could not match 'const pair<_Tp1, _Tp2>' against 'const long'
 1265 |     get(const pair<_Tp1, _Tp2>&& __in) noexcept
      |     ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/ranges_util.h:444:5: note: candidate template ignored: could not match 'const subrange<_It, _Sent, _Kind>' against 'const long'
  444 |     get(const subrange<_It, _Sent, _Kind>& __r)
      |     ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/ranges_util.h:455:5: note: candidate template ignored: could not match 'subrange<_It, _Sent, _Kind>' against 'const long'
  455 |     get(subrange<_It, _Sent, _Kind>&& __r)
      |     ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/stl_pair.h:1272:5: note: candidate template ignored: invalid explicitly-specified argument for template parameter '_Tp'
 1272 |     get(pair<_Tp, _Up>& __p) noexcept
      |     ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/stl_pair.h:1277:5: note: candidate template ignored: invalid explicitly-specified argument for template parameter '_Tp'
 1277 |     get(const pair<_Tp, _Up>& __p) noexcept
      |     ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/stl_pair.h:1282:5: note: candidate template ignored: invalid explicitly-specified argument for template parameter '_Tp'
 1282 |     get(pair<_Tp, _Up>&& __p) noexcept
      |     ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/stl_pair.h:1287:5: note: candidate template ignored: invalid explicitly-specified argument for template parameter '_Tp'
 1287 |     get(const pair<_Tp, _Up>&& __p) noexcept
      |     ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/stl_pair.h:1292:5: note: candidate template ignored: invalid explicitly-specified argument for template parameter '_Tp'
 1292 |     get(pair<_Up, _Tp>& __p) noexcept
      |     ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/stl_pair.h:1297:5: note: candidate template ignored: invalid explicitly-specified argument for template parameter '_Tp'
 1297 |     get(const pair<_Up, _Tp>& __p) noexcept
      |     ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/stl_pair.h:1302:5: note: candidate template ignored: invalid explicitly-specified argument for template parameter '_Tp'
 1302 |     get(pair<_Up, _Tp>&& __p) noexcept
      |     ^
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/14.1.1/../../../../include/c++/14.1.1/bits/stl_pair.h:1307:5: note: candidate template ignored: invalid explicitly-specified argument for template parameter '_Tp'
 1307 |     get(const pair<_Up, _Tp>&& __p) noexcept
      |     ^
1 error generated.
[11/171] Building CXX object CMakeFiles/Hyprland.dir/cmake_pch.hxx.pch
ninja: build stopped: subcommand failed.
make: *** [Makefile:20: debug] Error 1

@Ciel-MC
Copy link

Ciel-MC commented May 12, 2024

Same error uwu. Is it my cpp version issue

@Agent00Ming
Copy link
Contributor

hmm, it seems that dragging selected text from firefox get the cursor stuck in DnD mode (with the text moving with it)

@vaxerski
Copy link
Member Author

@Ciel-MC looks like using gcc stdlib with clang, not a hl issue

@Ciel-MC
Copy link

Ciel-MC commented May 12, 2024

@Ciel-MC looks like using gcc stdlib with clang, not a hl issue

Aha, okay, I'll go figure out how to fix that

@vaxerski vaxerski force-pushed the seat-xdg-data-rewrite branch 2 times, most recently from 786fb1d to 0d816d1 Compare May 12, 2024 15:15
@vaxerski
Copy link
Member Author

vaxerski commented May 14, 2024

odd... it should center on the parent, but that should not have any

kinda minor tho

@Aqa-Ib
Copy link
Contributor

Aqa-Ib commented May 14, 2024

Text selection on firefox is behaving weird. Let me upload a video.

@Aqa-Ib
Copy link
Contributor

Aqa-Ib commented May 14, 2024

2024-05-14.23-43-35.mp4

@vaxerski
Copy link
Member Author

idk lgtm :trollface:

@vaxerski
Copy link
Member Author

vaxerski commented May 14, 2024

image
I can repro this on sway and hyprland main. It's a ff bug.

@Aqa-Ib
Copy link
Contributor

Aqa-Ib commented May 14, 2024

Probably an AMD driver bug then, because in a laptop using hyprland 0.39.1 and Intel graphics it does not happen.

@nonetrix
Copy link

nonetrix commented May 14, 2024

Everyone told me AMD would be more stable on Linux but so far ran into 4 driver bugs already I've confirmed on Gitlab

@vaxerski
Copy link
Member Author

this looks like a firefox bug, not a driver bug. I'd bet on the laptop having a different ff ver

@vaxerski
Copy link
Member Author

Everyone told me AMD would be more stable on Linux but so far ran into 4 driver bugs already

it is more stable. You haven't seen the worst from nvidia.

@vaxerski
Copy link
Member Author

anyways, since everyone is finding non-issues, any last comments before I merge this bitch?

@Agent00Ming
Copy link
Contributor

Let's ruin xWayland clipboard support! 😈

@vaxerski
Copy link
Member Author

HELL FUCKING YES

@vaxerski vaxerski merged commit 0c01d59 into main May 14, 2024
19 checks passed
@Aqa-Ib
Copy link
Contributor

Aqa-Ib commented May 14, 2024

Time to use kitty I guess.

@nonetrix
Copy link

Nyan ฅ^•ﻌ•^ฅ

@moetayuko
Copy link

@vaxerski may I know the roadmap of the migration? Are you going to drop wlroots eventually?

@nonetrix
Copy link

nonetrix commented May 15, 2024

@vaxerski may I know the roadmap of the migration? Are you going to drop wlroots eventually?

It's here and up to date for now mostly
https://blog.vaxry.net/articles/2024-wlrootsRewrite

@andresilva
Copy link
Contributor

Touchpad scrolling on Firefox seems to have broken with this PR (sorry couldn't test it earlier). Seems to be working everywhere else I tested.

@Agent00Ming
Copy link
Contributor

Touchpad scrolling on Firefox seems to have broken with this PR (sorry couldn't test it earlier). Seems to be working everywhere else I tested.

works for me..?

@andresilva
Copy link
Contributor

andresilva commented May 15, 2024

Yeah sorry for the noise, it seems there's something wrong with my Firefox (probably related with update to 126.0 can replicate on 125.0).

@andresilva
Copy link
Contributor

I can't reproduce this on Hyprland before this change. It's not related to firefox version and I also tried with an empty firefox profile. Scrolling with touchpad works when I open firefox, and then it stops working after I switch tab. Weird that other people can't replicate 😕.

@sungyoonc
Copy link
Contributor

I can't reproduce this on Hyprland before this change. It's not related to firefox version and I also tried with an empty firefox profile. Scrolling with touchpad works when I open firefox, and then it stops working after I switch tab. Weird that other people can't replicate 😕.

I can repro. Anyways you should create a new issue and we can go from there

@Eclextic
Copy link

Agreed... Got the same issue, was doubting myself if I somehow changed the sens on my mousepad xd

@Agent00Ming
Copy link
Contributor

#6090 for touchpad scrolling issues

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.