chjj / compton

A compositor for X11.
Other
2.25k stars 500 forks source link

Severe graphical bugs when using `unredir-if-possible` in combination with maximized, always-on-top windows #138

Open Feltzer opened 11 years ago

Feltzer commented 11 years ago

Description

This only applies when unredir-if-possible is active: When starting a fullscreen application that is set to be "always on top" the screen will start to flicker and prevent you from minimizing the application again. As a result the system becomes unusable until compton is terminated.

Steps to reproduce (under LXDE/Openbox)

  1. Start compton with unredir-if-possible set to true
  2. If you are running a dual-head configuration make sure to disable one screen so that the unredirection triggers correctly
  3. Set the window layer of a select application (e.g. Chrome) to be always on top by right clicking on the title bar and selecting Layer → Always on top
  4. Make sure that other normal-layered windows are open as well
  5. Activate the fullscreen mode of the application
  6. Try to deactivate fullscreen mode again with your mouse. Flickering and other graphical glitches should occur

    Additional information

Using latest compton dev release as of 08/27/2013.

$ apt-cache policy fglrx
fglrx:
  Installed: 2:9.012-0ubuntu1
  Candidate: 2:9.012-0ubuntu1

$ apt-cache policy xserver-xorg-lts-raring
xserver-xorg-lts-raring:
  Installed: 1:7.7+1ubuntu4~precise1
  Candidate: 1:7.7+1ubuntu4~precise1

$ apt-cache policy openbox
openbox:
  Installed: 3.5.0-7~precise
  Candidate: 3.5.0-7~precise

$ lsb_release -rd
Description:    Ubuntu 12.04.3 LTS
Release:    12.04

$ uname -a
Linux Feltz 3.8.0-29-generic #42~precise1-Ubuntu SMP Wed Aug 14 16:19:23 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
richardgv commented 11 years ago

Thanks for the detailed bug report, firstly. :-)

Unfortunately, the problem is not reproducible here (GTX 650, x11-drivers/nvidia-drivers-325.15, openbox-3.5.2-r1, compton-git-v0.1_beta1-4-g5d4ed8f-2013-08-26). I tried both backends, with --paint-on-overlay and without, with my configuration or no configuration, with firefox-23.0 or google-chrome-30.0.1599.14_beta1.

--unredir-if-possibletypically will cause short flickering when switching, but never long ones. There are two possiblities I could think of now:

  1. Constant flickering may indicate compton is trying to switch back and forth between redirected/unredirected state -- for example, a popup window over a full-screen window will cause compton redirect the screen, and when the window gets unmapped compton will unredirect the screen. Compile compton with CPPFLAGS='-DDEBUG_REDIR' and it will print something in stdout when it (un)redirects the screen. If that is the case, you may find out the offending application (using, e.g. xwininfo, --paint-exclude, or -DDEBUG_EVENTS) and kill it, or we could add some sort of delay here before unredirecting the screen (probably doesn't cure the issue. only to make it less annoying).
  2. Probably your driver isn't playing well with it. You may wish to play with all those options I mentioned above, change settings in xorg.org (especially those related to "OpenGLOverlay" or something, or test with other compositors with similar functionality (e.g. Compiz).

By the way, in some applications F11 could be used to switch full-screen mode.

Feltzer commented 11 years ago

I believe I am accidentally copied on all these emails?

Best

Roderick

On Aug 27, 2013, at 1:55 PM, Richard Grenville notifications@github.com wrote:

Thanks for the detailed bug report, firstly. :-)

Unfortunately, the problem is not reproducible here (GTX 650, x11-drivers/nvidia-drivers-325.15, openbox-3.5.2-r1, compton-git-v0.1_beta1-4-g5d4ed8f-2013-08-26). I tried both backends, with --paint-on-overlay and without, with my configuration or no configuration, with firefox-23.0 or google-chrome-30.0.1599.14_beta1.

--unredir-if-possibletypically will cause short flickering when switching, but never long ones. There are two possiblities I could think of now:

Constant flickering may indicate compton is trying to switch back and forth between redirected/unredirected state -- for example, a popup window over a full-screen window will cause compton redirect the screen, and when the window gets unmapped compton will unredirect the screen. Compile compton with CPPFLAGS='-DDEBUG_REDIR' and it will print something in stdout when it (un)redirects the screen. If that is the case, you may find out the offending application (using, e.g. xwininfo, --paint-exclude, or -DDEBUG_EVENTS) and kill it, or we could add some sort of delay here before unredirecting the screen (probably doesn't cure the issue. only to make it less annoying).

Probably your driver isn't playing well with it. You may wish to play with all those options I mentioned above, change settings in xorg.org (especially those related to "OpenGLOverlay" or something, or test with other compositors with similar functionality (e.g. Compiz).

By the way, in some applications F11 could be used to switch full-screen mode.

— Reply to this email directly or view it on GitHub.

Feltzer commented 11 years ago

Sorry for all the confusion. I think I mistyped my email address and all the notifications were sent to Roderick above out of accident. I changed the address now to the correct one and hopefully everything will work fine.

I am sorry to hear that you can't reproduce the bug. Maybe there's more to it than unredir-if-possible. Here is my current configuration, just in case the bug might arise from the interplay with other options:

    # General and Performance related settings
    backend = "glx"; # glx or xrender
    paint-on-overlay = false; # causes issues with screenshots/screencasts
    glx-no-stencil = true;
    glx-no-rebind-pixmap = false; # makes dropdown menus bugged
    vsync = "opengl-swc"; # e.g. opengl-swc
    unredir-if-possible = true;
    #glx-swap-method = "copy"; # unusable, causes severe flickering
    glx-use-copysubbuffermesa = false; # causes severe issues with scrot
    sw-opti = false;
    detect-transient = true;
    detect-client-leader = true;
    shadow-ignore-shaped = true;

    # Shadows
    shadow = true;
    xinerama-shadow-crop = true;
    clear-shadow = true;
    no-dnd-shadow = true;
    no-dock-shadow = true;
    shadow-radius = 20;
    shadow-offset-x = -30;
    shadow-offset-y = -15;
    shadow-opacity = 0.7;

    # Fading
    fade-delta = 5;

    # Workarounds for apps that don't behave well under compton
    shadow-exclude = [ 
            "class_g ?= 'Notify-osd'",
            "class_g ?= 'gksudo'",
            "class_g ?= 'plank'",
            "class_g ?= 'scrot'",
            "class_g ?= 'Synapse'",
            "class_g ?= 'tilda'",
            "class_g = 'Google-chrome' && window_type = 'normal' && override_redirect && argb"
    ];

    # Window type settings
    wintypes:
    {
      tooltip = { fade = true; shadow = false; opacity = 0.8; focus = true; };
      # fade: Fade the particular type of windows.
      # shadow: Give those windows shadow
      # opacity: Default opacity for the type of windows.
      # focus: Whether to always consider windows of this type focused.
      # menu = { fade = true; shadow = true; opacity = 0.8; focus = true; };
      dropdown_menu = { fade = false; shadow = true; opacity = 1; focus = true; };
      popup_menu = { fade = false; shadow = true; opacity = 1; focus = true; };
      # combo = { fade = true; shadow = false; opacity = 0.8; focus = true; };
    };

I am currently busy with studywork but I'll make sure to do some of the debugging you suggested later on.

Feltzer commented 11 years ago

Okay, this is strange. I can't reproduce this bug anymore, either. I'll keep on trying and get back to you.

Feltzer commented 11 years ago

After three days of using compton extensively this hasn't reoccurred even once. I don't what triggered the bug in the first place but I wasn't able to reproduce it. I would advise closing this issue.

richardgv commented 11 years ago

Thanks for continuously tracking the issue. :-) Maybe we could leave it open for a few days, in case somebody else saw similar issues.

richardgv commented 11 years ago

4acbd56 on richardgv-dev branch brings --unredir-if-possible-exclude, --unredir-if-possible-delay. May act as temporary fix when the issue occurs.