Comments (5)
I can still reproduce this behavior. Is there a workaround to create transparent windows?
from web-view.
This seems like https://github.com/zserge/webview issue. Have you reported it there? This is just binding library, meaning we wrap webview and cannot fix regressions directly here.
from web-view.
Thanks, I'll do it and link the issue to that one to keep track of it.
from web-view.
Bump. Issue seems to have come back. No transparency when running example code in this issue.
from web-view.
After pouring over the documentation across multiple apps and platforms using gtk and webkit2 I built a hack using the crates already used within web-view that provides transparency (at least for linux):
/// Update Gtk's Screen w/ Custom CSS to make Transparent
fn transparency_hack() {
use gdk_sys::gdk_screen_get_default;
use gtk_sys::*;
use std::ffi::CString;
// generate css-provider
let provider = unsafe { gtk_css_provider_new() };
// apply css to css-provider
let css = CString::new("* { background: transparent }").unwrap();
let clen = css.as_bytes().len();
let mut error = std::ptr::null_mut();
unsafe { gtk_css_provider_load_from_data(provider, css.as_ptr() as _, clen as _, &mut error) };
// retrieve screen and apply css- provider to screen
let prio = GTK_STYLE_PROVIDER_PRIORITY_APPLICATION;
let screen = unsafe { gdk_screen_get_default() };
unsafe { gtk_style_context_add_provider_for_screen(screen, provider as _, prio as _) };
}
Make sure to run this after building the web-view instance since gtk has to be initialized first before this can work.
Might be the wrong way to go about it but it works lol.
It might be years late, but if you wanted to know @gcstr here it is. :)
Edit: had to tweak the code a gazillion times to fix a few glib errors that were logging to stderr when they could be avoided. fixed how hopefully.
from web-view.
Related Issues (20)
- Is there a ready event?
- Is this browser ready?
- Is there a way to access the true file system path when using a "Browse" button on webview?
- [Solved] Compilation fails with Edge feature enabled HOT 1
- Hovering over an image for alt text causes `NSException` on macOS 12.1 w/ M1
- Is multitouch supported? HOT 1
- Android? iOS?
- Make a fork and cooperate to maintain this crate! HOT 1
- box-shadow wrongly displayed
- iframe support?
- Corrupted files
- Is there a way to open two webview windows without crashing? HOT 1
- external.invoke returns undefined instead of promise on Windows 10 HOT 1
- Rust Webview JavaScript interface
- how to create handler? HOT 1
- Impossible to embed a local .js file to the .html code - it is simply not loaded HOT 1
- Blank page when running on X11 (but Wayland is ok)
- macos webview_cocoa.c unknown error
- jupyter iframe support on mac computers
- Problem storing WebView instances globally HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from web-view.