Commit ccbd20ad authored by Robert Roth's avatar Robert Roth

Only use wnck on X11

parent 438c0a31
......@@ -56,7 +56,8 @@ AC_PATH_PROG(DESKTOP_FILE_VALIDATE, desktop-file-validate)
AC_ARG_ENABLE(wnck, AS_HELP_STRING([--enable-wnck], [enable wnck support]),enable_wnck="$enableval",enable_wnck=no)
if test "x$enable_wnck" != "xno"; then
PKG_CHECK_MODULES(WNCK, libwnck-3.0 >= $LIBWNCK_REQUIRED)
PKG_CHECK_MODULES(WNCK, gdk-x11-3.0
libwnck-3.0 >= $LIBWNCK_REQUIRED)
AC_DEFINE(HAVE_WNCK, 1, [Define if libwnck is available])
fi
AM_CONDITIONAL(HAVE_WNCK, [test "enable_wnck" = "yes"])
......
......@@ -43,9 +43,10 @@
#include <set>
#include <list>
#ifdef HAVE_WNCK
#if defined(HAVE_WNCK) && defined(GDK_WINDOWING_X11)
#define WNCK_I_KNOW_THIS_IS_UNSTABLE
#include <libwnck/libwnck.h>
#include <gdk/gdkx.h>
#endif
#include "application.h"
......@@ -715,14 +716,19 @@ static void
get_process_memory_info(ProcInfo *info)
{
glibtop_proc_mem procmem;
#ifdef HAVE_WNCK
WnckResourceUsage xresources;
GdkDisplay *display = gdk_screen_get_display (gdk_screen_get_default ());
#if defined(HAVE_WNCK) && defined(GDK_WINDOWING_X11)
if (GDK_IS_X11_DISPLAY (display)) {
WnckResourceUsage xresources;
wnck_pid_read_resource_usage (gdk_screen_get_display (gdk_screen_get_default ()),
wnck_pid_read_resource_usage (display,
info->pid,
&xresources);
info->memxserver = xresources.total_bytes_estimate;
info->memxserver = xresources.total_bytes_estimate;
}
#endif
glibtop_get_proc_mem(&procmem, info->pid);
......@@ -732,7 +738,7 @@ get_process_memory_info(ProcInfo *info)
info->memshared = procmem.share;
info->mem = info->memres - info->memshared;
#ifdef HAVE_WNCK
#if defined(HAVE_WNCK) && defined(GDK_WINDOWING_X11)
info->mem += info->memxserver;
#endif
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment