Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
05fc2ef7
Commit
05fc2ef7
authored
Feb 20, 2007
by
Chong Yidong
Browse files
* frame.c (x_set_screen_gamma): Apply gamma value to the frame's bgcolor.
parent
864a4ae7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
6 deletions
+18
-6
src/frame.c
src/frame.c
+18
-6
No files found.
src/frame.c
View file @
05fc2ef7
...
...
@@ -3057,18 +3057,30 @@ x_set_screen_gamma (f, new_value, old_value)
struct
frame
*
f
;
Lisp_Object
new_value
,
old_value
;
{
Lisp_Object
bgcolor
;
if
(
NILP
(
new_value
))
f
->
gamma
=
0
;
else
if
(
NUMBERP
(
new_value
)
&&
XFLOATINT
(
new_value
)
>
0
)
{
Fclear_face_cache
(
Qnil
);
/* The value 0.4545 is the normal viewing gamma. */
f
->
gamma
=
1
.
0
/
(
0
.
4545
*
XFLOATINT
(
new_value
));
}
/* The value 0.4545 is the normal viewing gamma. */
f
->
gamma
=
1
.
0
/
(
0
.
4545
*
XFLOATINT
(
new_value
));
else
signal_error
(
"Invalid screen-gamma"
,
new_value
);
clear_face_cache
(
0
);
/* Apply the new gamma value to the frame background. */
bgcolor
=
Fassq
(
Qbackground_color
,
f
->
param_alist
);
if
(
CONSP
(
bgcolor
)
&&
(
bgcolor
=
XCDR
(
bgcolor
),
STRINGP
(
bgcolor
)))
{
Lisp_Object
index
=
Fget
(
Qbackground_color
,
Qx_frame_parameter
);
if
(
NATNUMP
(
index
)
&&
(
XFASTINT
(
index
)
<
sizeof
(
frame_parms
)
/
sizeof
(
frame_parms
[
0
]))
&&
rif
->
frame_parm_handlers
[
XFASTINT
(
index
)])
(
*
(
rif
->
frame_parm_handlers
[
XFASTINT
(
index
)]))
(
f
,
bgcolor
,
Qnil
);
}
Fclear_face_cache
(
Qnil
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment