Xfce Forum

Sub domains
 

You are not logged in.

#1 2013-07-27 06:30:38

Alexis_Evo
Member
Registered: 2013-07-27
Posts: 3

wmctrl unable to move a newly open window

Hi! Just switching back to xfce after using openbox for many years. Overall it's been a very pleasant switch. However, the one problem I am having is that wmctrl won't move a window after I first open it. If I manually move the window itself in xfce, then wmctrl can move it just fine!

Here's the scenario: I have two displays attached to my GPU, a 24" monitor and a 40" TV. Both are 1080p resolution. Catalyst combines the two into one gigantic monitor I can drag windows between. Most of the time, I want xbmc running fullscreen on the second monitor (the TV), but if I set xbmc to fullscreen mode via the traditional method, it takes over both displays. So I wrote together a quick script which calls wmctrl to start xbmc, move it to the second display, then "fullscreen" it within the WM, so that it behaves like fullscreen without dominating both displays.

Here's the relevant portions of the script:

wmctrl -F -r "XBMC Media Center" -e '0,1920,0,-1,-1'
wmctrl -F -r "XBMC Media Center" -b toggle,fullscreen

Pretty simple. Parameter 2 and 3 control X/Y positions to move the window to, 4&5 control the new height/width (which I want to remain at 1080p, so I set to -1). In OpenBox this works perfectly. In Xfce, it does not move the window at all, and then it fullscreens it, so it sits on my main display. However, if I move the xbmc window at ALL manually, then run the first command, it moves it to the second display just fine. This isn't an acceptable solution because I often start up xbmc remotely using my phone.

I run Arch Linux, here are the current versions of packages: https://www.archlinux.org/groups/x86_64/xfce4/

Offline

#2 2013-07-28 00:31:12

daggoth
Member
From: New Zealand
Registered: 2009-03-05
Posts: 42

Re: wmctrl unable to move a newly open window

So wmctrl can move the xbmc window, but only after a manual move. If a wmctrl command fails, normally it is because wmctrl thinks you've given it the wrong window name. But in this case, who knows...

Have you tried listing the windows seen by wmctrl, both before and after that manual move. To see what, if anything that manual move did to change the POV of wmctrl.

# list windows, with process PIDs and geometry
wmctrl -l -p -G

Offline

#3 2013-07-28 07:57:05

Alexis_Evo
Member
Registered: 2013-07-27
Posts: 3

Re: wmctrl unable to move a newly open window

[alexis@snuggles ~]$ wmctrl -l -p -G
0x00800003 -1 456    0    1049 1920 31   snuggles xfce4-panel
0x01200003 -1 460    0    0    3840 1080 snuggles Desktop
0x00808bde -1 456    -9999 -9999 192  31   snuggles xfce4-panel
0x00808de3 -1 456    799  0    192  3    snuggles xfce4-panel
0x01400003  0 1934   119  231  814  483  snuggles Terminal - alexis@snuggles:~
0x014000b0  0 1934   921  175  814  730  snuggles Terminal - alexis@snuggles:~
0x02a000d3  0 3827   63   173  469  623  snuggles alexandria.evo - Skype
0x01e00035  0 23776  600  32   1313 994  snuggles wmctrl unable to move a newly open window (Page 1) / Desktop / Xfce Forums - Chromium
0x0240000e  0 24110  0    44   1920 1027 snuggles XBMC Media Center

After moving the window slightly:

[alexis@snuggles ~]$ wmctrl -l -p -G
0x00800003 -1 456    0    1049 1920 31   snuggles xfce4-panel
0x01200003 -1 460    0    0    3840 1080 snuggles Desktop
0x00808bde -1 456    -9999 -9999 192  31   snuggles xfce4-panel
0x00808de3 -1 456    799  0    192  3    snuggles xfce4-panel
0x01400003  0 1934   119  231  814  483  snuggles Terminal - alexis@snuggles:~
0x014000b0  0 1934   921  175  814  730  snuggles Terminal - alexis@snuggles:~
0x02a000d3  0 3827   63   173  469  623  snuggles alexandria.evo - Skype
0x01e00035  0 23776  600  32   1313 994  snuggles wmctrl unable to move a newly open window (Page 1) / Desktop / Xfce Forums - Chromium
0x0240000e  0 24110  -69  -35  1920 1080 snuggles XBMC Media Center

What's odd is the fullscreen command works whether I've manually moved the window or not. So I doubt it is a problem with wmctrl failing to find the window, or not sending the proper commands, but xfce appears to ignore the move command until it's already been moved at least once by the user. I've tried testing it with other windows, and the script seems to work fine, so it appears to be some special case between xbmc and xfce.

Offline

#4 2013-07-28 13:33:07

daggoth
Member
From: New Zealand
Registered: 2009-03-05
Posts: 42

Re: wmctrl unable to move a newly open window

So wmctrl isn't working. Then perhaps try another tool...

... is that wmctrl won't move a window after I first open it.

Have you considered using devilspie? Devilspie acts upon newly created windows, and modifies their geometry/workspace. Given that you're modifying a newly created XBMC, it sounds ideal for your situation.

You could also try xdotool - it sometimes succeeds when wmctrl fails. If I have a single xterm open, then typical commands to move that xterm might be...

# Obtain the xterm window_id
$ xdotool search xterm
50331682

# Move that window to top-left
$ xdotool  windowmove 50331682 0 0

# Or to find and move the xterm in one simple step
$ xdotool search xterm windowmove 0 0 

Elsewise, if that doesn't work, then I'm outta ideas.

Offline

#5 2013-07-28 14:13:17

daggoth
Member
From: New Zealand
Registered: 2009-03-05
Posts: 42

Re: wmctrl unable to move a newly open window

Alexis_Evo wrote:

Catalyst combines the two into one gigantic monitor I can drag windows between.

I'm not familiar with Catalyst, or how it combines the two monitors. Do they combine into one large workspace. Or have they become separate workspaces, one on each monitor. 

Alexis_Evo wrote:

but if I set xbmc to fullscreen mode via the traditional method, it takes over both displays.

Fullscreen here is over both displays, so it appears to be treating them as one contiguous workspace.

Alexis_Evo wrote:

In Xfce, it does not move the window at all, and then it fullscreens it, so it sits on my main display.

Fullscreen here is over just one display, so it appears to be treating them as different workspaces.

So the descriptions above contradicts - it's not clear whether we are dealing with one contiguous workspace, or separate workspaces. But if wmctrl does indeed view them as separate workspaces, then some kind of shift workspace command may be needed instead of a move command.

# Move to workspace 1
$ wmctrl -r "XBMC Media Center" -t 1

Offline

#6 2013-07-29 06:19:17

Alexis_Evo
Member
Registered: 2013-07-27
Posts: 3

Re: wmctrl unable to move a newly open window

It is one workspace, I believe. The entire purpose of using wmctrl is that it doesn't use a "real" fullscreen, instead it just hides the borders of the windows and gives a fullscreen esque effect. The problem certainly isn't related to workspaces, even if I try moving the window on the same monitor/workspace, it refuses to move. Eg, putting coordinates as 100,100 instead of 1920,0, it still doesn't move.

I will take a look at those other tools and try to get them working, thanks.

Offline

#7 2013-07-29 14:49:53

MountainDewManiac
Member
From: Where Mr. Bankruptcy is Prez
Registered: 2013-03-24
Posts: 1,115

Re: wmctrl unable to move a newly open window

Does anything on one of these pages help?

http://linux.die.net/man/1/wmctrl
http://tomas.styblo.name/wmctrl/

Regards,
MDM


Mountain Dew Maniac

How to Ask for Help <=== Click on this link

Offline

#8 2014-03-16 20:45:07

flittermice
Member
Registered: 2014-03-16
Posts: 1

Re: wmctrl unable to move a newly open window

I've got exactly the same problem as you described.
I Had it with XFCE before and with Gnome Shell now. But it really seems specific to XBMC.

Offline

Board footer

Powered by FluxBB