Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transparent background support (Was: Exwm make GifCam and Licecap unusable) #24

Closed
tumashu opened this issue Aug 12, 2015 · 9 comments
Closed

Comments

@tumashu
Copy link
Contributor

tumashu commented Aug 12, 2015

I use wine run GifCam and LIcecap, but the emacs frame behind the app window make these app unusable,
is it possible create transparent emacs frame

@ch11ng
Copy link
Owner

ch11ng commented Aug 12, 2015

I've never used these applications. Could you please attach an image to illustrate why they cannot work here?

@tumashu
Copy link
Contributor Author

tumashu commented Aug 12, 2015

这两个程序功能类似,程序的窗口是透明的,这样,就可以看见窗口后面的东西,通过调整位置大小,将窗口后面的内容拍下来,exwm会在这个窗口后面放置一个emacs frame,直接遮挡了要记录的东西,如果emacs窗口也是透明的,那就没问题了。

@ch11ng
Copy link
Owner

ch11ng commented Aug 13, 2015

I see the problem. So some window (and probably a floating window) requires a transparent background to work, but the Emacs frame behind it acts as an extra opaque layer. Emacs do have an alpha frame parameter, but it seems not working here. I'll investigate this problem.

@ch11ng ch11ng changed the title Exwm make GifCam and Licecap unusable Transparent background support (Was: Exwm make GifCam and Licecap unusable) Aug 13, 2015
@ch11ng
Copy link
Owner

ch11ng commented Sep 7, 2015

You can partly solve this problem with xcompmgr or other compositing-only managers until we add compositing ability to EXWM. Please note that simply setting frame-parameter alpha will change the transparency of all frames (including workspace frames) and probably is not what you want.

@TLATER
Copy link

TLATER commented Sep 27, 2015

I'm toying with this to make non-exwm buffers slightly transparent to get a wallpaper, but since the workspaces overlap this doesn't work too well. Any ideas how I could go about this? I suppose setting inactive workspaces to 0% opacity would be an option, but I don't know where to start...

@ch11ng
Copy link
Owner

ch11ng commented Sep 27, 2015

I don't know if it's possible to assign different opacity to different workspaces, however it's possible to hide inactive workspaces completely with make-frame-invisible.

@TLATER
Copy link

TLATER commented Sep 27, 2015

Ok... make-frame-invisible isn't necessary, it's actually really easy to do in emacs.

The code I'm using is as follows:

(setq frame-alpha-lower-limit 0)
(set-frame-parameter (selected-frame) 'alpha '(80 0))
(add-to-list 'default-frame-alist '(alpha 80 0))

This will set active frames to 80% opacity and inactive frames to 0%. Funnily, I think this is a solution to the original question, since setting inactive frames to 0 hides the frames behind the X window... So replacing 80 by 100 should retain original behavior but fix the opacity issues (minus a little screen flickering).

A few new issues are added by this though. Whenever emacs starts managing an application the main frame seems to lose focus, which causes the window to go blank. Re-entering the workspace shows the window again, as a workaround.

Furthermore, all X windows seem to be bound to emacs' opacity. Which means that no composite managers can alter their opacity and that makes my original goal impossible. I've never directly worked with X, so I can't figure out why.

@ch11ng
Copy link
Owner

ch11ng commented Sep 28, 2015

We can't set the opacity based on whether an Emacs frame is active or not, for

  • if a workspace contains floating frames, there would be at most one active frame whereas all frames (including the workspace frame) should always be visually active,
  • and on multi-monitor settings, workspaces on other monitors would be inactive but they should also be visually active.

The problem isn't sophisticated though -- we can set the _NET_WM_WINDOW_OPACITY property on individual X windows. I do have some concerns however:

  • The _NET_WM_WINDOW_OPACITY property is not standard (although widely accepted) and I'm not able to find a documentation. To be specific:
    • I don't know if it behaves consistently among all compositing managers.
    • I don't know if the opacity of a parent X window affects its children's.
  • I have not decided whether to implement compositing in EXWM, but it's common for an X window manager acting as a compositing manager. It'd make some difference I believe.

@ch11ng
Copy link
Owner

ch11ng commented Aug 14, 2016

I've implemented a compositing manager in d8940d1, and this issue is resolved as a result. I'm closing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants