25 Commits

Author SHA1 Message Date
davc0n
d9cad5e1b6
protocols: refactor class member vars (core) (#10259) 2025-05-03 16:02:49 +02:00
davc0n
ce821294e2
managers: refactor class member vars (#10242) 2025-05-02 17:07:20 +02:00
davc0n
e9c3fcbb64
devices: refactor class member vars (#10206) 2025-04-29 19:51:07 +02:00
Vaxry
877fb5b93a time: move to stl's clocks and move timer 2025-04-16 01:37:48 +01:00
Vaxry
aec69131cd seat: avoid sending null surfaces in leave/enter events
ref #9699
2025-03-24 14:10:47 +00:00
Lee Bousfield
fdb7ca6c8f
core/compositor: Fix dropping cursor buffer data early (#9700) 2025-03-22 23:06:02 +01:00
Tom Englund
32c0fa2f2f
core: begin using CFileDescriptor from hyprutils (#9122)
* config: make fd use CFileDescriptor

make use of the new hyprutils CFileDescriptor instead of manual FD
handling.

* hyprctl: make fd use CFileDescriptor

make use of the new hyprutils CFileDescriptor instead of manual FD
handling.

* ikeyboard: make fd use CFileDescriptor

make use of the new CFileDescriptor instead of manual FD handling, also
in sendKeymap remove dead code, it already early returns if keyboard
isnt valid, and dont try to close the FD that ikeyboard owns.

* core: make SHMFile functions use CFileDescriptor

make SHMFile misc functions use CFileDescriptor and its associated usage
in dmabuf and keyboard.

* core: make explicit sync use CFileDescriptor

begin using CFileDescriptor in explicit sync and its timelines and
eglsync usage in opengl, there is still a bit left with manual handling
that requires future aquamarine change aswell.

* eventmgr: make fd and sockets use CFileDescriptor

make use of the hyprutils CFileDescriptor instead of manual FD and
socket handling and closing.

* eventloopmgr: make timerfd use CFileDescriptor

make the timerfd use CFileDescriptor instead of manual fd handling

* opengl: make gbm fd use CFileDescriptor

make the gbm rendernode fd use CFileDescriptor instead of manual fd
handling

* core: make selection source/offer use CFileDescriptor

make data selection source and offers use CFileDescriptor and its
associated use in xwm and protocols

* protocols: convert protocols fd to CFileDescriptor

make most fd handling use CFileDescriptor in protocols

* shm: make SHMPool use CfileDescriptor

make SHMPool use CFileDescriptor instead of manual fd handling.

* opengl: duplicate fd with CFileDescriptor

duplicate fenceFD with CFileDescriptor duplicate instead.

* xwayland: make sockets and fds use CFileDescriptor

instead of manual opening/closing make sockets and fds use
CFileDescriptor

* keybindmgr: make sockets and fds use CFileDescriptor

make sockets and fds use CFileDescriptor instead of manual handling.
2025-01-30 11:30:12 +00:00
vaxerski
b7a3c45269 core: add LIKELY and UNLIKELY macros
helps the compiler optimize
2025-01-17 18:56:39 +01:00
Vaxry
8bbeee1173
core: Add clang-tidy (#8664)
This adds a .clang-tidy file for us.

It's not a strict requirement to be compliant, but I tuned it to be alright.
2024-12-07 18:51:18 +01:00
Ikalco
1fb720b62a
seat: fix double scrolling in some applications (#8583) 2024-11-26 13:52:43 +00:00
staticssleever668
d679d20029
seat: avoid sending pointless 'keymap' and 'repeat_info' events (#8276)
#### Describe your PR, what does it fix/add?

Fix lag spikes when pressing more than 6 keys at the same time.

 #### Is there anything you want to mention? (unchecked code, possible bugs, found problems, breaking compatibility, etc.)

Debugging process:
<details>
This is triggered by typing some applications, like CopyQ or XWayland.
Typing in Firefox doesn't lead to lag, however it itself does lag
handling these events.

Profiling CopyQ shows that paths leading to
`QtWaylandClient::QWaylandInputDevice::Keyboard::keyboard` take over
80% of processing time of an otherwise idle program.

Looking at output of 'wev' even when it's not focused shows same events
received over and over again.

```
[14:     wl_keyboard] repeat_info: rate: 25 keys/sec; delay: 300 ms
[14:     wl_keyboard] keymap: format: 1 (xkb v1), size: 64754
```

Looking at what passes through CInputManager::onKeyboardKey() ->
CSeatManager::setKeyboard() shows Hyprland 'switching' between endpoints
of the same keyboard, one of them being named like the other but with
'-1' suffix.
</details>

Tested changing layouts in Fcitx5 and with following config.

```
input:kb_layout = us,cz
input:kb_variant = ,qwerty
input:kb_options = grp:alt_shift_toggle
```

Also tested changing 'input:repeat_delay' while running.

Curiously, now these events appear in the output of 'wev' only once.
Changing layouts still seems to work fine though.

 #### Is it ready for merging, or does it need work?

Ready for merging.
2024-10-28 19:25:27 +00:00
Tom Englund
72c7818ae6
misc: constify the remaining for loops (#7534)
now we roll loops at blazing constified speed.
2024-08-26 20:24:30 +02:00
Tom Englund
8d6c18076f
core: make most for loops use const references (#7527)
why not let the compiler optimise things for us at hyprspeeds when we
can.
2024-08-26 17:25:39 +02:00
Tom Englund
12d9901472
protocols: refactor protocol logging to a macro (#7324)
this avoids the usage of the unique_ptr PROTO::protocol before it has
been constructed incase one wants to log something inside the
constructor itself, move the logging to macros and print file:linenumber
on ERR,CRIT,WARN and classname on the rest of the levels.
2024-08-15 17:16:18 +01:00
Vaxry
37e1411e8d
core/surface/buffer: Buffer lock/release fixes (#7110) 2024-07-31 21:47:26 +02:00
Vaxry
87db950189 wl_seat: avoid sending events to objects without caps
ref #6835
2024-07-22 16:57:35 +02:00
Vaxry
016da234d0
Core: Move to aquamarine (#6608)
Moves Hyprland from wlroots to aquamarine for the backend.

---------

Signed-off-by: Vaxry <vaxry@vaxry.net>
Co-authored-by: Mihai Fufezan <mihai@fufexan.net>
Co-authored-by: Jan Beich <jbeich@FreeBSD.org>
Co-authored-by: vaxerski <vaxerski@users.noreply.github.com>
Co-authored-by: UjinT34 <41110182+UjinT34@users.noreply.github.com>
Co-authored-by: Tom Englund <tomenglund26@gmail.com>
Co-authored-by: Ikalco <73481042+ikalco@users.noreply.github.com>
Co-authored-by: diniamo <diniamo53@gmail.com>
2024-07-21 13:09:54 +02:00
はれなよ
718afe271e
seat: don't send keyboard data without a keyboard cap (#6697)
* Fix #6279: prevent sending keymap or repeat info events by keyboards without keyboard capability

* Remove brackets
2024-06-29 20:05:07 +02:00
Vaxry
785d062887 seat: track pressed pointer buttons
releases them on leave, unless there is a dnd going on
2024-06-17 16:07:32 +02:00
Vaxry
d0a6fa7aa6 wl_seat: accomodate for apps late-binding seat resources
Sends enter events when an app binds wl_keyboard or wl_pointer later than it should. Fixes some buggy apps.

Fixes #6131
2024-06-16 17:04:10 +02:00
Vaxry
908bec1564 wl_seat: send repeat data from current keyboard on bind
ref #6515
2024-06-15 21:24:34 +02:00
vaxerski
c7e85e26f7 seat: fixup touch event handling
fixes #6353
2024-06-12 16:49:26 +02:00
Vaxry
6967a31450
wayland/core: move to new impl (#6268)
* wayland/core/dmabuf: move to new impl

it's the final countdown
2024-06-08 10:07:59 +02:00
vaxerski
66acdfe2ad seat: don't send keymap on empty device 2024-06-02 18:38:36 +02:00
Vaxry
121d3a7213 wl_seat: move to hyprland impl 2024-05-14 23:02:24 +01:00