From fe04582b873b1aefce1e47d50424cdbf8dbff601 Mon Sep 17 00:00:00 2001 From: Johannes Sixt Date: Thu, 20 Apr 2006 23:17:53 +0200 Subject: [PATCH] Fixed that the debugger window really moves itself to the foreground. When the option "Pop into foreground when program stops" is turned on, KDbg attempted to move itself into the foreground using XRaiseWindow(). This used to work with older windowmanagers, but it does no longer. Quite some force is required to achieve the goal: KWin::raiseWindow() and KWin::forceActiveWindow() are actually reserved for pager applications. With some phantasy, the debugger event can be interpreted as "user interaction". This fixes http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=171845 --- ChangeLog | 4 ++++ kdbg/dbgmainwnd.cpp | 9 +++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4a7f052..842192e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,10 @@ Version 2.0.4 Added support for QString in Qt4's debug libraries. + Fixed that the debugger window really comes to the foreground and + receives the focus when the debuggee stops at a breakpoint, when this + option is on (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=171845). + Version 2.0.3 Fixed parsing of gdb output that mentions "operator<<", "operator>>", diff --git a/kdbg/dbgmainwnd.cpp b/kdbg/dbgmainwnd.cpp index 7c42049..37d76ba 100644 --- a/kdbg/dbgmainwnd.cpp +++ b/kdbg/dbgmainwnd.cpp @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include "dbgmainwnd.h" @@ -688,13 +689,13 @@ void DebuggerMainWnd::slotTermEmuExited() shutdownTermWindow(); } -#include /* XRaiseWindow, XLowerWindow */ - void DebuggerMainWnd::slotProgramStopped() { // when the program stopped, move the window to the foreground if (m_popForeground) { - ::XRaiseWindow(x11Display(), winId()); + // unfortunately, this requires quite some force to work :-( + KWin::raiseWindow(winId()); + KWin::forceActiveWindow(winId()); } m_backTimer.stop(); } @@ -708,7 +709,7 @@ void DebuggerMainWnd::intoBackground() void DebuggerMainWnd::slotBackTimer() { - ::XLowerWindow(x11Display(), winId()); + lower(); } void DebuggerMainWnd::slotRecentExec(const KURL& url) -- 2.11.4.GIT