Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rounded corners show strange aliasing (in Firefox, only on some tabs) #770

Closed
frebib opened this issue Jan 28, 2022 · 25 comments
Closed

Rounded corners show strange aliasing (in Firefox, only on some tabs) #770

frebib opened this issue Jan 28, 2022 · 25 comments

Comments

@frebib
Copy link

frebib commented Jan 28, 2022

Platform

Arch Linux, i3, picom-git from the AUR

GPU, drivers, and screen setup

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 (CFL GT2) (0x3e9b)
    Version: 21.3.4
    Accelerated: yes
    Video memory: 3072MB
    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 (CFL GT2)
OpenGL core profile version string: 4.6 (Core Profile) Mesa 21.3.4
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 21.3.4
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 21.3.4
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20

Environment

i3-gaps

picom version

vgit-3b9af

Diagnostics [ 28/01/22 10:33:04.075 get_cfg WARN ] Dual-kawase blur is not implemented by the legacy backends, you must use the `experimental-backends` option. [ 28/01/22 10:33:04.160 init_render WARN ] Old backends only support blur method "kernel". Your blur setting will not be applied **Version:** vgit-3b9af

Extensions:

  • Shape: Yes
  • XRandR: Yes
  • Present: Present

Misc:

  • Use Overlay: No
    (Another compositor is already running)
  • Config file used: /home/frebib/.config/picom/picom.conf

Drivers (inaccurate):

Intel

Backend: glx

  • Driver vendors:
  • GLX: Mesa Project and SGI
  • GL: Intel
  • GL renderer: Mesa Intel(R) UHD Graphics 630 (CFL GT2)
  • Accelerated: 1

Configuration:

https://gist.githubusercontent.com/frebib/bc9ea031e6cb982d0937e40e76b24f37/raw

Steps of reproduction

  1. Set corner-radius to some non-zero value
  2. Notice some tabs in Firefox (I didn't test other software extensively) show aliasing on the corners sometimes.

Expected behavior

  1. No aliasing

(Also the shadows don't conform to the corners, but that's another issue entirely.)

Current Behavior

image

@n-ovux

This comment was marked as off-topic.

@yshui
Copy link
Owner

yshui commented Feb 9, 2022

@frebib I am thinking this might be picom trying to draw a border around the corners.

Can you run xprop on the window?

@frebib
Copy link
Author

frebib commented Feb 9, 2022

It appears that the white pixels appear on the inside of the rounded portion, not outside if, if that helps.

$ xprop
_NET_WM_USER_TIME(CARDINAL) = 181397368
_NET_WM_OPAQUE_REGION(CARDINAL) = 0, 0, 1864, 990
GDK_TIMESTAMP_PROP(GDK_TIMESTAMP_PROP) = 0x61
_NET_WM_DESKTOP(CARDINAL) = 3
_NET_WM_STATE(ATOM) =
WM_STATE(WM_STATE):
		window state: Normal
		icon window: 0x0
_NET_WM_BYPASS_COMPOSITOR(CARDINAL) = 2
WM_HINTS(WM_HINTS):
		Client accepts input or input focus: True
		Initial state is Normal State.
		bitmap id # to use for icon: 0x6400030
		bitmap id # of mask for icon: 0x6400037
		window id # of group leader: 0x6400001
_GTK_THEME_VARIANT(UTF8_STRING) = "dark"
WM_WINDOW_ROLE(STRING) = "browser"
XdndAware(ATOM) = BITMAP
_NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_NORMAL
_NET_WM_SYNC_REQUEST_COUNTER(CARDINAL) = 104857646, 104857647
_NET_WM_USER_TIME_WINDOW(WINDOW): window id # 0x640002d
WM_CLIENT_LEADER(WINDOW): window id # 0x6400001
_NET_WM_PID(CARDINAL) = 555414
WM_LOCALE_NAME(STRING) = "en_GB.UTF-8"
WM_CLIENT_MACHINE(STRING) = "frebib-Cf"
WM_NORMAL_HINTS(WM_SIZE_HINTS):
		program specified minimum size: 450 by 120
		program specified maximum size: 16384 by 16384
		program specified base size: 450 by 120
		window gravity: NorthWest
WM_PROTOCOLS(ATOM): protocols  WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_SYNC_REQUEST
WM_CLASS(STRING) = "Navigator", "firefox"
WM_ICON_NAME(COMPOUND_TEXT) = "Inbox - Google Mail — Mozilla Firefox"
_NET_WM_ICON_NAME(UTF8_STRING) = "Inbox - Google Mail — Mozilla Firefox"
WM_NAME(COMPOUND_TEXT) = "Inbox - Google Mail — Mozilla Firefox"
_NET_WM_NAME(UTF8_STRING) = "Inbox - Google Mail — Mozilla Firefox"

@yshui
Copy link
Owner

yshui commented Feb 9, 2022

Can you run xwininfo as well? thanks.

@frebib
Copy link
Author

frebib commented Feb 9, 2022

xwininfo: Window id: 0x640002c "Inbox - Google Mail — Mozilla Firefox"

  Absolute upper-left X:  28
  Absolute upper-left Y:  1108
  Relative upper-left X:  0
  Relative upper-left Y:  0
  Width: 1864
  Height: 990
  Depth: 32
  Visual: 0x331
  Visual Class: TrueColor
  Border width: 0
  Class: InputOutput
  Colormap: 0x640002b (not installed)
  Bit Gravity State: NorthWestGravity
  Window Gravity State: NorthWestGravity
  Backing Store State: NotUseful
  Save Under State: no
  Map State: IsViewable
  Override Redirect State: no
  Corners:  +28+1108  -1948+1108  -1948-62  +28-62
  -geometry 1864x990+28-62

@yshui
Copy link
Owner

yshui commented Feb 9, 2022

Hmm it has nothing to do with border then. Does this happen on all corners or just the corner shown? Also are you using --experimental-backends?

@frebib
Copy link
Author

frebib commented Feb 9, 2022

Yep

# /home/frebib/.config/systemd/user/picom.service
[Unit]
Description=A lightweight compositor for X11
Requires=graphical-session.target
After=dbus.service graphical-session.target xorg.target

[Service]
ExecStart=/usr/bin/picom --experimental-backends --dbus
Restart=always
Slice=session.slice

[Install]
WantedBy=desktop.target

Config attached in the OP

It only really happens in Firefox and only on some tabs. Possibly those with a bright white page (gmail, gcal, bitbucket, but not github, google search (in dark mode))?

image
image

@frebib
Copy link
Author

frebib commented Feb 9, 2022

Actually I just noticed it in this terminal window, except it's the inverse of black not white:
image
It's more apparent when the window is unfocussed because it goes translucent, and the black pixels don't change transparency.

I wonder if this is some miscalculation in the anti-aliasing?

@yshui
Copy link
Owner

yshui commented Feb 9, 2022

Hmm, can you get a trace of picom with apitrace?

@yshui
Copy link
Owner

yshui commented Feb 9, 2022

I still think it has something to do with borders, maybe the border width calculation is wrong somehow.

@tryone144
Copy link
Collaborator

If this is a related to the rounded border, there is probably a problem in the way we get the border color (bottom left corner iirc). It seems to be affected by the website background color in firefox, as you mention.
Does this artifact appear on all four corners of the window?

@oncomouse
Copy link

I'm having this problem, too. Similar setup as OP (picom-git but awesome instead of i3).

I do see the artifact on all four corners.

I also noticed that the problem goes away if I turn off --experimental-backends.

@yshui
Copy link
Owner

yshui commented Feb 13, 2022

@oncomouse can you get a trace with apitrace?

@frebib
Copy link
Author

frebib commented Feb 13, 2022

https://gist.githubusercontent.com/frebib/9e53d98bb2144121eed183767f38bda3/raw
apitrace ^

When you say borders, do you mean borders from my window manager? I have i3 borders disabled entirely, if that helps.
@tryone144 Yeah it appears on all 4 corners of every window at closer inspection

@yshui
Copy link
Owner

yshui commented Feb 13, 2022

@frebib did you get this trace with apitrace trace picom?

@frebib
Copy link
Author

frebib commented Feb 13, 2022

apitrace trace /usr/bin/picom --experimental-backends
I kinda guessed. Should I do something else? Happy to do it again.
It also segfaulted when I ^C at the end, amusingly

@yshui
Copy link
Owner

yshui commented Feb 13, 2022

Can you upload the picom.trace file generated in the directory you ran the command?

@frebib
Copy link
Author

frebib commented Feb 13, 2022

picom.1.trace.gz
gzipped so github actually accepts it

@yshui
Copy link
Owner

yshui commented Feb 13, 2022

OK, I think I understand it now.

yshui added a commit that referenced this issue Feb 13, 2022
The outer pixels of the corner are drawn with antialiasing, but it color
used for antialiasing is wrong. The estimated border color is used when
there is actually no border.

Related: #770

Signed-off-by: Yuxuan Shui <[email protected]>
yshui added a commit that referenced this issue Feb 13, 2022
Previously postprocessing is omitted when estimating the color of the
border (e.g. dimming, opacity, inversion, etc.), causing the border to
be drawn with the wrong color.

Related: #770

Signed-off-by: Yuxuan Shui <[email protected]>
@yshui
Copy link
Owner

yshui commented Feb 13, 2022

Should've been fixed. Can you test?

@frebib
Copy link
Author

frebib commented Feb 13, 2022

Yeah, looks much better! Thanks

image

@frebib frebib closed this as completed Feb 13, 2022
yshui added a commit that referenced this issue Feb 13, 2022
Previously postprocessing is omitted when estimating the color of the
border (e.g. dimming, opacity, inversion, etc.), causing the border to
be drawn with the wrong color.

Related: #770

Signed-off-by: Yuxuan Shui <[email protected]>
yshui added a commit that referenced this issue Feb 13, 2022
The outer pixels of the corner are drawn with antialiasing, but it color
used for antialiasing is wrong. The estimated border color is used when
there is actually no border.

Related: #770

Signed-off-by: Yuxuan Shui <[email protected]>
@noctuid
Copy link

noctuid commented Feb 14, 2022

@frebib It still looks wrong in your screenshot though. I still see the same problem on all windows on the latest commit (only with --experimental-backends).

@yshui
Copy link
Owner

yshui commented Feb 14, 2022

@noctuid what looks wrong? if you are talking about the shadow doesn't adhere to the corner then it's a different problem.

@BachoSeven
Copy link

@noctuid what looks wrong? if you are talking about the shadow doesn't adhere to the corner then it's a different problem.

Is there an issue currently tracking that behaviour of the blur method not respecting the corners' radius?

@noctuid
Copy link

noctuid commented Feb 15, 2022

Yes, that's what I meant. I opened a separate issue to track it.

@BachoSeven See #775

F0xedb pushed a commit to ODEX-TOS/picom that referenced this issue Feb 20, 2022
The outer pixels of the corner are drawn with antialiasing, but it color
used for antialiasing is wrong. The estimated border color is used when
there is actually no border.

Related: yshui#770

Signed-off-by: Yuxuan Shui <[email protected]>
F0xedb pushed a commit to ODEX-TOS/picom that referenced this issue Feb 20, 2022
Previously postprocessing is omitted when estimating the color of the
border (e.g. dimming, opacity, inversion, etc.), causing the border to
be drawn with the wrong color.

Related: yshui#770

Signed-off-by: Yuxuan Shui <[email protected]>
0x526f6f74 added a commit to 0x526f6f74/picom that referenced this issue Dec 10, 2022
* Add build dependency Debian

* Use default `detect-client-leader` in sample conf

* Fixed ugly dark shadows in case of smaller window than shadow radius. (yshui#695)

* docs: explain the detect-client-leader option better

Signed-off-by: Yuxuan Shui <[email protected]>

* backend: add new image property: corner radius

Signed-off-by: Yuxuan Shui <[email protected]>

* backend: gl_common: handle corner radius property

Signed-off-by: Yuxuan Shui <[email protected]>

* options: don't disable rounded corner for new backends

Signed-off-by: Yuxuan Shui <[email protected]>

* backend: set corner radius property

Signed-off-by: Yuxuan Shui <[email protected]>

* backend: xrender: handle corner radius

Signed-off-by: Yuxuan Shui <[email protected]>

* backend: xrender: cache rounded rectangle mask

xcb_render_triangle is slow because (at least for Glamor) it's
rasterizing the triangles on CPU.

Signed-off-by: Yuxuan Shui <[email protected]>

* github: update git-clang-format-lint

Signed-off-by: Yuxuan Shui <[email protected]>

* Fix lack of timespec_get() on Android.

Some versions of the Android libc do not have timespec_get(), use
clock_gettime() instead on Android.

Signed-off-by: Rafael Kitover <[email protected]>

* allow dots (.) in condition targets

* backend: xrender: fix accidentally deleted refcount decrement

Thanks, @tryone144

Signed-off-by: Yuxuan Shui <[email protected]>

* backend: explicitly initialize corner_radius

Signed-off-by: Yuxuan Shui <[email protected]>

* backend: xrender: fix clone_image

We were using default_clone_image, but:

1) it's copying the wrong type, xrender_image has an extra member.
2) it doesn't clone the rounded corner cache properly, that has to be
   separately reference counted.

Reported-in: yshui#728
Signed-off-by: Yuxuan Shui <[email protected]>

* Fix segfaults on 32bit arch with --log-level=debug

There were a few improper uses of %ld for 64 bit numbers, as well as
some other 32 bit related warnings that I've fixed.

Signed-off-by: ktprograms <[email protected]>

* Use python3 for tests

The testcase python files were already compatible with python3, but the
shebang was wrongly set to just 'python'

* Fix all misspellings of _NET_WM_WINDOW_OPACITY.

* Fix 2 examples in manpage which had obsolete options.

* backend: add new property: BORDER_COLOR

Signed-off-by: Yuxuan Shui <[email protected]>

* backend: add new property: BORDER_WIDTH

Signed-off-by: Yuxuan Shui <[email protected]>

* backend: gl: trivial refactoring

* unifm -> uniform
* add macro for storing uniform locations

Signed-off-by: Yuxuan Shui <[email protected]>

* backend: gl: draw border for rounded windows

Signed-off-by: Yuxuan Shui <[email protected]>

* backend: gl: fix read_pixel

Signed-off-by: Yuxuan Shui <[email protected]>

* backend: remove the read_pixel interface.

Sample the border color in the shader instead.

Signed-off-by: Yuxuan Shui <[email protected]>

* Formally deprecated the sw-opti option

It was deprecated in v6, but wasn't formally deprecated back then (e.g.
no warnings were printed for it). So formally deprecate it here.

This also left the refresh-rate option unused, so that will be
deprecated too.

Signed-off-by: Yuxuan Shui <[email protected]>

* Remove the glx-use-gpushader4 options

Deprecated since v6.

Signed-off-by: Yuxuan Shui <[email protected]>

* Remove the vsync-aggressive flag

Deprecated since v6.

Signed-off-by: Yuxuan Shui <[email protected]>

* Remove the glx-swap-method option

Deprecated since v6.

Signed-off-by: Yuxuan Shui <[email protected]>

* Remove error messages for --dbe and --paint-on-overlay

Deprecated since v4.

Signed-off-by: Yuxuan Shui <[email protected]>

* Remove error message for --alpha-step

Deprecated since v5.

Signed-off-by: Yuxuan Shui <[email protected]>

* Remove error message for -d and -S

Deprecated since v5.

Signed-off-by: Yuxuan Shui <[email protected]>

* Remove error message for --no-name-pixmap

Deprecated since v5.

Signed-off-by: Yuxuan Shui <[email protected]>

* Remove error message for --xrender-sync

Deprecated in v5.

Signed-off-by: Yuxuan Shui <[email protected]>

* Deprecate the refresh-rate options

It's meaningless without the sw-opti option, which has been deprecated
since v6.

Signed-off-by: Yuxuan Shui <[email protected]>

* config_libconfig: reuse the deprecation message

Signed-off-by: Yuxuan Shui <[email protected]>

* Remove error message for no-dock-shadow and no-dnd-shadow

Deprecated since v4.

Signed-off-by: Yuxuan Shui <[email protected]>

* Formally deprecate --menu-opacity

It was deprecated in v4, but warning message wasn't printed for
specifying it on the command line.

Properly deprecate it now.

Signed-off-by: Yuxuan Shui <[email protected]>

* Report error for setting vsync to non-boolean values

This is deprecated since v5, but we forgot to change this to error in
v8.

Doing it now.

Signed-off-by: Yuxuan Shui <[email protected]>

* core: don't crash when binding root pixmap failed

Fixes yshui#767

Signed-off-by: Yuxuan Shui <[email protected]>

* dbus: fix win_get with "id"

The target name got changed to "base.id" by accident.

Signed-off-by: Yuxuan Shui <[email protected]>

* dbus: properly handle object path

Previously we reply to requests sent to _any_ object path, even though
we only declare /com/github/chjj/compton. This commit makes sure we only
reply to request sent to the right path.

Signed-off-by: Yuxuan Shui <[email protected]>

* tests: set dbus request to the right path

Signed-off-by: Yuxuan Shui <[email protected]>

* Update CONTRIBUTORS

Signed-off-by: Yuxuan Shui <[email protected]>

* Fix rounded corners on old pixmap for window animations

* Fix previous commit

* Fix code style

* dbus: expose windows as dbus objects

Signed-off-by: Yuxuan Shui <[email protected]>

* dbus: add some properties to window objects

Signed-off-by: Yuxuan Shui <[email protected]>

* dbus: add name property to windows

Signed-off-by: Yuxuan Shui <[email protected]>

* dbus: add mappepd property to windows

Signed-off-by: Yuxuan Shui <[email protected]>

* dbus: follow dbus naming conventions

Signed-off-by: Yuxuan Shui <[email protected]>

* config_libconfig: add dbus option

Signed-off-by: Yuxuan Shui <[email protected]>

* dbus: add Type property to window objects

Signed-off-by: Yuxuan Shui <[email protected]>

* dbus: add signal named according to dbus naming conventions

Some code generators don't work well with signal names not in
UpperCamelCase. (e.g. https://dbus.pages.freedesktop.org/zbus)

Signed-off-by: Yuxuan Shui <[email protected]>

* Bump version number

Closes yshui#776

Signed-off-by: Yuxuan Shui <[email protected]>

* backend: add new optional API: device_status

This is meant to be used to detect GPU resets.

Implemented in the glx backend using the GL_ARB_robustness extension.

Signed-off-by: Yuxuan Shui <[email protected]>

* backend: handle device reset

Signed-off-by: Yuxuan Shui <[email protected]>

* backend: don't trust device_status after a reset

Signed-off-by: Yuxuan Shui <[email protected]>

* backend: gl: don't fill window with big border_width

If a window's border_width is bigger than its corner_radius, the inner
radius of the border become less than 0, causing the entire window to be
filled.

Fixes yshui#778

Signed-off-by: Yuxuan Shui <[email protected]>

* backend: gl: fix corner being drawn with wrong color

The outer pixels of the corner are drawn with antialiasing, but it color
used for antialiasing is wrong. The estimated border color is used when
there is actually no border.

Related: yshui#770

Signed-off-by: Yuxuan Shui <[email protected]>

* backend: gl: apply postprocessing to border_color

Previously postprocessing is omitted when estimating the color of the
border (e.g. dimming, opacity, inversion, etc.), causing the border to
be drawn with the wrong color.

Related: yshui#770

Signed-off-by: Yuxuan Shui <[email protected]>

* ci: fix codeql tasks

Signed-off-by: Yuxuan Shui <[email protected]>

* Made meson/install.sh executable

Changed permissions of meson/install.sh from 644 to 755 to be able to run it via "./install.sh" without first executing "chmod +x install.sh".

* README: Move old historical info out of main README

The picom project is no longer a fledgling fork needing to justify its
existence. The README should present the user with relevant information
regarding the current project rather than apologies for a 6-year-old
fork of a longer-defunct prior project.

1. Rename README_orig.md to History.md, so it can contain other content
   of a historical nature.
2. Move still-relevant historical content from README to History.
3. Add a brief intro blurb to README saying that picom is an X
   compositor.
4. Mention Compton in the CONTRIBUTORS section.
5. Point to licensing information from README.

* Fix code style

* Fix window size animations with rounded borders

This is a slightly hacky solution in that it does not properly animate
the borders changing; however, what actually happens in the borders is
barely noticeable (especially with non snail-paced animation speeds), so
it seems to be fine.

Signed-off-by: Yuxuan Shui <[email protected]>
Signed-off-by: Rafael Kitover <[email protected]>
Signed-off-by: ktprograms <[email protected]>
Co-authored-by: Tom Dörr <[email protected]>
Co-authored-by: Johnny Pribyl <[email protected]>
Co-authored-by: Istvan Petres <[email protected]>
Co-authored-by: yshui <[email protected]>
Co-authored-by: Rafael Kitover <[email protected]>
Co-authored-by: Tuomas Kinnunen <[email protected]>
Co-authored-by: ktprograms <[email protected]>
Co-authored-by: Bert Gijsbers <[email protected]>
Co-authored-by: Daniel Csillag <[email protected]>
Co-authored-by: i-c-u-p <[email protected]>
Co-authored-by: Tim Siegel <[email protected]>
FT-Labs pushed a commit to FT-Labs/picom that referenced this issue Jan 23, 2023
The outer pixels of the corner are drawn with antialiasing, but it color
used for antialiasing is wrong. The estimated border color is used when
there is actually no border.

Related: yshui#770

Signed-off-by: Yuxuan Shui <[email protected]>
FT-Labs pushed a commit to FT-Labs/picom that referenced this issue Jan 23, 2023
Previously postprocessing is omitted when estimating the color of the
border (e.g. dimming, opacity, inversion, etc.), causing the border to
be drawn with the wrong color.

Related: yshui#770

Signed-off-by: Yuxuan Shui <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants