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

webgpu: Window Background Opacity not working on Hyprland in wayland mode #3589

Closed
Arjun31415 opened this issue Apr 22, 2023 · 12 comments
Closed
Labels
bug Something isn't working fixed-in-nightly This is (or is assumed to be) fixed in the nightly builds.

Comments

@Arjun31415
Copy link

What Operating System(s) are you seeing this problem on?

Linux Wayland

Which Wayland compositor or X11 Window manager(s) are you using?

Hyprland

WezTerm version

20230421-075330-e0a92c73

Did you try the latest nightly build to see if the issue is better (or worse!) than your current version?

Yes, and I updated the version box above to show the version of the nightly that I tried

Describe the bug

window_background_opacity config option does not seem to work on wayland

To Reproduce

launch wezterm with the command -
wezterm --config window_background_opacity=0

and then launch it under Xwayland with -
env -u WAYLAND_DISPLAY wezterm --config window_background_opacity=0

Configuration

Might not be relevant but here it is nonetheless -

local wezterm = require("wezterm")
return {
	window_frame = {
		-- The font used in the tab bar.
		-- Roboto Bold is the default; this font is bundled
		-- with wezterm.
		-- Whatever font is selected here, it will have the
		-- main font setting appended to it to pick up any
		-- fallback fonts you may have used there.
		font = wezterm.font({ family = "Roboto", weight = "Bold" }),

		-- The size of the font in the tab bar.
		-- Default to 10. on Windows but 12.0 on other systems
		font_size = 12.0,

		-- The overall background color of the tab bar when
		-- the window is focused
		active_titlebar_bg = "#333333",

		-- The overall background color of the tab bar when
		-- the window is not focused
		inactive_titlebar_bg = "#333333",
	},
	window_background_opacity = 0.4,
	font_size = 13,
	harfbuzz_features = { "cv12", "ss05", "cv06", "cv30", "ss03", "clig", "liga" },
	-- /home/arjun/.local/share/fonts/ttf/Fisa Code Book Regular.ttf, FontConfig
	font = wezterm.font("Fisa Code", {
		weight = "Regular",
		stretch = "Normal",
		style = "Normal",
	}),
	font_rules = {
		{
			italic = true,
			font = wezterm.font("Fisa Code", { weight = "Light", style = "Italic" }),
		},
	},
	term = "xterm-256color",
	default_cursor_style = "SteadyBar",
	window_padding = {
		left = 2,
		right = 2,
		top = 0,
		bottom = 0,
	},
	color_scheme = "tokyonight",
	automatically_reload_config = true,
	-- colors = require("TabBar"),
	adjust_window_size_when_changing_font_size = false,
	hide_tab_bar_if_only_one_tab = true,
    xcursor_theme="Catppuccin-Mocha-Maroon-Cursors"
}

Expected Behavior

As shown in the video, i expect the opacity being set in wayland, as it does under XWayland

Logs

wezterm version: 20230421-075330-e0a92c73 x86_64-unknown-linux-gnu
Window Environment: Wayland
WebGPU: name=AMD Radeon Graphics (RADV RENOIR), device_type=IntegratedGpu, backend=Vulkan, driver=radv, driver_info=Mesa 23.0.2, vendor=4098, device=5686
Enter lua statements or expressions and hit Enter.

Anything else?

With my config-

Kooha-2023-04-22-10-15-35.webm

Without any config-

Kooha-2023-04-22-10-36-02.webm
@Arjun31415 Arjun31415 added the bug Something isn't working label Apr 22, 2023
@wez
Copy link
Owner

wez commented Apr 22, 2023

Does it work if you use a different wayland compositor?

@wez wez added the waiting-on-op Waiting for more information from the original poster label Apr 22, 2023
@Arjun31415
Copy link
Author

does not work for me on sway also

@github-actions github-actions bot removed the waiting-on-op Waiting for more information from the original poster label Apr 22, 2023
@wez
Copy link
Owner

wez commented Apr 22, 2023

Can you try with front_end="OpenGL"?

@Arjun31415
Copy link
Author

wezterm --config window_background_opacity=0 --config front_end="OpenGL"
11:32:35.237  ERROR  wezterm_gui > common_init: set_config_overrides: apply_overrides_to: runtime error: [string "--config front_end=OpenGL"]:5: OpenGL evaluated as nil. Check for missing quotes or other syntax issues
stack traceback:
	[C]: in ?
	[C]: in function 'error'
	[string "--config front_end=OpenGL"]:5: in main chunk; terminating

@wez
Copy link
Owner

wez commented Apr 22, 2023

as the error suggests, you need to quote that properly when using the CLI: --config "front_end='OpenGL'"

@Arjun31415
Copy link
Author

sorry my bad. Yes it works now

@wez wez changed the title Window Background Opacity not working on Hyprland webgpu: Window Background Opacity not working on Hyprland in wayland mode Apr 22, 2023
@wez
Copy link
Owner

wez commented Apr 22, 2023

Can you run: vulkaninfo | grep -i COMPOS and share the output?

From looking through gfx-rs/wgpu#687 it sounds like different vulkan drivers don't always correctly report their capabilities.

On my linux system, which is also using radv, I see:

$ vulkaninfo | grep -i COMPOS
                supportedCompositeAlpha: count = 2
                        COMPOSITE_ALPHA_OPAQUE_BIT_KHR
                        COMPOSITE_ALPHA_INHERIT_BIT_KHR
                supportedCompositeAlpha: count = 2
                        COMPOSITE_ALPHA_OPAQUE_BIT_KHR
                        COMPOSITE_ALPHA_INHERIT_BIT_KHR

but for wgpu to enable support for transparency, we want to see VK_COMPOSITE_ALPHA_POST_MULTIPLIED_BIT_KHR in that output

@Arjun31415
Copy link
Author

vulkaninfo | grep -i COMPOS

		supportedCompositeAlpha: count = 2
			COMPOSITE_ALPHA_OPAQUE_BIT_KHR
			COMPOSITE_ALPHA_INHERIT_BIT_KHR
		supportedCompositeAlpha: count = 1
			COMPOSITE_ALPHA_OPAQUE_BIT_KHR
		supportedCompositeAlpha: count = 2
			COMPOSITE_ALPHA_OPAQUE_BIT_KHR
			COMPOSITE_ALPHA_INHERIT_BIT_KHR
		supportedCompositeAlpha: count = 2
			COMPOSITE_ALPHA_OPAQUE_BIT_KHR
			COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR
		supportedCompositeAlpha: count = 1
			COMPOSITE_ALPHA_INHERIT_BIT_KHR
		supportedCompositeAlpha: count = 2
			COMPOSITE_ALPHA_OPAQUE_BIT_KHR
			COMPOSITE_ALPHA_PRE_MULTIPLIED_BIT_KHR

@Arjun31415
Copy link
Author

If it is of any help, I have a optimus laptop, maybe webgpu is not supported on it

wez added a commit that referenced this issue Apr 23, 2023
We prefer post-multipled, but if the implementation doesn't
support that, pretend that we are pre-multiplied.

refs: #3589
@wez
Copy link
Owner

wez commented Apr 23, 2023

main now will also use pre-multipled mode if it is available.

It typically takes about an hour before commits are available as nightly builds for all platforms. Linux builds are the fastest to build and are often available within about 20 minutes. Windows and macOS builds take a bit longer.

Please take a few moments to try out the fix and let me know how that works out. You can find the nightly downloads for your system in the wezterm installation docs.

If you prefer to use packages provided by your distribution or package manager of choice and don't want to replace that with a nightly download, keep in mind that you can download portable packages (eg: a .dmg file on macOS, a .zip file on Windows and an .AppImage file on Linux) that can be run without permanently installing or replacing an existing package, and can then simply be deleted once you no longer need them.

If you are eager and can build from source then you may be able to try this out more quickly.

@wez wez added the fixed-in-nightly This is (or is assumed to be) fixed in the nightly builds. label Apr 23, 2023
@Arjun31415
Copy link
Author

Yup it is fixed for me. Thank you

@github-actions
Copy link
Contributor

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working fixed-in-nightly This is (or is assumed to be) fixed in the nightly builds.
Projects
None yet
Development

No branches or pull requests

2 participants