久久久久久久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ù)器時的歡迎消息)
主站蜘蛛池模板: 精品视频一区在线 | 午夜小视频免费观看 | 人人九九精 | 亚洲美乳中文字幕 | av一区二区三区四区 | 久久精品综合 | 久久久久电影 | 艹逼网 | 在线成人av | 欧美一区二区免费 | 国产午夜精品久久久 | 日本免费视频在线观看 | 国产精品久久久久久久久久久久午夜片 | 亚洲成人精选 | 久久精品亚洲精品国产欧美 | 日韩中文字幕在线播放 | 久久久国产一区二区三区 | 99国产精品视频免费观看一公开 | 久久久久久久久国产 | 国产精久久久久久 | 97人人干| 日韩毛片免费视频 | 国产一区二区在线播放 | 成人av一区| 91免费小视频 | 中文字幕日韩一区 | 久久久久久国产精品免费免费 | 久久精品网 | 天天干狠狠操 | 国产视频观看 | 欧美在线高清 | 亚洲高清三级 | 三级在线免费 | 亚洲 自拍 另类 欧美 丝袜 | 一区二区福利视频 | 成人日韩av | 九九热这里| 99爱视频| 亚洲精品久久久久中文字幕二区 | 国内精品久久精品 | 成人国产在线观看 |