aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSeiji Zenitani2008-11-28 05:40:36 +0000
committerSeiji Zenitani2008-11-28 05:40:36 +0000
commit59bc82c0b9e6072f3e889efe74a126e0a9228302 (patch)
tree59d24958dd81dc53175fda2a319cc9b725deaad9 /src
parenta99dceba926c23b8b852772169da73ae6cb33254 (diff)
downloademacs-59bc82c0b9e6072f3e889efe74a126e0a9228302.tar.gz
emacs-59bc82c0b9e6072f3e889efe74a126e0a9228302.zip
* frame.c (x_set_alpha) [NS_IMPL_COCOA]: Call x_set_frame_alpha.
* nsfns.m (ns_frame_parm_handlers): Set alpha handler. * nsterm.m (x_set_frame_alpha): New function.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog8
-rw-r--r--src/frame.c2
-rw-r--r--src/nsfns.m2
-rw-r--r--src/nsterm.m44
4 files changed, 53 insertions, 3 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index c8c1c7636af..df1fcc6dacb 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,11 @@
12008-11-28 Seiji Zenitani <zenitani@mac.com>
2
3 * frame.c (x_set_alpha) [NS_IMPL_COCOA]: Call x_set_frame_alpha.
4
5 * nsfns.m (ns_frame_parm_handlers): Set alpha handler.
6
7 * nsterm.m (x_set_frame_alpha): New function.
8
12008-11-27 Eli Zaretskii <eliz@gnu.org> 92008-11-27 Eli Zaretskii <eliz@gnu.org>
2 10
3 * xfaces.c (Fx_font_family_list, syms_of_xfaces): Fix last change. 11 * xfaces.c (Fx_font_family_list, syms_of_xfaces): Fix last change.
diff --git a/src/frame.c b/src/frame.c
index 722cf2f96a9..611dd1e2f55 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -3678,7 +3678,7 @@ x_set_alpha (f, arg, oldval)
3678 for (i = 0; i < 2; i++) 3678 for (i = 0; i < 2; i++)
3679 f->alpha[i] = newval[i]; 3679 f->alpha[i] = newval[i];
3680 3680
3681#if defined (HAVE_X_WINDOWS) || defined (HAVE_NTGUI) 3681#if defined (HAVE_X_WINDOWS) || defined (HAVE_NTGUI) || defined (NS_IMPL_COCOA)
3682 BLOCK_INPUT; 3682 BLOCK_INPUT;
3683 x_set_frame_alpha (f); 3683 x_set_frame_alpha (f);
3684 UNBLOCK_INPUT; 3684 UNBLOCK_INPUT;
diff --git a/src/nsfns.m b/src/nsfns.m
index 2e2d6a77b75..df5c7e13daf 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -1040,7 +1040,7 @@ frame_parm_handler ns_frame_parm_handlers[] =
1040 0, /* x_set_wait_for_wm, will ignore */ 1040 0, /* x_set_wait_for_wm, will ignore */
1041 0, /* x_set_fullscreen will ignore */ 1041 0, /* x_set_fullscreen will ignore */
1042 x_set_font_backend, /* generic OK */ 1042 x_set_font_backend, /* generic OK */
1043 0 1043 x_set_alpha
1044}; 1044};
1045 1045
1046 1046
diff --git a/src/nsterm.m b/src/nsterm.m
index 83cc18184ba..fbb6e91612e 100644
--- a/src/nsterm.m
+++ b/src/nsterm.m
@@ -964,9 +964,15 @@ ns_frame_rehighlight (struct frame *frame)
964 dpyinfo->x_highlight_frame != old_highlight) 964 dpyinfo->x_highlight_frame != old_highlight)
965 { 965 {
966 if (old_highlight) 966 if (old_highlight)
967 {
967 x_update_cursor (old_highlight, 1); 968 x_update_cursor (old_highlight, 1);
969 x_set_frame_alpha (old_highlight);
970 }
968 if (dpyinfo->x_highlight_frame) 971 if (dpyinfo->x_highlight_frame)
972 {
969 x_update_cursor (dpyinfo->x_highlight_frame, 1); 973 x_update_cursor (dpyinfo->x_highlight_frame, 1);
974 x_set_frame_alpha (dpyinfo->x_highlight_frame);
975 }
970 } 976 }
971} 977}
972 978
@@ -1634,6 +1640,39 @@ ns_get_rgb_color (struct frame *f, float r, float g, float b, float a)
1634} 1640}
1635 1641
1636 1642
1643void
1644x_set_frame_alpha (struct frame *f)
1645/* --------------------------------------------------------------------------
1646 change the entire-frame transparency
1647 -------------------------------------------------------------------------- */
1648{
1649 struct ns_display_info *dpyinfo = FRAME_NS_DISPLAY_INFO (f);
1650 EmacsView *view = FRAME_NS_VIEW (f);
1651 double alpha = 1.0;
1652 double alpha_min = 1.0;
1653
1654 if (dpyinfo->x_highlight_frame == f)
1655 alpha = f->alpha[0];
1656 else
1657 alpha = f->alpha[1];
1658
1659 if (FLOATP (Vframe_alpha_lower_limit))
1660 alpha_min = XFLOAT_DATA (Vframe_alpha_lower_limit);
1661 else if (INTEGERP (Vframe_alpha_lower_limit))
1662 alpha_min = (XINT (Vframe_alpha_lower_limit)) / 100.0;
1663
1664 if (alpha < 0.0)
1665 return;
1666 else if (1.0 < alpha)
1667 alpha = 1.0;
1668 else if (0.0 <= alpha && alpha < alpha_min && alpha_min <= 1.0)
1669 alpha = alpha_min;
1670
1671#ifdef NS_IMPL_COCOA
1672 [[view window] setAlphaValue: alpha];
1673#endif
1674}
1675
1637 1676
1638/* ========================================================================== 1677/* ==========================================================================
1639 1678
@@ -5009,7 +5048,10 @@ if (NS_KEYLOG) NSLog (@"attributedSubstringFromRange request");
5009 /* FIXME: for some reason needed on second and subsequent clicks away 5048 /* FIXME: for some reason needed on second and subsequent clicks away
5010 from sole-frame Emacs to get hollow box to show */ 5049 from sole-frame Emacs to get hollow box to show */
5011 if (!windowClosing && [[self window] isVisible] == YES) 5050 if (!windowClosing && [[self window] isVisible] == YES)
5012 x_update_cursor (emacsframe, 1); 5051 {
5052 x_update_cursor (emacsframe, 1);
5053 x_set_frame_alpha (emacsframe);
5054 }
5013 5055
5014 if (emacs_event) 5056 if (emacs_event)
5015 { 5057 {