Here's a short one for all you BlackBox hackers listening in:

My patch to get "onto current workspace" is almost working besides of o=
ne
little problem. The window does not show.
It's moved to current workspace allright, and if I shift workspace and
go back - the window is there, and it everything is fine. Which method
should be invoked so the window is actually painted?

The file I have been tampering with, is attached. All I have added is
the reaction to button=3D=3D2.

/Mads Martin
--=20
Mads Martin J=F8rgensen
Stud. Scient. Dat/Chem
E-Mail: [EMAIL PROTECTED]
URL: http://mmj.dk
// Clientmenu.cc for Blackbox - an X11 Window manager
// Copyright (c) 1997 - 2000 Brad Hughes ([EMAIL PROTECTED])
//
// Permission is hereby granted, free of charge, to any person obtainin=
g a
// copy of this software and associated documentation files (the "Softw=
are"),
// to deal in the Software without restriction, including without limit=
ation
// the rights to use, copy, modify, merge, publish, distribute, sublice=
nse,
// and/or sell copies of the Software, and to permit persons to whom th=
e
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be inclu=
ded in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPR=
ESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABIL=
ITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT S=
HALL
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR=
 OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARIS=
ING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.

// stupid macros needed to access some functions in version 2 of the GN=
U C
// library
#ifndef   _GNU_SOURCE
#define   _GNU_SOURCE
#endif // _GNU_SOURCE

#ifdef    HAVE_CONFIG_H
#  include "../config.h"
#endif // HAVE_CONFIG_H

#include "blackbox.hh"
#include "Clientmenu.hh"
#include "Screen.hh"
#include "Window.hh"
#include "Workspace.hh"
#include "Workspacemenu.hh"


Clientmenu::Clientmenu(Workspace *ws) : Basemenu(ws->getScreen()) {
  wkspc =3D ws;
  screen =3D wkspc->getScreen();

  setInternalMenu();
}


void Clientmenu::itemSelected(int button, int index) {
  if (button =3D=3D 1) {
    if (index >=3D 0 && index < wkspc->getCount()) {
      if (! wkspc->isCurrent()) wkspc->setCurrent();

      BlackboxWindow *win =3D wkspc->getWindow(index);
      if (win) {
        wkspc->raiseWindow(win);
        win->setInputFocus();
      }
    }

    if (! (screen->getWorkspacemenu()->isTorn() || isTorn()))
      hide();
  }
  if (button =3D=3D 2) {
    Workspace *cur_wkspc =3D screen->getCurrentWorkspace();
    if (index >=3D 0 && index < wkspc->getCount()) {
      if (!wkspc->isCurrent()) {=20
        BlackboxWindow *win =3D wkspc->getWindow(index);
        if(win){
          screen->reassociateWindow(win, cur_wkspc->getWorkspaceID(), T=
rue);
          win->setInputFocus();
          cur_wkspc->raiseWindow(win);
        }
      }
    }
    if (! (screen->getWorkspacemenu()->isTorn() || isTorn()))
      hide();
  }
}

Reply via email to