-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathlion-fullscreen.patch
51 lines (42 loc) · 1.46 KB
/
lion-fullscreen.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
diff --git a/lisp/term/ns-win.el b/lisp/term/ns-win.el
index b8baaa0..9d25ff3 100644
--- a/lisp/term/ns-win.el
+++ b/lisp/term/ns-win.el
@@ -940,6 +940,10 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.")
(add-to-list 'frame-creation-function-alist '(ns . x-create-frame-with-faces))
(add-to-list 'window-system-initialization-alist '(ns . ns-initialize-window-system))
+(declare-function ns-toggle-fullscreen-internal "nsfns.m" ())
+(defun ns-toggle-fullscreen ()
+ (interactive)
+ (ns-toggle-fullscreen-internal))
(provide 'ns-win)
diff --git a/src/nsfns.m b/src/nsfns.m
index fac61d2..9dbbc47 100644
--- a/src/nsfns.m
+++ b/src/nsfns.m
@@ -2580,6 +2580,21 @@ Value is t if tooltip was open, nil otherwise. */)
return Qt;
}
+DEFUN ("ns-toggle-fullscreen-internal", Fns_toggle_fullscreen_internal, Sns_toggle_fullscreen_internal,
+ 0, 0, 0,
+ doc: /* Toggle fulscreen mode */)
+()
+{
+ struct frame *f = SELECTED_FRAME();
+ EmacsWindow *window = ns_get_window(f);
+
+#if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
+ [window toggleFullScreen:nil];
+#endif
+
+ return Qnil;
+}
+
/* ==========================================================================
@@ -2736,5 +2751,7 @@ be used as the image of the icon representing the frame. */);
defsubr (&Sx_show_tip);
defsubr (&Sx_hide_tip);
+ defsubr (&Sns_toggle_fullscreen_internal);
+
as_status = 0;
as_script = Qnil;