# Fixing toFront() for alwaysOnTop windows

**URL:** <https://forum.juce.com/t/fixing-tofront-for-alwaysontop-windows/3879>\
**Category:** Linux\
**Created:** [May 3, 2009, 12:52pm UTC](https://forum.juce.com/t/fixing-tofront-for-alwaysontop-windows/3879 "2009-05-03T12:52:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jpo](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/jpo/32/503_2.png) [@jpo](https://forum.juce.com/u/jpo)\
**Post date:** [May 3, 2009, 12:52pm UTC](https://forum.juce.com/t/fixing-tofront-for-alwaysontop-windows/3879/1 "2009-05-03T12:52:42Z")

</div>

Hi Jules,

Adding this code in LinuxPeerComponent::toFront

[code]XWindowAttributes attr;  
XGetWindowAttributes(display, windowH, &attr);

if (attr.override\_redirect) {  
XRaiseWindow(display, windowH);  
}[/code]

fixes that function for windows which have the override\_redirect flag.

(maybe a better fix would be to set a \_NET\_WM\_WINDOW\_TYPE\_DOCK property or something similar on alwayOnTop windows, but I did not check, it could also break some other juce stuff…)

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://forum.juce.com/u/jules)\
**Post date:** [May 3, 2009, 2:12pm UTC](https://forum.juce.com/t/fixing-tofront-for-alwaysontop-windows/3879/2 "2009-05-03T14:12:04Z")

</div>

ah, right, thanks!
