cleaning in FluxboxWindow interface
This commit is contained in:
parent
93220b5f1a
commit
cbce8634dd
16 changed files with 452 additions and 428 deletions
10
src/Ewmh.cc
10
src/Ewmh.cc
|
@ -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.23 2003/05/11 17:06:02 fluxgen Exp $
|
||||
// $Id: Ewmh.cc,v 1.24 2003/05/15 11:17:26 fluxgen Exp $
|
||||
|
||||
#include "Ewmh.hh"
|
||||
|
||||
|
@ -103,7 +103,7 @@ void Ewmh::setupWindow(FluxboxWindow &win) {
|
|||
unsigned long nitems, bytes_after;
|
||||
long *data = 0;
|
||||
/*
|
||||
if (XGetWindowProperty(disp, win.getClientWindow(),
|
||||
if (XGetWindowProperty(disp, win.clientWindow(),
|
||||
m_net_wm_state, 0, 1, False, XA_CARDINAL,
|
||||
&ret_type, &fmt, &nitems, &bytes_after,
|
||||
(unsigned char **) &data) == Success && data) {
|
||||
|
@ -112,7 +112,7 @@ void Ewmh::setupWindow(FluxboxWindow &win) {
|
|||
XFree(data);
|
||||
}
|
||||
*/
|
||||
if (XGetWindowProperty(disp, win.getClientWindow(),
|
||||
if (XGetWindowProperty(disp, win.clientWindow(),
|
||||
m_net_wm_desktop, 0, 1, False, XA_CARDINAL,
|
||||
&ret_type, &fmt, &nitems, &bytes_after,
|
||||
(unsigned char **) &data) == Success && data) {
|
||||
|
@ -168,7 +168,7 @@ void Ewmh::updateClientList(BScreen &screen) {
|
|||
(*workspace_it)->windowList().end();
|
||||
for (; it != it_end; ++it) {
|
||||
if ((*it)->numClients() == 1)
|
||||
wl[win++] = (*it)->getClientWindow();
|
||||
wl[win++] = (*it)->clientWindow();
|
||||
else {
|
||||
// add every client in fluxboxwindow to list window list
|
||||
std::list<WinClient *>::iterator client_it =
|
||||
|
@ -251,7 +251,7 @@ void Ewmh::updateHints(FluxboxWindow &win) {
|
|||
}
|
||||
|
||||
void Ewmh::updateWorkspace(FluxboxWindow &win) {
|
||||
int workspace = win.getWorkspaceNumber();
|
||||
int workspace = win.workspaceNumber();
|
||||
if (win.isStuck())
|
||||
workspace = 0xFFFFFFFF; // appear on all desktops/workspaces
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
// $Id: FbWinFrame.cc,v 1.23 2003/05/01 13:19:36 rathnor Exp $
|
||||
// $Id: FbWinFrame.cc,v 1.24 2003/05/15 11:17:26 fluxgen Exp $
|
||||
|
||||
#include "FbWinFrame.hh"
|
||||
#include "ImageControl.hh"
|
||||
|
@ -284,7 +284,6 @@ void FbWinFrame::setClientWindow(Window win) {
|
|||
XSetWindowBorderWidth(display, win, 0);
|
||||
|
||||
XChangeSaveSet(display, win, SetModeInsert);
|
||||
|
||||
|
||||
XSelectInput(display, m_clientarea.window(), NoEventMask);
|
||||
// we need to mask this so we don't get unmap event
|
||||
|
@ -292,7 +291,7 @@ void FbWinFrame::setClientWindow(Window win) {
|
|||
XReparentWindow(display, win, m_clientarea.window(), 0, 0);
|
||||
// remask window so we get events
|
||||
XSelectInput(display, win, PropertyChangeMask | StructureNotifyMask |
|
||||
FocusChangeMask );
|
||||
FocusChangeMask);
|
||||
XSelectInput(display, m_clientarea.window(), SubstructureRedirectMask);
|
||||
|
||||
XFlush(display);
|
||||
|
|
20
src/Gnome.cc
20
src/Gnome.cc
|
@ -19,7 +19,7 @@
|
|||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
// $Id: Gnome.cc,v 1.22 2003/05/11 17:11:58 fluxgen Exp $
|
||||
// $Id: Gnome.cc,v 1.23 2003/05/15 11:17:27 fluxgen Exp $
|
||||
|
||||
#include "Gnome.hh"
|
||||
|
||||
|
@ -92,7 +92,7 @@ void Gnome::setupWindow(FluxboxWindow &win) {
|
|||
unsigned long nitems, bytes_after;
|
||||
long flags, *data = 0;
|
||||
|
||||
if (XGetWindowProperty(disp, win.getClientWindow(),
|
||||
if (XGetWindowProperty(disp, win.clientWindow(),
|
||||
m_gnome_wm_win_state, 0, 1, False, XA_CARDINAL,
|
||||
&ret_type, &fmt, &nitems, &bytes_after,
|
||||
(unsigned char **) &data) == Success && data) {
|
||||
|
@ -102,7 +102,7 @@ void Gnome::setupWindow(FluxboxWindow &win) {
|
|||
}
|
||||
|
||||
// load gnome layer atom
|
||||
if (XGetWindowProperty(disp, win.getClientWindow(),
|
||||
if (XGetWindowProperty(disp, win.clientWindow(),
|
||||
m_gnome_wm_win_layer, 0, 1, False, XA_CARDINAL,
|
||||
&ret_type, &fmt, &nitems, &bytes_after,
|
||||
(unsigned char **) &data) == Success && data) {
|
||||
|
@ -112,12 +112,12 @@ void Gnome::setupWindow(FluxboxWindow &win) {
|
|||
}
|
||||
|
||||
// load gnome workspace atom
|
||||
if (XGetWindowProperty(disp, win.getClientWindow(),
|
||||
if (XGetWindowProperty(disp, win.clientWindow(),
|
||||
m_gnome_wm_win_workspace, 0, 1, False, XA_CARDINAL,
|
||||
&ret_type, &fmt, &nitems, &bytes_after,
|
||||
(unsigned char **) &data) == Success && data) {
|
||||
unsigned int workspace_num = *data;
|
||||
if (win.getWorkspaceNumber() != workspace_num)
|
||||
if (win.workspaceNumber() != workspace_num)
|
||||
win.screen().reassociateWindow(&win, workspace_num, false);
|
||||
XFree (data);
|
||||
}
|
||||
|
@ -222,12 +222,12 @@ void Gnome::updateWorkspaceCount(BScreen &screen) {
|
|||
}
|
||||
|
||||
void Gnome::updateWorkspace(FluxboxWindow &win) {
|
||||
int val = win.getWorkspaceNumber();
|
||||
int val = win.workspaceNumber();
|
||||
#ifdef DEBUG
|
||||
cerr<<__FILE__<<"("<<__LINE__<<"): setting workspace("<<val<<
|
||||
") for window("<<&win<<")"<<endl;
|
||||
#endif // DEBUG
|
||||
XChangeProperty(FbTk::App::instance()->display(), win.getClientWindow(),
|
||||
XChangeProperty(FbTk::App::instance()->display(), win.clientWindow(),
|
||||
m_gnome_wm_win_workspace,
|
||||
XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&val, 1);
|
||||
}
|
||||
|
@ -242,7 +242,7 @@ void Gnome::updateState(FluxboxWindow &win) {
|
|||
if (win.isShaded())
|
||||
state |= WIN_STATE_SHADED;
|
||||
|
||||
XChangeProperty(FbTk::App::instance()->display(), win.getClientWindow(),
|
||||
XChangeProperty(FbTk::App::instance()->display(), win.clientWindow(),
|
||||
m_gnome_wm_win_state,
|
||||
XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&state, 1);
|
||||
}
|
||||
|
@ -250,8 +250,8 @@ void Gnome::updateState(FluxboxWindow &win) {
|
|||
void Gnome::updateLayer(FluxboxWindow &win) {
|
||||
//TODO - map from flux layers to gnome ones
|
||||
// our layers are in the opposite direction to GNOME
|
||||
int layernum = Fluxbox::instance()->getDesktopLayer() - win.getLayerNum();
|
||||
XChangeProperty(FbTk::App::instance()->display(), win.getClientWindow(),
|
||||
int layernum = Fluxbox::instance()->getDesktopLayer() - win.layerNum();
|
||||
XChangeProperty(FbTk::App::instance()->display(), win.clientWindow(),
|
||||
m_gnome_wm_win_layer,
|
||||
XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&layernum, 1);
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
// $Id: IconBar.cc,v 1.33 2003/05/10 22:55:10 fluxgen Exp $
|
||||
// $Id: IconBar.cc,v 1.34 2003/05/15 11:17:27 fluxgen Exp $
|
||||
|
||||
#include "IconBar.hh"
|
||||
|
||||
|
@ -29,6 +29,7 @@
|
|||
#include "ImageControl.hh"
|
||||
#include "Text.hh"
|
||||
#include "RootTheme.hh"
|
||||
#include "FbWinFrameTheme.hh"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
|
@ -321,7 +322,7 @@ void IconBar::draw(const IconBarObj * const obj, int width) const {
|
|||
unsigned int title_text_w;
|
||||
|
||||
title_text_w = m_font.textWidth(
|
||||
fluxboxwin->getIconTitle().c_str(), fluxboxwin->getIconTitle().size());
|
||||
fluxboxwin->iconTitle().c_str(), fluxboxwin->iconTitle().size());
|
||||
|
||||
unsigned int bevel_w = screen().rootTheme().bevelWidth();
|
||||
int dx=bevel_w*2;
|
||||
|
@ -330,8 +331,8 @@ void IconBar::draw(const IconBarObj * const obj, int width) const {
|
|||
unsigned int newlen = 0;
|
||||
dx = FbTk::doAlignment(m_vertical ? obj->height() : obj->width(),
|
||||
bevel_w*2, FbTk::CENTER, m_font,
|
||||
fluxboxwin->getIconTitle().c_str(),
|
||||
fluxboxwin->getIconTitle().size(),
|
||||
fluxboxwin->iconTitle().c_str(),
|
||||
fluxboxwin->iconTitle().size(),
|
||||
newlen);
|
||||
//Draw title to m_iconwin
|
||||
|
||||
|
@ -348,7 +349,7 @@ void IconBar::draw(const IconBarObj * const obj, int width) const {
|
|||
iconwin,
|
||||
screen().getScreenNumber(),
|
||||
screen().winFrameTheme().labelTextFocusGC(),
|
||||
fluxboxwin->getIconTitle().c_str(), newlen,
|
||||
fluxboxwin->iconTitle().c_str(), newlen,
|
||||
dx, dy, m_vertical);
|
||||
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
// $Id: LayerMenu.hh,v 1.3 2003/05/07 11:30:28 fluxgen Exp $
|
||||
// $Id: LayerMenu.hh,v 1.4 2003/05/15 11:17:27 fluxgen Exp $
|
||||
|
||||
#ifndef LAYERMENU_HH
|
||||
#define LAYERMENU_HH
|
||||
|
@ -45,7 +45,7 @@ public:
|
|||
LayerMenuItem(const char *label, ItemType *object, int layernum):
|
||||
FbTk::MenuItem(label), m_object(object), m_layernum(layernum) {}
|
||||
|
||||
bool isEnabled() const { return m_object->getLayerItem().getLayerNum() != m_layernum; } ;
|
||||
bool isEnabled() const { return m_object->layerItem().getLayerNum() != m_layernum; } ;
|
||||
void click(int button, int time) {
|
||||
m_object->moveToLayer(m_layernum);
|
||||
FbTk::MenuItem::click(button, time);
|
||||
|
@ -101,12 +101,12 @@ LayerMenu<ItemType>::LayerMenu(FbTk::MenuTheme &tm, int screen_num, FbTk::ImageC
|
|||
// TODO: fetch nls string
|
||||
if (save_rc) {
|
||||
insert(new LayerMenuItem<ItemType>(
|
||||
layer_menuitems[i].default_str,
|
||||
m_object, layer_menuitems[i].layernum, saverc_cmd));
|
||||
layer_menuitems[i].default_str,
|
||||
m_object, layer_menuitems[i].layernum, saverc_cmd));
|
||||
} else {
|
||||
insert(new LayerMenuItem<ItemType>(
|
||||
layer_menuitems[i].default_str,
|
||||
m_object, layer_menuitems[i].layernum));
|
||||
layer_menuitems[i].default_str,
|
||||
m_object, layer_menuitems[i].layernum));
|
||||
}
|
||||
}
|
||||
update();
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
// $Id: Remember.cc,v 1.13 2003/05/11 13:36:10 fluxgen Exp $
|
||||
// $Id: Remember.cc,v 1.14 2003/05/15 11:17:27 fluxgen Exp $
|
||||
|
||||
#include "Remember.hh"
|
||||
#include "StringUtil.hh"
|
||||
|
@ -462,19 +462,19 @@ void Remember::rememberAttrib(WinClient &winclient, Attribute attrib) {
|
|||
}
|
||||
switch (attrib) {
|
||||
case REM_WORKSPACE:
|
||||
app->rememberWorkspace(win->getWorkspaceNumber());
|
||||
app->rememberWorkspace(win->workspaceNumber());
|
||||
break;
|
||||
case REM_DIMENSIONS:
|
||||
app->rememberDimensions(win->width(), win->height());
|
||||
break;
|
||||
case REM_POSITION:
|
||||
app->rememberPosition(win->getXFrame(), win->getYFrame());
|
||||
app->rememberPosition(win->x(), win->y());
|
||||
break;
|
||||
case REM_STUCKSTATE:
|
||||
app->rememberShadedstate(win->isShaded());
|
||||
break;
|
||||
case REM_DECOSTATE:
|
||||
app->rememberDecostate(win->getDecorationMask());
|
||||
app->rememberDecostate(win->decorationMask());
|
||||
break;
|
||||
case REM_SHADEDSTATE:
|
||||
app->rememberStuckstate(win->isStuck());
|
||||
|
@ -485,7 +485,7 @@ void Remember::rememberAttrib(WinClient &winclient, Attribute attrib) {
|
|||
app->rememberJumpworkspace(true);
|
||||
break;
|
||||
case REM_LAYER:
|
||||
app->rememberLayer(win->getLayerNum());
|
||||
app->rememberLayer(win->layerNum());
|
||||
break;
|
||||
case REM_SAVEONCLOSE:
|
||||
app->rememberSaveOnClose(true);
|
||||
|
@ -547,7 +547,7 @@ void Remember::setupWindow(FluxboxWindow &win) {
|
|||
|
||||
// we don't touch the window if it is a transient
|
||||
// of something else
|
||||
int menupos = win.getWindowmenu().numberOfItems()-2;
|
||||
int menupos = win.menu().numberOfItems()-2;
|
||||
if (menupos < -1)
|
||||
menupos = -1;
|
||||
|
||||
|
@ -556,18 +556,18 @@ void Remember::setupWindow(FluxboxWindow &win) {
|
|||
// so, we add a disabled item...
|
||||
FbTk::MenuItem *item = new FbTk::MenuItem("Remember...");
|
||||
item->setEnabled(false);
|
||||
win.getWindowmenu().insert(item, menupos);
|
||||
win.getWindowmenu().update();
|
||||
win.menu().insert(item, menupos);
|
||||
win.menu().update();
|
||||
return;
|
||||
}
|
||||
|
||||
// add the menu, this -2 is somewhat dodgy... :-/
|
||||
// All windows get the remember menu.
|
||||
// TODO: nls
|
||||
win.getWindowmenu().insert("Remember...",
|
||||
win.menu().insert("Remember...",
|
||||
createRememberMenu(*this, win),
|
||||
menupos);
|
||||
win.getWindowmenu().reconfigure();
|
||||
win.menu().reconfigure();
|
||||
|
||||
Application *app = find(winclient);
|
||||
if (app == 0)
|
||||
|
@ -629,17 +629,17 @@ void Remember::updateWindowClose(FluxboxWindow &win) {
|
|||
}
|
||||
/*
|
||||
if (app->workspace_remember)
|
||||
app->rememberWorkspace(win.getWorkspaceNumber());
|
||||
app->rememberWorkspace(win.workspaceNumber());
|
||||
if (app->dimensions_remember)
|
||||
app->rememberDimensions(win.width(), win.height());
|
||||
if (app->position_remember)
|
||||
app->rememberPosition(win.getXFrame(), win.getYFrame());
|
||||
app->rememberPosition(win.x(), win.y());
|
||||
if (app->shadedstate_remember)
|
||||
app->rememberShadedstate(win.isShaded());
|
||||
// external tabs off atm
|
||||
//if (app->tabstate_remember) ...
|
||||
if (app->decostate_remember)
|
||||
app->rememberDecostate(win.getDecorationMask());
|
||||
app->rememberDecostate(win.decorationMask());
|
||||
if (app->stuckstate_remember)
|
||||
app->rememberStuckstate(win.isStuck());
|
||||
if (app->jumpworkspace_remember)
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
// $Id: Screen.cc,v 1.165 2003/05/14 12:08:19 fluxgen Exp $
|
||||
// $Id: Screen.cc,v 1.166 2003/05/15 11:17:27 fluxgen Exp $
|
||||
|
||||
|
||||
#include "Screen.hh"
|
||||
|
@ -52,6 +52,7 @@
|
|||
#include "LayerMenu.hh"
|
||||
#include "WinClient.hh"
|
||||
#include "Subject.hh"
|
||||
#include "FbWinFrame.hh"
|
||||
|
||||
//use GNU extensions
|
||||
#ifndef _GNU_SOURCE
|
||||
|
@ -1005,7 +1006,7 @@ void BScreen::removeWindow(FluxboxWindow *win) {
|
|||
if (win->isIconic())
|
||||
removeIcon(win);
|
||||
else
|
||||
getWorkspace(win->getWorkspaceNumber())->removeWindow(win);
|
||||
getWorkspace(win->workspaceNumber())->removeWindow(win);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1173,7 +1174,7 @@ void BScreen::sendToWorkspace(unsigned int id, FluxboxWindow *win, bool changeWS
|
|||
}
|
||||
#ifdef DEBUG
|
||||
cerr<<__FILE__<<": Sending to id = "<<id<<endl;
|
||||
cerr<<__FILE__<<": win->workspaceId="<<win->getWorkspaceNumber()<<endl;
|
||||
cerr<<__FILE__<<": win->workspaceId="<<win->workspaceNumber()<<endl;
|
||||
#endif //DEBUG
|
||||
|
||||
}
|
||||
|
@ -1196,13 +1197,13 @@ void BScreen::addNetizen(Window win) {
|
|||
Workspace::Windows::iterator win_it = (*it)->windowList().begin();
|
||||
Workspace::Windows::iterator win_it_end = (*it)->windowList().end();
|
||||
for (; win_it != win_it_end; ++win_it) {
|
||||
net->sendWindowAdd((*win_it)->getClientWindow(),
|
||||
net->sendWindowAdd((*win_it)->clientWindow(),
|
||||
(*it)->workspaceID());
|
||||
}
|
||||
}
|
||||
|
||||
Window f = ((Fluxbox::instance()->getFocusedWindow()) ?
|
||||
Fluxbox::instance()->getFocusedWindow()->getClientWindow() : None);
|
||||
Fluxbox::instance()->getFocusedWindow()->clientWindow() : None);
|
||||
net->sendWindowFocus(f);
|
||||
}
|
||||
|
||||
|
@ -1242,7 +1243,7 @@ void BScreen::updateNetizenWindowFocus() {
|
|||
Netizens::iterator it = netizenList.begin();
|
||||
Netizens::iterator it_end = netizenList.end();
|
||||
Window f = ((Fluxbox::instance()->getFocusedWindow()) ?
|
||||
Fluxbox::instance()->getFocusedWindow()->getClientWindow() : None);
|
||||
Fluxbox::instance()->getFocusedWindow()->clientWindow() : None);
|
||||
for (; it != it_end; ++it) {
|
||||
(*it)->sendWindowFocus(f);
|
||||
}
|
||||
|
@ -1305,7 +1306,7 @@ FluxboxWindow *BScreen::createWindow(Window client) {
|
|||
|
||||
#ifdef SLIT
|
||||
if (win->initialState() == WithdrawnState)
|
||||
getSlit()->addClient(win->getClientWindow());
|
||||
getSlit()->addClient(win->clientWindow());
|
||||
#endif // SLIT
|
||||
|
||||
if (!win->isManaged()) {
|
||||
|
@ -1324,7 +1325,7 @@ FluxboxWindow *BScreen::createWindow(Window client) {
|
|||
setupWindowActions(*win);
|
||||
Fluxbox::instance()->attachSignals(*win);
|
||||
}
|
||||
if (win->getWorkspaceNumber() == getCurrentWorkspaceID() || win->isStuck()) {
|
||||
if (win->workspaceNumber() == getCurrentWorkspaceID() || win->isStuck()) {
|
||||
win->show();
|
||||
}
|
||||
XSync(FbTk::App::instance()->display(), False);
|
||||
|
@ -1337,7 +1338,7 @@ FluxboxWindow *BScreen::createWindow(WinClient &client) {
|
|||
*layerManager().getLayer(Fluxbox::instance()->getNormalLayer()));
|
||||
#ifdef SLIT
|
||||
if (win->initialState() == WithdrawnState)
|
||||
getSlit()->addClient(win->getClientWindow());
|
||||
getSlit()->addClient(win->clientWindow());
|
||||
#endif // SLIT
|
||||
if (!win->isManaged()) {
|
||||
delete win;
|
||||
|
@ -1349,7 +1350,7 @@ FluxboxWindow *BScreen::createWindow(WinClient &client) {
|
|||
Fluxbox::instance()->saveWindowSearch(client.window(), win);
|
||||
setupWindowActions(*win);
|
||||
Fluxbox::instance()->attachSignals(*win);
|
||||
if (win->getWorkspaceNumber() == getCurrentWorkspaceID() || win->isStuck()) {
|
||||
if (win->workspaceNumber() == getCurrentWorkspaceID() || win->isStuck()) {
|
||||
win->show();
|
||||
}
|
||||
return win;
|
||||
|
@ -1450,7 +1451,7 @@ void BScreen::setupWindowActions(FluxboxWindow &win) {
|
|||
frame.setOnClickTitlebar(lower_cmd, 2); // on release with button 2
|
||||
frame.setDoubleClickTime(Fluxbox::instance()->getDoubleClickInterval());
|
||||
// setup menu
|
||||
FbTk::Menu &menu = win.getWindowmenu();
|
||||
FbTk::Menu &menu = win.menu();
|
||||
menu.removeAll(); // clear old items
|
||||
menu.disableTitle(); // not titlebar
|
||||
|
||||
|
@ -1463,7 +1464,7 @@ void BScreen::setupWindowActions(FluxboxWindow &win) {
|
|||
menu.insert("Iconify", iconify_cmd);
|
||||
menu.insert("Raise", raise_cmd);
|
||||
menu.insert("Lower", lower_cmd);
|
||||
menu.insert("Layer...", &win.getLayermenu());
|
||||
menu.insert("Layer...", &win.layermenu());
|
||||
CommandRef next_client_cmd(new WindowCmd(win, &FluxboxWindow::nextClient));
|
||||
CommandRef prev_client_cmd(new WindowCmd(win, &FluxboxWindow::prevClient));
|
||||
menu.insert("Next Client", next_client_cmd);
|
||||
|
@ -1508,7 +1509,7 @@ void BScreen::reassociateWindow(FluxboxWindow *w, unsigned int wkspc_id,
|
|||
#endif // DEBUG
|
||||
}
|
||||
|
||||
if (!w->isIconic() && w->getWorkspaceNumber() == wkspc_id)
|
||||
if (!w->isIconic() && w->workspaceNumber() == wkspc_id)
|
||||
return;
|
||||
|
||||
|
||||
|
@ -1516,7 +1517,7 @@ void BScreen::reassociateWindow(FluxboxWindow *w, unsigned int wkspc_id,
|
|||
removeIcon(w);
|
||||
getWorkspace(wkspc_id)->addWindow(*w);
|
||||
} else if (ignore_sticky || ! w->isStuck()) {
|
||||
getWorkspace(w->getWorkspaceNumber())->removeWindow(w);
|
||||
getWorkspace(w->workspaceNumber())->removeWindow(w);
|
||||
getWorkspace(wkspc_id)->addWindow(*w);
|
||||
}
|
||||
}
|
||||
|
@ -1532,7 +1533,7 @@ void BScreen::nextFocus(int opts) {
|
|||
if (focused->screen().getScreenNumber() ==
|
||||
getScreenNumber()) {
|
||||
have_focused = true;
|
||||
focused_window_number = focused->getWindowNumber();
|
||||
focused_window_number = focused->windowNumber();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1564,7 +1565,7 @@ void BScreen::nextFocus(int opts) {
|
|||
FluxboxWindow *fbwin = (*it)->m_win;
|
||||
if (fbwin && !fbwin->isIconic() &&
|
||||
(fbwin->isStuck()
|
||||
|| fbwin->getWorkspaceNumber() == getCurrentWorkspaceID())) {
|
||||
|| fbwin->workspaceNumber() == getCurrentWorkspaceID())) {
|
||||
// either on this workspace, or stuck
|
||||
|
||||
// keep track of the originally selected window in a set
|
||||
|
@ -1622,7 +1623,7 @@ void BScreen::prevFocus(int opts) {
|
|||
if (focused->screen().getScreenNumber() ==
|
||||
getScreenNumber()) {
|
||||
have_focused = true;
|
||||
focused_window_number = focused->getWindowNumber();
|
||||
focused_window_number = focused->windowNumber();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1655,7 +1656,7 @@ void BScreen::prevFocus(int opts) {
|
|||
FluxboxWindow *fbwin = (*it)->m_win;
|
||||
if (fbwin && !fbwin->isIconic() &&
|
||||
(fbwin->isStuck()
|
||||
|| fbwin->getWorkspaceNumber() == getCurrentWorkspaceID())) {
|
||||
|| fbwin->workspaceNumber() == getCurrentWorkspaceID())) {
|
||||
// either on this workspace, or stuck
|
||||
|
||||
// keep track of the originally selected window in a set
|
||||
|
@ -1714,7 +1715,7 @@ void BScreen::raiseFocus() {
|
|||
if (fb->getFocusedWindow()->screen().getScreenNumber() ==
|
||||
getScreenNumber()) {
|
||||
have_focused = true;
|
||||
focused_window_number = fb->getFocusedWindow()->getWindowNumber();
|
||||
focused_window_number = fb->getFocusedWindow()->windowNumber();
|
||||
}
|
||||
|
||||
if ((getCurrentWorkspace()->numberOfWindows() > 1) && have_focused)
|
||||
|
@ -1739,10 +1740,10 @@ void BScreen::dirFocus(FluxboxWindow &win, FocusDir dir) {
|
|||
FluxboxWindow *foundwin = 0;
|
||||
int weight = 999999, exposure = 0; // extreme values
|
||||
int borderW = m_root_theme->borderWidth(),
|
||||
top = win.getYFrame(),
|
||||
bottom = win.getYFrame() + win.height() + 2*borderW,
|
||||
left = win.getXFrame(),
|
||||
right = win.getXFrame() + win.width() + 2*borderW;
|
||||
top = win.y(),
|
||||
bottom = win.y() + win.height() + 2*borderW,
|
||||
left = win.x(),
|
||||
right = win.x() + win.width() + 2*borderW;
|
||||
|
||||
Workspace::Windows &wins = getCurrentWorkspace()->windowList();
|
||||
Workspace::Windows::iterator it = wins.begin();
|
||||
|
@ -1752,10 +1753,10 @@ void BScreen::dirFocus(FluxboxWindow &win, FocusDir dir) {
|
|||
// we check things against an edge, and within the bounds (draw a picture)
|
||||
int edge=0, upper=0, lower=0, oedge=0, oupper=0, olower=0;
|
||||
|
||||
int otop = (*it)->getYFrame(),
|
||||
obottom = (*it)->getYFrame() + (*it)->height() + 2*borderW,
|
||||
oleft = (*it)->getXFrame(),
|
||||
oright = (*it)->getXFrame() + (*it)->width() + 2*borderW;
|
||||
int otop = (*it)->y(),
|
||||
obottom = (*it)->y() + (*it)->height() + 2*borderW,
|
||||
oleft = (*it)->x(),
|
||||
oright = (*it)->x() + (*it)->width() + 2*borderW;
|
||||
// check if they intersect
|
||||
switch (dir) {
|
||||
case FOCUSUP:
|
||||
|
@ -2494,7 +2495,7 @@ WinClient *BScreen::getLastFocusedWindow(int workspace) {
|
|||
FocusedWindows::iterator it_end = focused_list.end();
|
||||
for (; it != it_end; ++it)
|
||||
if ((*it)->fbwindow() &&
|
||||
(((int)(*it)->fbwindow()->getWorkspaceNumber()) == workspace
|
||||
(((int)(*it)->fbwindow()->workspaceNumber()) == workspace
|
||||
&& !(*it)->fbwindow()->isIconic()
|
||||
&& (!(*it)->fbwindow()->isStuck() || (*it)->fbwindow()->isFocused())))
|
||||
// only give focus to a stuck window if it is currently focused
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
/// $Id: Slit.hh,v 1.28 2003/05/13 21:09:43 fluxgen Exp $
|
||||
/// $Id: Slit.hh,v 1.29 2003/05/15 11:17:27 fluxgen Exp $
|
||||
|
||||
#ifndef SLIT_HH
|
||||
#define SLIT_HH
|
||||
|
@ -105,7 +105,7 @@ public:
|
|||
//@}
|
||||
|
||||
void moveToLayer(int layernum);
|
||||
FbTk::XLayerItem &getLayerItem() { return *m_layeritem; }
|
||||
FbTk::XLayerItem &layerItem() { return *m_layeritem; }
|
||||
|
||||
virtual void timeout();
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
// $Id: Toolbar.cc,v 1.80 2003/05/12 23:05:19 fluxgen Exp $
|
||||
// $Id: Toolbar.cc,v 1.81 2003/05/15 11:17:27 fluxgen Exp $
|
||||
|
||||
#include "Toolbar.hh"
|
||||
|
||||
|
@ -41,6 +41,7 @@
|
|||
#include "MacroCommand.hh"
|
||||
#include "RootTheme.hh"
|
||||
#include "BoolMenuItem.hh"
|
||||
#include "FbWinFrameTheme.hh"
|
||||
|
||||
// use GNU extensions
|
||||
#ifndef _GNU_SOURCE
|
||||
|
@ -792,15 +793,15 @@ void Toolbar::redrawWindowLabel(bool redraw) {
|
|||
|
||||
FluxboxWindow *foc = Fluxbox::instance()->getFocusedWindow();
|
||||
// don't draw focused window if it's not on the same screen
|
||||
if (&foc->screen() != &screen() || foc->getTitle().size() == 0)
|
||||
if (&foc->screen() != &screen() || foc->title().size() == 0)
|
||||
return;
|
||||
|
||||
unsigned int newlen = foc->getTitle().size();
|
||||
unsigned int newlen = foc->title().size();
|
||||
int dx = FbTk::doAlignment(frame.window_label_w, frame.bevel_w*2,
|
||||
m_theme.justify(),
|
||||
m_theme.font(),
|
||||
foc->getTitle().c_str(),
|
||||
foc->getTitle().size(), newlen);
|
||||
foc->title().c_str(),
|
||||
foc->title().size(), newlen);
|
||||
int dy = 1 + m_theme.font().ascent();
|
||||
|
||||
if (m_theme.font().isRotated()) {
|
||||
|
@ -814,7 +815,7 @@ void Toolbar::redrawWindowLabel(bool redraw) {
|
|||
frame.window_label.window(),
|
||||
screen().getScreenNumber(),
|
||||
m_theme.windowTextGC(),
|
||||
foc->getTitle().c_str(), newlen,
|
||||
foc->title().c_str(), newlen,
|
||||
dx, dy);
|
||||
} else
|
||||
frame.window_label.clear();
|
||||
|
@ -895,7 +896,7 @@ void Toolbar::buttonPressEvent(XButtonEvent &be) {
|
|||
FluxboxWindow *fluxboxwin = 0;
|
||||
// if we clicked on a icon then show window menu
|
||||
if ( m_iconbar.get() != 0 && (fluxboxwin = m_iconbar->findWindow(be.window)) ) {
|
||||
const FbTk::Menu &wm = fluxboxwin->getWindowmenu();
|
||||
const FbTk::Menu &wm = fluxboxwin->menu();
|
||||
|
||||
int menu_y = be.y_root - wm.height();
|
||||
int menu_x = be.x_root;
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
// $Id: Toolbar.hh,v 1.30 2003/05/10 13:55:57 fluxgen Exp $
|
||||
// $Id: Toolbar.hh,v 1.31 2003/05/15 11:17:27 fluxgen Exp $
|
||||
|
||||
#ifndef TOOLBAR_HH
|
||||
#define TOOLBAR_HH
|
||||
|
@ -87,7 +87,7 @@ public:
|
|||
|
||||
void moveToLayer(int layernum);
|
||||
|
||||
FbTk::XLayerItem &getLayerItem() { return m_layeritem; }
|
||||
FbTk::XLayerItem &layerItem() { return m_layeritem; }
|
||||
|
||||
/// are we in workspacename editing?
|
||||
inline bool isEditing() const { return editing; }
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
// $Id: ToolbarHandler.cc,v 1.10 2003/05/11 17:11:58 fluxgen Exp $
|
||||
// $Id: ToolbarHandler.cc,v 1.11 2003/05/15 11:17:27 fluxgen Exp $
|
||||
|
||||
/**
|
||||
* The ToolbarHandler class acts as a rough interface to the toolbar.
|
||||
|
@ -196,7 +196,7 @@ void ToolbarHandler::initForScreen(BScreen &screen) {
|
|||
BScreen::Icons::iterator iconit = wiconlist.begin();
|
||||
BScreen::Icons::iterator iconit_end = wiconlist.end();
|
||||
for(; iconit != iconit_end; ++iconit) {
|
||||
if ((*iconit)->getWorkspaceNumber() == m_current_workspace)
|
||||
if ((*iconit)->workspaceNumber() == m_current_workspace)
|
||||
m_toolbar->addIcon(*iconit);
|
||||
}
|
||||
}
|
||||
|
@ -213,11 +213,11 @@ void ToolbarHandler::setupWindow(FluxboxWindow &win) {
|
|||
case NONE:
|
||||
break;
|
||||
case WORKSPACE:
|
||||
if (win.getWorkspaceNumber() == m_current_workspace)
|
||||
if (win.workspaceNumber() == m_current_workspace)
|
||||
m_toolbar->addIcon(&win);
|
||||
break;
|
||||
case WORKSPACEICONS:
|
||||
if (win.getWorkspaceNumber() != m_current_workspace)
|
||||
if (win.workspaceNumber() != m_current_workspace)
|
||||
break;
|
||||
// else fall through and add the icon
|
||||
case LASTMODE:
|
||||
|
@ -242,7 +242,7 @@ void ToolbarHandler::updateWindowClose(FluxboxWindow &win) {
|
|||
case NONE:
|
||||
break;
|
||||
case WORKSPACEICONS:
|
||||
if (win.getWorkspaceNumber() != m_current_workspace)
|
||||
if (win.workspaceNumber() != m_current_workspace)
|
||||
break;
|
||||
// else fall through and remove the icon
|
||||
case LASTMODE:
|
||||
|
@ -252,7 +252,7 @@ void ToolbarHandler::updateWindowClose(FluxboxWindow &win) {
|
|||
}
|
||||
break;
|
||||
case WORKSPACE:
|
||||
if (win.getWorkspaceNumber() == m_current_workspace)
|
||||
if (win.workspaceNumber() == m_current_workspace)
|
||||
m_toolbar->delIcon(&win);
|
||||
break;
|
||||
case ALLWINDOWS:
|
||||
|
@ -273,7 +273,7 @@ void ToolbarHandler::updateState(FluxboxWindow &win) {
|
|||
case ALLWINDOWS:
|
||||
break;
|
||||
case WORKSPACEICONS:
|
||||
if (win.getWorkspaceNumber() != m_current_workspace) break;
|
||||
if (win.workspaceNumber() != m_current_workspace) break;
|
||||
// else fall through and do the same as icons (knowing it is the right ws)
|
||||
case LASTMODE:
|
||||
case ICONS:
|
||||
|
@ -298,7 +298,7 @@ void ToolbarHandler::updateWorkspace(FluxboxWindow &win) {
|
|||
// don't care about current workspace except if in workspace mode
|
||||
if (!(m_mode == WORKSPACE || (m_mode == WORKSPACEICONS && win.isIconic()))) return;
|
||||
|
||||
if (win.getWorkspaceNumber() == m_current_workspace) {
|
||||
if (win.workspaceNumber() == m_current_workspace) {
|
||||
//!! TODO
|
||||
// this shouldn't be needed, but is until Workspaces get fixed so that
|
||||
// you only move between them, you don't 'add' and 'remove'
|
||||
|
|
539
src/Window.cc
539
src/Window.cc
File diff suppressed because it is too large
Load diff
|
@ -1,5 +1,5 @@
|
|||
// Window.hh for Fluxbox Window Manager
|
||||
// Copyright (c) 2001-2003 Henrik Kinnunen (fluxgen at users.sourceforge.net)
|
||||
// Copyright (c) 2001 - 2003 Henrik Kinnunen (fluxgen at users.sourceforge.net)
|
||||
//
|
||||
// Window.hh for Blackbox - an X11 Window manager
|
||||
// Copyright (c) 1997 - 2000 Brad Hughes (bhughes at tcac.net)
|
||||
|
@ -22,7 +22,7 @@
|
|||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
// $Id: Window.hh,v 1.72 2003/05/14 14:43:06 fluxgen Exp $
|
||||
// $Id: Window.hh,v 1.73 2003/05/15 11:17:27 fluxgen Exp $
|
||||
|
||||
#ifndef WINDOW_HH
|
||||
#define WINDOW_HH
|
||||
|
@ -30,29 +30,22 @@
|
|||
#include "Timer.hh"
|
||||
#include "Menu.hh"
|
||||
#include "Subject.hh"
|
||||
#include "FbWinFrame.hh"
|
||||
#include "EventHandler.hh"
|
||||
#include "XLayerItem.hh"
|
||||
#include "LayerMenu.hh"
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
|
||||
#ifdef SHAPE
|
||||
#include <X11/extensions/shape.h>
|
||||
#endif // SHAPE
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <memory>
|
||||
#include <map>
|
||||
|
||||
#define PropMwmHintsElements 3
|
||||
|
||||
class WinClient;
|
||||
class FbWinFrameTheme;
|
||||
class BScreen;
|
||||
class TextButton;
|
||||
class FbWinFrame;
|
||||
|
||||
namespace FbTk {
|
||||
class MenuTheme;
|
||||
|
@ -60,7 +53,6 @@ class ImageControl;
|
|||
class XLayer;
|
||||
};
|
||||
|
||||
|
||||
/// Creates the window frame and handles any window event for it
|
||||
class FluxboxWindow : public FbTk::TimeoutHandler, public FbTk::EventHandler {
|
||||
public:
|
||||
|
@ -112,6 +104,7 @@ public:
|
|||
|
||||
static const int PropBlackboxHintsElements = 5;
|
||||
static const int PropBlackboxAttributesElements = 8;
|
||||
static const int PropMwmHintsElements = 3;
|
||||
|
||||
typedef struct _blackbox_hints {
|
||||
unsigned long flags, attrib, workspace, stack;
|
||||
|
@ -249,13 +242,9 @@ public:
|
|||
DECORM_LAST = (1<<11) // useful for getting "All"
|
||||
};
|
||||
|
||||
unsigned int getDecorationMask() const;
|
||||
unsigned int decorationMask() const;
|
||||
void setDecorationMask(unsigned int mask);
|
||||
|
||||
#ifdef SHAPE
|
||||
void shapeEvent(XShapeEvent *event);
|
||||
#endif // SHAPE
|
||||
|
||||
virtual void timeout();
|
||||
|
||||
/**
|
||||
|
@ -264,7 +253,7 @@ public:
|
|||
//@{
|
||||
inline bool isManaged() const { return m_managed; }
|
||||
inline bool isFocused() const { return focused; }
|
||||
inline bool isVisible() const { return m_frame.isVisible(); }
|
||||
bool isVisible() const;
|
||||
inline bool isIconic() const { return iconic; }
|
||||
inline bool isShaded() const { return shaded; }
|
||||
inline bool isMaximized() const { return maximized; }
|
||||
|
@ -286,46 +275,42 @@ public:
|
|||
inline const BScreen &screen() const { return m_screen; }
|
||||
inline BScreen &screen() { return m_screen; }
|
||||
|
||||
inline const FbTk::XLayerItem &getLayerItem() const { return m_layeritem; }
|
||||
inline FbTk::XLayerItem &getLayerItem() { return m_layeritem; }
|
||||
inline const FbTk::XLayerItem &layerItem() const { return m_layeritem; }
|
||||
inline FbTk::XLayerItem &layerItem() { return m_layeritem; }
|
||||
|
||||
Window getClientWindow() const;
|
||||
Window clientWindow() const;
|
||||
|
||||
FbTk::FbWindow &getFbWindow() { return m_frame.window(); }
|
||||
const FbTk::FbWindow &getFbWindow() const { return m_frame.window(); }
|
||||
FbTk::FbWindow &fbWindow();
|
||||
const FbTk::FbWindow &fbWindow() const;
|
||||
|
||||
FbTk::Menu &getWindowmenu() { return m_windowmenu; }
|
||||
const FbTk::Menu &getWindowmenu() const { return m_windowmenu; }
|
||||
FbTk::Menu &menu() { return m_windowmenu; }
|
||||
const FbTk::Menu &menu() const { return m_windowmenu; }
|
||||
|
||||
FbTk::Menu &getLayermenu() { return m_layermenu; }
|
||||
const FbTk::Menu &getLayermenu() const { return m_layermenu; }
|
||||
FbTk::Menu &layermenu() { return *m_layermenu.get(); }
|
||||
const FbTk::Menu &layermenu() const { return *m_layermenu.get(); }
|
||||
|
||||
const FbTk::FbWindow &parent() const { return m_parent; }
|
||||
FbTk::FbWindow &parent() { return m_parent; }
|
||||
|
||||
const std::string &getTitle() const;
|
||||
const std::string &getIconTitle() const;
|
||||
int getXFrame() const { return m_frame.x(); }
|
||||
int getYFrame() const { return m_frame.y(); }
|
||||
int getXClient() const;
|
||||
int getYClient() const;
|
||||
unsigned int getWorkspaceNumber() const { return m_workspace_number; }
|
||||
int getWindowNumber() const { return m_window_number; }
|
||||
int getLayerNum() const { return m_layernum; }
|
||||
const std::string &title() const;
|
||||
const std::string &iconTitle() const;
|
||||
int x() const;
|
||||
int y() const;
|
||||
unsigned int workspaceNumber() const { return m_workspace_number; }
|
||||
int windowNumber() const { return m_window_number; }
|
||||
int layerNum() const { return m_layernum; }
|
||||
void setLayerNum(int layernum);
|
||||
|
||||
unsigned int width() const { return m_frame.width(); }
|
||||
unsigned int height() const { return m_frame.height(); }
|
||||
unsigned int getClientHeight() const;
|
||||
unsigned int getClientWidth() const;
|
||||
unsigned int getTitleHeight() const { return m_frame.titleHeight(); }
|
||||
unsigned int width() const;
|
||||
unsigned int height() const;
|
||||
unsigned int titleHeight() const;
|
||||
const std::string &className() const { return m_class_name; }
|
||||
const std::string &instanceName() const { return m_instance_name; }
|
||||
bool isLowerTab() const;
|
||||
int initialState() const;
|
||||
|
||||
FbWinFrame &frame() { return m_frame; }
|
||||
const FbWinFrame &frame() const { return m_frame; }
|
||||
FbWinFrame &frame() { return *m_frame.get(); }
|
||||
const FbWinFrame &frame() const { return *m_frame.get(); }
|
||||
|
||||
/**
|
||||
@name signals
|
||||
|
@ -343,7 +328,7 @@ public:
|
|||
const FbTk::Subject &dieSig() const { return m_diesig; }
|
||||
/** @} */ // end group signals
|
||||
|
||||
const timeval &getLastFocusTime() const { return m_last_focus_time;}
|
||||
const timeval &lastFocusTime() const { return m_last_focus_time;}
|
||||
|
||||
//@}
|
||||
|
||||
|
@ -420,7 +405,7 @@ private:
|
|||
BlackboxAttributes m_blackbox_attrib;
|
||||
|
||||
FbTk::Menu m_windowmenu;
|
||||
LayerMenu<FluxboxWindow> m_layermenu;
|
||||
std::auto_ptr<FbTk::Menu> m_layermenu;
|
||||
|
||||
timeval m_last_focus_time;
|
||||
|
||||
|
@ -458,7 +443,7 @@ private:
|
|||
unsigned int m_old_width, m_old_height; ///< old size so we can restore from maximized state
|
||||
int m_last_button_x, ///< last known x position of the mouse button
|
||||
m_last_button_y; ///< last known y position of the mouse button
|
||||
FbWinFrame m_frame;
|
||||
std::auto_ptr<FbWinFrame> m_frame;
|
||||
|
||||
FbTk::XLayerItem m_layeritem;
|
||||
int m_layernum;
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
// $Id: Workspace.cc,v 1.63 2003/05/11 17:14:41 fluxgen Exp $
|
||||
// $Id: Workspace.cc,v 1.64 2003/05/15 11:17:27 fluxgen Exp $
|
||||
|
||||
#include "Workspace.hh"
|
||||
|
||||
|
@ -203,7 +203,7 @@ int Workspace::addWindow(FluxboxWindow &w, bool place) {
|
|||
screen().updateNetizenWindowAdd((*client_it)->window(), m_id);
|
||||
}
|
||||
|
||||
return w.getWindowNumber();
|
||||
return w.windowNumber();
|
||||
}
|
||||
|
||||
|
||||
|
@ -485,8 +485,8 @@ void Workspace::placeWindow(FluxboxWindow &win) {
|
|||
if (screen().getRowPlacementDirection() == BScreen::RIGHTLEFT)
|
||||
change_x = -1;
|
||||
|
||||
int win_w = win.width() + win.getFbWindow().borderWidth()*2,
|
||||
win_h = win.height() + win.getFbWindow().borderWidth()*2;
|
||||
int win_w = win.width() + win.fbWindow().borderWidth()*2,
|
||||
win_h = win.height() + win.fbWindow().borderWidth()*2;
|
||||
|
||||
|
||||
int test_x, test_y, curr_x, curr_y, curr_w, curr_h;
|
||||
|
@ -563,11 +563,11 @@ void Workspace::placeWindow(FluxboxWindow &win) {
|
|||
for (; win_it != win_it_end && placed; ++win_it) {
|
||||
FluxboxWindow &window = **win_it;
|
||||
|
||||
curr_x = window.getXFrame();
|
||||
curr_y = window.getYFrame();
|
||||
curr_w = window.width() + window.getFbWindow().borderWidth()*2;
|
||||
curr_h = window.isShaded() ? window.getTitleHeight() :
|
||||
window.height() + window.getFbWindow().borderWidth()*2;
|
||||
curr_x = window.x();
|
||||
curr_y = window.y();
|
||||
curr_w = window.width() + window.fbWindow().borderWidth()*2;
|
||||
curr_h = window.isShaded() ? window.titleHeight() :
|
||||
window.height() + window.fbWindow().borderWidth()*2;
|
||||
|
||||
if (curr_x < test_x + win_w &&
|
||||
curr_x + curr_w > test_x &&
|
||||
|
@ -618,14 +618,14 @@ void Workspace::placeWindow(FluxboxWindow &win) {
|
|||
Windows::iterator it = m_windowlist.begin();
|
||||
Windows::iterator it_end = m_windowlist.end();
|
||||
for (; it != it_end && placed; ++it) {
|
||||
curr_x = (*it)->getXFrame();
|
||||
curr_y = (*it)->getYFrame();
|
||||
curr_w = (*it)->width() + (*it)->getFbWindow().borderWidth()*2;
|
||||
curr_x = (*it)->x();
|
||||
curr_y = (*it)->y();
|
||||
curr_w = (*it)->width() + (*it)->fbWindow().borderWidth()*2;
|
||||
curr_h =
|
||||
(((*it)->isShaded())
|
||||
? (*it)->getTitleHeight()
|
||||
? (*it)->titleHeight()
|
||||
: (*it)->height()) +
|
||||
(*it)->getFbWindow().borderWidth()*2;
|
||||
(*it)->fbWindow().borderWidth()*2;
|
||||
|
||||
|
||||
if (curr_x < test_x + win_w &&
|
||||
|
@ -663,8 +663,8 @@ void Workspace::placeWindow(FluxboxWindow &win) {
|
|||
place_x = m_cascade_x;
|
||||
place_y = m_cascade_y;
|
||||
|
||||
m_cascade_x += win.getTitleHeight();
|
||||
m_cascade_y += win.getTitleHeight();
|
||||
m_cascade_x += win.titleHeight();
|
||||
m_cascade_y += win.titleHeight();
|
||||
}
|
||||
|
||||
if (place_x + win_w > (signed) screen().getWidth())
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
// DEALINGS IN THE SOFTWARE.
|
||||
|
||||
// $Id: fluxbox.cc,v 1.147 2003/05/14 14:37:06 fluxgen Exp $
|
||||
// $Id: fluxbox.cc,v 1.148 2003/05/15 11:17:27 fluxgen Exp $
|
||||
|
||||
#include "fluxbox.hh"
|
||||
|
||||
|
@ -718,7 +718,7 @@ void Fluxbox::handleEvent(XEvent * const e) {
|
|||
m_masked_window->motionNotifyEvent(e->xmotion);
|
||||
return;
|
||||
} else if (e->type == ButtonRelease) {
|
||||
e->xbutton.window = m_masked_window->getFbWindow().window();
|
||||
e->xbutton.window = m_masked_window->fbWindow().window();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1199,7 +1199,7 @@ void Fluxbox::handleKeyEvent(XKeyEvent &ke) {
|
|||
case Keys::KILLWINDOW: //kill the current window
|
||||
if (m_focused_window) {
|
||||
XKillClient(FbTk::App::instance()->display(),
|
||||
m_focused_window->getClientWindow());
|
||||
m_focused_window->clientWindow());
|
||||
}
|
||||
break;
|
||||
case Keys::NEXTWINDOW: { //activate next window
|
||||
|
@ -1282,7 +1282,7 @@ void Fluxbox::handleKeyEvent(XKeyEvent &ke) {
|
|||
BScreen::FocusedWindows::iterator it = fwins.begin();
|
||||
for (; it != fwins.end(); ++it) {
|
||||
if ((*it)->fbwindow() != m_focused_window &&
|
||||
(*it)->fbwindow()->getWorkspaceNumber() ==
|
||||
(*it)->fbwindow()->workspaceNumber() ==
|
||||
keyscreen->getCurrentWorkspaceID()) {
|
||||
m_focused_window->attachClient(**it);
|
||||
break;
|
||||
|
@ -1417,64 +1417,64 @@ void Fluxbox::doWindowAction(int action, const int param) {
|
|||
break;
|
||||
case Keys::NUDGERIGHT:
|
||||
m_focused_window->moveResize(
|
||||
m_focused_window->getXFrame()+param, m_focused_window->getYFrame(),
|
||||
m_focused_window->x() + param, m_focused_window->y(),
|
||||
m_focused_window->width(), m_focused_window->height());
|
||||
break;
|
||||
case Keys::NUDGELEFT:
|
||||
m_focused_window->moveResize(
|
||||
m_focused_window->getXFrame()-param, m_focused_window->getYFrame(),
|
||||
m_focused_window->x() - param, m_focused_window->y(),
|
||||
m_focused_window->width(), m_focused_window->height());
|
||||
break;
|
||||
case Keys::NUDGEUP:
|
||||
m_focused_window->moveResize(
|
||||
m_focused_window->getXFrame(), m_focused_window->getYFrame()-param,
|
||||
m_focused_window->x(), m_focused_window->y() - param,
|
||||
m_focused_window->width(), m_focused_window->height());
|
||||
break;
|
||||
case Keys::NUDGEDOWN:
|
||||
m_focused_window->moveResize(
|
||||
m_focused_window->getXFrame(), m_focused_window->getYFrame()+param,
|
||||
m_focused_window->x(), m_focused_window->y() + param,
|
||||
m_focused_window->width(), m_focused_window->height());
|
||||
break;
|
||||
// NOTE !!! BIGNUDGExxxx is not needed, just use 10 as a parameter
|
||||
case Keys::BIGNUDGERIGHT:
|
||||
m_focused_window->moveResize(
|
||||
m_focused_window->getXFrame()+10, m_focused_window->getYFrame(),
|
||||
m_focused_window->x() + 10, m_focused_window->y(),
|
||||
m_focused_window->width(), m_focused_window->height());
|
||||
break;
|
||||
case Keys::BIGNUDGELEFT:
|
||||
m_focused_window->moveResize(
|
||||
m_focused_window->getXFrame()-10, m_focused_window->getYFrame(),
|
||||
m_focused_window->x() - 10, m_focused_window->y(),
|
||||
m_focused_window->width(), m_focused_window->height());
|
||||
break;
|
||||
case Keys::BIGNUDGEUP:
|
||||
m_focused_window->moveResize(
|
||||
m_focused_window->getXFrame(), m_focused_window->getYFrame()-10,
|
||||
m_focused_window->x(), m_focused_window->y()-10,
|
||||
m_focused_window->width(), m_focused_window->height());
|
||||
break;
|
||||
case Keys::BIGNUDGEDOWN:
|
||||
m_focused_window->moveResize(
|
||||
m_focused_window->getXFrame(), m_focused_window->getYFrame()+10,
|
||||
m_focused_window->x(), m_focused_window->y()+10,
|
||||
m_focused_window->width(), m_focused_window->height());
|
||||
break;
|
||||
case Keys::HORIZINC:
|
||||
m_focused_window->moveResize(
|
||||
m_focused_window->getXFrame(), m_focused_window->getYFrame(),
|
||||
m_focused_window->x(), m_focused_window->y(),
|
||||
m_focused_window->width() + 10, m_focused_window->height());
|
||||
|
||||
break;
|
||||
case Keys::VERTINC:
|
||||
m_focused_window->moveResize(
|
||||
m_focused_window->getXFrame(), m_focused_window->getYFrame(),
|
||||
m_focused_window->x(), m_focused_window->y(),
|
||||
m_focused_window->width(), m_focused_window->height()+10);
|
||||
break;
|
||||
case Keys::HORIZDEC:
|
||||
m_focused_window->moveResize(
|
||||
m_focused_window->getXFrame(), m_focused_window->getYFrame(),
|
||||
m_focused_window->x(), m_focused_window->y(),
|
||||
m_focused_window->width() - 10, m_focused_window->height());
|
||||
break;
|
||||
case Keys::VERTDEC:
|
||||
m_focused_window->moveResize(
|
||||
m_focused_window->getXFrame(), m_focused_window->getYFrame(),
|
||||
m_focused_window->x(), m_focused_window->y(),
|
||||
m_focused_window->width(), m_focused_window->height()-10);
|
||||
|
||||
break;
|
||||
|
@ -1561,7 +1561,7 @@ void Fluxbox::update(FbTk::Subject *changedsub) {
|
|||
// if window changed to iconic state
|
||||
// add to icon list
|
||||
if (win.isIconic()) {
|
||||
Workspace *space = win.screen().getWorkspace(win.getWorkspaceNumber());
|
||||
Workspace *space = win.screen().getWorkspace(win.workspaceNumber());
|
||||
if (space != 0)
|
||||
space->removeWindow(&win);
|
||||
win.screen().addIcon(&win);
|
||||
|
@ -1571,7 +1571,7 @@ void Fluxbox::update(FbTk::Subject *changedsub) {
|
|||
// if we're sticky then reassociate window
|
||||
// to all workspaces
|
||||
BScreen &scr = win.screen();
|
||||
if (scr.getCurrentWorkspaceID() != win.getWorkspaceNumber()) {
|
||||
if (scr.getCurrentWorkspaceID() != win.workspaceNumber()) {
|
||||
scr.reassociateWindow(&win,
|
||||
scr.getCurrentWorkspaceID(),
|
||||
true);
|
||||
|
@ -2369,10 +2369,10 @@ void Fluxbox::setFocusedWindow(FluxboxWindow *win) {
|
|||
old_screen = &old_win->screen();
|
||||
|
||||
old_tbar = old_screen->getToolbar();
|
||||
old_wkspc = old_screen->getWorkspace(old_win->getWorkspaceNumber());
|
||||
old_wkspc = old_screen->getWorkspace(old_win->workspaceNumber());
|
||||
|
||||
old_win->setFocusFlag(false);
|
||||
old_wkspc->menu().setItemSelected(old_win->getWindowNumber(), false);
|
||||
old_wkspc->menu().setItemSelected(old_win->windowNumber(), false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2386,12 +2386,12 @@ void Fluxbox::setFocusedWindow(FluxboxWindow *win) {
|
|||
} else {
|
||||
screen = *winscreen;
|
||||
tbar = screen->getToolbar();
|
||||
wkspc = screen->getWorkspace(win->getWorkspaceNumber());
|
||||
wkspc = screen->getWorkspace(win->workspaceNumber());
|
||||
m_focused_window = win; // update focused window
|
||||
win->setFocusFlag(true); // set focus flag
|
||||
// select this window in workspace menu
|
||||
if (wkspc != 0)
|
||||
wkspc->menu().setItemSelected(win->getWindowNumber(), true);
|
||||
wkspc->menu().setItemSelected(win->windowNumber(), true);
|
||||
}
|
||||
} else
|
||||
m_focused_window = 0;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
CXX=g++
|
||||
CXXFLAGS= -I.. -I../FbTk -DDEBUG -DUSE_XFT -Wall -g -O2
|
||||
LIBS=
|
||||
CXXFLAGS= -I.. -I../FbTk -DDEBUG -DUSE_XFT -Wall -g -O2 ../FbTk/libFbTk.a
|
||||
LIBS=
|
||||
XFLAGS= -I/usr/X11R6/include
|
||||
XLIBS= -L/usr/X11R6/lib -lX11 -lXft
|
||||
COMPILEFILE=$(CXX) -c $(CXXFLAGS)
|
||||
|
@ -50,6 +50,12 @@ testFont: testFont.cc ${FONT_OBJ}
|
|||
testLayers: testLayers.cc
|
||||
${CXX} ${CXXFLAGS} ${XLIBS} testLayers.cc ../FbTk/libFbTk.a -o testLayers
|
||||
|
||||
testTransp: transpTest.cc
|
||||
${CXX} ${CXXFLAGS} ${XLIBS} transpTest.cc ../FbTk/libFbTk.a -o testTransp
|
||||
|
||||
testScale: scaleTest.cc
|
||||
${CXX} ${CXXFLAGS} ${XLIBS} scaleTest.cc ../FbTk/libFbTk.a -lXpm -o testScale
|
||||
|
||||
run: testLayers testResource testKeys testStringUtil testFont
|
||||
./testLayers
|
||||
./testKeys
|
||||
|
|
Loading…
Reference in a new issue