久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

Linux 上的透明窗口(電子)

Transparent Windows on Linux (Electron)(Linux 上的透明窗口(電子))
本文介紹了Linux 上的透明窗口(電子)的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

在 Electron 中創建新的 BrowserWindow 時使用 transparent 參數并將其設置為 true 通常會為窗口提供透明背景...但據我所知,在 Linux 上并非如此

Using the transparent argument and setting it to true when creating a new BrowserWindow in Electron usually gives the window a transparent background... But on Linux that isn't the case for my knowledge

現在我聽說您可以設置一些命令行參數...但這不起作用...無論如何它只會顯示黑色或白色...

Now I heard you can set some Command Line Arguments... But that isn't working... It just displays black or white no matter what...

// Should set the commandLine arguments and work...

const {app} = require('electron')

app.commandLine.appendSwitch('enable-transparent-visuals');
app.commandLine.appendSwitch('disable-gpu');

現在我聽說這不是電子問題,而是硬件問題......但我只需要確保因此創建這個問題!

Now i have heard this is no problem with electron rather a problem with hardware... But i just needed to make sure therefore creating this question!

推薦答案

我遇到了和你一樣的問題,所以寫了:

I have encounter the same problem as you and so I have written :

  • 這個 StackOverFlow 問題:無法在 Electron (javascript) 中成功制作透明窗口
  • 這個 Electron 問題:https://github.com/electron/electron/issues/15947
  • 最后請求此功能:https://github.com/electron/electron/issues/16809

在實現所請求的功能之前,解決方案很簡單,只需在啟動窗口之前添加延遲即可.

Till the requested feature is implemented, the solution is simple just add a delay before launching the window.

你可以克隆 這個 git repo,把延遲放到500,一般會出現魔法.

You can clone this git repo, put the delay to 500, and normally magic will appear.

編輯 1:使用這個倉庫:https://gitlab.com/doom-fr/electron-transparency-demo

EDIT 1 : Use this repo : https://gitlab.com/doom-fr/electron-transparency-demo

git clone https://gitlab.com/doom-fr/electron-transparency-demo
cd electron-transparency-demo
npm install
npm start
# or npm run startWithTransparentOption
# or npm run startWithAllOptions

對我來說,它適用于 Debian Jessie 和 electron 4.0.5,適用于 npm startnpm run startWithTransparentOption 但不適用于 npm runstartWithAllOptions.

For me, it works out of the box with Debian Jessie and electron 4.0.5, for npm start, npm run startWithTransparentOption but not with npm run startWithAllOptions.

注意:請小心設置至少 500 毫秒,以便有機會正常工作.之后可以減少延遲但不穩定.這就是為什么需要在 transparentReady 上的事件.

NB : be carefull to set at least 500ms to have chance it works. After you can reduce the delay but it is not stable. It is why an event on transparentReady is needed.

厄運

這篇關于Linux 上的透明窗口(電子)的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

discord.js v12: How do I await for messages in a DM channel?(discord.js v12:我如何等待 DM 頻道中的消息?)
how to make my bot mention the person who gave that bot command(如何讓我的機器人提及發出該機器人命令的人)
How to fix Must use import to load ES Module discord.js(如何修復必須使用導入來加載 ES 模塊 discord.js)
How to list all members from a specific server?(如何列出來自特定服務器的所有成員?)
Discord bot: Fix ‘FFMPEG not found’(Discord bot:修復“找不到 FFMPEG)
Welcome message when joining discord Server using discord.js(使用 discord.js 加入 discord 服務器時的歡迎消息)
主站蜘蛛池模板: 欧美日韩在线一区 | аⅴ资源新版在线天堂 | 黄色成人免费网站 | 国产福利91精品一区二区三区 | 中文字幕在线观看日本 | 欧美狠狠操 | 五月婷婷网 | 久久99视频 | 一区二区三区在线免费 | www.国产.com| 久久久午夜 | 91精品国产综合久久久蜜臀 | 五月亚洲 | 日韩免费高清视频 | 日韩精品久久久久久久 | 精品国产三级 | 欧美日韩一区二区在线 | 欧美日韩精品一区二区 | 亚洲午夜视频在线观看 | 又色又爽又黄gif动态图 | 99超碰在线观看 | 免费亚洲婷婷 | 成人综合婷婷国产精品久久 | 久久久久伊人 | 日本www色 | 日韩精品国产精品 | 日韩欧美中文在线 | 免费色视频 | 久久久精品一区 | 欧美网站在线观看 | 欧美日韩亚洲另类 | 国产视频成人 | 色婷婷狠狠 | 最新中文字幕av | 日韩不卡av| 国产不卡视频 | 深夜福利久久 | 日本久久久久久久久 | www.一区二区三区 | 在线观看亚洲一区 | 日产精品久久久一区二区 |