Fix Kate not coming to foreground with focus in MDI mode

This resolves Bug 692
pull/16/head
Timothy Pearson 12 years ago
parent 6f1973a708
commit 93993ebd03

@ -27,29 +27,7 @@
#include <tdeaction.h> #include <tdeaction.h>
#include <tqclipboard.h> #include <tqclipboard.h>
#include <X11/Xlib.h> #include <twin.h>
#include <X11/Xatom.h>
// INTERNAL
// Originally from http://permalink.gmane.org/gmane.comp.lib.qt.general/4733
void wmMessage(TDEMainWindow * 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);
}
TDEMainWindowInterface::TDEMainWindowInterface(TDEMainWindow * mainWindow) TDEMainWindowInterface::TDEMainWindowInterface(TDEMainWindow * mainWindow)
: DCOPObject( mainWindow->name()) : DCOPObject( mainWindow->name())
@ -216,8 +194,7 @@ void TDEMainWindowInterface::setActiveWindowFocused()
m_MainWindow->setActiveWindow(); m_MainWindow->setActiveWindow();
// activate window (try to work around focus-stealing prevention) // activate window (try to work around focus-stealing prevention)
static Atom NET_ACTIVE_WINDOW = XInternAtom(m_MainWindow->x11Display(), "_NET_ACTIVE_WINDOW", False); KWin::forceActiveWindow(m_MainWindow->winId());
wmMessage(m_MainWindow, NET_ACTIVE_WINDOW, 2, CurrentTime, 0, 0, 0);
} }
QCStringList TDEMainWindowInterface::functionsDynamic() QCStringList TDEMainWindowInterface::functionsDynamic()
{ {

Loading…
Cancel
Save