2 Copyright © 1995-2007, The AROS Development Team. All rights reserved.
3 Copyright © 2001-2003, The MorphOS Development Team. All Rights Reserved.
6 Move window in front of all other windows.
9 #include <proto/layers.h>
10 #include "intuition_intern.h"
11 #include "inputhandler_actions.h"
12 #include "inputhandler_support.h"
14 struct WindowToFrontActionMsg
16 struct IntuiActionMsg msg
;
17 struct Window
*window
;
20 static VOID
int_windowtofront(struct WindowToFrontActionMsg
*msg
,
21 struct IntuitionBase
*IntuitionBase
);
23 /*****************************************************************************
26 #include <intuition/intuition.h>
27 #include <proto/intuition.h>
29 AROS_LH1(void, WindowToFront
,
32 AROS_LHA(struct Window
*, window
, A0
),
35 struct IntuitionBase
*, IntuitionBase
, 52, Intuition
)
38 Bring a window to the front (ie. before any other window).
56 *****************************************************************************/
60 struct WindowToFrontActionMsg msg
;
62 DEBUG_WINDOWTOFRONT(dprintf("WindowToFront: Window 0x%lx\n", window
));
68 DoASyncAction((APTR
)int_windowtofront
, &msg
.msg
, sizeof(msg
), IntuitionBase
);
75 static VOID
int_windowtofront(struct WindowToFrontActionMsg
*msg
,
76 struct IntuitionBase
*IntuitionBase
)
78 struct Window
*window
= msg
->window
;
79 struct Layer
*layer
= WLAYER(window
);
80 struct Screen
*screen
= window
->WScreen
;
81 struct Requester
*req
;
83 DEBUG_WINDOWTOFRONT(dprintf("IntWindowToFront: Window 0x%lx\n", window
));
85 if (!ResourceExisting(window
, RESOURCE_WINDOW
, IntuitionBase
)) return;
87 if (!(layer
->Flags
& LAYERBACKDROP
))
91 /* GZZ or regular window? */
94 /* bring outer window to front first!! */
96 UpfrontLayer(NULL
, BLAYER(window
));
99 UpfrontLayer(NULL
, layer
);
101 for (req
= window
->FirstRequest
; req
; req
= req
->OlderRequest
)
105 MoveLayerInFrontOf(req
->ReqLayer
, layer
);
109 CheckLayers(screen
, IntuitionBase
);
111 UNLOCK_REFRESH(screen
);
115 ((struct IntWindow
*)(window
))->specialflags
&= ~SPFLAG_ICONIFIED
;
116 /* window is not iconified anymore */
118 NotifyDepthArrangement(window
, IntuitionBase
);