yshui / picom

A lightweight compositor for X11 with animation support
https://picom.app/
Other
4.1k stars 587 forks source link

Border around GTK-dialogs #1226

Closed parham-dev27 closed 5 months ago

parham-dev27 commented 6 months ago

Platform

OS: Arco WM: Qtile

GPU, drivers, and screen setup

GPU: Intel CometLake-S GT2 [UHD Graphics 630] Video-Driver: mesa 1:24.0.3-2 glxinfo -B:

name of display: :0
display: :0  screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
    Vendor: Intel (0x8086)
    Device: Mesa Intel(R) UHD Graphics 630 (CML GT2) (0x9bc8)
    Version: 24.0.3
    Accelerated: yes
    Video memory: 31912MB
    Unified memory: yes
    Preferred profile: core (0x1)
    Max core profile version: 4.6
    Max compat profile version: 4.6
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.2
OpenGL vendor string: Intel
OpenGL renderer string: Mesa Intel(R) UHD Graphics 630 (CML GT2)
OpenGL core profile version string: 4.6 (Core Profile) Mesa 24.0.3-arch1.2
OpenGL core profile shading language version string: 4.60
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

OpenGL version string: 4.6 (Compatibility Profile) Mesa 24.0.3-arch1.2
OpenGL shading language version string: 4.60
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile

OpenGL ES profile version string: OpenGL ES 3.2 Mesa 24.0.3-arch1.2
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20

picom version

vgit-89c2c

Diagnostics ``` **Version:** vgit-89c2c ### Extensions: * Shape: Yes * RandR: Yes * Present: Present ### Misc: * Use Overlay: No (Another compositor is already running) * Config file used: /home/parham/.config/picom.conf ### Drivers (inaccurate): modesetting ### Backend: glx * Driver vendors: * GLX: Mesa Project and SGI * GL: Intel * GL renderer: Mesa Intel(R) UHD Graphics 630 (CML GT2) * Accelerated: 1 ### Backend: egl * Driver vendors: * EGL: Mesa Project * EGL driver: iris * GL: Intel * GL renderer: Mesa Intel(R) UHD Graphics 630 (CML GT2) ```

Configuration:

Configuration file ``` shadow = true; shadow-radius = 7; shadow-offset-x = -7; shadow-offset-y = -7; shadow-exclude = [ "name = 'Notification'", "class_g ?= 'Notify-osd'", "name = 'Plank'", "name = 'Docky'", "name = 'Kupfer'", "name = 'xfce4-notifyd'", "name *= 'VLC'", "name *= 'compton'", "name *= 'Chromium'", "name *= 'Chrome'", "class_g = 'Firefox' && argb", "class_g = 'Conky'", "class_g = 'Kupfer'", "class_g = 'Synapse'", "class_g ?= 'Notify-osd'", "class_g ?= 'Cairo-dock'", "class_g = 'Cairo-clock'", "class_g ?= 'Xfce4-notifyd'", "class_g ?= 'Xfce4-power-manager'", "_GTK_FRAME_EXTENTS@:c", ]; fading = false fade-in-step = 0.03; fade-out-step = 0.03; inactive-opacity = 1; frame-opacity = 1; inactive-opacity-override = false; focus-exclude = [ "class_g = 'Cairo-clock'" ]; opacity-rule = [ "80:class_g = 'Alacritty'" ] blur-kern = "3x3box"; blur-background-exclude = [ "window_type = 'dock'", "window_type = 'desktop'", "_GTK_FRAME_EXTENTS@:c" ]; backend = "glx"; glx-copy-from-front = true; glx-swap-method = true; vsync = true mark-wmwin-focused = true; mark-ovredir-focused = true; detect-rounded-corners = true; detect-client-opacity = true; refresh-rate = 0 detect-transient = true detect-client-leader = true use-damage = true xrender-sync = true; xrender-sync-fence = true; log-level = "warn"; wintypes: { tooltip = { fade = true; shadow = true; opacity = 0.9; focus = true; full-shadow = false; }; dock = { shadow = false; } dnd = { shadow = false; } popup_menu = { opacity = 0.9; } dropdown_menu = { opacity = 0.9; } }; ```

Current Behavior

Most of GTK-Apps have this weird border around their dialogs. The issue is only visible when picom is running. ksnip_20240328-130547

trace

picom.trace

yshui commented 6 months ago

Can you upload a trace log (--log-level=trace) when this happens?

parham-dev27 commented 6 months ago

I have already. Sadly, you can't upload .trace files to GitHub. I used a File Sharing Service. https://www.file-upload.net/download-15289848/picom.trace.html

yshui commented 6 months ago

@parham-dev27 that's the opengl trace. can you run picom with --log-level=trace and upload the log file

parham-dev27 commented 6 months ago

picom.log

Monsterovich commented 6 months ago

Did you try "_GTK_FRAME_EXTENTS@:c" rule in shadow-exclude?

parham-dev27 commented 6 months ago

@Monsterovich Yes I already have "_GTK_FRAME_EXTENTS@:c" in my config-file

parham-dev27 commented 6 months ago

If I use another compositor, like xcompmgr the issue is solved. But then I get screen-tearing, so I have to use picom.

yshui commented 6 months ago

oh shoot, I forgot many useful log messages are only added recently and you don't have that yet. I wonder if you can build from latest git and upload trace log again?

MiguelLatorre commented 6 months ago

Same here with xrender (built with latest git commit a5e3de4489ce33726516809e172e9ae5e018334c)

Adding in shadow-exclude "_GTK_FRAME_EXTENTS@:c" in config file log emits the warning:

Type specifier is deprecated. Type "c" specified on target "_GTK_FRAME_EXTENTS" will be ignored, you can remove it.

With the line from the git config file example: in shadow-exclude "_GTK_FRAME_EXTENTS@" gives the same frame shadow issue.

picom.log

parham-dev27 commented 6 months ago

picom.log Built with latest git commit a5e3de

DarioDarko commented 6 months ago

i used to have that problem, too. IIRC i got rid of it with

dropdown_menu = { fade = true; shadow = false; focus = true; }; popup_menu = { fade = true; shadow = false; focus = true; };

in wintypes. disabling shadow seems to do the trick

cbirchinger commented 6 months ago

i used to have that problem, too. IIRC i got rid of it with

dropdown_menu = { fade = true; shadow = false; focus = true; }; popup_menu = { fade = true; shadow = false; focus = true; };

in wintypes. disabling shadow seems to do the trick

It doesn't fix it here. In fact it doesn't even go away with a global "shadow = false;"

image This screenshot was done with a global "shadow = false;"

parham-dev27 commented 6 months ago

The problem seems to go away if you use global shadow = false, but not when specifying in wintypes. I don't want to use the global shadow = false because I want shadows.

Maybe I have a syntax error in my config file. My wintypes look like this with the code that @DarioDarko suggested:

wintypes:
{
  dropdown_menu = { fade = true; shadow = false; focus = true; };
  popup_menu = { fade = true; shadow = false; focus = true; };
};

But it still doesn't work like intended.

difhel commented 5 months ago

Is it connected with #413 ?

I am experiencing this issue with Firefox and context (right-click) menus (which window type is "popout-menu").

image image

If I add _GTK_FRAME_EXTENTS@:c to blur-background-exclude, the blur dissapears not only from margins of the windows, but from the whole window frame. I want to have them blurred, but without annoying "margin".

image

I tried to set margin: 0 in gtk.css, but it seems to have no effect.

parham-dev27 commented 5 months ago

@difhel Yes this is mostly related to #413. Sadly, the margin doesn't go away for me, even if I add _GTK_FRAME_EXTENTS@:c to blur-background-exclude. This issue is only visible for context menus and not for whole apps like you said.

Celibistrial commented 5 months ago

When i add _GTK_FRAME_EXTENTS@:c to shadow exclude i get the error

❯ picom
[ 02/04/24 21:14:45.572 c2_parse_target ERROR ] Pattern "_GTK_FRAME_EXTENTS@" pos 19: Target type cannot be determined.

(i am using picom.conf.sample provided in this repo) NixOS

parham-dev27 commented 5 months ago

@Celibistrial take a look at my original config. I already have it there. Maybe its a Syntax error. But it still does not help with this issue

Celibistrial commented 5 months ago

Thanks your config works Can confirm the same issue Maybe the sample config should be updated?In sample config its "_GTK_FRAME_EXTENTS@" whereas (i think) its meant to be "_GTK_FRAME_EXTENTS@:c",

DarioDarko commented 5 months ago

i gotta correct myself:

i didnt have that issue for the right click menu, but i did have a weird frame around the application menu (im using librewolf, but should be the same for firefox)

that menu is another wintype, not dropdown_menu or popup_menu but utility

utility = { fade = true; shadow = false; focus = true; };

now the frame is gone!

parham-dev27 commented 5 months ago

It goes away for some apps, but not for all. Firefox doesn't have this weird frame anymore, but GTK apps are still like that.

Would you be so kind and share your full config file?

DarioDarko commented 5 months ago
shadow = true;
shadow-radius = 7;
shadow-offset-x = -7;
shadow-offset-y = -7;
shadow-opacity = 0.60;

fading = true;
fade-delta = 7.0;
fade-in-step = 0.03;
fade-out-step = 0.03;

corner-radius = 20;
blur-background = false;

vsync = true;
backend = "glx";
mark-wmwin-focused = false;
use-ewmh-active-win = true;
unredir-if-possible = true;
mark-ovredir-focused = true;
detect-rounded-corners = false;
detect-client-opacity = true;
use-damage = false;

active-opacity = 0.9;
inactive-opacity = 0.8;

opacity-rule = [
"100:class_g *= 'LibreWolf' && focused",
"100:class_g *= 'Element' && focused",
"100:class_g *= 'Gimp' && focused",
"100:class_g *= 'feh' && focused",
"90:class_g *= 'Rofi'",
"95:class_g *= 'Polybar'"
];

shadow-exclude = [
    "! name~=''",
    "name = 'Notification'",
    "class_g ?= 'Notify-osd'",
    "_GTK_FRAME_EXTENTS@:c",
    "_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'",
    "class_g = 'Dunst'"
];

rounded-corners-exclude = [
    "class_g = 'Tint2'",
    "class_g = 'Polybar'",
    "class_g = 'Rofi'",
    "class_g = 'copyq'"
];

wintypes:
{
    tooltip = { fade = true; shadow = false; focus = true; };
    dropdown_menu = { fade = true; shadow = false; focus = true; };
    popup_menu = { fade = true; shadow = false; focus = true; };
    utility = { fade = true; shadow = false; focus = true; };
    dock = { shadow = false; };
    dnd = { shadow = false; };
};
parham-dev27 commented 5 months ago

So, I did some digging on this problem. Big shoutout to @DarioDarko for their comment (source), which pointed me in the right direction: turning off shadows globally fixes the whole thing. We found out that certain window types like dropdown_menu, popup_menu, utility, dock, and dnd were causing the trouble.

But here's the kicker: After playing around with some X11 commands, I discovered that some apps also use _NET_WM_WINDOW_TYPE_MENU. So, to really squash this bug, you need to remove shadows for this window type too by adding menu = { shadow = false; } to wintypes

Output of xprop:

_VARIABLE_REFRESH(CARDINAL) = 1
_NET_WM_OPAQUE_REGION(CARDINAL) = 12, 19, 216, 3, 9, 22, 222, 220, 12, 242, 216, 3
WM_HINTS(WM_HINTS):
        Client accepts input or input focus: True
        Initial state is Normal State.
        window id # of group leader: 0x2a00002
_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_MENU
XdndAware(ATOM) = BITMAP
_NET_WM_SYNC_REQUEST_COUNTER(CARDINAL) = 44040225, 44040226
_NET_WM_USER_TIME(CARDINAL) = 1037464
_NET_WM_USER_TIME_WINDOW(WINDOW): window id # 0x2a00020
WM_CLIENT_LEADER(WINDOW): window id # 0x2a00002
_NET_WM_PID(CARDINAL) = 50096
WM_LOCALE_NAME(STRING) = "en_US.utf8"
WM_CLIENT_MACHINE(STRING) = "arco"
WM_NORMAL_HINTS(WM_SIZE_HINTS):
        program specified size: 1 by 1
WM_PROTOCOLS(ATOM): protocols  WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_SYNC_REQUEST
WM_CLASS(STRING) = "simple-scan", "simple-scan"
WM_ICON_NAME(STRING) = "simple-scan"
_NET_WM_ICON_NAME(UTF8_STRING) = "simple-scan"
WM_NAME(STRING) = "simple-scan"
_NET_WM_NAME(UTF8_STRING) = "simple-scan"

SOLUTION: Add menu = { shadow = false; } to wintypes