2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 Copyright © 2001-2003, The MorphOS Development Team. All Rights Reserved.
7 #include <proto/layers.h>
8 #include "intuition_intern.h"
9 #include "inputhandler_actions.h"
11 struct MoveWindowInFrontOfActionMsg
13 struct IntuiActionMsg msg
;
14 struct Window
*window
;
15 struct Window
*behindwindow
;
18 static VOID
int_movewindowinfrontof(struct MoveWindowInFrontOfActionMsg
*msg
,
19 struct IntuitionBase
*IntuitionBase
);
21 /*****************************************************************************
24 #include <proto/intuition.h>
26 AROS_LH2(void, MoveWindowInFrontOf
,
29 AROS_LHA(struct Window
*, window
, A0
),
30 AROS_LHA(struct Window
*, behindwindow
, A1
),
33 struct IntuitionBase
*, IntuitionBase
, 80, Intuition
)
36 Arrange the relative depth of a window.
39 window - the window to reposition
40 behindwindow - the window the other one will be brought in front of
52 WindowToFront(), WindowToBack(), layers.library/MoveLayerInFrontOf()
55 Uses layers.library/MoveLayerInFrontOf().
59 *****************************************************************************/
63 struct MoveWindowInFrontOfActionMsg msg
;
66 SANITY_CHECK(behindwindow
)
69 msg
.behindwindow
= behindwindow
;
70 DoASyncAction((APTR
)int_movewindowinfrontof
, &msg
.msg
, sizeof(msg
), IntuitionBase
);
74 } /* MoveWindowInFrontOf */
77 static VOID
int_movewindowinfrontof(struct MoveWindowInFrontOfActionMsg
*msg
,
78 struct IntuitionBase
*IntuitionBase
)
80 struct Window
*window
= msg
->window
;
81 struct Window
*behindwindow
= msg
->behindwindow
;
82 struct Screen
*screen
= window
->WScreen
;
83 struct Requester
*req
;
84 struct Layer
*layer
= WLAYER(window
);
86 BOOL movetoback
= TRUE
;
88 if (!ResourceExisting(window
, RESOURCE_WINDOW
, IntuitionBase
)) return;
89 if (!ResourceExisting(behindwindow
, RESOURCE_WINDOW
, IntuitionBase
)) return;
93 for(lay
= WLAYER(behindwindow
); lay
; lay
= lay
->back
)
102 /* FIXXXXXXXXXXXXXXXXXXXXXXXXXXXX FIXME FIXXXXXXXXXXXXXXXXXX */
104 /* If GZZ window then also move outer window */
106 MoveLayerInFrontOf(layer
, WLAYER(behindwindow
));
110 MoveLayerInFrontOf(BLAYER(window
), BLAYER(behindwindow
));
113 for (req
= window
->FirstRequest
; req
; req
= req
->OlderRequest
)
117 MoveLayerInFrontOf(layer
, req
->ReqLayer
);
121 CheckLayers(screen
, IntuitionBase
);
123 UNLOCK_REFRESH(screen
);
125 NotifyDepthArrangement(window
, IntuitionBase
);