How to make transparent window on linux
This is definitely something that you will want to offload to the GPU. I would not recommend directly using the X11 lib for performance reasons. Let OpenGL do it. I did find the following link for glXChooseVisual.
Also, here is another S.O. question that may be helpful.
Furthermore, this is for windows, but it should still apply.
Transparent Windows on Linux (Electron)
I have encounter the same problem as you and so I have written :
- this StackOverFlow question :
Can't succeed in making transparent window in Electron (javascript) - this Electron issue : https://github.com/electron/electron/issues/15947
- and finally request this feature : 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.
You can clone this git repo, put the delay to 500, and normally magic will appear.
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
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
.
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.
Doom
Simple way to make a transparent window in Vala & Gtk3?
You should not do this. Gtk+ is just not designed that way. You will have problems with different output backends. Your users will have problems with their user experience.
If you really want to, you have to translate one of the code examples in C, Python, etc. that you can find on the internet.
Here are two such examples:
How to make Gtk+ window background transparent?
http://www.kcjengr.com/programing/2017/11/02/transparent-gtk-window.html
It shouldn't be too hard to translate those into Vala. If you encounter problems, ask new questions about the concrete problems.
Transparent windows with Linux
You can take a look at the code of the X terminal emulators, KTerm for KDE or Gnome Terminal for gnome (depending of your target platform). I think these are the best examples of apps that implement transparency. I think that you can even find in that code solutions for getting transparency when compiz is not available.
Related Topics
How to Avoid Multiple Definition Linking Error
Getting Mangled Name from Demangled Name
Weird Behavior of Right Shift Operator (1 >> 32)
Singleton Instance Declared as Static Variable of Getinstance Method, Is It Thread-Safe
Difference Between *(Pointer + Index) and Pointer[]
Destroy and Then Construct New Object Using the Same Variable
Is It Smart to Replace Boost::Thread and Boost::Mutex with C++11 Equivalents
C++: Simple Return Value from Std::Thread
Borderless Window Using Areo Snap, Shadow, Minimize Animation, and Shake
/Usr/Lib64/Libstdc++.So.6: Version 'Glibcxx_3.4.15' Not Found
How to Catch the Null Pointer Exception
Is Adding to a "Char *" Pointer Ub, When It Doesn't Actually Point to a Char Array
Can a Recursive Function Be Inline
How to Find and Replace String