![]() Registered Member ![]()
|
I'm trying to make a program that toggles showdesktop.
I made this from the source code of plasma_applet_showdesktop.so: NETRootInfo info(QX11Info::display(), 0); info.setShowingDesktop(true); But the NetRootInfo constructor gives a segmentation fault. Can anyone tell me why? I'm using Mandriva 2009, KDE 4.1.2. See below for code. vatbier myshowdesktop.cpp :
CMakeLists.txt :
vatbier, proud to be a member of KDE forums since 2008-Oct.
|
![]() KDE Developer ![]()
|
RE: Segmentation fault when running NETRootInfo info(QX11Info::display(), 0)
Fri Oct 31, 2008 4:05 pm
Check if it already segaults at QX11Info::display() That class/method looks like it might need a QApplication instance Cheers, _
anda_skoa, proud to be a member of KDE forums since 2008-Oct.
|
![]() Registered Member ![]()
|
RE: Segmentation fault when running NETRootInfo info(QX11Info::display(), 0)
Fri Oct 31, 2008 10:21 pm
No segfault occurs when I do this:
And it runs now without segfault and it minimizes all windows now!! Thank you very much! I know very little yet about Qt programming vatbier
Last edited by vatbier on Fri Oct 31, 2008 11:42 pm, edited 1 time in total.
vatbier, proud to be a member of KDE forums since 2008-Oct.
|
![]() Registered Member ![]()
|
RE: Segmentation fault when running NETRootInfo info(QX11Info::display(), 0)
Fri Oct 31, 2008 11:00 pm
Are you planning to make this into a plasmoid so there can be Show Desktop button and a keyboard shortcut to go along with it?
Type Colemak!
Proud, Conservative Republican "Gentlemen! You can't fight in here! This is the war room!" --President Merkin Muffley, Dr. Strangelove |
![]() Registered Member ![]()
|
RE: Segmentation fault when running NETRootInfo info(QX11Info::display(), 0)
Fri Oct 31, 2008 11:40 pm
I want to have a ShowDesktop icon in the quicklauncher plasmoid that I have placed next to the icon of K menu.
The ShowDesktop widget that now sits next to the quicklauncher takes too much place (I like small icons like those of quicklaunch in Windows XP and Vista). Dragging the ShowDesktop widget to the quicklauncher doesn't work as the quicklauncher widget can't work with "services", it expects a .desktop file with an exec command. In KDE 3.5.9 I had made my own .desktop file with a dcop command. Now in KDE 4.1.2 I want to do the same with a c++ program (there isn't yet a full dbus interface for plasma)
vatbier, proud to be a member of KDE forums since 2008-Oct.
|
Registered users: Bing [Bot], Evergrowing, Google [Bot], rblackwell