Search Unity

Editor panels only redraw on update / mouse over

Discussion in 'Linux' started by javl, Aug 20, 2019.

  1. javl

    javl

    Joined:
    Oct 18, 2013
    Posts:
    3
    I've been having this problem on two separate machines. Both running the latest Unity and Debian (which I know isn't officially supported).

    All of the separate panels in unity (Scene, Game, Console, Inspector) only redraw when they are updated, meaning that when I alt-tab between programs or move a different window over the Unity window, it will leave a trace (see screenshot where I dragged my browser over the window).

    As soon as one of the panels updates (like the scene window redrawing after editing some script) or when I move the cursor over a panel, they redraw and are fine again. I've been getting around this by just flicking my cursor all over the screen every time I alt tab into Unity from some other program, but is it starting to drive me nuts ;)

    Unity 2019.2.0f1 (via Hub)
    Debian 9 (buster), all up to date
    Openbox window manager
    Latest Nvidia drivers (430.40)
    No display manager (Other programs don't seem to care edit: just installed xldm and got the sme result)

     
    Last edited: Aug 20, 2019
  2. sentropie

    sentropie

    Joined:
    Aug 20, 2019
    Posts:
    5
    +1
    have the same problem here with latest Arch Linux, i3 wm and Compton.
     
  3. markedagain

    markedagain

    Joined:
    Aug 3, 2012
    Posts:
    21
    I been trying to solve this for months, my super old editors work just fine, but not on newer ones.
    I have tried compton and xcompmgr. i tried playing around nvidia settings also, but still no go. Ill post if i get anywhere else.
    Edit:changed pic
     

    Attached Files:

    Last edited: Aug 21, 2019
  4. javl

    javl

    Joined:
    Oct 18, 2013
    Posts:
    3
    Good to know it's not just me.
    @markedagain I think I was using a 2018 version for a long time, which worked fine. So maybe something changed around the 2019 versions? Not sure if that's something we can use to figure out how to fix this (and if this even is something users can fix, or is caused by something in the Unity code).
     
  5. markedagain

    markedagain

    Joined:
    Aug 3, 2012
    Posts:
    21
    I also noticed, on some of my pcs I cant pull the tabs out or have them anchor back in by dragging em. I now have a feeling the panes are being treated as individual windows by i3 and its causing some weird behaviors.
    @javl do u have same issue with changing where panels are ?
     
  6. Luminoth

    Luminoth

    Joined:
    Jan 15, 2013
    Posts:
    25
    Same issue here on both a laptop and PC, using i3 on Ubuntu 18.04
     
  7. r9shackleford

    r9shackleford

    Joined:
    Jul 23, 2019
    Posts:
    23
    You need to enable compositing in your WM. If your WM doesn't have that, you need to install something like Compton or Xcompmgr.
     
    Deleted User and PixelJ like this.
  8. Oonushi

    Oonushi

    Joined:
    Aug 25, 2019
    Posts:
    7
    Thank you, this worked for me.

    I was having a similar problem, but when I changed Layouts from the Layout menu the menu bars would stay visible, but the rest of the area was blank and I couldn't get it to update.

    Installing xcompmgr fixed it right off the bat.
     
    PixelJ likes this.
  9. sentropie

    sentropie

    Joined:
    Aug 20, 2019
    Posts:
    5
    compton and xcompmgr with default settings will not fix this problem.
     
  10. markedagain

    markedagain

    Joined:
    Aug 3, 2012
    Posts:
    21
    Compositing is required for menu bars for the shadows it creates. But this does not solve my redraw of panels issue. I did notice when i run my game, the game window itself will render on workspace swap, but the other panels still requires mousing over to force a redraw. If i reload my i3 instance it also works fine to force a redraw, instead of mousing over.
     
  11. hunabku94

    hunabku94

    Joined:
    Jun 12, 2017
    Posts:
    50
    First, unity seems only correctly refresh with a compositor on
    Second, it actualy works with XFWM (xfce compositor) and KWin (KDE/Plasma compositor) that i tested
     
  12. sentropie

    sentropie

    Joined:
    Aug 20, 2019
    Posts:
    5
    ok cool, but we can’t use these compositors in another window manager like i3, bspwm, awesome, etc. … So it’s probably a bug in Unity’s side when it is not working with compton/xcompmgr.
    I hope they will fix it soon. I switched for developing to a freshly installed window, when it’s fixed I can switch back to my preferred GNU/Linux environment <3
     
  13. javl

    javl

    Joined:
    Oct 18, 2013
    Posts:
    3
    Thank you r9shackleford!

    For me (Debian Buster + openbox) installing xcompmgr and running it (without any arguments) before starting Unity seems to do the trick. Some new glitches have appeared (the `create` menu now has a lot of empty space at the top) but nothing major. Overal the UI works way better now.

    edit: the only problem I'm having now is that I can't use the scrollwheel on my wireless mouse to zoom in the editor, even though the built-in trackpad works fine (and according to xev they are sending out the same signal).
     
    Last edited: Sep 18, 2019
    Deleted User likes this.
  14. hunabku94

    hunabku94

    Joined:
    Jun 12, 2017
    Posts:
    50
    Sentropie, you're right, kwin and xfwm can only replace the windowmanager.

    Thanks for the info javl !
     
  15. markedagain

    markedagain

    Joined:
    Aug 3, 2012
    Posts:
    21
    So i recently realized unity has said its optimized for ubuntu. Running the editor from terminal i noticed a bunch of gtk widget errors.
    Code (CSharp):
    1.  
    2. Editor % ./Unity -projectpath /home/username/Projects/Personal/New\ Unity\ Project
    3. npm ERR! extraneous: unityeditor-collab-history@0.6.14 /home/username/.local/share/unity3d/Packages/node_modules/unityeditor-collab-history
    4.  
    5. (Unity:42516): Gtk-CRITICAL **: 16:17:07.858: gtk_widget_get_scale_factor: assertion 'GTK_IS_WIDGET (widget)' failed
    6.  
    7. (Unity:42516): Gtk-CRITICAL **: 16:17:07.906: gtk_widget_get_scale_factor: assertion 'GTK_IS_WIDGET (widget)' failed
    8.  
    9. (Unity:42516): Gtk-CRITICAL **: 16:17:07.919: gtk_widget_get_scale_factor: assertion 'GTK_IS_WIDGET (widget)' failed
    10. [0925/161708:ERROR:browser_main_loop.cc(161)] Running without the SUID sandbox! See https://code.google.com/p/chromium/wiki/LinuxSUIDSandboxDevelopment for more information on developing with the sandbox on.
    11. [0925/161718:ERROR:browser_main_loop.cc(207)] Gtk: gtk_widget_get_scale_factor: assertion 'GTK_IS_WIDGET (widget)' failed
    12. [0925/161718:ERROR:browser_main_loop.cc(207)] Gtk: gtk_widget_get_scale_factor: assertion 'GTK_IS_WIDGET (widget)' failed
    13.  
    14. (Unity:42516): Gtk-WARNING **: 16:17:18.255: Attempting to add a widget with type GtkFixed to a container of type GtkWindow,
    15. but the widget is already inside a container of type GtkViewport, please remove the widget from its existing container first.
    16. [0925/161719:ERROR:browser_main_loop.cc(207)] Gtk: gtk_widget_get_scale_factor: assertion 'GTK_IS_WIDGET (widget)' failed
    17. [0925/161719:ERROR:browser_main_loop.cc(207)] Gtk: gtk_widget_get_scale_factor: assertion 'GTK_IS_WIDGET (widget)' failed
    18.  
    19.  
    the time stamped errors are on startup, then the rest of errors happen when moving the panes around
     
    Last edited: Sep 25, 2019
  16. hunabku94

    hunabku94

    Joined:
    Jun 12, 2017
    Posts:
    50
    I tested on linux support declaration on ubuntu and have a lot of Editor GUI problems.
     
  17. One-Legged-Spider

    One-Legged-Spider

    Joined:
    Oct 9, 2019
    Posts:
    1
    I have the same problem in AwesomeWM on Arch. Using Compton (yshui's fork) doesn't help.
     
  18. hunabku94

    hunabku94

    Joined:
    Jun 12, 2017
    Posts:
    50
    You can try instead of Compton :
    xcompmgr : works for javl

    Also you can use these, will chnage your window manager too :
    XFWM (XFCE compositor) : works for me but with some settings about focus and gliches because of it use XRender compositing
    Kwin (KDE compositor) : works better than XFMW for me without specific settings

    My KWin compositing settings that perfectly works :

    In english :
    - Ultra-Fast
    - Direct
    - Never
    - Never
     
    Last edited: Oct 15, 2019
  19. hunabku94

    hunabku94

    Joined:
    Jun 12, 2017
    Posts:
    50
    Okai i tested and i can confirm the problem is with XRender compositing mode.
    You need to use GLX (OpenGL) compositing mode to fix that issue.

    I also recommand to use the highest OpenGL version you can.
     
  20. hunabku94

    hunabku94

    Joined:
    Jun 12, 2017
    Posts:
    50
    So,
    One-Legged-Spider
    I tested compton, it works like a charm.You just need to switch from "X Render" to "OpenGL (GLX)".
     
  21. Endless-Cat

    Endless-Cat

    Joined:
    Oct 20, 2014
    Posts:
    2
    Hey guys, seems like the issue is still there with latest versions of unity Unity 2020.3.10f1 on Arch Linux with DE: Awesome WM + picom (compton fork)

    * tried different drivers (nvidia proprietary/intel) because laptop has hybrid mode (X runs on intel, can run just unity on nvidia using prime-run command)
    * tried on desktop that only has nvidia (X runs on nvidia proprietary driver)
    * tried different composition managers: original old xcompmgn, compton, picom forks
    * tried differrent backends on picom ( glx, xrender, xr_glx_hybrid)
    * tried some options to picom ( --xrender-sync-fence --no-use-damage --vsync --vsync-use-glfinish) in differet combinations
    * tried switching to vulkan in unity editor settings (runs vulkan by default in prime-run on nvidia, forced vulkan on intel)

    So on switching desktops unity ui is not updated (shows whatever was on previous desktop), game view usually is updated though, but the rest - it only redraws on mouse over, or on window resize
     

    Attached Files:

    Celsiuss likes this.
  22. NickVst

    NickVst

    Joined:
    Feb 17, 2017
    Posts:
    25
    Issue persisting on Arch+i3wm+picom, tested:
    - 2018.4.36f1
    - 2019.4.28f1
    - 2020.3.12f1
    - 2021.1.12f1

    with all backend options, different damage settings, nothing really seems to work.

    I managed to almost completely alleviate the issue by toggling Unity's fullscreen status twice on workspace switch.

    Code (csharp):
    1. set $unity-refresh exec i3-msg [class="Unity"] fullscreen toggle; exec i3-msg [class="Unity"] fullscreen toggle
    2.  
    3. # Now it can be appended at your workspace switches.
    4. bindsym $mod+1 workspace $ws1; $unity-refresh
    5. bindsym $mod+2 workspace $ws2; $unity-refresh # and so on...
    There is a slight stutter if I switch to the Unity workspace from a workspace on another monitor, but it works fine when I switch from workspaces on the same monitor.
     
    njegomir and tchum95 like this.
  23. ynuteminnof

    ynuteminnof

    Joined:
    Apr 1, 2018
    Posts:
    7
    I am using i3 and have the same issue with redrawing. I don't want any compositor (few I tried lead to freezes in games and worse FPS). I am using heavily tabs in i3, so I can't use the workaround from NickVst. It inspired me to write a script which monitors active window and when it detects switch back to unity, it toggles the fullscreen mode. https://gitlab.com/-/snippets/2171264
     
  24. saga000

    saga000

    Joined:
    Nov 2, 2020
    Posts:
    4
    I have same problem. I'm clicking to color picker, sprite selector and more...
    If restart Unity, it works fine for a while (from 2 to 10 minutes), then again the same thing.
    ---
    Ubuntu 20.04.3 LTS
    UnityHub
    Unity 2020.3.19f1

    (color picker screen) Unity_color_picker_clk.png
    (sprite selector screen)
    Unity_sprite_picker.png
    what about that S***?
     
    Last edited: Sep 28, 2021
  25. MadWatch

    MadWatch

    Joined:
    May 26, 2016
    Posts:
    112
    @saga000 you need to enable composition. It seems you're using KDE, so open the settings, go to Display and Monitor/Compositor and check the box named "Enable compositor on startup". Restart. You should be good.
     
    saga000 likes this.
  26. saga000

    saga000

    Joined:
    Nov 2, 2020
    Posts:
    4
    Settings already:
    upload_2021-10-1_9-51-1.png

    rebooted the system just now. And:
    upload_2021-10-1_9-54-40.png

    did not help ;(
    What else can I do?
     
  27. saga000

    saga000

    Joined:
    Nov 2, 2020
    Posts:
    4
    upload_2021-10-8_9-59-42.png
    mouse over - :( HELP!!!
     
  28. unity_95924FA6BB7539FBF89B

    unity_95924FA6BB7539FBF89B

    Joined:
    Nov 14, 2021
    Posts:
    1
    Less intrusive shell one-liner which will toggle borders for Unity window instead of making it fullscreen:

    xprop -spy -root _NET_ACTIVE_WINDOW | grep --line-buffered -oP '# \K.*' | xargs -I{} xprop -id {} WM_CLASS | grep --line-buffered Unity | xargs -I{} bash -c "for p in {2,1}; do i3-msg '[class=\"Unity\"] border pixel '\$p; done"
     
    ynuteminnof likes this.
  29. LoneGoat

    LoneGoat

    Joined:
    Dec 16, 2020
    Posts:
    21
    I experience this issue when I use the editor (2021 atm) when running under wayland and using an nvidia card.

    If I switch to my igpu (amd) the editor works as expected, as does switching to xorg where the editor plays fine with the nvidia driver.
     
  30. Misfitxtm

    Misfitxtm

    Joined:
    Jun 2, 2020
    Posts:
    1
    Has anyone found a way to alleviate this in AwesomeWM? I'm using Arch Linux, AwesomeWM, and picom w/ GLX. Any suggestions problem still persists on 2021.3.7f1 LTS
     
  31. darthdeus

    darthdeus

    Joined:
    Oct 13, 2013
    Posts:
    81
    Anyone found any solution on i3? Also using Arch/i3 and tried picom and xcompmgr and neither seems to work, on 2021.3.12f1
     
  32. sfjuocekr

    sfjuocekr

    Joined:
    Sep 16, 2014
    Posts:
    1
    You need to remove any appmenu-gtk3-parser you have installed and then you need a compositor enabled.

    After you apply these two steps, Unity Editor will work correctly for you!

    The reason for this is quite simple, there is no redraw needed when the compositor is used as it just keeps showing whatever was shown. If there is no compositor present, these "thumbnails" get discarded until there is a redraw event triggered and thus resulting in these nice streaks of dragged windows over areas that were not set to repaint.

    Either GTK3 or the Unity Editor makes the assumption a compositor is used, I've not delved much further into this "issue" as using a compositor should have been the default since like 2004.
     
    Last edited: Dec 17, 2022
  33. snezhniylis

    snezhniylis

    Joined:
    Feb 7, 2023
    Posts:
    1
    You can throw the following piece of code anywhere inside your
    ~/.config/awesome/rc.lua

    Code (JavaScript):
    1. tag.connect_signal("property::selected", function(t)
    2.     local clients = awful.client.visible(s)
    3.     for _, client in pairs(clients) do
    4.         if awful.rules.match(client, {class = "Unity"}) then
    5.             client.border_width = client.border_width + 1
    6.             gears.timer.start_new(1/60, function()
    7.                 client.border_width = client.border_width - 1
    8.             end)
    9.         end
    10.     end
    11. end)
    It registers a callback function for when you select (switch to) another tag (virtual desktop). The function does the following:
    1. Finds all the visible clients (windows)
    2. Every Unity window gets its borders increased by 1px, forcing its contents to shrink and get redrawn
    3. 1/60 seconds later, the borders get reduces to their initial values
    Alternatively, you can replace resizing borders with toggling fullscreen mode, but it induces an annoying flicker:
    Code (JavaScript):
    1. client.fullscreen = not client.fullscreen
    2. gears.timer.start_new(1/60, function()
    3.     client.fullscreen = not client.fullscreen
    4. end)
     
  34. JMorgado

    JMorgado

    Joined:
    Jan 13, 2019
    Posts:
    1
    This worked perfectly for me (arch linux + awesomewm + picom). Thanks a lot!