Search Unity

Left Click stops working after selecting Game View

Discussion in 'Linux' started by v-oid, Jun 13, 2022.

  1. v-oid

    v-oid

    Joined:
    Sep 13, 2017
    Posts:
    12
    Hi all,

    I recently encountered a bug that pretty much rendered Unity to be unusable on my system.
    Whenever I select the Game View my left mouse button no longer works on controls inside the editor.

    Right click, wheel and middle button panning are still working but the left click seems to be only working about 10% of the time. The window menu can still be clicked but pretty much any control or element inside the editor is affected.

    The problem is 100% reproducible and can only be fixed by restarting the editor. I recorded a short clip demonstrating the issue:



    After clicking the Game tab (at about 00:20) I tried to click various elements without much success. I did click repeatedly and as you can see it only registered the input in a fraction of the attempts and I had to do weird pointer movements to get it working.

    Tested versions have been 2021.3.4f1, 2021.2.15f and 2022.1.4f1 - all show the same behaviour.

    Any ideas how to solve that? Thank you very much.
     
  2. rafaelhipercg

    rafaelhipercg

    Joined:
    Oct 13, 2015
    Posts:
    4
    Same here. after the system update. left click on unity stopped working. Tested on 2022.1.2. maybe is something with KDE
     
    Last edited: Jun 14, 2022
    v-oid likes this.
  3. KevinWelton

    KevinWelton

    Joined:
    Jul 26, 2018
    Posts:
    239
    @ravoid, what is your Linux configuration, including window server and manager?
     
    v-oid likes this.
  4. v-oid

    v-oid

    Joined:
    Sep 13, 2017
    Posts:
    12
    I second that. Happened during one of the recent system updates, probably related to KDE (I am using it as well).

    Kevin, thanks for the quick response. Here is a summary of my system:

    Code (csharp):
    1. uname -a
    2. Linux t800 5.18.3-arch1-1 #1 SMP PREEMPT_DYNAMIC Thu, 09 Jun 2022 16:14:10 +0000 x86_64 GNU/Linux
    Code (csharp):
    1. glxinfo -B
    2. name of display: :0
    3. display: :0  screen: 0
    4. direct rendering: Yes
    5. Memory info (GL_NVX_gpu_memory_info):
    6.    Dedicated video memory: 8192 MB
    7.    Total available memory: 8192 MB
    8.    Currently available dedicated video memory: 7184 MB
    9. OpenGL vendor string: NVIDIA Corporation
    10. OpenGL renderer string: NVIDIA GeForce RTX 2080/PCIe/SSE2
    11. OpenGL core profile version string: 4.6.0 NVIDIA 515.48.07
    12. OpenGL core profile shading language version string: 4.60 NVIDIA
    13. OpenGL core profile context flags: (none)
    14. OpenGL core profile profile mask: core profile
    15.  
    16. OpenGL version string: 4.6.0 NVIDIA 515.48.07
    17. OpenGL shading language version string: 4.60 NVIDIA
    18. OpenGL context flags: (none)
    19. OpenGL profile mask: (none)
    20.  
    21. OpenGL ES profile version string: OpenGL ES 3.2 NVIDIA 515.48.07
    22. OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
    23.  
    Code (csharp):
    1. sudo -X -version
    2. X.Org X Server 1.21.1.3
    3. X Protocol Version 11, Revision 0
    4.  
    Code (csharp):
    1. plasmashell --version
    2. plasmashell 5.24.5
    Code (csharp):
    1. kf5-config --version
    2. Qt: 5.15.4
    3. KDE Frameworks: 5.94.0
    4. kf5-config: 1.0
    Just an addition to that: I was trying the same on wayland as well but it didn't seem to have any effect.

    Hope that helps. Let me know if you need anything else, happy to support with whatever it takes.
     
  5. KevinWelton

    KevinWelton

    Joined:
    Jul 26, 2018
    Posts:
    239
    @ravoid, thanks for the info. Since it is KDE it isn't something that we have the resources to fully investigate or fix right now. Still, I would recommend you log a bug with the information you gave me so we can at least be aware of what our users are running on and using so we can give consideration in the future.

    As far as Wayland, we don't technically support it, but my experience shows with Ubuntu 22.04 the X translation layer is working pretty well. Window server hasn't been the primary issue yet for any major problems.
     
    v-oid likes this.
  6. demilich1

    demilich1

    Joined:
    Jul 26, 2013
    Posts:
    15
    Same issue for me, Unity basically unusable since the latest system update. I am running Manjaro with Gnome. I know that Manjaro (or Arch Linux in general) is not officially supported, but I had no issues up to this point. Since it broke for so many people at once, I think it is something which is not related to a specific distro.

    This is the Manjaro update which broke it for me: https://forum.manjaro.org/t/stable-...a-mesa-pulseaudio-pipewire-libreoffice/113551
    My graphics card is NVIDIA GeForce RTX 2060, and people above me also had an NIVIDIA GPU. So wild guess: maybe the new NVIDIA driver is the culprit?

    I also want to add: I am working on a game which uses the new UI Toolkit system and the issue also affects my in-game UI. I also noticed the hover effects are still working perfectly both in the Editor and in-game, so Unity can still detect if the mouse is over a button. It is really just the click that is not working.
     
    v-oid likes this.
  7. v-oid

    v-oid

    Joined:
    Sep 13, 2017
    Posts:
    12
    Kevin, thanks again for getting back on this so quickly. I already filed a bug report along with my original post so I think you should see it on your backlog already.

    I guess for the time being the only way to solve this issue is to use another window manager. I think I did try GNOME already when I first encountered the problem and noticed it wouldn't work as well, but I am not sure, maybe someone else could verify it is working on a WM that is not KDE/Plasma?

    Just wanted to add that I would be happily volunteer to support in terms of testing potential solutions on my systems if that is something you would be looking for.

    Yes, this is exactly what I was experiencing with UI Toolkit as well. At first I thought it was an issue with UIT directly because as soon as I pulled it into my project the problem occured. But even in a fresh project without UI Toolkit the click is not working anymore, so I figured these two components to be unrelated.

    I'm also on the most recent NVIDIA driver but I think it is very unlikely that this is the cause because there really isn't anything wrong with the visual elements themselves, it is just the click that refuses to work and it seems like a race condition. It's probably related with some kind of translation of the XY coordinates from X over KDE into the editor, but this is just a wild guess as well.
     
    Last edited: Jun 15, 2022
  8. synasius

    synasius

    Joined:
    Nov 22, 2013
    Posts:
    8
    I have the same issue on EndeavourOS with Gnome.

    Unity 2022.1 works until the Game window is shown, which is always if you use a 2 by 3 layout, and then left mouse clicks stop working
     
    v-oid likes this.
  9. rafaelhipercg

    rafaelhipercg

    Joined:
    Oct 13, 2015
    Posts:
    4
    v-oid likes this.
  10. synasius

    synasius

    Joined:
    Nov 22, 2013
    Posts:
    8
    nice tip, thanks!

    I want to add that Unity version 2021.3.3f1 works fine as expected. I'm using that one for now, waiting to switch to 2022 once this issue is addressed.
     
    v-oid likes this.
  11. demilich1

    demilich1

    Joined:
    Jul 26, 2013
    Posts:
    15
    Now I am wondering who needs to fix it. Apparently a change in GTK broke it, so it seems logical that GTK needs to be fixed. However, I am noticing no issues on other applications using GTK, it is just Unity with UI Toolkit. So maybe the change in GTK was just fine and Unity needs to make it work? *confused*
     
    v-oid likes this.
  12. v-oid

    v-oid

    Joined:
    Sep 13, 2017
    Posts:
    12
    Are you referring to a specific GTK bug?
     
  13. v-oid

    v-oid

    Joined:
    Sep 13, 2017
    Posts:
    12
    Just an update on the issue:

    I tried the most recent Alpha as well as stable and LTS versions on GTK, Plasma and i3 now and they all show the same bug, ultimately resulting in making Unity completely unusable. So I am convinced now it is safe to conclude that KDE/Plasma is not the cause here.
     
  14. JLambda

    JLambda

    Joined:
    May 3, 2019
    Posts:
    2
    I found a workaround that seems to solve my instance of this issue.

    I've been having this issue with version 2022.1.5f1. Interactive elements of the UI such as buttons became unresponsive, and it was impossible to interact with the left click with any of the view ports.

    After checking the
    ~/.config/unity3d/Editor.log
    file, I saw error messages containing:

    Code (CSharp):
    1. Couldn't find a valid ICU package installed on the system.
    2. Set the configuration flag System.Globalization.Invariant to true if you want
    3. to run with no globalization support.
    To solve the issue, I started the Unity Hub from the terminal with the following setting:

    Code (CSharp):
    1. DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1 unityhub &
    This seems to have fixed the problem, and for the first time I can interact with the interface normally.

    In addition to this problem, it has also fixed a problem I had with version 2020.3.28f1, where the project would permanently show empty error messages which only showed the timestamp. This made it impossible to build the project. The logs for this issue were similar to the other one, and contained the same error message.

    I've tried to reproduce the problem again. Strangely, after having used the setting once I am not able to see the problem again, even without using it. If it does re-appear, I'd temporarily add it to bash's configuration file until it is resolved.

    As to why this problem is happening, I don't know. I run arch linux, and these are the versions for ICU currently installed in the system:

    Code (CSharp):
    1. local/icu 71.1-1
    2.     International Components for Unicode library
    3. local/lib32-icu 71.1-1
    4.     International Components for Unicode library (32 bit)
    Maybe there is a version mismatch?
     
    tmakij and v-oid like this.
  15. demilich1

    demilich1

    Joined:
    Jul 26, 2013
    Posts:
    15
    I just tried the solution you posted and it did not help in my case, no difference at all.

    The only workaround which helps a bit is having another Editor Window open and lay it on top of the GameView (I use the UI Toolkit Event debugger). That at least alleviates the issues with the ingame UI. Everything which is part of the Editor UI is still not working correctly though
     
    v-oid likes this.
  16. JLambda

    JLambda

    Joined:
    May 3, 2019
    Posts:
    2
    Sorry to hear!

    Are there any error messages in the editor logs I've mentioned? Try to open the editor, and then close it as soon as the problem appears, so the file is shorter and easier to read through.

    If there's a missing/broken library, there might be a message about it.
     
    v-oid likes this.
  17. v-oid

    v-oid

    Joined:
    Sep 13, 2017
    Posts:
    12
    Unfortunately even though I was really excited to see a possible solution, it didn't work in my case.

    Checking the logs is a good idea though. I do not see any message complaining about missing ICU packages but I have these lines a lot:

    Code (CSharp):
    1. GLib-GIO-CRITICAL **: 18:59:20.381: g_dbus_proxy_call_sync_internal: assertion 'G_IS_DBUS_PROXY (proxy)' failed
    2.  
    Everything else looking pretty normal I guess. Could it be that this is somehow related to DBus?

    Oh and one more question to you guys affected by the problem as well: Is your project using Vulkan or GL?
     
  18. synasius

    synasius

    Joined:
    Nov 22, 2013
    Posts:
    8
    The solution reported did not work for me.

    In the `Editor.log` I do not see errors related to DBUS or ICU. I have projects with both OpenGL and Vulkan as primary API and they both show the same error.

    With Unity 2022.1.5f1 I can now interact with tabs, while the UX with all the other components is buggy. Is there an official issue open for this in the tracker?
     
    v-oid likes this.
  19. v-oid

    v-oid

    Joined:
    Sep 13, 2017
    Posts:
    12
    Thanks for reporting back here. So we can rule out Vulkan as the cause of the problem then I guess and probably DBUS as well.

    Yes, I did submit a bug report via the editor. This is supposed to show up in the bug tracker, correct?

    I think the guys at Unity put low priority on this issue which is understandable given that the affected user-base is probably rather small. However, I am desperate for a solution, so let's try to gather more information on the roots of the problem ourselves. For what it's worth I scanned through the list of packages that were updated on my system the day I noticed the problem for the first time (around 13th of June). I copied the relevant parts from
    /var/log/pacman.log
    and uploaded it here. It is worth to mention a couple of possible troublemakers have been updated too: nvidia, qt5-base and lib32-libx11 for example.
     
  20. v-oid

    v-oid

    Joined:
    Sep 13, 2017
    Posts:
    12
    Short update: I noticed the problem seems to go away once you toggle themes in the preferences (still will break once you switch between Game and Scene view). So something in this routine is causing the input to work again when refreshing the UI.
     
  21. v-oid

    v-oid

    Joined:
    Sep 13, 2017
    Posts:
    12
    Alright, so I got some more insight on this:

    I was tinkering around with
    xdotool
    for a while now to simulate left mouse clicks and I found out that the clicks do work perfectly when the editor window is not focused and then stops working once the window gets the focus.

    You can reproduce this easily on your own: Fire up the editor, focus another application while still keeping the editor window visible when it goes out of focus and then click anywhere in the interface. The first click should always be registered and then it should stop working.
     
  22. HerbertSSchaefer

    HerbertSSchaefer

    Joined:
    Oct 25, 2014
    Posts:
    7
    Well ... I don't know how to say this. It does not make a lot of sense, but i've managed to get the left click working in my system again. I think the problem is Pipewire.

    Disabling Unity Audio and restarting the editor have solved the problem. In Edit > Project Settings ... > Audio > Disable Unity Audio, then restart.

    What i have tried and did not work, system: Arch, AMD Radeon RX 6600, Inten Pentium G:
    Zen Kernel 5.18
    LTS Kernel 5.15
    DE: KDE Plasma ( X11 and Wayland), Sway, DWM, AwesomeWM.
    Downgrade X11 libs.

    Gonna try to downgrade Pipewire to some last month's version.

    Edit: Negative. Downgrading Pipewire, changing from Wireplumber to media session, switching to PulseAudio, and nothing, i am completely lost here, but disabling the audio continues to consistently work. The only thing left to do is to comb the Unity and system logs, try to install gnome (i would like to avoid, gnome likes to rewrite the user configurations), or go to another distro.
     
    Last edited: Jun 24, 2022
    tmakij and v-oid like this.
  23. synasius

    synasius

    Joined:
    Nov 22, 2013
    Posts:
    8
    > Well ... I don't know how to say this.

    :D:D

    Ok, I don't know how to say this too... but your workaround works for me too! I have to say it is still not perfect.. it loses a click every now and then but I can definitely work with it.

    I'm using Gnome on Endeavour OS with kernel 5.18.6-arch1-1 #1 SMP PREEMPT_DYNAMIC Wed, 22 Jun 2022 18:10:56 +0000 x86_64 GNU/Linux.

    I have latest nvidia drivers 515.48.07-12 with optimus-manager in hybrid mode.
     
    HerbertSSchaefer and v-oid like this.
  24. v-oid

    v-oid

    Joined:
    Sep 13, 2017
    Posts:
    12
    Holy cow! This seems to have fixed it for me as well!

    I don't know what to say... how did you even find this out, I mean... why would you even want to try this!?

    But anyway, this is a huge step forward in finding a solution, thank you so much!
     
    HerbertSSchaefer likes this.
  25. HerbertSSchaefer

    HerbertSSchaefer

    Joined:
    Oct 25, 2014
    Posts:
    7
    More news. Logs don't show anything, even with audit, and Gnome also does not fix the problem.

    But i have found a " " " workaround " " " by installing Unity inside a container running Ubuntu 20.04. This method it is own can of worms buy it might be worth it if you need audio or you are trying to find the bug, or just want to use Unity more close to officially supported as possible without having to install Ubuntu or use a VM.

    Install Distrobox with Docker (both properly configured to be used in userspace)
    Share your xhost with: ~ xhost + local:docker
    Start / Enable the docker service
    Create and enter a Ubuntu distrobox
    Install gnome and Unity depencencies (cpio for android, opencl, etc)
    Install UnityHub (if is v3 then configure firefox (installed with gnome) and the mimetypes and lauch firefox as a job before UnityHub)
    And install and use Unity normally.

    With this method you can use Unity with Ubuntu libraries and dependencies with your distro in your x11 DE/WM of choice. Basically is kind of like a Flatpak.

    Also, is not the kernel since this container uses the same kernel as the host system, so the problem comes from some library. The only different / missing libraries that i have found that Unity uses are:
    libffi 7, libselinux, libresolv, libpcre 3, libicuuc 66, libuuid, libpcre2-8, libicudata 66, libbsd
    Tried installing libffi 7 and libselinux but the problem still persists. The other libraries are not in the Arch repository, the current version is older than 3 months, or the library is in another group.

    Glad i could help.

    Basically i have noticed that when using Unity with an old project there were no problems. So the problem must come from some configuration. After frankensteineing this old project with a new project for 2 hours the only ProjectSettings folder file that triggered the problem was the AudioManager.asset, and the only difference in the old project was the m_DisableAudio: 1. hehehehe
     
    tmakij, v-oid and sfjohansson like this.
  26. v-oid

    v-oid

    Joined:
    Sep 13, 2017
    Posts:
    12
    Unbelievable, but I'm so glad you took the time to do that, helps me a lot in my current project, so thank you very much!

    In my case I don't need audio (yet) so I can live with just disabling it - but obviously this won't solve the problem forever. I wonder what is it that makes Pipewire interact with X resp. Unity in such an odd way.
     
  27. morphex

    morphex

    Joined:
    Dec 18, 2012
    Posts:
    112
    The weirdest thing about this is that its only the left mouse button that fails.

    So i just got hit with this same error, the thing is Its Unity 2022 thing . I have both 2021 and 2022 installed side by side, and 2022 has the bug, and 2021 does not, so it is 100% a Unity thing, specifically unity 2022 problem in my instance.

    Weirdly enough while using some assets on 2022, I am getting Audio Errors , FMOD for example is crashing unity when using GAIA PRO 2021, which ties into what @HerbertSherbert was metnioning with unity audio.

    Edit: It seems disabling Unity Audio does not fix it for me sadly.
     
    Last edited: Jun 27, 2022
  28. v-oid

    v-oid

    Joined:
    Sep 13, 2017
    Posts:
    12
    Another update on the issue: Unfortunately the solution provided by @HerbertSSchaefer doesn't work as good as I thought at first. When going into play mode and switching back to the scene view clicks randomly stop working again.

    Ugh, I'm kind of giving up on it for now, it's just impossible to work with Unity on Linux at the moment. If I only knew what kind of hardware or software constellation is causing the observed behaviour. This has to be the most annoying bug I've encountered for any software in a while.

    I think that you're maybe facing a different issue because the one I am experiencing is reproducible in pretty much any version I tested (2021 branch, 2022 as well as pre-releases).
     
  29. morphex

    morphex

    Joined:
    Dec 18, 2012
    Posts:
    112
    Installing the latest 2021.3 branch gives the error back, but not on 2021.1.
     
  30. tmakij

    tmakij

    Joined:
    Feb 14, 2013
    Posts:
    1
    "Disable Unity Audio" seems to have fixed the issue for me, thanks for the solution.

    My system for the reference.

    uname -r:
    Kernel: 5.18.7-arch1-1

    pactl info:
    Server String: /run/user/1000/pulse/native
    Library Protocol Version: 35
    Server Protocol Version: 35
    Is Local: yes
    Client Index: 343
    Tile Size: 65472
    User Name: *
    Host Name: *
    Server Name: PulseAudio (on PipeWire 0.3.53)
    Server Version: 15.0.0
    Default Sample Specification: float32le 2ch 48000Hz
    Default Channel Map: front-left,front-right
    Default Sink: alsa_output.pci-0000_01_00.1.hdmi-stereo-extra1
    Default Source: alsa_input.usb-Kingston_HyperX_Quadcast_4110-00.analog-stereo
    Cookie: 81d7:624c

    Xorg -version:
    X.Org X Server 1.21.1.3
    X Protocol Version 11, Revision 0
    Current Operating System: Linux archlinux 5.18.7-arch1-1 #1 SMP PREEMPT_DYNAMIC Sat, 25 Jun 2022 20:22:01 +0000 x86_64
    Kernel command line: initrd=\intel-ucode.img initrd=\initramfs-linux.img root=PARTUUID=e5425807-ec27-47e3-9fbc-d3e9b74f0946
    Current version of pixman: 0.40.0

    libinput --version:
    1.21.0

    I am now a bit lost where should this bug be reported. Is this something in PipeWire, PulseAudio, or Unity? And why does audio affect left mouse click?
     
  31. synasius

    synasius

    Joined:
    Nov 22, 2013
    Posts:
    8
    Hello everyone,

    I just downloaded 2022.1.8f1 and the issue's still there.

    I want to ask Unity Developers if there is something we can do to help them to identify where the problem is, like submitting more detailed logs, system specs and so on... also, I know I've asked this before, is there an official issue in the Unity Issue tracker?
     
    Atraisce likes this.
  32. bytewav

    bytewav

    Joined:
    Jan 8, 2013
    Posts:
    8
    For me the "Disable Unity Audio" in Project settings did improved the usability of the left click.

    Before:
    After about 5 seconds no left clicks go through.

    After:
    Most clicks go through but some of them miss kinda randomly. about 1/15
    Repro: Open and close two headers in the inspector like Transform and Mesh Renderer.

    Unity 2022.1.3f1.3228
     
    Last edited: Sep 15, 2022
  33. Atraisce

    Atraisce

    Joined:
    Jan 2, 2021
    Posts:
    2
    Hi all!

    I am also having this issue. Using Manjaro, Unity 2022.1.11f1. I tried the disable audio trick and it doesn't make any difference for me. The issue happens the instant you click the Game tab. The the top menu bar still respond fine and play, pause still work, but any of the contents of the windows does not respond to left click. Closing and reopening fixes it until I go into Game view again. After some time programming in C#, I'm trying Visual Scripting and wondering if that could be one of the issues. I ran 2019 for a long time on the same machine with absolutely no issues. Now Visual Scripting is fully integrated into more recent versions where I'm having trouble. Could this be related?

    Thanks everyone. All the best!

    Quick Edit: I have confirmed that I do not have this issue in 2019. It works perfectly but I need the newer version to work with the up-to-date Visual Scripting...

    Edit 2: tagging @KevinWelton here as well. Thanks for any insights you have.
     
    Last edited: Aug 1, 2022
    synasius likes this.
  34. noxor0

    noxor0

    Joined:
    Jul 6, 2022
    Posts:
    1
    synasius, leotada and Atraisce like this.
  35. Atraisce

    Atraisce

    Joined:
    Jan 2, 2021
    Posts:
    2
  36. leotada

    leotada

    Joined:
    Aug 9, 2019
    Posts:
    10
  37. tomcio225

    tomcio225

    Joined:
    May 10, 2019
    Posts:
    1
  38. Skade88

    Skade88

    Joined:
    Jan 2, 2017
    Posts:
    21
    Hello All!

    I am getting this same problem with Unity 2023.1.0a6 on my Ubuntu 22.04 machine. Is there an Ubuntu version of that Arch Downgrade Tool? I am not seeing it when I check apt-cache search. Will the Arch git repo version of the application work on Ubuntu?

    I am at a stand still with my game development now :(

    Best,
    David Brooks
     
  39. leotada

    leotada

    Joined:
    Aug 9, 2019
    Posts:
    10
    Distrobox with Ubuntu 20 LTS and Unity Hub works too here.
     
    Skade88 likes this.
  40. synasius

    synasius

    Joined:
    Nov 22, 2013
    Posts:
    8
    Hello!
    With the latest Unity 2022.1.23f1 and glib2 2.74.1 I do not experience the issue anymore :)
     
  41. MadFlyer

    MadFlyer

    Joined:
    Oct 28, 2014
    Posts:
    1
    Unity 2022.3.16f1 here same exact issue, just on a specific project. Another project works fine.
    No idea how i'm going to solve this. I will contact unity support and file a bug report.