yshui / picom

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

`[... win_find_monitor DEBUG ] Window <...>, is not entirely on any monitor` is logged for every single window every frame regardless of position #1301

Closed awused closed 1 month ago

awused commented 1 month ago

Platform

Fedora 40 amd 64

GPU, drivers, and screen setup

Environment

i3 with gaps, so relatively few of these windows even touch the edge of a monitor and are mostly firmly inside one of them.

picom version

vgit-7094d

Diagnostics ``` [ 08/03/2024 10:17:27.429 c2_parse_target WARN ] Type specifier is deprecated. Type "c" specified on target "I3_FLOATING_WINDOW" will be ignored, you can remove it. [ 08/03/2024 10:17:27.429 c2_parse_target WARN ] Type specifier is deprecated. Type "a" specified on target "_NET_WM_STATE" will be ignored, you can remove it. [ 08/03/2024 10:17:27.429 c2_parse_target WARN ] Format specifier is deprecated. Format "32" specified on target "_NET_WM_STATE" will be ignored, you can remove it. [ 08/03/2024 10:17:27.429 c2_parse_target WARN ] Type specifier is deprecated. Type "a" specified on target "_NET_WM_STATE" will be ignored, you can remove it. [ 08/03/2024 10:17:27.429 c2_parse_target WARN ] Format specifier is deprecated. Format "32" specified on target "_NET_WM_STATE" will be ignored, you can remove it. [ 08/03/2024 10:17:27.429 c2_parse_target WARN ] Type specifier is deprecated. Type "c" specified on target "_GTK_FRAME_EXTENTS" will be ignored, you can remove it. [ 08/03/2024 10:17:27.429 c2_parse_target WARN ] Type specifier is deprecated. Type "c" specified on target "_GTK_FRAME_EXTENTS" will be ignored, you can remove it. [ 08/03/2024 10:17:27.429 c2_parse_target WARN ] Type specifier is deprecated. Type "a" specified on target "_NET_WM_STATE" will be ignored, you can remove it. [ 08/03/2024 10:17:27.429 c2_parse_target WARN ] Format specifier is deprecated. Format "32" specified on target "_NET_WM_STATE" will be ignored, you can remove it. **Version:** vgit-7094d ### Extensions: * Shape: Yes * RandR: Yes * Present: Present ### Misc: * Use Overlay: No * Config file specified: None * Config file used: /home/desuwa/.config/picom.conf ### Drivers (inaccurate): NVIDIA [ 08/03/2024 10:17:27.446 egl_init WARN ] The egl backend is still experimental, use with care. ### Backend: egl * Driver vendors: * EGL: NVIDIA * GL: NVIDIA Corporation * GL renderer: NVIDIA GeForce RTX 4090/PCIe/SSE2 ### Backend: glx * Driver vendors: * GLX: NVIDIA Corporation * GL: NVIDIA Corporation * GL renderer: NVIDIA GeForce RTX 4090/PCIe/SSE2 ```

Configuration:

Configuration file ``` backend = "glx"; vsync = true; shadow = true; #no-dock-shadow = true; #no-dnd-shadow = true; shadow-radius = 10; shadow-offset-x = -5; shadow-offset-y = 0; shadow-opacity = 0.8; shadow-red = 0.11; shadow-green = 0.12; shadow-blue = 0.13; shadow-exclude = [ "name = 'Notification'", "_GTK_FRAME_EXTENTS@:c", "class_g = 'i3-frame'", "_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'", "_NET_WM_STATE@:32a *= '_NET_WM_STATE_STICKY'", "!I3_FLOATING_WINDOW@:c" ]; shadow-ignore-shaped = true; #alpha-step = 0.06; blur-background = false; blur-background-fixed = true; blur-kern = "7x7box"; blur-background-exclude = [ "class_g = 'i3-frame'", "window_type = 'dock'", "window_type = 'desktop'", "_GTK_FRAME_EXTENTS@:c" ]; # Duplicating the _NET_WM_STATE entries because compton cannot deal with atom arrays :-/ opacity-rule = [ "0:_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'" ]; fading = false; fade-delta = 7; fade-in-step = 0.05; fade-out-step = 0.05; fade-exclude = []; mark-wmwin-focused = true; mark-ovredir-focused = true; use-ewmh-active-win = true; detect-rounded-corners = true; detect-client-opacity = true; # refresh-rate = 0; dbe = false; glx-no-stencil = true; glx-copy-from-front = false; use-damage = true; # sw-opti = false; unredir-if-possible = false; focus-exclude = []; detect-transient = true; detect-client-leader = true; invert-color-include = []; xrender-sync-fence = true; wintypes: { tooltip = { fade = true; shadow = false; opacity = 1.00; focus = true; }; }; use_realtime_scheduling = false; ```

Steps of reproduction

  1. Turn on debug logging

Expected behavior

[ 08/03/2024 10:11:47.728 win_find_monitor DEBUG ] Window <id> <title> <geometry> is not entirely on any monitor Should only log for windows that aren't entirely on any monitor

Current Behavior

[ 08/03/2024 10:11:47.728 win_find_monitor DEBUG ] Window <id> <title> <geometry> is not entirely on any monitor logs for every single window, even those floating in the center of a monitor not near any edge.

I haven't manually confirmed every single window I have open, but every single window I have gone to manually confirm was being logged.

Other details

Monitor geometries:

HDMI-0 connected 2560x1440+3200+0 (normal left inverted right x axis y axis) 610mm x 350mm DP-0 connected primary 3840x2160+2560+1440 (normal left inverted right x axis y axis) 700mm x 410mm DP-2 connected 2560x1440+6400+2160 (normal left inverted right x axis y axis) 609mm x 355mm DP-4 connected 2560x1440+0+2160 (normal left inverted right x axis y axis) 609mm x 355mm

[ 08/03/2024 10:11:47.728 win_find_monitor DEBUG ] Window 0x00c00002 (Dunst), 8460x2190+455x99, is not entirely on any monitor
[ 08/03/2024 10:11:47.728 win_find_monitor DEBUG ] Window 0x022000b2 (Firefox), -99x-99+1x1, is not entirely on any monitor
[ 08/03/2024 10:11:47.728 win_find_monitor DEBUG ] Window 0x00444257 (New Issue · yshui/picom — Mozilla Firefox), 2717x1573+3440x1830, is not entirely on any monitor
[ 08/03/2024 10:11:47.728 win_find_monitor DEBUG ] Window 0x004b5ab8 (foobar2000 v1.5.1), 3471x164+1859x989, is not entirely on any monitor
[ 08/03/2024 10:11:47.728 win_find_monitor DEBUG ] Window 0x00400091 (polybar-primary_DP-0), 2560x3570+3840x30, is not entirely on any monitor
[ 08/03/2024 10:11:47.728 win_find_monitor DEBUG ] Window 0x00400092 (polybar-primary_DP-4), 0x3570+2560x30, is not entirely on any monitor
[ 08/03/2024 10:11:47.728 win_find_monitor DEBUG ] Window 0x004feded (Alacritty), 1799x2519+746x339, is not entirely on any monitor
[ 08/03/2024 10:11:47.728 win_find_monitor DEBUG ] Window 0x0044493a (Alacritty), 1799x2175+746x330, is not entirely on any monitor
[ 08/03/2024 10:11:47.728 win_find_monitor DEBUG ] Window 0x004f60a9 (aw-fm), 15x2175+1770x1380, is not entirely on any monitor
[ 08/03/2024 10:11:47.728 win_find_monitor DEBUG ] Window 0x00400090 (polybar-primary_HDMI-0), 3200x1410+2560x30, is not entirely on any monitor
[ 08/03/2024 10:11:47.728 win_find_monitor DEBUG ] Window 0x0040029e (Alacritty), 4487x712+1258x683, is not entirely on any monitor
[ 08/03/2024 10:11:47.728 win_find_monitor DEBUG ] Window 0x00400be8 (Alacritty), 3215x1064+1258x331, is not entirely on any monitor
[ 08/03/2024 10:11:47.728 win_find_monitor DEBUG ] Window 0x00400198 (Alacritty), 3215x712+1258x338, is not entirely on any monitor
[ 08/03/2024 10:11:47.728 win_find_monitor DEBUG ] Window 0x0040017c (Alacritty), 3215x15+2530x683, is not entirely on any monitor
[ 08/03/2024 10:11:47.728 win_find_monitor DEBUG ] Window 0x0040008f (polybar-primary_DP-2), 6400x3570+2560x30, is not entirely on any monitor
[ 08/03/2024 10:11:47.728 win_find_monitor DEBUG ] Window 0x004f5955 (Alacritty), 7687x2872+1258x683, is not entirely on any monitor
[ 08/03/2024 10:11:47.728 win_find_monitor DEBUG ] Window 0x004aa8c9 (Alacritty), 7687x2175+1258x683, is not entirely on any monitor
[ 08/03/2024 10:11:47.728 win_find_monitor DEBUG ] Window 0x00420100 (Alacritty), 6415x2175+1258x1380, is not entirely on any monitor

Notably, here's the firefox window at the time [ 08/03/2024 10:11:47.728 win_find_monitor DEBUG ] Window 0x00444257 (New Issue · yshui/picom — Mozilla Firefox), 2717x1573+3440x1830, is not entirely on any monitor was logged. It's not even maximized or touching the edge of the monitor.

2024-08-03_10-22-35

awused commented 1 month ago

After updating to the newest git head the logs are now verbose instead of debug, but they're still wrong.

absolutelynothelix commented 1 month ago

i think i observed the same behavior a while ago. i guess this function should be called only when there is some motion, not each frame or how often it's called now.

awused commented 1 month ago

After adding some debug lines manually, the problem is that monitors->count is 0 in win_find_monitor. Obviously I have monitors attached, so there's something else wrong.

awused commented 1 month ago

x_update_monitors_async is only called to set ps->monitors when ps->o.crop_shadow_to_monitor is set, so these logs and checks will always fail when users haven't set that, making them useless. It seems like a bug that any code is using ps->monitors without checking ps->o.crop_shadow_to_monitor.

https://github.com/yshui/picom/blob/797e60f618755c6ba142a31e9dc494eb62409391/src/picom.c#L2353 https://github.com/yshui/picom/blob/797e60f618755c6ba142a31e9dc494eb62409391/src/event.c#L833

yshui commented 1 month ago

I don't see why this is a problem? monitor information is only used to crop shadow, so if you turn it off it is not needed.

yshui commented 1 month ago

Oh, this made me realise if someone uses monitor information for animations, they would also need to enable crop-shadow-to-monitor :thinking:

I should either document this, or enable this automatically if such animations exist.

awused commented 1 month ago

It's also spamming logs with nonsense and it's pretty clear the function can never return anything besides -1 without crop_shadow_to_monitor.

yshui commented 1 month ago

@awused verbose log level already prints a ton of logs, this doesn't really make any difference.

awused commented 1 month ago

It's not just that they're a lot of logs, it's that they're actually wrong logs. Though if the monitors will always be fetched then that shouldn't be a problem any more.