hyprwm / Hyprland

Hyprland is an independent, highly customizable, dynamic tiling Wayland compositor that doesn't sacrifice on its looks.
https://hyprland.org
BSD 3-Clause "New" or "Revised" License
19.7k stars 834 forks source link

Bug: xeyes opens out-of-screen after reconnecting monitor #3727

Open rszyma opened 10 months ago

rszyma commented 10 months ago

I found a different issue with xwayland, maybe related to this the previous ones that this PR adresses:

  1. suspend
  2. wake up
  3. open xeyes

Result: Instead of opening main display, xeyes seem to open out-of-screen to the left. Right after opening, a new xeyes window still has focus so I can press shortcut to maximize it, and then it pops out on main screen and maximizes there.

It happens only with xeyes, and only after a suspend/wakeup cycle.

Should I create a new issue instead of blocking this PR?

Originally posted by @rszyma in https://github.com/hyprwm/Hyprland/issues/3713#issuecomment-1789095126

andresilva commented 10 months ago

I can't replicate this, xeyes always opens at the center of the screen for me. I am only using one monitor though. Also I didn't suspend but instead turn off/on the monitor.

rszyma commented 10 months ago

I'm also using one monitor

monitor=eDP-1,disable
monitor=HDMI-A-1,1920x1080@180,0x0,1
rszyma commented 10 months ago

Also I didn't suspend but instead turn off/on the monitor.

Maybe try suspend then?

andresilva commented 10 months ago

Couldn't replicate with suspend either.

rszyma commented 10 months ago

Right after opening, a new xeyes window still has focus

This is no longer true, but xeyes window still don't open on main screen.

Just an assumption, maybe this bug has something to do with the fact that a headless display is created during suspend and for some reason it doesn't go away completely after waking up? Idk.

phonetic112 commented 10 months ago

I'm getting this as well after dealing with #3713. xeyes spawns at -1920, 0 but using togglefloating on it brings it back into view

phonetic112 commented 10 months ago

@rszyma can you reproduce #3862?

I also get a crash if I just leave winecfg open without closing it and reconnect monitor

Thread 1 "Hyprland" received signal SIGSEGV, Segmentation fault.
0x000055a3eadd216d in Events::listener_commitSubsurface (owner=0x55a3ebf533a0, data=0x55a3ecfef110) at ~/applications/Hyprland/Hyprland/src/helpers/SubsurfaceTree.cpp:262
262        if (PMONITOR->solitaryClient == pNode->pWindowOwner && pNode->pWindowOwner->canBeTorn() && PMONITOR->tearingState.canTear &&
#0  0x000055a3eadd216d in Events::listener_commitSubsurface(void*, void*) (owner=0x55a3ebf533a0, data=0x55a3ecfef110) at ~/applications/Hyprland/Hyprland/src/helpers/SubsurfaceTree.cpp:262
        PMONITOR = 0x0
        pNode = 0x55a3ebf533a0
        lx = 756
        ly = 318
        SCALE = 1
#1  0x000055a3ead00be7 in std::__invoke_impl<void, void (*&)(void*, void*), void*, void*>(std::__invoke_other, void (*&)(void*, void*), void*&&, void*&&) (__f=@0x55a3ebf534b8: 0x55a3eadd1a89 <Events::listener_commitSubsurface(void*, void*)>) at /usr/include/c++/13.2.1/bits/invoke.h:61
#2  0x000055a3eacffc4a in std::__invoke_r<void, void (*&)(void*, void*), void*, void*>(void (*&)(void*, void*), void*&&, void*&&) (__fn=@0x55a3ebf534b8: 0x55a3eadd1a89 <Events::listener_commitSubsurface(void*, void*)>) at /usr/include/c++/13.2.1/bits/invoke.h:111
#3  0x000055a3eacfe2b5 in std::_Function_handler<void (void*, void*), void (*)(void*, void*)>::_M_invoke(std::_Any_data const&, void*&&, void*&&) (__functor=..., __args#0=@0x7ffe10e0f690: 0x55a3ebf533a0, __args#1=@0x7ffe10e0f688: 0x55a3ecfef110) at /usr/include/c++/13.2.1/bits/std_function.h:290
#4  0x000055a3eaddd247 in std::function<void (void*, void*)>::operator()(void*, void*) const (this=0x55a3ebf534b8, __args#0=0x55a3ebf533a0, __args#1=0x55a3ecfef110) at /usr/include/c++/13.2.1/bits/std_function.h:591
#5  0x000055a3eaddbee3 in CHyprWLListener::emit(void*) (this=0x55a3ebf53490, data=0x55a3ecfef110) at ~/applications/Hyprland/Hyprland/src/helpers/WLListener.cpp:59
#6  0x000055a3eaddb974 in handleWrapped(wl_listener*, void*) (listener=0x55a3ebf53490, data=0x55a3ecfef110) at ~/applications/Hyprland/Hyprland/src/helpers/WLListener.cpp:13
        pWrap = 0x55a3ebf53490
#7  0x00007f0ab146f2ac in wl_signal_emit_mutable () at /usr/lib/libwayland-server.so.0
#8  0x00007f0ab1579b43 in surface_commit_state (surface=0x55a3ecfef110, next=0x55a3ecfef290) at ../types/wlr_compositor.c:502
        __PRETTY_FUNCTION__ = "surface_commit_state"
        invalid_buffer = true
        subsurface = 0x55a3ecfef308
#9  0x00007f0ab1579bf9 in surface_handle_commit (client=0x55a3ecfd3650, resource=0x55a3ecfef4c0) at ../types/wlr_compositor.c:521
        surface = 0x55a3ecfef110
#10 0x00007f0ab06a04f6 in  () at /usr/lib/libffi.so.8
#11 0x00007f0ab069cf5e in  () at /usr/lib/libffi.so.8
#12 0x00007f0ab069fb73 in ffi_call () at /usr/lib/libffi.so.8
#13 0x00007f0ab1473925 in wl_closure_invoke () at /usr/lib/libwayland-server.so.0
#14 0x00007f0ab146db22 in wl_client_connection_data () at /usr/lib/libwayland-server.so.0
#15 0x00007f0ab1470f52 in wl_event_loop_dispatch () at /usr/lib/libwayland-server.so.0
#16 0x00007f0ab146e395 in wl_display_run () at /usr/lib/libwayland-server.so.0
#17 0x000055a3eac4e406 in CCompositor::startCompositor() (this=0x55a3eb9d2ed0) at ~/applications/Hyprland/Hyprland/src/Compositor.cpp:556
#18 0x000055a3eae0b815 in main(int, char**) (argc=1, argv=0x7ffe10e10238) at ~/applications/Hyprland/Hyprland/src/main.cpp:105
        cmd = "./build/Hyprland"
        configPath = ""
        ignoreSudo = false
        args = std::vector of length 0, capacity 0
rszyma commented 10 months ago

@rszyma can you reproduce #3862?

testing on v0.32.3-33-g483302a2

Some Xwayland windows like xeyes, glxgears [...] spawn out of view after disconnecting and reconnecting my monitor

same

and wine/proton apps spawn out of view after disconnecting and reconnecting my monitor

can't repro

Wine applications also get their mouse input mapped incorrectly, so I can't click on or hover over anything in the menus.

can't repro

I also get a crash if I just leave winecfg open without closing it and reconnect monitor

can't repro

phonetic112 commented 10 months ago

what is your output from xrandr?

xrandr shows a different resolution after I reconnect the monitor

before:

Screen 0: minimum 16 x 16, current 1920 x 1080, maximum 32767 x 32767
DP-1 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 600mm x 340mm
   1920x1080    143.88*+

after:

Screen 0: minimum 16 x 16, current 2880 x 1080, maximum 32767 x 32767
DP-1 connected 1920x1080+960+0 (normal left inverted right x axis y axis) 600mm x 340mm
   1920x1080    143.88*+
rszyma commented 10 months ago

what is your output from xrandr?

before:

Screen 0: minimum 16 x 16, current 1920 x 1080, maximum 32767 x 32767
HDMI-A-1 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 520mm x 290mm
   1920x1080    179.98*+
   1440x1080    179.92
   1400x1050    179.92
   1280x1024    179.91
   1280x960     179.87
   1152x864     179.78
   1024x768     179.84
   800x600      179.71
   640x480      179.43
   320x240      178.06
   1680x1050    179.94
   1440x900     179.84
   1280x800     179.74
   1152x720     179.84
   960x600      179.74
   928x580      179.47
   800x500      179.63
   768x480      179.51
   720x480      179.35
   640x400      179.55
   320x200      176.99
   1600x900     179.77
   1368x768     179.92
   1280x720     179.72
   1024x576     179.77
   864x486      179.75
   720x400      179.53
   640x350      179.74

after:

Screen 0: minimum 16 x 16, current 2880 x 1080, maximum 32767 x 32767
HDMI-A-1 connected 1920x1080+960+0 (normal left inverted right x axis y axis) 520mm x 290mm
   1920x1080    179.98*+
   1440x1080    179.92
   1400x1050    179.92
   1280x1024    179.91
   1280x960     179.87
   1152x864     179.78
   1024x768     179.84
   800x600      179.71
   640x480      179.43
   320x240      178.06
   1680x1050    179.94
   1440x900     179.84
   1280x800     179.74
   1152x720     179.84
   960x600      179.74
   928x580      179.47
   800x500      179.63
   768x480      179.51
   720x480      179.35
   640x400      179.55
   320x200      176.99
   1600x900     179.77
   1368x768     179.92
   1280x720     179.72
   1024x576     179.77
   864x486      179.75
   720x400      179.53
   640x350      179.74
rszyma commented 10 months ago

This is a monitor config that has this bug:

monitor = eDP-1,disable
monitor = HDMI-A-1,1920x1080@180,0x0,1

After reconnecting the monitor resolution gets changed from 1920x1080 to 2880x1080. And probably that's why xeyes gets spawned out of screen. I found that I can get the resolution back to 1920x1080 after enabling and disabling my laptop monitor (eDP-1).

Also, when I don't disable laptop monitor and suspend&wakeup xeyes works normally.

phonetic112 commented 10 months ago

Setting the resolution to highrr or preferred fixed it for me.