2 Copyright © 1995-2013, 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 (i.e. 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 LayersBase
*LayersBase
= GetPrivIBase(IntuitionBase
)->LayersBase
;
79 struct Window
*window
= msg
->window
;
80 struct Layer
*layer
= WLAYER(window
);
81 struct Screen
*screen
= window
->WScreen
;
82 struct Requester
*req
;
84 DEBUG_WINDOWTOFRONT(dprintf("IntWindowToFront: Window 0x%lx\n", window
));
86 if (!ResourceExisting(window
, RESOURCE_WINDOW
, IntuitionBase
)) return;
88 if (!(layer
->Flags
& LAYERBACKDROP
))
92 /* GZZ or regular window? */
95 /* bring outer window to front first!! */
97 UpfrontLayer(0, BLAYER(window
));
100 UpfrontLayer(0, layer
);
102 for (req
= window
->FirstRequest
; req
; req
= req
->OlderRequest
)
106 MoveLayerInFrontOf(req
->ReqLayer
, layer
);
110 CheckLayers(screen
, IntuitionBase
);
112 UNLOCK_REFRESH(screen
);
116 ((struct IntWindow
*)(window
))->specialflags
&= ~SPFLAG_ICONIFIED
;
117 /* window is not iconified anymore */
119 NotifyDepthArrangement(window
, IntuitionBase
);