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

Dancing windows on sway #1647

Open
stacyharper opened this issue Apr 24, 2020 · 20 comments
Open

Dancing windows on sway #1647

stacyharper opened this issue Apr 24, 2020 · 20 comments
Labels
bug Something isn't working as intended, or works in a confusing/unintuitive way for the user wayland/sway Any issues pertaining to Wayland compositors or the Sway tiling window manager

Comments

@stacyharper
Copy link

Describe the bug

When my mouse is over some parts, the windows start dancing in i3/sway.

As you can see in the demonstration, in fullscreen mode (second part), everything seems ok.

To reproduce

  • Use Chatterino on i3 or sway WM

Demonstration

https://dav.misterbanal.net/pub/720de968-50a0-4d53-b889-4614ca5472a7.flv

Chatterino version

Chatterino 2.1.7 (commit )

Operating system

VoidLinux, up to date.

@stacyharper stacyharper added bug Something isn't working as intended, or works in a confusing/unintuitive way for the user needs triage labels Apr 24, 2020
@Mm2PL
Copy link
Collaborator

Mm2PL commented Apr 24, 2020

Cannot reproduce on i3-gaps on Ubuntu 19.04.

@leon-richardt
Copy link
Collaborator

leon-richardt commented Apr 24, 2020

It appears to be happening whenever a popup window is opened. I think this would also explain the behavior in fullscreen: the popup windows do not need to be laid out as the fullscreen window hides them anyway.

I cannot reproduce on i3-gaps either. Is there anything relevant in your i3 config that could be relevant?

@stacyharper
Copy link
Author

Okay my bad ! It seems it works correctly on i3. I see the popup message at the left.

The bug seems to only occurs on sway.

Is there a way to disable this popup?

@stacyharper stacyharper changed the title Dancing windows on i3/sway Dancing windows on sway Apr 25, 2020
@pajlada
Copy link
Member

pajlada commented Apr 25, 2020

I'm unable to reproduce this using a fresh unconfigured sway + Xwayland setup (can't get chatterino to run without using Xwayland)
if you have any tips for how to help me who's new to sway/wayland how to reproduce this, I can look further into it

@stacyharper
Copy link
Author

stacyharper commented Apr 25, 2020

can't get chatterino to run without using Xwayland

I can but I dunno what tips to give.

What is the graphical lib behind chatterino? I think it's Qt so you'll have to install qt5-wayland

ps: I don't have any special env variable nor special Qt5 config file. It should works OOTB

@tollyx
Copy link

tollyx commented Jun 11, 2020

Ran into this as well, using sway on Arch.

You can force Qt5 to use wayland by setting the env var QT_QPA_PLATFORM to wayland. So try reproducing it by running this in a sway session:

QT_QPA_PLATFORM=wayland chatterino

The issue seems to be that sway thinks that the popups you get when hovering the channel name (and other things) are proper windows and tries to tile them accordingly.

For now I'm just running chatterino through xwayland which seems to work fine.

@stacyharper
Copy link
Author

I'm unable to reproduce this using a fresh unconfigured sway + Xwayland setup (can't get chatterino to run without using Xwayland)

Maybe you have to install qt5-wayland ?

@pajlada
Copy link
Member

pajlada commented Jun 14, 2020

I managed to reproduce it with
QT_QPA_PLATFORM=wayland chatterino

@pajlada
Copy link
Member

pajlada commented Jun 14, 2020

I created a branch which fixes it for me: @Eluminae https://github.com/Chatterino/chatterino2/tree/wayland-sway-tooltip-test could you try it out?
If you can't build it, I can get an AppImage for you (if that works)
Would also love to get some other linux person to try it out on their setup to make sure this doesn't break their workflow, because this works for me using X11 and i3

@ilya-zlobintsev
Copy link
Contributor

Popups work correctly on sway with the branch. You also can't move the user info window though.

@tollyx
Copy link

tollyx commented Jun 14, 2020

I also tried it out, can confirm that it fixes the 'dancing windows'.

There's minor difference I noted though - the emote/badge tooltips does not follow the cursor like they do when running through xwayland, they stay in place where they appeared instead. But unlike before it's functional.

Can also confirm that the user info window cannot be moved when running on sway/wayland (also true on the master branch though).

@stacyharper
Copy link
Author

stacyharper commented Jun 14, 2020

Yeah it is way better ! Nice work. I tested it some minutes but it seems to works as well as the xwayland version.

I detected a crazy random bug with the three dot drop down top right menu with it position

bugged menu screencast

I use scaling on sway (1.6) so maybe the position is misscomputed (maybe?)

@syphoxy
Copy link

syphoxy commented Jul 24, 2020

I wanted to test the above mentioned branch since I basically had to either use xwayland, which looks like garbage to me because I use a hidpi display or deal with chatterino having a pretty major UI bug.

I rebased on master to check if it had gone stale. everything built successfully. as indicated above, the issue has disappeared and overall the experience is much smoother now.

I'm not sure what @ilyazzz and @tollyx means when they say that they can't move the user info window. it opens up for me and gets tiled immediately like you'd expect in sway. I can float it and it becomes movable by virtue of the window manager.

I haven't tried Chatterino in X11 so I don't know what the moving tooltips look like but I definitely don't think it's problematic enough to delay pushing this fix into master. I think adding a TODO is sufficient enough to address that concern.

I also can confirm the bug @Eluminae exhibited above. I happen to also be using 1.6x scaling in sway but when I tried setting it to 1x the issue still materialized. that said, it seems to only ever happen once per execution per tab so it's potentially a tab initialization issue.


just as I was about to wrap up writing this comment, I discovered a weird issue. it appears that the tooltips don't work unless QT_QPA_PLATFORM=wayland is explicitly set. I'm pretty sure this is currently autodetecting as wayland already so I'm not sure what the difference is here but tooltips and menus stop working when that isn't set at runtime.

and another issue ... irrespective of the QT_QPA_PLATFORM variable being set, it appears that my IME is broken in the new branch. it works in the master branch and it doesn't work on the wayland tooltips branch before or after rebasing on master.

@syphoxy
Copy link

syphoxy commented Jul 24, 2020

I feel like my head is spinning. after more troubleshooting I no longer need QT_QPA_PLATFORM=wayland to be explicitly set and my IME is now working correctly ... but I haven't made any code changes. I worried that maybe there was a cached object somewhere but even after deleting and compiling from scratch doesn't manifest the issue again. I think I was chasing my tail on environment variables being not set or being unset during troubleshooting.

everything works as expected. thanks for the fix.

@pajlada
Copy link
Member

pajlada commented Jul 25, 2020

Thanks for all the input everyone - I'm merging the https://github.com/Chatterino/chatterino2/tree/wayland-sway-tooltip-test branch into master now. Please feel free to reopen this if I closed it in mistake, and open a new issue for any other issues you run into that are sway-related!

@pajlada pajlada closed this as completed Jul 25, 2020
@ilya-zlobintsev
Copy link
Contributor

The issue seems to be still present when chatterino window isn't focused: video showcase

The user info window behavior is indeed what @syphoxy described with the latest build so that's resolved.

@syphoxy
Copy link

syphoxy commented Aug 3, 2020

sorry to have to come back to this but I recently upgraded from Fedora 31 to Fedora 32 and it seems like the issue has partially returned.

the windows aren't dancing and most hovers appear to work properly but the menu does not work properly. at first, it opens in the wrong place, like discussed above, but in later invocations it appears to .. not appear at all.

that said, it doesn't appear to be rendering at all according to Chatterino itself. in previous builds, despite not showing a menu, it would still absorb one click if you tried to click away. it doesn't appear to do that now which makes me feel like it's not rendering whatsoever, not just not rendering correctly according to Wayland. I could be wrong about this. it's just a theory.

I've tried tweaking the flags applied to tooltips but that may be a red herring because dropdown menus are likely not "tooltips". I've looked through the menu related code in SplitHeader.cpp but I didn't find any similar calls to setWindowFlags.

is there a better way I can help debug this?

@pajlada pajlada reopened this Aug 8, 2020
@pajlada
Copy link
Member

pajlada commented Aug 8, 2020

Please provide a video of more dancing

@syphoxy
Copy link

syphoxy commented Aug 10, 2020

@pajlada as I said, the window isn't dancing. the menu does not render when the three dots hamburger menu is pressed.

I can provide a video of this if I must but it's very much that simple. is there something else I can do to help debug this or is a video capture the best way to diagnose it?

@syphoxy
Copy link

syphoxy commented Aug 11, 2020

@pajlada

here are two different manifestations of this bug. it appears to only manifest itself once during the lifecycle of a tab.

bug1

bug2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working as intended, or works in a confusing/unintuitive way for the user wayland/sway Any issues pertaining to Wayland compositors or the Sway tiling window manager
Projects
None yet
Development

No branches or pull requests

8 participants