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

background: transparent doesn't work in fullscreen wayland #6145

Closed
dustdfg opened this issue Sep 14, 2024 · 8 comments
Closed

background: transparent doesn't work in fullscreen wayland #6145

dustdfg opened this issue Sep 14, 2024 · 8 comments
Labels
a:platform-linux issue specific to Linux, X11 or wayland (mO,bT) upstream Needs a fix upstream

Comments

@dustdfg
Copy link

dustdfg commented Sep 14, 2024

If I set background: transparent on a tiled window it works good but if I open it in a fullscreen mode, I get black background

OS: Debian testing. Sway (Wayland) 1.9
Lang: Rust

@dustdfg dustdfg changed the title background: transparent doesn't work in sway in fullscreen background: transparent doesn't work in sway in fullscreen Sep 14, 2024
@FloVanGH FloVanGH added the need triaging Issue that the owner of the area still need to triage label Sep 16, 2024
@ogoffart ogoffart added a:platform-linux issue specific to Linux, X11 or wayland (mO,bT) needs info Further information from the reporter is requested and removed need triaging Issue that the owner of the area still need to triage labels Sep 18, 2024
@ogoffart
Copy link
Member

I wonder if this is not a sway bug rather than a Slint issue.
My guess is that sway optimizes for fullscreen window and only render then one window. But I might be wrong and the bug may be in winit or in the renderer.
What renderer are you using? Did you try if the problem exist with all the renderer? (skia, femtovg, software).

What is your use case? Maybe you can get the same result with a maximized window?

@dustdfg
Copy link
Author

dustdfg commented Sep 18, 2024

  1. I think you are right about sway optimization for rendering only one window but I am not sure about it
  2. I've tried to start learning slint several times but something happened each time and I didn't have time for learning so I am able to only to open "basic" window and play with crate features...
  3. I've tried all three renderers and it didn't work. I hope that just disabling default features and enabling only one specific was correct way to test all three renderers
  4. My use case is custom wlogout which should open on top of all the apps and ideally ignore current open workspace too
  5. As I googled I think I need something like wlr-layershell which as I assume isn't implemented in winit

@dustdfg
Copy link
Author

dustdfg commented Sep 18, 2024

It seems that maximized doesn't have any effect...

@dustdfg
Copy link
Author

dustdfg commented Sep 18, 2024

And just in case if you say about popup window for my use case. As I understand popup windows doesn't fit because they are bound to my original window. Thought I don't know slint and can't be sure if it should be bound to a main window or not...
screen-1726682020

fn main() {
	let app = MainWindow::new().unwrap();
	app.window().set_maximized(true);
	app.run().unwrap();
}

slint::slint! {
	export component MainWindow inherits Window {
		background: transparent;
		no-frame: true;
		popup := PopupWindow {
			Rectangle { height:100%; width: 100%; background: yellow; }
			x: 0px; y: 0px; height: 500px; width: 100px;
		}
		TouchArea {
			height:100%; width: 100%;
			clicked => { popup.show(); }
		}
	}
}

@dustdfg
Copy link
Author

dustdfg commented Sep 18, 2024

And I also found two discussion which are about layer shell:

#3119
#1765

@The-Briel-Deal
Copy link

The-Briel-Deal commented Oct 14, 2024

One thing I can confirm is that this isn't specific to just winit or any rust crate.

Kitty does the same thing with transparency enabled.

Guessing this is just how sway works. iirc, I kind of remember this not being an issue in i3? So it might not be by design and it could just be a bug?

Pretty sure this doesn't happen in Hyprland also iirc.

So this might be worth making a bug on sway for.

@tronical
Copy link
Member

I think it might be possible to implement the layer shell protocol within the application, outside of winit and Slint.

@ogoffart
Copy link
Member

This is intentional in the compositors.
Fullscreen wayland windows can't be transparent.
https://gitlab.gnome.org/GNOME/mutter/-/issues/2520

@ogoffart ogoffart added upstream Needs a fix upstream and removed needs info Further information from the reporter is requested labels Oct 14, 2024
@ogoffart ogoffart changed the title background: transparent doesn't work in sway in fullscreen background: transparent doesn't work in fullscreen wayland Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:platform-linux issue specific to Linux, X11 or wayland (mO,bT) upstream Needs a fix upstream
Projects
None yet
Development

No branches or pull requests

5 participants