From b6e521cef6a3eef200b14bbb9fe097608a7d7f45 Mon Sep 17 00:00:00 2001 From: Ximi1970 Date: Sat, 22 Feb 2020 01:16:25 +0100 Subject: [PATCH] Restore window on top --- app/SysTray-X/windowctrl-unix.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/app/SysTray-X/windowctrl-unix.cpp b/app/SysTray-X/windowctrl-unix.cpp index 7a6a9bc..edeeeb4 100644 --- a/app/SysTray-X/windowctrl-unix.cpp +++ b/app/SysTray-X/windowctrl-unix.cpp @@ -175,8 +175,17 @@ void WindowCtrlUnix::normalizeWindow( quint64 window ) { hideWindow( static_cast( window ), false ); -// XMapRaised( m_display, static_cast( window ) ); - XMapWindow( m_display, static_cast( window ) ); + XEvent event = { 0 }; + event.xclient.type = ClientMessage; + event.xclient.serial = 0; + event.xclient.send_event = True; + event.xclient.message_type = XInternAtom( m_display, "_NET_ACTIVE_WINDOW", False ); + event.xclient.window = static_cast( window ); + event.xclient.format = 32; + + XSendEvent( m_display, m_root_window, False, SubstructureRedirectMask | SubstructureNotifyMask, &event ); + XMapRaised( m_display, static_cast( window ) ); +// XMapWindow( m_display, static_cast( window ) ); XFlush( m_display ); }