diff options
author | HÃ¥kon Flatval <hkon20@hotmail.com> | 2022-01-29 16:13:06 +0100 |
---|---|---|
committer | Po Lu <luangruo@yahoo.com> | 2022-01-30 08:38:32 +0800 |
commit | b944841173f12134e4c68d269d5b82b1820b2a40 (patch) | |
tree | 2b6e67f274027b2e608bf1624a92cc80159b8be7 /src/frame.c | |
parent | 35cd9197fc3bda7576b3c343d1183360067dccd2 (diff) | |
download | emacs-b944841173f12134e4c68d269d5b82b1820b2a40.tar.gz |
Add background transparency support for GTK+Cairo
Diffstat (limited to 'src/frame.c')
-rw-r--r-- | src/frame.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/frame.c b/src/frame.c index 8aaff949ba2..c331cff32b4 100644 --- a/src/frame.c +++ b/src/frame.c @@ -3907,6 +3907,7 @@ static const struct frame_parm_table frame_parms[] = {"z-group", SYMBOL_INDEX (Qz_group)}, {"override-redirect", SYMBOL_INDEX (Qoverride_redirect)}, {"no-special-glyphs", SYMBOL_INDEX (Qno_special_glyphs)}, + {"alpha-background", SYMBOL_INDEX (Qalpha_background)}, #ifdef NS_IMPL_COCOA {"ns-appearance", SYMBOL_INDEX (Qns_appearance)}, {"ns-transparent-titlebar", SYMBOL_INDEX (Qns_transparent_titlebar)}, @@ -5024,6 +5025,33 @@ gui_set_alpha (struct frame *f, Lisp_Object arg, Lisp_Object oldval) } } +void +gui_set_alpha_background (struct frame *f, Lisp_Object arg, Lisp_Object oldval) +{ + double alpha = 1.0; + + if (NILP (arg)) + alpha = 1.0; + else if (FLOATP (arg)) + { + alpha = XFLOAT_DATA (arg); + if (! (0 <= alpha && alpha <= 1.0)) + args_out_of_range (make_float (0.0), make_float (1.0)); + } + else if (FIXNUMP (arg)) + { + EMACS_INT ialpha = XFIXNUM (arg); + if (! (0 <= ialpha && ialpha <= 100)) + args_out_of_range (make_fixnum (0), make_fixnum (100)); + alpha = ialpha / 100.0; + } + else + wrong_type_argument (Qnumberp, arg); + + f->alpha_background = alpha; + + SET_FRAME_GARBAGED (f); +} /** * gui_set_no_special_glyphs: @@ -6100,6 +6128,7 @@ syms_of_frame (void) #endif DEFSYM (Qalpha, "alpha"); + DEFSYM (Qalpha_background, "alpha-background"); DEFSYM (Qauto_lower, "auto-lower"); DEFSYM (Qauto_raise, "auto-raise"); DEFSYM (Qborder_color, "border-color"); |