Search Unity

Editor repaint issue when using i3 window manager

Discussion in 'Linux' started by enesefendi, Apr 6, 2019.

  1. enesefendi

    enesefendi

    Joined:
    Jul 20, 2013
    Posts:
    4
    Edit:
    Apparently it is not related to i3.
    Second video demonstrates same thing happens on Xfce4 aswell.
    When the compositing is off some weird windows 98 stuff is happening :)

    First video is on Ubuntu 18.04 i3 desktop manager.
    Second is on Mx Linux 18.2 xfce4.
    Gpu is nvidia 1080 ti. Driver version: 418.56


    Hello, first of, thanks for porting Unity to linux.

    When I switch from and to Unity when using i3 desktop manager Editor is not repainted.
    I have to move my mouse over each part of the editor to make it appear again.
    I recorded a 1 minute video showing the problem.







    Thanks.
     
    Last edited: Apr 9, 2019
  2. vertexmachina

    vertexmachina

    Joined:
    Feb 12, 2019
    Posts:
    9
    I see this as well.


    Arch Linux 4.19.34-1

    i3 version 4.16.1 (2019-01-27)
     
  3. enesefendi

    enesefendi

    Joined:
    Jul 20, 2013
    Posts:
    4
    I wonder if it is possible to force a repaint on window focus event.

    That would solve the i3 issue.
     
  4. CSaratakij

    CSaratakij

    Joined:
    Jan 24, 2018
    Posts:
    2
    I'm using i3 (v.4.16.1) + compton (gl sync) and Unity 2019.3.0a8.
    Seems like a repaint problem fixed.
    But you need a compositor for a 2nd video.
    Artifacts when window overlaping each other is normal, if you didn't use compositor.
     
  5. petitpixel

    petitpixel

    Joined:
    Sep 11, 2015
    Posts:
    2
    I'm using Openbox , and i have the same issue. Very annoying refresh problems, in fact nothing is refreshed (menus are overapping, for example). I have to move around mouse cursor to invalidate regions, and for a refresh.
    Reading this thread, i've found the solution: installing
    xcompmgr
    package, which is a compositor for Xorg.

    Just launch
    xcompmgr
    , even after started unity3d editor, and the composition problems disappear.
    May be you will need compositing extension to be activated in xorg, but it should be by default.

    Of course ,compositing is eating resources, so you should kill
    xcompmgr
    when leaving unity3d.
     
  6. vxdcxw

    vxdcxw

    Joined:
    Mar 21, 2014
    Posts:
    15
    I had the same issue, however I don't use
    i3
    but
    kwin
    . The problem was KDE Plasma automatically disable OpenGL rendering backend on the compositor because of a driver crash. I had to reenable it and it worked again.

    For KDE users, you can reenable the OpenGL rendering backend by going in
    System Settings
    >
    Hardware
    >
    Display and Monitor
    >
    Compositor
    >
    Rendering backend
    (a pop-up may tell you the driver crashed and you can reenable it by clicking directly in the pop-up)
     
    marra1996 likes this.
  7. marra1996

    marra1996

    Joined:
    Sep 8, 2018
    Posts:
    1
    This fixed the Issue for me.
    I set my compositor settings to openGL3.1 and approved the pop-up notification.
     
  8. tesq0

    tesq0

    Joined:
    Sep 23, 2018
    Posts:
    2
    None of the above fixed it for me, but it found out that toggling full screen mode on and off in i3 on the unity editor window fixes it. I made a script that does it automatically when changing workspaces and basically fixes the problem. It only works on i3. Feel free to check it out https://github.com/tesq0/i3-unity-fix
     
    nulldevs likes this.
  9. oxysofts

    oxysofts

    Joined:
    Dec 17, 2015
    Posts:
    124
    Workaround for awesomewm

    Code (csharp):
    1.  
    2. -- Unity repaint fix
    3. last_focus = nil
    4. unity_force_repaint = true
    5. client.connect_signal('focus', function(c)
    6.     if not c then return end -- that can happen :/
    7.  
    8.     -- This is needed to have Unity on one screen and some utility panels on another
    9.     -- without constantly repainting whenever the user switches back and forth
    10.     if not unity_force_repaint and last_focus and last_focus.valid and last_focus.tag == c.tag and awful.rules.match(last_focus, { class = "Unity" }) then
    11.         last_focus = c
    12.         return
    13.     end
    14.     last_focus = c
    15.     unity_force_repaint = false
    16.  
    17.     if not awful.rules.match(c, { class = "Unity" }) then return end
    18.     if awful.rules.match(c, { rule_any = {type = { "dialog", "popup", "popup_menu" }}}) then return end -- Ignore these types of windows
    19.     if awful.rules.match(c, { name = "Select" }) then return end
    20.  
    21.     -- The workaround
    22.     -- note: gears.timer.delayed_call doesn't not seem to work for this
    23.    c.fullscreen = false
    24.    gears.timer.start_new(1/60, function() -- 0 doesn't always work in every case
    25.         c.fullscreen = true
    26.     end)
    27. end)
    28.  
    29. tag.connect_signal('property::selected', function ()
    30.     unity_force_repaint = true
    31. end)
    32.  
    You may have to tweak this depending on your work preferences. Using
    maximized
    instead of
    fullscreen
    also works well!
     
    Last edited: Dec 18, 2020
  10. nulldevs

    nulldevs

    Joined:
    Aug 12, 2022
    Posts:
    1
    A lot of thanks for you. This solution is working like a charm on i3wm + picom compositor