aboutsummaryrefslogtreecommitdiff
path: root/src/ui/windowsystem.cpp
diff options
context:
space:
mode:
authortrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2010-05-16 12:09:27 +0000
committertrialuser02 <trialuser02@90c681e8-e032-0410-971d-27865f9a5e38>2010-05-16 12:09:27 +0000
commit49ba6c2fa06151f4c80b847d5be20185e3896ac8 (patch)
tree0e5fa5097e5bf910f71a7da7f9e09612d952e1e1 /src/ui/windowsystem.cpp
parent8723363378b7eb979af12d73c05f3f9a083f7e33 (diff)
downloadqmmp-49ba6c2fa06151f4c80b847d5be20185e3896ac8.tar.gz
qmmp-49ba6c2fa06151f4c80b847d5be20185e3896ac8.tar.bz2
qmmp-49ba6c2fa06151f4c80b847d5be20185e3896ac8.zip
added wm detection, removed useless settings
git-svn-id: http://svn.code.sf.net/p/qmmp-dev/code/trunk/qmmp@1737 90c681e8-e032-0410-971d-27865f9a5e38
Diffstat (limited to 'src/ui/windowsystem.cpp')
-rw-r--r--src/ui/windowsystem.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/ui/windowsystem.cpp b/src/ui/windowsystem.cpp
index a85748584..bbf1a457b 100644
--- a/src/ui/windowsystem.cpp
+++ b/src/ui/windowsystem.cpp
@@ -59,10 +59,8 @@ void WindowSystem::ghostWindow(WId win)
SubstructureRedirectMask | SubstructureNotifyMask, &xev);
}
-char* WindowSystem::netWindowManagerName()
+QString WindowSystem::netWindowManagerName()
{
- char* name = NULL;
-
Display* dsp = QX11Info::display();
WId root = DefaultRootWindow(dsp);
@@ -71,7 +69,7 @@ char* WindowSystem::netWindowManagerName()
retValue1 = getWindowProperty(root, "_NET_SUPPORTING_WM_CHECK");
if (retValue1 == NULL)
- return NULL;
+ return QString();
WId win = *(reinterpret_cast<unsigned long*>(retValue1));
@@ -79,14 +77,14 @@ char* WindowSystem::netWindowManagerName()
if (retValue2 == NULL)
{
XFree(retValue1);
- return NULL;
+ return QString();
}
if (win != *(reinterpret_cast<unsigned long*>(retValue2)))
{
XFree(retValue1);
XFree(retValue2);
- return NULL;
+ return QString();
}
XFree(retValue2);
@@ -95,12 +93,10 @@ char* WindowSystem::netWindowManagerName()
retValue2 = getWindowProperty(win, "_NET_WM_NAME");
XFree(retValue1);
if (retValue2 == NULL)
- return NULL;
-
- name = strdup(reinterpret_cast<const char*>(retValue2));
+ return QString();
+ QString name = QString((char *)retValue2);
XFree(retValue2);
-
return name;
}