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

Linux 上的透明窗口(電子)

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

問題描述

在 Electron 中創(chuàng)建新的 BrowserWindow 時使用 transparent 參數(shù)并將其設(shè)置為 true 通常會為窗口提供透明背景...但據(jù)我所知,在 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

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

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');

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

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

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

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

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

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.

注意:請小心設(shè)置至少 500 毫秒,以便有機會正常工作.之后可以減少延遲但不穩(wěn)定.這就是為什么需要在 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.

厄運

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

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

相關(guān)文檔推薦

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(如何讓我的機器人提及發(fā)出該機器人命令的人)
How to fix Must use import to load ES Module discord.js(如何修復(fù)必須使用導(dǎo)入來加載 ES 模塊 discord.js)
How to list all members from a specific server?(如何列出來自特定服務(wù)器的所有成員?)
Discord bot: Fix ‘FFMPEG not found’(Discord bot:修復(fù)“找不到 FFMPEG)
Welcome message when joining discord Server using discord.js(使用 discord.js 加入 discord 服務(wù)器時的歡迎消息)
主站蜘蛛池模板: 国产福利资源在线 | 99久9| 国产色视频网站 | 亚洲午夜精品 | 亚洲高清网 | 国产视频一区在线 | 国产久 | 九九99靖品 | 成人在线视频一区二区三区 | 91精品久久久久久久久 | 亚洲成人精 | 日韩午夜电影在线观看 | 欧美日韩精品区 | 欧美精品一区二区三区在线播放 | 国产 欧美 日韩 一区 | 国产在线高清 | 日本一区二区三区在线观看 | 国产 欧美 日韩 一区 | 国产在线一级片 | 91视频播放 | 日韩二区三区 | 狠狠操狠狠干 | 国产欧美一区二区三区久久手机版 | 91私密视频 | 日韩久久精品电影 | 中文字幕一区二区三区不卡 | 国产精品黄色 | 久久夜视频 | 四虎影院一区二区 | 久久免费视频在线 | 一区二区三区国产视频 | 欧美在线视频一区二区 | 亚洲免费精品一区 | 爱爱视频在线观看 | 精品国产一区二区三区日日嗨 | 亚洲欧美一区二区三区视频 | 日韩精品一区二区三区视频播放 | 在线视频91| 国产精品99久久久久久宅男 | 日本精品在线观看 | 午夜丁香视频在线观看 |