#329 [PATCH] Blackbox blows up on _NET_NUMBER_OF_DESKTOPS

0.70.x
open
nobody
Behaviour (212)
5
2008-11-17
2008-11-17
Ryan Beasley
No

Setting _NET_NUMBER_OF_DESKTOPS may cause Blackbox to explode. The problem is due to a bad loop condition in Screen.cc::clientMessageEvent(). If the difference between the new number of desktops and the initial workspaceCount() is odd, the condition is always true, or at least until "number" underflows or overflows. BB will usually end up munching a lot of memory & dying when it creates thousands of desktops first, though. ;)

Anyway, the attached patch seems to fix this. :)
TIA!

Discussion

  • Ryan Beasley
    Ryan Beasley
    2008-11-17

    Patch to fix _NET_NUMBER_OF_DESKTOPS.

     
  • Ryan Beasley
    Ryan Beasley
    2008-11-17

    • summary: Blackbox blows up in response to _NET_NUMBER_OF_DESKTOPS --> [PATCH] Blackbox blows up on _NET_NUMBER_OF_DESKTOPS
     
  • Patrick Bogen
    Patrick Bogen
    2008-12-02

    Hi, Ryan. Thanks for the report and the patch; I've fixed this in my subversion repository (https://cernu.us/~pdbogen/svn/blackbox). You're welcome to pull down the repo and build from that. I actually didn't use your patched, but replaced the two if's and two for's with a pair of while loops, in a way that seems more intuitive to me. Please test this fix and let me know if you encounter any problems.