This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Activate window (setFocus) via dbus or command [solved]

Tags: None
(comma "," separated)
Murz
Registered Member
Posts
52
Karma
0
I use KDE 4.6.3 on Kubuntu Natty.
I need to activate some KDE window via console command. Good tool for this is qdbus. It works normally with other actions, but I can't find the way to set focus. Command:
Code: Select all
qdbus org.kde.kontact  /kontact/MainWindow_1 com.trolltech.Qt.QWidget.setFocus

does nothing.
Also I try with other apps and see nothing result too:
Code: Select all
qdbus org.kde.kate-24423 /kate/__KateMainWindow_1 com.trolltech.Qt.QWidget.setFocus

But other actions works normally:
Code: Select all
com.trolltech.Qt.QWidget.setWindowTitle
com.trolltech.Qt.QWidget.showMaximized
com.trolltech.Qt.QWidget.showMinimized
com.trolltech.Qt.QWidget.showNormal
com.trolltech.Qt.QWidget.showFullScreen
com.trolltech.Qt.QWidget.hide
com.trolltech.Qt.QWidget.show

Those commands do the actions, but don't activate (set focus) to window.

Also I try this with SUSE linux and got the same problem with setFocus.

What I do wrong and how I can set focus to window via dbus or other tool?

Last edited by Murz on Fri May 13, 2011 12:21 pm, edited 1 time in total.
pinotree
KDE Developer
Posts
222
Karma
7
OS
Use "wmctrl" to manage windows in X11, and forget D-Bus.


Pino Toscano
Murz
Registered Member
Posts
52
Karma
0
Many thank's! I don't know about this tool before... All works good!
User avatar
Hans
Administrator
Posts
3304
Karma
24
OS
Although not directly related, I moved the topic to KWin since it deals with window management. I also marked the topic as solved as described here.


Problem solved? Please click on "Accept this answer" below the post with the best answer to mark your topic as solved.

10 things you might want to do in KDE | Open menu with Super key | Mouse shortcuts


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Sogou [Bot]