Fix Kate not coming to foreground with focus in MDI mode

This resolves Bug 692
(cherry picked from commit 93993ebd03)
v3.5.13-sru
Timothy Pearson 12 years ago committed by Slávek Banko
parent 3c86967a31
commit f2208fe7d1

@ -27,29 +27,7 @@
#include <kaction.h>
#include <tqclipboard.h>
#include <X11/Xlib.h>
#include <X11/Xatom.h>
// INTERNAL
// Originally from http://permalink.gmane.org/gmane.comp.lib.qt.general/4733
void wmMessage(KMainWindow * mainWindow, long type, long l0, long l1, long l2, long l3, long l4)
{
XClientMessageEvent xev;
xev.type = ClientMessage;
xev.window = mainWindow->winId();
xev.message_type = type;
xev.format = 32;
xev.data.l[0] = l0;
xev.data.l[1] = l1;
xev.data.l[2] = l2;
xev.data.l[3] = l3;
xev.data.l[4] = l4;
XSendEvent(mainWindow->x11Display(), mainWindow->winId(), False,
(SubstructureNotifyMask | SubstructureRedirectMask),
(XEvent *)&xev);
}
#include <kwin.h>
KMainWindowInterface::KMainWindowInterface(KMainWindow * mainWindow)
: DCOPObject( mainWindow->name())
@ -216,8 +194,7 @@ void KMainWindowInterface::setActiveWindowFocused()
m_MainWindow->setActiveWindow();
// activate window (try to work around focus-stealing prevention)
static Atom NET_ACTIVE_WINDOW = XInternAtom(m_MainWindow->x11Display(), "_NET_ACTIVE_WINDOW", False);
wmMessage(m_MainWindow, NET_ACTIVE_WINDOW, 2, CurrentTime, 0, 0, 0);
KWin::forceActiveWindow(m_MainWindow->winId());
}
QCStringList KMainWindowInterface::functionsDynamic()
{

Loading…
Cancel
Save