mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-02-16 17:24:23 +00:00
Implement "window cascading" on NS
* src/nsfns.m (Fx_create_frame): Cascade new frame position if size hint flags are not USPosition or PPosition.
This commit is contained in:
parent
db2cb522e1
commit
e09bbfc37d
1 changed files with 21 additions and 1 deletions
22
src/nsfns.m
22
src/nsfns.m
|
|
@ -1112,6 +1112,7 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side.
|
|||
Lisp_Object parent, parent_frame;
|
||||
struct kboard *kb;
|
||||
static int desc_ctr = 1;
|
||||
NSWindow *main_window = [NSApp mainWindow];
|
||||
|
||||
/* gui_display_get_arg modifies parms. */
|
||||
parms = Fcopy_alist (parms);
|
||||
|
|
@ -1483,8 +1484,27 @@ Turn the input menu (an NSMenu) into a lisp list for tracking on lisp side.
|
|||
if (CONSP (XCAR (tem)) && !NILP (XCAR (XCAR (tem))))
|
||||
fset_param_alist (f, Fcons (XCAR (tem), f->param_alist));
|
||||
|
||||
if (window_prompting & USPosition)
|
||||
/* This cascading behavior (which is the job of the window manager
|
||||
on X-based systems) is something NS applications are expected to
|
||||
implement themselves. At least one person tells me he used
|
||||
Carbon Emacs solely for this behavior. */
|
||||
if (window_prompting & (USPosition | PPosition) || FRAME_PARENT_FRAME (f))
|
||||
ns_set_offset (f, f->left_pos, f->top_pos, 1);
|
||||
else
|
||||
{
|
||||
NSWindow *frame_window = [FRAME_NS_VIEW (f) window];
|
||||
NSPoint top_left;
|
||||
|
||||
if (main_window)
|
||||
{
|
||||
top_left = NSMakePoint (NSMinX ([main_window frame]),
|
||||
NSMaxY ([main_window frame]));
|
||||
top_left = [frame_window cascadeTopLeftFromPoint: top_left];
|
||||
[frame_window cascadeTopLeftFromPoint: top_left];
|
||||
}
|
||||
else
|
||||
[main_window center];
|
||||
}
|
||||
|
||||
/* Make sure windows on this frame appear in calls to next-window
|
||||
and similar functions. */
|
||||
|
|
|
|||
Loading…
Reference in a new issue