0.9.2 «put» plugin moves any window only to second viewport

Bug #684019 reported by Tobias Wolf
168
This bug affects 30 people
Affects Status Importance Assigned to Milestone
compiz-fusion-plugins-main (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Binary package hint: compiz-fusion-plugins-main

There must be an off-by-one error in the «put» plugin because pressing the «Put to arbitrary Viewport» bindings all put a window to the second viewport where it becomes ›trapped‹ :

<Alt><Super>1 → Viewport 2
<Alt><Super>2 → Viewport 2
<Alt><Super>3 → Viewport 2
<Alt><Super>4 → Viewport 2

Tags: patch
Revision history for this message
Tobias Wolf (towolf) wrote :
Revision history for this message
Tobias Wolf (towolf) wrote :

Correction, as a matter of fact it ›gets stuck‹ with whichever target viewport it was used with *first*.

With ›put to arbitrary viewport‹ it get’s stuck with the target viewport number that it was used with the first time.

E.g., If <Super>1,2,3,4 are key bindings to move a window, and <Super>2 is pressed the first time, it works and puts the window on the intended Desktop 2. But any later <Super>1,3,4 will also go to Desktop 2 and never to any other Desktop.

Revision history for this message
MDCore (mdcore) wrote :

This bug is still occuring in Ubuntu Natty 11.04

Revision history for this message
Karl Yngve Lervåg (karl-yngve) wrote :

The bug is also in Linux Mint 11 RC. Tobias Wolfs description seems to be very accurate. I've also noticed that I have the same problem with the rotate-cube plugin, i.e. the key bindings to move (with) windows get stuck with one specific window.

This bug is really annoying, as the put plugin is one of the most important plugins of all, in my opinion!

Revision history for this message
malraux (scottanderson42) wrote :

Another reporter with Natty.

Between this and the bug that prevents the keys from being set in the System->Preferences->Keyboard Shortcuts app (https://bugs.launchpad.net/ubuntu/+source/compiz/+bug/348848?comments=all), put to viewport is essentially useless in Natty. I wasn't expecting to lose so much functionality I depend on daily when I upgraded from Gutsy.

Revision history for this message
dansheen (dansheen) wrote :

Here, too. What kind I say - annoying. Odd thing is: it worked fine until I installed cssm.

Revision history for this message
chca (chca) wrote :

Okay, this bug annoyed me very much, so I identified it in the source code. What really happened: Whenever you first move a window to a different viewport, the target viewport number is appended to a list. When you do it again, the old entry is not removed or updated; instead a new "viewport" entry is added (which also is a small memory leak). Afterwards, only the first "viewport" entry in the list is ever read on moving a window, so all subsequent windows will be sent to the viewport to which the first window was moved (it can also be the first, third, fourth or any other one).

A patch proposal is attached.

tags: added: patch
Revision history for this message
Sam Spilsbury (smspillaz) wrote : Re: [Compiz] [Bug 684019] Re: 0.9.2 «put» plugin moves any window only to second viewport

On Sat, Jul 2, 2011 at 10:08 PM, chca <email address hidden> wrote:
> Okay, this bug annoyed me very much, so I identified it in the source
> code. What really happened: Whenever you first move a window to a
> different viewport, the target viewport number is appended to a list.
> When you do it again, the old entry is not removed or updated; instead a
> new "viewport" entry is added (which also is a small memory leak).
> Afterwards, only the first "viewport" entry in the list is ever read on
> moving a window, so all subsequent windows will be sent to the viewport
> to which the first window was moved (it can also be the first, third,
> fourth or any other one).
>

Thanks for the patch, but I don't quite understand it. Are you saying
that the "viewport" option is being appended to "options" every single
time and this "options" vector is persistent among calls to
::toViewport ? Since that's definitely wrong and is a bug in core if
that's happening.

> A patch proposal is attached.
>
> ** Patch added: "fix for this issue"
>   https://bugs.launchpad.net/ubuntu/+source/compiz-fusion-plugins-main/+bug/684019/+attachment/2187914/+files/0001-bug-fix-overwrite-viewport-option-parameter-instead-.patch
>
> --
> You received this bug notification because you are a member of compiz
> packagers, which is subscribed to compiz-fusion-plugins-main in Ubuntu.
> https://bugs.launchpad.net/bugs/684019
>
> Title:
>  0.9.2 «put» plugin moves any window only to second viewport
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/compiz-fusion-plugins-main/+bug/684019/+subscriptions
>
> _______________________________________________
> Mailing list: https://launchpad.net/~compiz
> Post to     : <email address hidden>
> Unsubscribe : https://launchpad.net/~compiz
> More help   : https://help.launchpad.net/ListHelp
>

--
Sam Spilsbury

Revision history for this message
chca (chca) wrote : Re: [Compiz] [Bug 684019] Re: 0.9.2«put» plugin moves any window only to second viewport

Am 02.07.2011 19:57, schrieb Sam Spilsbury:
> Thanks for the patch, but I don't quite understand it. Are you saying
> that the "viewport" option is being appended to "options" every single
> time and this "options" vector is persistent among calls to
> ::toViewport ? Since that's definitely wrong and is a bug in core if
> that's happening.

Yes, that's what happens. To check that, I have added some debug code
and moved a window to viewport 2, 3, 4, 4 (see attachment). As you can
see, the option parameter indeed seems to be persistent, which is also
supported by the fact that its memory address does not change.

Revision history for this message
Sam Spilsbury (smspillaz) wrote :

Good find, I'll fix that now

On Sun, Jul 3, 2011 at 3:44 PM, chca <email address hidden> wrote:

> Am 02.07.2011 19:57, schrieb Sam Spilsbury:
> > Thanks for the patch, but I don't quite understand it. Are you saying
> > that the "viewport" option is being appended to "options" every single
> > time and this "options" vector is persistent among calls to
> > ::toViewport ? Since that's definitely wrong and is a bug in core if
> > that's happening.
>
> Yes, that's what happens. To check that, I have added some debug code
> and moved a window to viewport 2, 3, 4, 4 (see attachment). As you can
> see, the option parameter indeed seems to be persistent, which is also
> supported by the fact that its memory address does not change.
>
>
> ** Attachment added: "debug.cpp"
>
> https://bugs.launchpad.net/bugs/684019/+attachment/2189292/+files/debug.cpp
>
> --
> You received this bug notification because you are a member of compiz
> packagers, which is subscribed to compiz-fusion-plugins-main in Ubuntu.
> https://bugs.launchpad.net/bugs/684019
>
> Title:
> 0.9.2 «put» plugin moves any window only to second viewport
>
> To manage notifications about this bug go to:
>
> https://bugs.launchpad.net/ubuntu/+source/compiz-fusion-plugins-main/+bug/684019/+subscriptions
>
> _______________________________________________
> Mailing list: https://launchpad.net/~compiz
> Post to : <email address hidden>
> Unsubscribe : https://launchpad.net/~compiz
> More help : https://help.launchpad.net/ListHelp
>

--
Sam Spilsbury

Changed in compiz-fusion-plugins-main (Ubuntu):
status: New → Confirmed
Revision history for this message
Dario Manesku (dariomanesku) wrote :

I am having the same problem and I have the latest version. Is it fixed?

Package: compiz-core
Version: 1:0.9.4+bzr20110606-0ubuntu1~natty2

Package: compiz-fusion-plugins-main
Version: 0.9.4+bzr20110527-0ubuntu1~natty1

Revision history for this message
Dominik (dominik-dbruhn) wrote :

Same problem still valid in 11.10:

Package: compiz-core
Version: 1:0.9.6+bzr20110929-0ubuntu3

Package: compiz-plugins-main
Version: 1:0.9.6-0ubuntu2

Revision history for this message
Twoja Stara (opava82) wrote :

Does not work for me on 11.10 too:

Package: compiz-core
Version: 1:0.9.6+bzr20110929-0ubuntu3

Package: compiz-plugins-main
Version: 1:0.9.6-0ubuntu2

Revision history for this message
Tri Ngo (tringo) wrote :

Also not working for me on 11.10, for me.
I can fix it myself by compiling the plugin but just wanted to let you guys know the mainstream one isn't working.

Package: compiz-core
Version: 1:0.9.6+bzr20110929-0ubuntu5

Package: compiz-plugins-main
Version: 1:0.9.6-0ubuntu4

Revision history for this message
Shirakawasuna (shirakawasuna) wrote :

Has the patch been applied? This bug is still present, almost in time for Precise.

Revision history for this message
Sylvain Benner (syl20bnr) wrote :

Also not fix here in 11.10. Will it be fixed for Precise?

Revision history for this message
Twoja Stara (opava82) wrote :

Oh come on - it remains unfixed for 17 months. I'm forced to use kwin because this makes compiz unusable.

I switched from gentoo to arch linux then to ubuntu - I don't have time to hack my desktop packages (patch this, download and compile from devel branch that, remove this, make symbolic link to that). I thought: 'OK. I have decent machine now and I can afford to have slower, not so bleeding-edge (aka stable) and more bloated distro. In return I'll get out-of-the box working distro with strong community/support'. And I have to say I am pretty happy with the choice I made.

But the way this bug is being handled is tragic. Is there someone who cares about compiz on ubuntu?

Maybe you need a volunteer to fix this bug? I can help - apply (or write if current patch is incorrect) the patch, create package, etc. Actually I can devote some of my free time to fix ubuntu bugs I encounter - all I need is someone who can make fixed packages available for the public (e.g. via apt-get upgrade)

Revision history for this message
otakuj462 (otakuj462) wrote :

I have applied the patch, from https://bugs.launchpad.net/ubuntu/+source/compiz-fusion-plugins-main/+bug/684019/comments/7 to the upstream put plugin, and it does seem to fix the bug. As this appears to be the only way to get "Put Window at Workspace X" functionality working in Ubuntu, I have written instructions to help others accomplish this.

First get your build requirements:

1. sudo apt-get build-essential
2. sudo apt-get build-dep compiz
3. sudo apt-get install compiz-dev git

Then get the put plugin source:

4. git clone git://anongit.compiz-fusion.org/compiz/plugins/put
5. cd put

Then get and apply the patch:

6. wget https://bugs.launchpad.net/ubuntu/+source/compiz-fusion-plugins-main/+bug/684019/+attachment/2187914/+files/0001-bug-fix-overwrite-viewport-option-parameter-instead-.patch
7. git apply 0001-bug-fix-overwrite-viewport-option-parameter-instead-.patch

Then build and install it:

6. mkdir build
7. cd build
8. cmake .. -DCOMPIZ_PLUGIN_INSTALL_TYPE="compiz" -DCMAKE_INSTALL_PREFIX=/usr/lib/compiz/
9. make
10. sudo make install

Note that in step 8, you will be potentially be installing the put plugin on top of the one installed from the debian package. It might be possible to install it locally instead, but I didn't try this. It would be great if others could try this and let me know how it works, because it is potentially a cleaner solution. To install locally, you would likely do the following in steps 8-10:

8. cmake ..
9. make
10. make install

Most of the information here came from the following resource: http://wiki.compiz.org/C%2B%2BCompiling

I think this patch should get merged upstream. Are there any barriers to this?

Revision history for this message
Cson (theceason) wrote :

Also not working for me on 12.04, for me.
I can fix it myself by compiling the plugin but just wanted to let you guys know the mainstream one isn't working.

Revision history for this message
Hans Deragon (deragon) wrote :

Still present in Ubuntu 14.04 LTS Trusty Thar. But in my case, I see the window moving away by animation, and then it returns spontaneously back to the current viewport.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.