Hyprland icon indicating copy to clipboard operation
Hyprland copied to clipboard

1px layer-surfaces on top and left sides of the screen can not be entered

Open Clutchnp opened this issue 1 year ago • 9 comments

Hyprland Version

System/Version info
Hyprland, built from branch  at commit cba1ade848feac44b2eda677503900639581c3f4  (props: bump version to 0.40.0).
Date: Sat May 4 15:42:32 2024
Tag: v0.40.0, commits: 4606

flags: (if any)


System Information:
System name: Linux
Node name: clutchrig
Release: 6.9.1-arch1-1
Version: #1 SMP PREEMPT_DYNAMIC Fri, 17 May 2024 16:56:38 +0000


GPU information: 
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation TU116 [GeForce GTX 1660 SUPER] [10de:21c4] (rev a1) (prog-if 00 [VGA controller])


os-release: NAME="Arch Linux"
PRETTY_NAME="Arch Linux"
ID=arch
BUILD_ID=rolling
ANSI_COLOR="38;2;23;147;209"
HOME_URL="https://archlinux.org/"
DOCUMENTATION_URL="https://wiki.archlinux.org/"
SUPPORT_URL="https://bbs.archlinux.org/"
BUG_REPORT_URL="https://gitlab.archlinux.org/groups/archlinux/-/issues"
PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/"
LOGO=archlinux-logo


plugins:

Bug or Regression?

Regression

Description

When using lan-mouse during input capture if cursor is taken to the edge of the screen hyprland crashes

How to reproduce

  1. Install lan-mouse
  2. Run lan-mouse --test-capture
  3. Take mouse pointer to the edge of the screen

Crash reports, logs, images, videos

hyprlandCrashReport621782.txt

Clutchnp avatar May 20 '24 15:05 Clutchnp

can you test on git

vaxerski avatar May 21 '24 11:05 vaxerski

after testing on git:

  1. No crashes happen
  2. Pointer can't escape to the client screen using top and left positions (right and down work fine)
  3. Pointer can't return to the hyprland surface (Once the pointer is on client screen's surface you can't bring it back to Hyprland)

I have not personally tested on Hyprland 0.39.1 but according to this comment , this was not a problem in 0.39.1

Clutchnp avatar May 21 '24 17:05 Clutchnp

For me in the git version, cursor can't escape when using top or left positions, but returning to the hyprland surface works without any problems, just like in 0.39.1

UPD: When saying about returning to the surface, I'm referring to the bottom and right positions, I haven't tested the top and left positions because the cursor can't leave them.

ch4og avatar May 21 '24 23:05 ch4og

Latest git (93fea890433ec11d7a915f5e0466b2e8b513e895) does not crash but surfaces placed top or left can not be entered (arguably a separate issue).

v0.40.0:

pcilib: Error reading /sys/bus/pci/devices/0000:00:08.3/label: Operation not permitted
amdgpu: amdgpu_cs_ctx_create2 failed. (-13)
amdgpu: amdgpu_cs_ctx_create2 failed. (-13)
/usr/include/c++/14.1.1/optional:482: constexpr const _Tp& std::_Optional_base_impl<_Tp, _Dp>::_M_get() const [with _Tp = CBox; _Dp = std::_Optional_base<CBox, true, true>]: Assertion 'this->_M_is_engaged()' failed.
Hyprland has crashed :( Consult the crash report at /home/ferdinand/.cache/hyprland/hyprlandCrashReport11669.txt for more information.
pcilib: Error reading /sys/bus/pci/devices/0000:00:08.3/label: Operation not permitted
 err: Gdk-Message: 11:53:44.961: Error reading events from display: Broken pipe
wayland.c:1447: failed to read events from the Wayland socket: Connection reset by peer
 err: wayland.c:2019: failed to roundtrip Wayland display: Connection reset by peer
 err: wayland.c:2019: failed to roundtrip Wayland display: Connection reset by peer
 err: wayland.c:2019: failed to roundtrip Wayland display: Connection reset by peer
 err: wayland.c:1984: failed to flush wayland socket: Connection reset by peer

#############

Version: cba1ade848feac44b2eda677503900639581c3f4
Tag: v0.40.0

System info:
	System name: Linux
	Node name: thorium
	Release: 6.9.1-arch1-1
	Version: #1 SMP PREEMPT_DYNAMIC Fri, 17 May 2024 16:56:38 +0000

GPU:
	04:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Rembrandt [Radeon 680M] [1002:1681] (rev d1) (prog-if 00 [VGA controller])


os-release:
	NAME="Arch Linux"
	PRETTY_NAME="Arch Linux"
	ID=arch
	BUILD_ID=rolling
	ANSI_COLOR="38;2;23;147;209"
	HOME_URL="https://archlinux.org/"
	DOCUMENTATION_URL="https://wiki.archlinux.org/"
	SUPPORT_URL="https://bbs.archlinux.org/"
	BUG_REPORT_URL="https://gitlab.archlinux.org/groups/archlinux/-/issues"
	PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/"
	LOGO=archlinux-logo
Backtrace:
	# | Hyprland(_Z12getBacktracev+0x61) [0x604f709bfd21]
		getBacktrace()
		??:?
	#1 | Hyprland(_ZN13CrashReporter18createAndSaveCrashEi+0xde9) [0x604f70956729]
		CrashReporter::createAndSaveCrash(int)
		??:?
	#2 | Hyprland(_Z25handleUnrecoverableSignali+0x71) [0x604f708d6281]
		handleUnrecoverableSignal(int)
		??:?
	#3 | /usr/lib/libc.so.6(+0x3cae0) [0x79d06a965ae0]
		??
		??:0
	#4 | /usr/lib/libc.so.6(+0x94e44) [0x79d06a9bde44]
		??
		??:0
	#5 | /usr/lib/libc.so.6(gsignal+0x20) [0x79d06a965a30]
		??
		??:0
	#6 | /usr/lib/libc.so.6(abort+0xdf) [0x79d06a94d4c3]
		??
		??:0
	#7 | /usr/lib/libstdc++.so.6(_ZNSt6chrono3_V212system_clock3nowEv+0) [0x79d06acd2d60]
		main
		??:?
	#8 | Hyprland(_ZN18CPointerConstraint17logicPositionHintEv+0xaa) [0x604f70a7a5da]
		CPointerConstraint::logicPositionHint()
		??:?
	#9 | Hyprland(_ZN18CPointerConstraint8activateEv+0x144) [0x604f70a7b254]
		CPointerConstraint::activate()
		??:?
	#1 | Hyprland(_ZN18CPointerConstraintC1ESt10shared_ptrI19CZwpLockedPointerV1EP11wlr_surfaceP11wl_resource31zwpPointerConstraintsV1Lifetime+0x42b) [0x604f70a753fb]
		CPointerConstraint::CPointerConstraint(std::shared_ptr<CZwpLockedPointerV1>, wlr_surface*, wl_resource*, zwpPointerConstraintsV1Lifetime)
		??:?
	#11 | Hyprland(_ZN27CPointerConstraintsProtocol13onLockPointerEP24CZwpPointerConstraintsV1jP11wl_resourceS3_S3_31zwpPointerConstraintsV1Lifetime+0xea) [0x604f70a7caaa]
		CPointerConstraintsProtocol::onLockPointer(CZwpPointerConstraintsV1*, unsigned int, wl_resource*, wl_resource*, wl_resource*, zwpPointerConstraintsV1Lifetime)
		??:?
	#12 | Hyprland(+0x309f1b) [0x604f70adcf1b]
		CZwpRelativePointerV1::setDestroy(std::function<void (CZwpRelativePointerV1*)>)
		??:?
	#13 | /usr/lib/libffi.so.8(+0x7596) [0x79d06af22596]
		??
		??:0
	#14 | /usr/lib/libffi.so.8(+0x400e) [0x79d06af1f00e]
		??
		??:0
	#15 | /usr/lib/libffi.so.8(ffi_call+0x123) [0x79d06af21bd3]
		??
		??:0
	#16 | /usr/lib/libwayland-server.so.0(+0x8ada) [0x79d06b3cbada]
		??
		??:0
	#17 | /usr/lib/libwayland-server.so.0(+0xd180) [0x79d06b3d0180]
		??
		??:0
	#18 | /usr/lib/libwayland-server.so.0(wl_event_loop_dispatch+0xa2) [0x79d06b3ceae2]
		??
		??:0
	#19 | /usr/lib/libwayland-server.so.0(wl_display_run+0x27) [0x79d06b3cf2d7]
		??
		??:0
	#2 | Hyprland(_ZN17CEventLoopManager9enterLoopEP10wl_displayP13wl_event_loop+0x55) [0x604f70a17bc5]
		CEventLoopManager::enterLoop(wl_display*, wl_event_loop*)
		??:?
	#21 | Hyprland(main+0xa4d) [0x604f7089f59d]
		main
		??:?
	#22 | /usr/lib/libc.so.6(+0x25c88) [0x79d06a94ec88]
		??
		??:0
	#23 | /usr/lib/libc.so.6(__libc_start_main+0x8c) [0x79d06a94ed4c]
		??
		??:0
	#24 | Hyprland(_start+0x25) [0x604f708d2bb5]
		_start
		??:?


Log tail:
[LOG] Window 604f7acbffe0 set title to cargo run -- --test-capture
[LOG] Registered signal for owner 604f7a28a950: 604f7aceab48 -> 604f7a28afa0 (owner: layerSurface)
[LOG] Registered signal for owner 604f7a28a950: 604f7acebfc8 -> 604f7a28ae68 (owner: layerSurface)
[LOG] Registered signal for owner 604f7a28a950: 604f7aceab58 -> 604f7a28aed0 (owner: layerSurface)
[LOG] Registered signal for owner 604f7a28a950: 604f7aceab68 -> 604f7a28af38 (owner: layerSurface)
[LOG] Registered signal for owner 604f7acae5e0: 604f7acebfd8 -> 604f7acae7c0 (owner: CPopup Head)
[LOG] Registered signal for owner 604f7a28ac30: 604f7aceab88 -> 604f7a28acc8 (owner: CWLSurface)
[LOG] Registered signal for owner 604f7a28ac30: 604f7aceab48 -> 604f7a28ad30 (owner: CWLSurface)
[LOG] CWLSurface 604f7a28ac30 called init()
[LOG] LayerSurface 604f7acebf00 (namespace LAN Mouse Sharing layer 3) created on monitor eDP-1
[LOG] Registered signal for owner 604f7acea870: 604f7aceab88 -> 604f7acd6ef0 (owner: FractionalScale)
[LOG] Registered signal for owner 604f7a28b010: 604f7aca7ad8 -> 604f7a28b660 (owner: layerSurface)
[LOG] Registered signal for owner 604f7a28b010: 604f7acd8858 -> 604f7a28b528 (owner: layerSurface)
[LOG] Registered signal for owner 604f7a28b010: 604f7aca7ae8 -> 604f7a28b590 (owner: layerSurface)
[LOG] Registered signal for owner 604f7a28b010: 604f7aca7af8 -> 604f7a28b5f8 (owner: layerSurface)
[LOG] Registered signal for owner 604f7ace7fc0: 604f7acd8868 -> 604f7ace81a0 (owner: CPopup Head)
[LOG] Registered signal for owner 604f7a28b2f0: 604f7aca7b18 -> 604f7a28b388 (owner: CWLSurface)
[LOG] Registered signal for owner 604f7a28b2f0: 604f7aca7ad8 -> 604f7a28b3f0 (owner: CWLSurface)
[LOG] CWLSurface 604f7a28b2f0 called init()
[LOG] LayerSurface 604f7acd8790 (namespace LAN Mouse Sharing layer 3) created on monitor eDP-1
[LOG] Registered signal for owner 604f7aca7800: 604f7aca7b18 -> 604f7acd7be0 (owner: FractionalScale)
[LOG] Registered signal for owner 604f7acec2d0: 604f7acd98d8 -> 604f7acec920 (owner: layerSurface)
[LOG] Registered signal for owner 604f7acec2d0: 604f7ace8b98 -> 604f7acec7e8 (owner: layerSurface)
[LOG] Registered signal for owner 604f7acec2d0: 604f7acd98e8 -> 604f7acec850 (owner: layerSurface)
[LOG] Registered signal for owner 604f7acec2d0: 604f7acd98f8 -> 604f7acec8b8 (owner: layerSurface)
[LOG] Registered signal for owner 604f7ace6360: 604f7ace8ba8 -> 604f7ace6540 (owner: CPopup Head)
[LOG] Registered signal for owner 604f7acec5b0: 604f7acd9918 -> 604f7acec648 (owner: CWLSurface)
[LOG] Registered signal for owner 604f7acec5b0: 604f7acd98d8 -> 604f7acec6b0 (owner: CWLSurface)
[LOG] CWLSurface 604f7acec5b0 called init()
[LOG] LayerSurface 604f7ace8ad0 (namespace LAN Mouse Sharing layer 3) created on monitor eDP-1
[LOG] Registered signal for owner 604f7acd9600: 604f7acd9918 -> 604f7a20bf40 (owner: FractionalScale)
[LOG] Registered signal for owner 604f7acec990: 604f7a2577f8 -> 604f7acecfe0 (owner: layerSurface)
[LOG] Registered signal for owner 604f7acec990: 604f7ace8e18 -> 604f7acecea8 (owner: layerSurface)
[LOG] Registered signal for owner 604f7acec990: 604f7a257808 -> 604f7acecf10 (owner: layerSurface)
[LOG] Registered signal for owner 604f7acec990: 604f7a257818 -> 604f7acecf78 (owner: layerSurface)
[LOG] Registered signal for owner 604f7aca9280: 604f7ace8e28 -> 604f7aca9460 (owner: CPopup Head)
[LOG] Registered signal for owner 604f7acecc70: 604f7a257838 -> 604f7acecd08 (owner: CWLSurface)
[LOG] Registered signal for owner 604f7acecc70: 604f7a2577f8 -> 604f7acecd70 (owner: CWLSurface)
[LOG] CWLSurface 604f7acecc70 called init()
[LOG] LayerSurface 604f7ace8d50 (namespace LAN Mouse Sharing layer 3) created on monitor eDP-1
[LOG] Registered signal for owner 604f7a257520: 604f7a257838 -> 604f7a292e90 (owner: FractionalScale)
[LOG] LayerSurface 604f7acebf00 mapped
[LOG] LayerSurface 604f7acd8790 mapped
[LOG] LayerSurface 604f7ace8ad0 mapped
[LOG] LayerSurface 604f7ace8d50 mapped
[LOG] cursorImage request: surface 0
[LOG] Set keyboard focus to surface 604f7aca7800

feschber avatar May 22 '24 09:05 feschber

Some more information:

export LM_DEBUG_LAYER_SHELL=1
lan-mouse --test-capture

should show 1px wide green windows on all four sides. (this works on sway and KDE!)

on Hyprland none of the surfaces are shown.

bottom and right positions generate enter events correctly, top and left positions for the layer-surface never generate an enter event

diff --git a/src/capture/wayland.rs b/src/capture/wayland.rs
index 9f2b82c..1aac930 100644
--- a/src/capture/wayland.rs
+++ b/src/capture/wayland.rs
@@ -146,8 +146,8 @@ impl Window {
         let g = &state.g;
 
         let (width, height) = match pos {
-            Position::Left | Position::Right => (1, size.1 as u32),
-            Position::Top | Position::Bottom => (size.0 as u32, 1),
+            Position::Left | Position::Right => (2, size.1 as u32),
+            Position::Top | Position::Bottom => (size.0 as u32, 2),
         };
         let mut file = tempfile::tempfile().unwrap();
         draw(&mut file, (width, height));

Increasing the width of the surface by 1px to 2px, fixes both issues. The surfaces all show up (with the correct 2x width!) and all of them correctly "grab" the mouse (i.e. enter events are generated and the pointer lock is working).

feschber avatar May 22 '24 10:05 feschber

@vaxerski could you rename this issue to something like "1px layer-surfaces on top and left sides of the screen can not be entered"?

I could also open a new issue, as the original problem here is fixed.

And to be more specific: I'm not getting an "Enter" event on 1px surfaces top and left side of the screen. 2px surfaces work as expected, so I suspect this is some sort of of-by-one error.

feschber avatar Jun 28 '24 09:06 feschber

I think we should continue here since this is related, It would be better if all the issues regarding this are wrapped in a single issue for future references? If not, I can close the issue , for now I have renamed the issue as the previous title was no longer relevant.

Clutchnp avatar Jun 28 '24 15:06 Clutchnp

check out #6027, probably changes that behaviour

Agent00Ming avatar Jun 28 '24 15:06 Agent00Ming

Can confirm, #6027 fixes this

feschber avatar Jun 28 '24 19:06 feschber

Thanks Everyone !!

Clutchnp avatar Jul 02 '24 16:07 Clutchnp