You are not logged in.

#1 2009-01-14 15:44:08

profylno
Member
Registered: 2008-09-23
Posts: 10

wmctrl problems

Hi!

I've been using the command 'wmctrl -d' for a while to find the name of my current workspace, without any problems whatsoever. Recently, it stopped working and started giving me the following:

GLib-ERROR **: gmem.c:156: failed to allocate 1117103813820448 bytes
aborting...
Aborted

While searching for a solution to this, I noticed people also had issues with 'wmctrl -l' printing only a partial list of all the windows, instead of the full list like it should, though it supposedly works in a 32bit chroot. I tried 'wmctrl -l', and indeed got the same problem, and both -d and -l work fine in a 32bit chroot.

Here, https://bugzilla.redhat.com/show_bug.cgi?id=426383#c2 , somebody suggests compiling it with the -m32 flag. I tried that, but it didn't compile.

Any ideas?

Offline

#2 2009-01-31 15:55:50

DonVla
Member
From: Bonn, Germany
Registered: 2007-06-07
Posts: 997

Re: wmctrl problems

use this patch

--- main.c.orig 2005-01-29 04:31:33.000000000 +0100
+++ main.c  2009-01-31 16:52:09.000000000 +0100
@@ -1441,6 +1441,8 @@

     /* null terminate the result to make string handling easier */
     tmp_size = (ret_format / 8) * ret_nitems;
+    /* Correct 64 Architecture implementation of 32 bit data */
+    if(ret_format==32) tmp_size *= sizeof(long)/4;
     ret = g_malloc(tmp_size + 1);
     memcpy(ret, ret_prop, tmp_size);
     ret[tmp_size] = '\0';

vlad

Offline

#3 2009-07-07 03:00:50

wankel
Member
From: Iowa, USA
Registered: 2008-05-30
Posts: 218
Website

Re: wmctrl problems

DonVla wrote:

use this patch

--- main.c.orig 2005-01-29 04:31:33.000000000 +0100
+++ main.c  2009-01-31 16:52:09.000000000 +0100
@@ -1441,6 +1441,8 @@

     /* null terminate the result to make string handling easier */
     tmp_size = (ret_format / 8) * ret_nitems;
+    /* Correct 64 Architecture implementation of 32 bit data */
+    if(ret_format==32) tmp_size *= sizeof(long)/4;
     ret = g_malloc(tmp_size + 1);
     memcpy(ret, ret_prop, tmp_size);
     ret[tmp_size] = '\0';

vlad

Hi, could you please explain how I would implement this patch? Many thanks smile

Offline

#4 2009-07-07 08:28:15

DonVla
Member
From: Bonn, Germany
Registered: 2007-06-07
Posts: 997

Re: wmctrl problems

use this PKGBUILD:

# Maintainer: Geoffroy Carrier <geoffroy.carrier@koon.fr>
# Previous Contributor: Dalius <dagis@takas.lt>
pkgname=wmctrl
pkgver=1.07
pkgrel=1
pkgdesc="Control your EWMH compliant window manager from command line."
url="http://sweb.cz/tripie/utils/wmctrl/"
arch=('i686' 'x86_64')
license=('GPL')
depends=(libxmu glib2)
source=(http://sweb.cz/tripie/utils/wmctrl/dist/$pkgname-$pkgver.tar.gz main.c.patch)
md5sums=('1fe3c7a2caa6071e071ba34f587e1555'
         'd2e935eee462171e83c83f3ad5678c8e')
sha256sums=('d78a1efdb62f18674298ad039c5cbdb1edb6e8e149bb3a8e3a01a4750aa3cca9'
            'a4b7de3b3e62e29372f7335daccc026f93f9e88c54ff6d99f50c2528bc7684b4')

build() {
  cd "$srcdir/$pkgname-$pkgver"

  patch -p0 < ${srcdir}/main.c.patch
  ./configure --prefix=/usr || return 1

  make || return 1
  make prefix="$pkgdir/usr" install || return 1

and save this as main.c.patch:

--- main.c.orig 2005-01-29 04:31:33.000000000 +0100
+++ main.c  2009-01-31 16:52:09.000000000 +0100
@@ -1441,6 +1441,8 @@

     /* null terminate the result to make string handling easier */
     tmp_size = (ret_format / 8) * ret_nitems;
+    /* Correct 64 Architecture implementation of 32 bit data */
+    if(ret_format==32) tmp_size *= sizeof(long)/4;
     ret = g_malloc(tmp_size + 1);
     memcpy(ret, ret_prop, tmp_size);
     ret[tmp_size] = '\0';

build the package with makepkg as usual .

Offline

#5 2009-07-07 17:55:52

wankel
Member
From: Iowa, USA
Registered: 2008-05-30
Posts: 218
Website

Re: wmctrl problems

Thanks for the quick reply, works like a charm smile

Offline

#6 2009-07-07 18:14:40

foutrelis
Developer/TU
From: Athens, Greece
Registered: 2008-07-28
Posts: 675
Website

Re: wmctrl problems

For any other people coming across this thread, the above patch is included in wmctrl-1.07-1.1 which was uploaded yesterday. smile

Offline

#7 2009-07-07 18:34:59

DonVla
Member
From: Bonn, Germany
Registered: 2007-06-07
Posts: 997

Re: wmctrl problems

oh sorry, i missed that.
i'm not using wmctrl anyway...

Offline

Board footer

Powered by FluxBB