aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Ewmh.cc31
1 files changed, 23 insertions, 8 deletions
diff --git a/src/Ewmh.cc b/src/Ewmh.cc
index 7f23302..64583cc 100644
--- a/src/Ewmh.cc
+++ b/src/Ewmh.cc
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: Ewmh.cc,v 1.44 2004/02/20 09:05:38 fluxgen Exp $ 22// $Id: Ewmh.cc,v 1.45 2004/03/07 23:37:39 rathnor Exp $
23 23
24#include "Ewmh.hh" 24#include "Ewmh.hh"
25 25
@@ -498,15 +498,30 @@ void Ewmh::updateWorkspace(FluxboxWindow &win) {
498bool Ewmh::checkClientMessage(const XClientMessageEvent &ce, 498bool Ewmh::checkClientMessage(const XClientMessageEvent &ce,
499 BScreen * screen, WinClient * const winclient) { 499 BScreen * screen, WinClient * const winclient) {
500 if (ce.message_type == m_net_wm_desktop) { 500 if (ce.message_type == m_net_wm_desktop) {
501 if (screen == 0)
502 return true;
503 // ce.data.l[0] = workspace number 501 // ce.data.l[0] = workspace number
504 // valid window and workspace number? 502 // valid window
505 if (winclient == 0 || winclient->fbwindow() == 0 || 503
506 static_cast<unsigned int>(ce.data.l[0]) >= screen->getCount()) 504 if (winclient == 0 || winclient->fbwindow() == 0)
507 return true; 505 return true;
508 506
509 screen->sendToWorkspace(ce.data.l[0], winclient->fbwindow(), false); 507 FluxboxWindow *fbwin = winclient->fbwindow();
508
509 // if it's stick, make sure it is stuck.
510 // otherwise, make sure it isn't stuck
511 if (ce.data.l[0] == 0xFFFFFFFF) {
512 if (!fbwin->isStuck())
513 fbwin->stick();
514 return true;
515 } else if (fbwin->isStuck())
516 fbwin->stick();
517
518 // the screen is the root window of the message,
519 // which doesn't apply here (so borrow the variable :) )
520 screen = &fbwin->screen();
521 // valid workspace number?
522 if (static_cast<unsigned int>(ce.data.l[0]) < screen->getCount())
523 screen->sendToWorkspace(ce.data.l[0], fbwin, false);
524
510 return true; 525 return true;
511 } else if (ce.message_type == m_net_wm_state) { 526 } else if (ce.message_type == m_net_wm_state) {
512 if (winclient == 0 || winclient->fbwindow() == 0) 527 if (winclient == 0 || winclient->fbwindow() == 0)