Using set_desktop on display :0.1

504 views
Skip to first unread message

John Newbigin

unread,
Jul 3, 2012, 10:00:38 PM7/3/12
to xdotool-users
Hi,

I am attempting to use xdotool xdotool-2.20110530.1 to switch desktop
on my machine. I have used it successfully in the past but on my new
machine it does not seem to work correctly.

I have two displays numbered :0.0 and :0.1. I am using gnome and each
display has 4 desktops.

No matter how I use xdotool, it will only change the desktop on
display :0.0 which is annoying because I want to change :0.1 :-(

Also, when I use --relative it does not seem to work
$ xdotool set_desktop --relative +1
just takes me to desktop 1 (on display :0.0)

$ xdotool set_desktop --relative -1
set_desktop: unrecognized option `-1'
Usage: set_desktop desktop
--relative - Move relative to the current desktop. Negative values
OK

Am I just missing something or is this a bug?

Thanks,

John.

Anthony Thyssen

unread,
Jul 4, 2012, 2:21:56 AM7/4/12
to xdotoo...@googlegroups.com, jnew...@chrysocome.net
Try specifically setting the DISPLAY.

EG:
DISPLAY=:0.1 xdotool ....




Anthony Thyssen ( System Programmer ) <A.Th...@griffith.edu.au>
--------------------------------------------------------------------------
If the automobile had followed the same development as the computer,
a Rolls-Royce would today cost $100, get a million miles per gallon,
and explode once a year killing everyone inside.
-- Robert Cringely, InfoWorld
--------------------------------------------------------------------------
Anthony's Castle http://www.ict.griffith.edu.au/anthony/

John Newbigin

unread,
Jul 4, 2012, 10:42:45 PM7/4/12
to xdotool-users
Yeah, I tried that. It always changes the :0.0 display.

I did some more tests. If I specify :0 it uses :0.0 but that is the
same as any other X program.

If I use :0.2 I get:
Error: Can't open display: (null)
Segmentation fault

This is the same as if I unset the DISPLAY environment variable but
obviously it is actually checking if the display exists.

John.

On Jul 4, 4:21 pm, Anthony Thyssen <A.Thys...@griffith.edu.au> wrote:
> On Tue, 3 Jul 2012 19:00:38 -0700 (PDT)John Newbigin <jnewbi...@chrysocome.net> wrote:
> Try specifically setting the DISPLAY.
>
> EG:
>    DISPLAY=:0.1 xdotool ....
>
>   Anthony Thyssen ( System Programmer )    <A.Thys...@griffith.edu.au>

John Newbigin

unread,
Jul 16, 2012, 8:11:58 PM7/16/12
to xdotool-users
I have had a chance to check the source code. I have found:
* The segfault is easy to fix and not related to the problem
* xdo_get_current_desktop works correctly
* xdo_set_current_desktop has a comment:
/* XXX: This should support passing a screen number */

so it looks like this is a known issue.

When using --relative, the current is read from the correct screen but
the new value is applied to the wrong one.

To use relative switching, this was the required command:
xdotool set_desktop --relative -- 1

I have never done any low level X programming but it seems to be that switching
root = RootWindow(xdo->xdpy, 0);
to be
root = XDefaultRootWindow(xdo->xdpy);
is all that is requred.

If you want I can send a patch to fix these two bugs.

John.
> --
> You received this message because you are subscribed to the Google Groups "xdotool-users" group.
> To post to this group, send email to xdotoo...@googlegroups.com.
> To unsubscribe from this group, send email to xdotool-user...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/xdotool-users?hl=en.
>

John Newbigin

unread,
Jul 16, 2012, 8:25:08 PM7/16/12
to xdotool-users
Well, I made patches anyway...
See attached.

John.
debug-segfault.patch
set-desktop-screen.patch

Jordan Sissel

unread,
Jul 16, 2012, 8:30:46 PM7/16/12
to jnew...@chrysocome.net, xdotool-users
On Mon, Jul 16, 2012 at 5:25 PM, John Newbigin <jnew...@chrysocome.net> wrote:
Well, I made patches anyway...
See attached.

John.

Awesome! I will review these this week and merge it in!

Thanks for taking the effort to debug and patch this :)

-Jordan

goja...@gmail.com

unread,
Mar 18, 2018, 5:03:29 PM3/18/18
to xdotool-users
i had patch using this patch file... n recompile it.... but still not working...
any suggestion?

Thank in advance...
Reply all
Reply to author
Forward
0 new messages