Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
5996e1b7
Commit
5996e1b7
authored
May 06, 2009
by
Stefan Monnier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(ns_get_screen): Rewrite.
Don't presume selected-frame is of type `ns'.
parent
ba98e3a0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
38 deletions
+27
-38
src/ChangeLog
src/ChangeLog
+3
-0
src/nsfns.m
src/nsfns.m
+24
-38
No files found.
src/ChangeLog
View file @
5996e1b7
2009-05-06 Stefan Monnier <monnier@iro.umontreal.ca>
* nsfns.m (ns_get_screen): Rewrite.
Don't presume selected-frame is of type `ns'.
* font.c (font_update_drivers): Sanity fallback to avoid disabling
all drivers.
...
...
src/nsfns.m
View file @
5996e1b7
...
...
@@ -203,46 +203,32 @@ Updated by Christian Limpach (chris@nice.ch)
static
NSScreen
*
ns_get_screen
(
Lisp_Object
anythingUnderTheSun
)
{
id
window
=
nil
;
NSScreen
*
screen
=
0
;
struct
terminal
*
terminal
;
struct
ns_display_info
*
dpyinfo
;
struct
frame
*
f
=
NULL
;
Lisp_Object
frame
;
if
(
INTEGERP
(
anythingUnderTheSun
))
{
/* we got a terminal */
terminal
=
get_terminal
(
anythingUnderTheSun
,
1
);
dpyinfo
=
terminal
->
display_info
.
ns
;
f
=
dpyinfo
->
x_focus_frame
;
if
(
!
f
)
f
=
dpyinfo
->
x_highlight_frame
;
}
else
if
(
FRAMEP
(
anythingUnderTheSun
)
&&
FRAME_NS_P
(
XFRAME
(
anythingUnderTheSun
)))
{
/* we got a frame */
f
=
XFRAME
(
anythingUnderTheSun
);
}
else
if
(
STRINGP
(
anythingUnderTheSun
))
{
/* FIXME/cl for multi-display */
}
if
(
!
f
)
f
=
SELECTED_FRAME
();
if
(
f
)
ns_get_screen
(
Lisp_Object
screen
)
{
struct
terminal
*
terminal
=
get_terminal
(
screen
,
1
);
if
(
terminal
->
type
!=
output_ns
)
// Not sure if this special case for nil is needed. It does seem to be
// important in xfns.c for the make-frame call in frame-initialize,
// so let's keep it here for now.
return
(
NILP
(
screen
)
?
[
NSScreen
mainScreen
]
:
NULL
);
else
{
XSETFRAME
(
frame
,
f
);
window
=
ns_get_window
(
frame
);
struct
ns_display_info
*
dpyinfo
=
terminal
->
display_info
.
ns
;
struct
frame
*
f
=
dpyinfo
->
x_focus_frame
;
if
(
!
f
)
f
=
dpyinfo
->
x_highlight_frame
;
if
(
!
f
)
return
NULL
;
else
{
id
window
=
nil
;
Lisp_Object
frame
;
eassert
(
FRAME_NS_P
(
f
));
XSETFRAME
(
frame
,
f
);
window
=
ns_get_window
(
frame
);
return
window
?
[
window
screen
]
:
NULL
;
}
}
if
(
window
)
screen
=
[
window
screen
];
if
(
!
screen
)
screen
=
[
NSScreen
mainScreen
];
return
screen
;
}
...
...
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