fix _NET_WM_DESKTOP client message handling

This commit is contained in:
rathnor 2004-03-07 23:37:39 +00:00
parent c0325e6127
commit 206a7ca10d
2 changed files with 27 additions and 8 deletions

View file

@ -1,5 +1,9 @@
(Format: Year/Month/Day)
Changes for 0.9.9:
*04/03/08:
* Fix receipt of _NET_WM_DESKTOP client messages (Simon)
- fixes xmms "show on all desktops" not working
Ewmh.cc
*04/03/03:
* Fix update of keys on keymap change (Simon)
fluxbox.cc

View file

@ -19,7 +19,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
// $Id: Ewmh.cc,v 1.44 2004/02/20 09:05:38 fluxgen Exp $
// $Id: Ewmh.cc,v 1.45 2004/03/07 23:37:39 rathnor Exp $
#include "Ewmh.hh"
@ -498,15 +498,30 @@ void Ewmh::updateWorkspace(FluxboxWindow &win) {
bool Ewmh::checkClientMessage(const XClientMessageEvent &ce,
BScreen * screen, WinClient * const winclient) {
if (ce.message_type == m_net_wm_desktop) {
if (screen == 0)
return true;
// ce.data.l[0] = workspace number
// valid window and workspace number?
if (winclient == 0 || winclient->fbwindow() == 0 ||
static_cast<unsigned int>(ce.data.l[0]) >= screen->getCount())
// valid window
if (winclient == 0 || winclient->fbwindow() == 0)
return true;
screen->sendToWorkspace(ce.data.l[0], winclient->fbwindow(), false);
FluxboxWindow *fbwin = winclient->fbwindow();
// if it's stick, make sure it is stuck.
// otherwise, make sure it isn't stuck
if (ce.data.l[0] == 0xFFFFFFFF) {
if (!fbwin->isStuck())
fbwin->stick();
return true;
} else if (fbwin->isStuck())
fbwin->stick();
// the screen is the root window of the message,
// which doesn't apply here (so borrow the variable :) )
screen = &fbwin->screen();
// valid workspace number?
if (static_cast<unsigned int>(ce.data.l[0]) < screen->getCount())
screen->sendToWorkspace(ce.data.l[0], fbwin, false);
return true;
} else if (ce.message_type == m_net_wm_state) {
if (winclient == 0 || winclient->fbwindow() == 0)