LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 10-20-2012, 10:22 AM   #1
emgee_1
Member
 
Registered: Aug 2009
Location: Nijmegen, The Netherlands
Distribution: Slackware 14
Posts: 39

Rep: Reputation: 6
wmctrl is not showing all windows


Dear Slackers,

I am using Slackware 14 64 bit and installed using sbopkg wmctrl; I use openbox as window manager and want to control the different started apps using wmctrl;
now having maybe 8 windows open the
Code:
wmctrl -l
should give a list of all windows but it doesn't. It appears that this has to do 64 bit version.

I found some code
Code:
#ifdef __x86_64
             if(ret_type == 32) tmp_size *=2;
           #endif
To add ad main.c at line 1441;
I modified manually main.c and executed the slackbuild; but it won't compile.

Background why I want this is this article by urukrama : http://urukrama.wordpress.com/2012/0...-applications/



The code was taken from here:
x86_64 part 2
Posted 6th Mar 2012 at 16:57 by Rod3775
Tags 64 bit, wmctrl, xwindows
When XWindows was ported to 64 bit architectures, the decision was made (probably for legacy compatibility) not to add a 64 bit data format to routines that return overloaded pointers, specifically XGetWindowProperties. Pointers, which are 64 bits, are returned in 64 bit elements that are claimed to be 32 bits. There is no way to cope with this in user code, except to check which architecture you are running on. The compiler define "__x86_64" is set on Intel 64 bit compilers. wmctrl (not part of base Slackware, but available as a Slackbuild), uses this routine and fails. In wmctrl-1.07/main.c add the following after line 1441 to fix the problem:
#ifdef __x86_64
if(ret_type == 32) tmp_size *=2;
#endif


Any pointers are much appreciated

Marcel

Last edited by emgee_1; 10-20-2012 at 10:32 AM.
 
Old 10-21-2012, 03:36 AM   #2
ppencho
LQ Newbie
 
Registered: Jan 2004
Location: Bulgaria
Distribution: Slackware64-current
Posts: 25

Rep: Reputation: 3
The compilation error was that ret_type variable was not defined. Also your patch does not make sense because at the next line (1443 in the original main.c) tmp_size is changed again.

So I did some tests and it seems that the correct patch is:
Code:
#ifdef __x86_64
    if (ret_format == 32)
    {
        ret_format *= 2;
    }
#endif
It works here, but use it w/o any WARRANTY
 
1 members found this post helpful.
Old 10-21-2012, 11:53 AM   #3
emgee_1
Member
 
Registered: Aug 2009
Location: Nijmegen, The Netherlands
Distribution: Slackware 14
Posts: 39

Original Poster
Rep: Reputation: 6
the proposed patch works

Thank you ppencho: your patch works;

the proposed small script on urukrama's blog is now working correctly.

for those interested this is the small working script of urukrama:

Code:
#!/bin/sh
# Use dmenu to launch or raise and focus running applications

CMD=$(dmenu_path | dmenu -b -fn '-*-nu-*-*-*-*-*-*-*-*-*-*-*-*' )

# if no instance of the app has been started, launch one now
if [ -z "`wmctrl -lx | grep -i $CMD`" ]; then
    $CMD &
else
    # search for existing app on any desktop and move it to the current desktop
    app_on_any_desk=`wmctrl -lx | grep -i $CMD | cut -d ' ' -f 1`
    wmctrl -i -R $app_on_any_desk
    #wmctrl -i -X $app_on_any_desk
fi;

So what does it do:

Sometimes you find yourself in a situation that you fire up some terminals and other apps along the way and all your workspaces get cluttered up. To avoid that this little script brings your needed terminal or app into focus by bringing it to the current desktop. I you bind a key to the script then by typing the intial name of the app for example ter for terminal and it wil bring an existing terminal on some workspace into focus on your current workspace (if you have not terminal running then typing terminal will start a new instance. It keeps your workspace tidy and you do not need to have a lot of terminals open.

Thanks for your solution.
Thank you for your attention

Marcel

Last edited by emgee_1; 10-22-2012 at 04:08 AM. Reason: I goofed up the script and put the original minus colouring back
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
wmctrl to place a window on top / bottom layer ? Xeratul Linux - General 0 05-19-2012 05:00 AM
minimizing windows from CLI (wmctrl not working) mike11 Linux - Newbie 2 09-20-2010 12:41 AM
wmctrl or devil's pie not able to move firefox chenyl Linux - Software 3 02-12-2009 12:46 AM
LXer: Take charge of your window manager with WMCTRL and Devil's Pie LXer Syndicated Linux News 0 12-21-2007 05:30 PM
Smb4k not showing Windows shares Latem Linux - Software 2 03-09-2005 09:32 AM


All times are GMT -5. The time now is 06:27 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration