From aad50046de0b1971f869ee95a0f80267c74a1fd3 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Wed, 5 Jun 2002 04:20:08 +0000 Subject: [PATCH] synched with bb-cvs. couple bug fixes. --- src/Screen.cc | 15 ++++++++++----- src/Window.cc | 1 - src/Workspace.cc | 1 - src/blackbox.cc | 7 +++---- util/Makefile.am | 2 +- 5 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/Screen.cc b/src/Screen.cc index 8779733c..512475c8 100644 --- a/src/Screen.cc +++ b/src/Screen.cc @@ -1040,10 +1040,14 @@ void BScreen::changeWorkspaceID(unsigned int id) { workspacemenu->setItemSelected(current_workspace->getID() + 2, False); - if (blackbox->getFocusedWindow() && - blackbox->getFocusedWindow()->getScreen() == this && - ! blackbox->getFocusedWindow()->isStuck()) { - current_workspace->setLastFocusedWindow(blackbox->getFocusedWindow()); + BlackboxWindow *focused = blackbox->getFocusedWindow(); + if (focused && focused->getScreen() == this && ! focused->isStuck()) { + if (focused->getWorkspaceNumber() != current_workspace->getID()) { + fprintf(stderr, "%s is on the wrong workspace, aborting\n", + focused->getTitle()); + abort(); + } + current_workspace->setLastFocusedWindow(focused); blackbox->setFocusedWindow((BlackboxWindow *) 0); } @@ -1079,7 +1083,8 @@ void BScreen::manageWindow(Window w) { XMapRequestEvent mre; mre.window = w; - win->restoreAttributes(); + if (blackbox->isStartup()) + win->restoreAttributes(); win->mapRequestEvent(&mre); } diff --git a/src/Window.cc b/src/Window.cc index be03e4aa..2fe0928f 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -268,7 +268,6 @@ BlackboxWindow::BlackboxWindow(Blackbox *b, Window w, BScreen *s) { BlackboxWindow::~BlackboxWindow(void) { - #ifdef DEBUG fprintf(stderr, "BlackboxWindow::~BlackboxWindow: destroying 0x%lx\n", client.window); diff --git a/src/Workspace.cc b/src/Workspace.cc index 35b3b593..64710a59 100644 --- a/src/Workspace.cc +++ b/src/Workspace.cc @@ -224,7 +224,6 @@ void Workspace::lowerTransients(const BlackboxWindow * const win, wkspc->stackingList.push_back((*it)); } } - } diff --git a/src/blackbox.cc b/src/blackbox.cc index 266d0e73..118a17bc 100644 --- a/src/blackbox.cc +++ b/src/blackbox.cc @@ -666,10 +666,9 @@ void Blackbox::process_event(XEvent *e) { } else if(e->xclient.message_type == getBlackboxChangeWorkspaceAtom()) { BScreen *screen = searchScreen(e->xclient.window); - if (screen && e->xclient.data.l[0] >= 0 && - e->xclient.data.l[0] < - static_cast(screen->getWorkspaceCount())) - screen->changeWorkspaceID(e->xclient.data.l[0]); + unsigned int workspace = e->xclient.data.l[0]; + if (screen && workspace < screen->getWorkspaceCount()) + screen->changeWorkspaceID(workspace); } else if (e->xclient.message_type == getBlackboxChangeWindowFocusAtom()) { BlackboxWindow *win = searchWindow(e->xclient.window); diff --git a/util/Makefile.am b/util/Makefile.am index e0f3ecc6..9d60a964 100644 --- a/util/Makefile.am +++ b/util/Makefile.am @@ -11,7 +11,7 @@ bsetroot_LDADD = ../src/BaseDisplay.o ../src/Color.o ../src/GCCache.o ../src/Tex MAINTAINERCLEANFILES = Makefile.in distclean-local: - rm -f *\~ + rm -f *\~ .\#* # local dependencies -- 2.45.2