cleaning
This commit is contained in:
parent
77beb5472b
commit
89fddca1d7
6 changed files with 160 additions and 150 deletions
|
@ -19,7 +19,7 @@
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
// $Id: Gnome.cc,v 1.16 2003/04/15 00:17:59 fluxgen Exp $
|
// $Id: Gnome.cc,v 1.17 2003/04/15 12:22:52 fluxgen Exp $
|
||||||
|
|
||||||
#include "Gnome.hh"
|
#include "Gnome.hh"
|
||||||
|
|
||||||
|
@ -126,6 +126,7 @@ void Gnome::setupWindow(FluxboxWindow &win) {
|
||||||
void Gnome::updateClientList(BScreen &screen) {
|
void Gnome::updateClientList(BScreen &screen) {
|
||||||
size_t num=0;
|
size_t num=0;
|
||||||
|
|
||||||
|
// count window clients in each workspace
|
||||||
BScreen::Workspaces::const_iterator workspace_it =
|
BScreen::Workspaces::const_iterator workspace_it =
|
||||||
screen.getWorkspacesList().begin();
|
screen.getWorkspacesList().begin();
|
||||||
BScreen::Workspaces::const_iterator workspace_it_end =
|
BScreen::Workspaces::const_iterator workspace_it_end =
|
||||||
|
@ -138,14 +139,14 @@ void Gnome::updateClientList(BScreen &screen) {
|
||||||
for (; win_it != win_it_end; ++win_it)
|
for (; win_it != win_it_end; ++win_it)
|
||||||
num += (*win_it)->numClients();
|
num += (*win_it)->numClients();
|
||||||
}
|
}
|
||||||
//int num = getCurrentWorkspace()->getWindowList().size();
|
|
||||||
|
|
||||||
Window *wl = new (nothrow) Window[num];
|
Window *wl = new (nothrow) Window[num];
|
||||||
if (wl == 0) {
|
if (wl == 0) {
|
||||||
cerr<<"Fatal: Out of memory, can't allocate for gnome client list"<<endl;
|
cerr<<"Fatal: Out of memory, can't allocate for gnome client list"<<endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//start the iterator from begining
|
|
||||||
|
//add client windows to buffer
|
||||||
workspace_it = screen.getWorkspacesList().begin();
|
workspace_it = screen.getWorkspacesList().begin();
|
||||||
int win=0;
|
int win=0;
|
||||||
for (; workspace_it != workspace_it_end; ++workspace_it) {
|
for (; workspace_it != workspace_it_end; ++workspace_it) {
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
// $Id: Screen.cc,v 1.120 2003/04/15 00:50:24 rathnor Exp $
|
// $Id: Screen.cc,v 1.121 2003/04/15 12:14:53 fluxgen Exp $
|
||||||
|
|
||||||
|
|
||||||
#include "Screen.hh"
|
#include "Screen.hh"
|
||||||
|
@ -377,7 +377,8 @@ BScreen::ScreenResource::ScreenResource(ResourceManager &rm,
|
||||||
opaque_move(rm, false, "session.opaqueMove", "Session.OpaqueMove"),
|
opaque_move(rm, false, "session.opaqueMove", "Session.OpaqueMove"),
|
||||||
full_max(rm, true, scrname+".fullMaximization", altscrname+".FullMaximization"),
|
full_max(rm, true, scrname+".fullMaximization", altscrname+".FullMaximization"),
|
||||||
max_over_slit(rm, true, scrname+".maxOverSlit",altscrname+".MaxOverSlit"),
|
max_over_slit(rm, true, scrname+".maxOverSlit",altscrname+".MaxOverSlit"),
|
||||||
sloppy_window_grouping(rm, true, scrname+".sloppywindowgrouping", altscrname+".SloppyWindowGrouping"),
|
sloppy_window_grouping(rm, true,
|
||||||
|
scrname+".sloppywindowgrouping", altscrname+".SloppyWindowGrouping"),
|
||||||
workspace_warping(rm, true, scrname+".workspacewarping", altscrname+".WorkspaceWarping"),
|
workspace_warping(rm, true, scrname+".workspacewarping", altscrname+".WorkspaceWarping"),
|
||||||
desktop_wheeling(rm, true, scrname+".desktopwheeling", altscrname+".DesktopWheeling"),
|
desktop_wheeling(rm, true, scrname+".desktopwheeling", altscrname+".DesktopWheeling"),
|
||||||
show_window_pos(rm, true, scrname+".showwindowposition", altscrname+".ShowWindowPosition"),
|
show_window_pos(rm, true, scrname+".showwindowposition", altscrname+".ShowWindowPosition"),
|
||||||
|
@ -388,13 +389,17 @@ BScreen::ScreenResource::ScreenResource(ResourceManager &rm,
|
||||||
rootcommand(rm, "", scrname+".rootCommand", altscrname+".RootCommand"),
|
rootcommand(rm, "", scrname+".rootCommand", altscrname+".RootCommand"),
|
||||||
focus_model(rm, Fluxbox::CLICKTOFOCUS, scrname+".focusModel", altscrname+".FocusModel"),
|
focus_model(rm, Fluxbox::CLICKTOFOCUS, scrname+".focusModel", altscrname+".FocusModel"),
|
||||||
workspaces(rm, 1, scrname+".workspaces", altscrname+".Workspaces"),
|
workspaces(rm, 1, scrname+".workspaces", altscrname+".Workspaces"),
|
||||||
toolbar_width_percent(rm, 65, scrname+".toolbar.widthPercent", altscrname+".Toolbar.WidthPercent"),
|
toolbar_width_percent(rm, 65,
|
||||||
|
scrname+".toolbar.widthPercent", altscrname+".Toolbar.WidthPercent"),
|
||||||
edge_snap_threshold(rm, 0, scrname+".edgeSnapThreshold", altscrname+".EdgeSnapThreshold"),
|
edge_snap_threshold(rm, 0, scrname+".edgeSnapThreshold", altscrname+".EdgeSnapThreshold"),
|
||||||
slit_layernum(rm, Fluxbox::instance()->getDockLayer(), scrname+".slit.layer", altscrname+".Slit.Layer"),
|
slit_layernum(rm, Fluxbox::Layer(Fluxbox::instance()->getDockLayer()),
|
||||||
toolbar_layernum(rm, Fluxbox::instance()->getDesktopLayer(), scrname+".toolbar.layer", altscrname+".Toolbar.Layer"),
|
scrname+".slit.layer", altscrname+".Slit.Layer"),
|
||||||
|
toolbar_layernum(rm, Fluxbox::Layer(Fluxbox::instance()->getDesktopLayer()),
|
||||||
|
scrname+".toolbar.layer", altscrname+".Toolbar.Layer"),
|
||||||
toolbar_mode(rm, ToolbarHandler::ICONS, scrname+".toolbar.mode", altscrname+".Toolbar.Mode"),
|
toolbar_mode(rm, ToolbarHandler::ICONS, scrname+".toolbar.mode", altscrname+".Toolbar.Mode"),
|
||||||
toolbar_on_head(rm, 0, scrname+".toolbar.onhead", altscrname+".Toolbar.onHead"),
|
toolbar_on_head(rm, 0, scrname+".toolbar.onhead", altscrname+".Toolbar.onHead"),
|
||||||
toolbar_placement(rm, Toolbar::BOTTOMCENTER, scrname+".toolbar.placement", altscrname+".Toolbar.Placement")
|
toolbar_placement(rm, Toolbar::BOTTOMCENTER,
|
||||||
|
scrname+".toolbar.placement", altscrname+".Toolbar.Placement")
|
||||||
{
|
{
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -460,7 +465,7 @@ BScreen::BScreen(ResourceManager &rm,
|
||||||
image_control->installRootColormap();
|
image_control->installRootColormap();
|
||||||
root_colormap_installed = true;
|
root_colormap_installed = true;
|
||||||
|
|
||||||
fluxbox->load_rc(this);
|
fluxbox->load_rc(*this);
|
||||||
|
|
||||||
image_control->setDither(*resource.image_dither);
|
image_control->setDither(*resource.image_dither);
|
||||||
theme = new Theme(disp, getRootWindow(), colormap(), getScreenNumber(),
|
theme = new Theme(disp, getRootWindow(), colormap(), getScreenNumber(),
|
||||||
|
@ -698,7 +703,7 @@ void BScreen::reconfigure() {
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
cerr<<__FILE__<<"("<<__LINE__<<"): BScreen::reconfigure"<<endl;
|
cerr<<__FILE__<<"("<<__LINE__<<"): BScreen::reconfigure"<<endl;
|
||||||
#endif // DEBUG
|
#endif // DEBUG
|
||||||
Fluxbox::instance()->loadRootCommand(this);
|
Fluxbox::instance()->loadRootCommand(*this);
|
||||||
theme->setRootCommand(getRootCommand());
|
theme->setRootCommand(getRootCommand());
|
||||||
const string &filename = Fluxbox::instance()->getStyleFilename();
|
const string &filename = Fluxbox::instance()->getStyleFilename();
|
||||||
theme->load(filename.c_str()); // old theme engine
|
theme->load(filename.c_str()); // old theme engine
|
||||||
|
|
108
src/Window.cc
108
src/Window.cc
|
@ -22,7 +22,7 @@
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
// $Id: Window.cc,v 1.132 2003/04/15 00:50:25 rathnor Exp $
|
// $Id: Window.cc,v 1.133 2003/04/15 12:18:37 fluxgen Exp $
|
||||||
|
|
||||||
#include "Window.hh"
|
#include "Window.hh"
|
||||||
|
|
||||||
|
@ -34,9 +34,9 @@
|
||||||
#include "Netizen.hh"
|
#include "Netizen.hh"
|
||||||
#include "FbWinFrameTheme.hh"
|
#include "FbWinFrameTheme.hh"
|
||||||
#include "MenuTheme.hh"
|
#include "MenuTheme.hh"
|
||||||
|
|
||||||
#include "TextButton.hh"
|
#include "TextButton.hh"
|
||||||
#include "EventManager.hh"
|
#include "EventManager.hh"
|
||||||
|
#include "FbAtoms.hh"
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
@ -279,11 +279,12 @@ void FluxboxWindow::init() {
|
||||||
// we don't want to duplicate code here and in attachClient
|
// we don't want to duplicate code here and in attachClient
|
||||||
m_clientlist.push_back(m_client);
|
m_clientlist.push_back(m_client);
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
cerr<<"FluxboxWindow::init(this="<<this<<")"<<endl;
|
cerr<<__FILE__<<": FluxboxWindow::init(this="<<this<<", client="<<hex<<m_client->window()<<dec<<")"<<endl;
|
||||||
#endif // DEBUG
|
#endif // DEBUG
|
||||||
TextButton *btn = new TextButton(m_frame.label(),
|
TextButton *btn = new TextButton(m_frame.label(),
|
||||||
m_frame.theme().font(),
|
m_frame.theme().font(),
|
||||||
m_client->title());
|
m_client->title());
|
||||||
|
btn->setJustify(m_frame.theme().justify());
|
||||||
m_labelbuttons[m_client] = btn;
|
m_labelbuttons[m_client] = btn;
|
||||||
m_frame.addLabelButton(*btn);
|
m_frame.addLabelButton(*btn);
|
||||||
btn->show();
|
btn->show();
|
||||||
|
@ -464,10 +465,6 @@ void FluxboxWindow::attachClient(WinClient &client) {
|
||||||
if (client.m_win == this)
|
if (client.m_win == this)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
cerr<<__FILE__<<"("<<__FUNCTION__<<")["<<this<<"]"<<endl;
|
|
||||||
cerr<<"attach client window = "<<hex<<client.window()<<dec<<endl;
|
|
||||||
#endif // DEBUG
|
|
||||||
// reparent client win to this frame
|
// reparent client win to this frame
|
||||||
m_frame.setClientWindow(client);
|
m_frame.setClientWindow(client);
|
||||||
|
|
||||||
|
@ -483,26 +480,31 @@ void FluxboxWindow::attachClient(WinClient &client) {
|
||||||
// reparent window to this
|
// reparent window to this
|
||||||
m_frame.setClientWindow(*(*client_it));
|
m_frame.setClientWindow(*(*client_it));
|
||||||
(*client_it)->m_win = this;
|
(*client_it)->m_win = this;
|
||||||
// create a labelbutton for this client and associate it with the pointer
|
// create a labelbutton for this client and
|
||||||
|
// associate it with the pointer
|
||||||
TextButton *btn = new TextButton(m_frame.label(),
|
TextButton *btn = new TextButton(m_frame.label(),
|
||||||
m_frame.theme().font(),
|
m_frame.theme().font(),
|
||||||
(*client_it)->title());
|
(*client_it)->title());
|
||||||
|
btn->setJustify(m_frame.theme().justify());
|
||||||
m_labelbuttons[(*client_it)] = btn;
|
m_labelbuttons[(*client_it)] = btn;
|
||||||
m_frame.addLabelButton(*btn);
|
m_frame.addLabelButton(*btn);
|
||||||
btn->show();
|
btn->show();
|
||||||
FbTk::EventManager &evm = *FbTk::EventManager::instance();
|
FbTk::EventManager &evm = *FbTk::EventManager::instance();
|
||||||
// we need motion notify so we mask it
|
// we need motion notify so we mask it
|
||||||
btn->window().setEventMask(ExposureMask | ButtonPressMask | ButtonReleaseMask |
|
btn->window().setEventMask(ExposureMask | ButtonPressMask |
|
||||||
ButtonMotionMask);
|
ButtonReleaseMask | ButtonMotionMask);
|
||||||
|
|
||||||
|
|
||||||
FbTk::RefCount<FbTk::Command> set_client_cmd(new SetClientCmd(*(*client_it)));
|
FbTk::RefCount<FbTk::Command>
|
||||||
|
set_client_cmd(new SetClientCmd(*(*client_it)));
|
||||||
btn->setOnClick(set_client_cmd);
|
btn->setOnClick(set_client_cmd);
|
||||||
evm.add(*this, btn->window()); // we take care of button events for this
|
evm.add(*this, btn->window()); // we take care of button events for this
|
||||||
|
|
||||||
// update transients in client to have this as transient_for
|
// update transients in client to have this as transient_for
|
||||||
WinClient::TransientList::iterator trans_it = (*client_it)->transientList().begin();
|
WinClient::TransientList::iterator trans_it =
|
||||||
WinClient::TransientList::iterator trans_it_end = (*client_it)->transientList().end();
|
(*client_it)->transientList().begin();
|
||||||
|
WinClient::TransientList::iterator trans_it_end =
|
||||||
|
(*client_it)->transientList().end();
|
||||||
for (; trans_it != trans_it_end; ++trans_it) {
|
for (; trans_it != trans_it_end; ++trans_it) {
|
||||||
(*trans_it)->m_client->transient_for = this;
|
(*trans_it)->m_client->transient_for = this;
|
||||||
}
|
}
|
||||||
|
@ -525,8 +527,8 @@ void FluxboxWindow::attachClient(WinClient &client) {
|
||||||
btn->show();
|
btn->show();
|
||||||
FbTk::EventManager &evm = *FbTk::EventManager::instance();
|
FbTk::EventManager &evm = *FbTk::EventManager::instance();
|
||||||
// we need motion notify so we mask it
|
// we need motion notify so we mask it
|
||||||
btn->window().setEventMask(ExposureMask | ButtonPressMask | ButtonReleaseMask |
|
btn->window().setEventMask(ExposureMask | ButtonPressMask |
|
||||||
ButtonMotionMask);
|
ButtonReleaseMask | ButtonMotionMask);
|
||||||
|
|
||||||
|
|
||||||
FbTk::RefCount<FbTk::Command> set_client_cmd(new SetClientCmd(client));
|
FbTk::RefCount<FbTk::Command> set_client_cmd(new SetClientCmd(client));
|
||||||
|
@ -535,8 +537,10 @@ void FluxboxWindow::attachClient(WinClient &client) {
|
||||||
|
|
||||||
client.m_win = this;
|
client.m_win = this;
|
||||||
// update transients in client to have this as transient_for
|
// update transients in client to have this as transient_for
|
||||||
WinClient::TransientList::iterator trans_it = client.transientList().begin();
|
WinClient::TransientList::iterator trans_it =
|
||||||
WinClient::TransientList::iterator trans_it_end = client.transientList().end();
|
client.transientList().begin();
|
||||||
|
WinClient::TransientList::iterator trans_it_end =
|
||||||
|
client.transientList().end();
|
||||||
for (; trans_it != trans_it_end; ++trans_it) {
|
for (; trans_it != trans_it_end; ++trans_it) {
|
||||||
(*trans_it)->m_client->transient_for = this;
|
(*trans_it)->m_client->transient_for = this;
|
||||||
}
|
}
|
||||||
|
@ -545,19 +549,11 @@ void FluxboxWindow::attachClient(WinClient &client) {
|
||||||
}
|
}
|
||||||
|
|
||||||
m_frame.reconfigure();
|
m_frame.reconfigure();
|
||||||
#ifdef DEBUG
|
|
||||||
XSync(display, False); // so we see error/warnings in time
|
|
||||||
cerr<<"destroyed old window "<<client.window()<<endl;
|
|
||||||
#endif // DEBUG
|
|
||||||
|
|
||||||
// keep the current window on top
|
// keep the current window on top
|
||||||
m_client->raise();
|
m_client->raise();
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
XSync(display, False); // so we see error/warnings in time
|
|
||||||
cerr<<__FILE__<<"("<<__FUNCTION__<<") clientlist size: "<<m_clientlist.size()<<endl;
|
|
||||||
cerr<<endl<<endl<<endl;
|
|
||||||
#endif // DEBUG
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -567,12 +563,6 @@ bool FluxboxWindow::detachClient(WinClient &client) {
|
||||||
if (client.m_win != this || numClients() <= 1)
|
if (client.m_win != this || numClients() <= 1)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
#ifdef DEBUG
|
|
||||||
cerr<<__FILE__<<"("<<__FUNCTION__<<")["<<this<<"] client to detach: "<<
|
|
||||||
hex<<client.window()<<dec<<endl;
|
|
||||||
cerr<<__FILE__<<"("<<__FUNCTION__<<"): number of clients = "<<numClients()<<endl;
|
|
||||||
#endif // DEBUG
|
|
||||||
|
|
||||||
removeClient(client);
|
removeClient(client);
|
||||||
|
|
||||||
client.m_win = screen.createWindow(client);
|
client.m_win = screen.createWindow(client);
|
||||||
|
@ -634,11 +624,15 @@ WinClient *FluxboxWindow::findClient(Window win) {
|
||||||
|
|
||||||
/// raise and focus next client
|
/// raise and focus next client
|
||||||
void FluxboxWindow::nextClient() {
|
void FluxboxWindow::nextClient() {
|
||||||
if (numClients() == 1)
|
if (numClients() <= 1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ClientList::iterator it = find(m_clientlist.begin(), m_clientlist.end(), m_client);
|
ClientList::iterator it = find(m_clientlist.begin(), m_clientlist.end(), m_client);
|
||||||
assert(it != m_clientlist.end());
|
if (it == m_clientlist.end()) {
|
||||||
|
m_client = m_clientlist.front();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
it++;
|
it++;
|
||||||
if (it == m_clientlist.end())
|
if (it == m_clientlist.end())
|
||||||
m_client = m_clientlist.front();
|
m_client = m_clientlist.front();
|
||||||
|
@ -649,12 +643,14 @@ void FluxboxWindow::nextClient() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void FluxboxWindow::prevClient() {
|
void FluxboxWindow::prevClient() {
|
||||||
if (numClients() == 1)
|
if (numClients() <= 1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ClientList::iterator it = find(m_clientlist.begin(), m_clientlist.end(), m_client);
|
ClientList::iterator it = find(m_clientlist.begin(), m_clientlist.end(), m_client);
|
||||||
assert(it != m_clientlist.end());
|
if (it == m_clientlist.end()) {
|
||||||
|
m_client = m_clientlist.front();
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (it == m_clientlist.begin())
|
if (it == m_clientlist.begin())
|
||||||
m_client = m_clientlist.back();
|
m_client = m_clientlist.back();
|
||||||
else
|
else
|
||||||
|
@ -909,11 +905,11 @@ void FluxboxWindow::getMWMHints() {
|
||||||
int format;
|
int format;
|
||||||
Atom atom_return;
|
Atom atom_return;
|
||||||
unsigned long num, len;
|
unsigned long num, len;
|
||||||
Fluxbox *fluxbox = Fluxbox::instance();
|
Atom motif_wm_hints = XInternAtom(display, "_MOTIF_WM_HINTS", False);
|
||||||
if (!XGetWindowProperty(display, m_client->window(),
|
if (!XGetWindowProperty(display, m_client->window(),
|
||||||
fluxbox->getMotifWMHintsAtom(), 0,
|
motif_wm_hints, 0,
|
||||||
PropMwmHintsElements, false,
|
PropMwmHintsElements, false,
|
||||||
fluxbox->getMotifWMHintsAtom(), &atom_return,
|
motif_wm_hints, &atom_return,
|
||||||
&format, &num, &len,
|
&format, &num, &len,
|
||||||
(unsigned char **) &m_client->mwm_hint) == Success &&
|
(unsigned char **) &m_client->mwm_hint) == Success &&
|
||||||
m_client->mwm_hint) {
|
m_client->mwm_hint) {
|
||||||
|
@ -1550,7 +1546,7 @@ void FluxboxWindow::installColormap(bool install) {
|
||||||
Colormap *cmaps = XListInstalledColormaps(display, m_client->window(), &ncmap);
|
Colormap *cmaps = XListInstalledColormaps(display, m_client->window(), &ncmap);
|
||||||
XWindowAttributes wattrib;
|
XWindowAttributes wattrib;
|
||||||
if (cmaps) { //!!
|
if (cmaps) { //!!
|
||||||
if (m_client->getAttrib(wattrib)) { //XGetWindowAttributes(display, m_client->window, &wattrib)) {
|
if (m_client->getAttrib(wattrib)) {
|
||||||
if (install) {
|
if (install) {
|
||||||
// install the window's colormap
|
// install the window's colormap
|
||||||
for (i = 0; i < ncmap; i++) {
|
for (i = 0; i < ncmap; i++) {
|
||||||
|
@ -1613,9 +1609,8 @@ bool FluxboxWindow::getState() {
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
int foo;
|
int foo;
|
||||||
unsigned long *state, ulfoo, nitems;
|
unsigned long *state, ulfoo, nitems;
|
||||||
Fluxbox *fluxbox = Fluxbox::instance();
|
if ((XGetWindowProperty(display, m_client->window(), FbAtoms::instance()->getWMStateAtom(),
|
||||||
if ((XGetWindowProperty(display, m_client->window(), fluxbox->getWMStateAtom(),
|
0l, 2l, false, FbAtoms::instance()->getWMStateAtom(),
|
||||||
0l, 2l, false, fluxbox->getWMStateAtom(),
|
|
||||||
&atom_return, &foo, &nitems, &ulfoo,
|
&atom_return, &foo, &nitems, &ulfoo,
|
||||||
(unsigned char **) &state) != Success) ||
|
(unsigned char **) &state) != Success) ||
|
||||||
(! state)) {
|
(! state)) {
|
||||||
|
@ -1713,13 +1708,13 @@ void FluxboxWindow::restoreAttributes() {
|
||||||
Atom atom_return;
|
Atom atom_return;
|
||||||
int foo;
|
int foo;
|
||||||
unsigned long ulfoo, nitems;
|
unsigned long ulfoo, nitems;
|
||||||
Fluxbox *fluxbox = Fluxbox::instance();
|
FbAtoms *fbatoms = FbAtoms::instance();
|
||||||
|
|
||||||
BaseDisplay::BlackboxAttributes *net;
|
BaseDisplay::BlackboxAttributes *net;
|
||||||
if (XGetWindowProperty(display, m_client->window(),
|
if (XGetWindowProperty(display, m_client->window(),
|
||||||
fluxbox->getFluxboxAttributesAtom(), 0l,
|
fbatoms->getFluxboxAttributesAtom(), 0l,
|
||||||
PropBlackboxAttributesElements, false,
|
PropBlackboxAttributesElements, false,
|
||||||
fluxbox->getFluxboxAttributesAtom(), &atom_return, &foo,
|
fbatoms->getFluxboxAttributesAtom(), &atom_return, &foo,
|
||||||
&nitems, &ulfoo, (unsigned char **) &net) ==
|
&nitems, &ulfoo, (unsigned char **) &net) ==
|
||||||
Success && net && nitems == PropBlackboxAttributesElements) {
|
Success && net && nitems == PropBlackboxAttributesElements) {
|
||||||
blackbox_attrib.flags = net->flags;
|
blackbox_attrib.flags = net->flags;
|
||||||
|
@ -1949,7 +1944,11 @@ void FluxboxWindow::mapRequestEvent(XMapRequestEvent &re) {
|
||||||
|
|
||||||
|
|
||||||
void FluxboxWindow::mapNotifyEvent(XMapEvent &ne) {
|
void FluxboxWindow::mapNotifyEvent(XMapEvent &ne) {
|
||||||
if (ne.window == m_client->window() && !ne.override_redirect && visible) {
|
WinClient *client = findClient(ne.window);
|
||||||
|
if (client == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (!ne.override_redirect && visible) {
|
||||||
Fluxbox *fluxbox = Fluxbox::instance();
|
Fluxbox *fluxbox = Fluxbox::instance();
|
||||||
fluxbox->grab();
|
fluxbox->grab();
|
||||||
if (! validateClient())
|
if (! validateClient())
|
||||||
|
@ -1990,6 +1989,7 @@ void FluxboxWindow::unmapNotifyEvent(XUnmapEvent &ue) {
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
cerr<<__FILE__<<"("<<__FUNCTION__<<"): 0x"<<hex<<client->window()<<dec<<endl;
|
cerr<<__FILE__<<"("<<__FUNCTION__<<"): 0x"<<hex<<client->window()<<dec<<endl;
|
||||||
|
cerr<<__FILE__<<"("<<__FUNCTION__<<"): title="<<client->title()<<endl;
|
||||||
#endif // DEBUG
|
#endif // DEBUG
|
||||||
|
|
||||||
restore(client, false);
|
restore(client, false);
|
||||||
|
@ -2107,7 +2107,8 @@ void FluxboxWindow::exposeEvent(XExposeEvent &ee) {
|
||||||
|
|
||||||
|
|
||||||
void FluxboxWindow::configureRequestEvent(XConfigureRequestEvent &cr) {
|
void FluxboxWindow::configureRequestEvent(XConfigureRequestEvent &cr) {
|
||||||
if (cr.window != m_client->window())
|
WinClient *client = findClient(cr.window);
|
||||||
|
if (client == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int cx = m_frame.x(), cy = m_frame.y();
|
int cx = m_frame.x(), cy = m_frame.y();
|
||||||
|
@ -2116,7 +2117,7 @@ void FluxboxWindow::configureRequestEvent(XConfigureRequestEvent &cr) {
|
||||||
m_frame.titlebar().height() + frame().titlebar().borderWidth()
|
m_frame.titlebar().height() + frame().titlebar().borderWidth()
|
||||||
: 0);
|
: 0);
|
||||||
if (cr.value_mask & CWBorderWidth)
|
if (cr.value_mask & CWBorderWidth)
|
||||||
m_client->old_bw = cr.border_width;
|
client->old_bw = cr.border_width;
|
||||||
|
|
||||||
if (cr.value_mask & CWX)
|
if (cr.value_mask & CWX)
|
||||||
cx = cr.x;
|
cx = cr.x;
|
||||||
|
@ -2638,8 +2639,13 @@ void FluxboxWindow::restore(WinClient *client, bool remap) {
|
||||||
|
|
||||||
delete client;
|
delete client;
|
||||||
|
|
||||||
if (numClients() == 0)
|
#ifdef DEBUG
|
||||||
|
cerr<<__FILE__<<"("<<__FUNCTION__<<"): numClients() = "<<numClients()<<endl;
|
||||||
|
#endif // DEBUG
|
||||||
|
if (numClients() == 0) {
|
||||||
|
|
||||||
m_frame.hide();
|
m_frame.hide();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
// $Id: Workspace.cc,v 1.51 2003/04/14 14:59:15 fluxgen Exp $
|
// $Id: Workspace.cc,v 1.52 2003/04/15 12:20:27 fluxgen Exp $
|
||||||
|
|
||||||
#include "Workspace.hh"
|
#include "Workspace.hh"
|
||||||
|
|
||||||
|
@ -496,15 +496,10 @@ void Workspace::updateClientmenu() {
|
||||||
(*win_it)->clientList().begin();
|
(*win_it)->clientList().begin();
|
||||||
FluxboxWindow::ClientList::iterator client_it_end =
|
FluxboxWindow::ClientList::iterator client_it_end =
|
||||||
(*win_it)->clientList().end();
|
(*win_it)->clientList().end();
|
||||||
for (; client_it != client_it_end; ++client_it) {
|
for (; client_it != client_it_end; ++client_it)
|
||||||
/* FbTk::RefCount<FbTk::Command>
|
|
||||||
raise_and_focus(new RaiseFocusAndSetWorkspace(*this,
|
|
||||||
*(*client_it)));
|
|
||||||
*/
|
|
||||||
m_clientmenu.insert(new ClientMenuItem(*(*client_it), *this));
|
m_clientmenu.insert(new ClientMenuItem(*(*client_it), *this));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m_clientmenu.update();
|
m_clientmenu.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
116
src/fluxbox.cc
116
src/fluxbox.cc
|
@ -22,7 +22,7 @@
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
// $Id: fluxbox.cc,v 1.108 2003/04/15 08:54:40 fluxgen Exp $
|
// $Id: fluxbox.cc,v 1.109 2003/04/15 12:11:54 fluxgen Exp $
|
||||||
|
|
||||||
#include "fluxbox.hh"
|
#include "fluxbox.hh"
|
||||||
|
|
||||||
|
@ -39,6 +39,8 @@
|
||||||
#include "EventManager.hh"
|
#include "EventManager.hh"
|
||||||
#include "FbCommands.hh"
|
#include "FbCommands.hh"
|
||||||
#include "WinClient.hh"
|
#include "WinClient.hh"
|
||||||
|
#include "Keys.hh"
|
||||||
|
#include "FbAtoms.hh"
|
||||||
|
|
||||||
//Use GNU extensions
|
//Use GNU extensions
|
||||||
#ifndef _GNU_SOURCE
|
#ifndef _GNU_SOURCE
|
||||||
|
@ -356,7 +358,8 @@ Fluxbox::Titlebar Fluxbox::m_titlebar_left[] = {STICK};
|
||||||
Fluxbox::Titlebar Fluxbox::m_titlebar_right[] = {MINIMIZE, MAXIMIZE, CLOSE};
|
Fluxbox::Titlebar Fluxbox::m_titlebar_right[] = {MINIMIZE, MAXIMIZE, CLOSE};
|
||||||
|
|
||||||
Fluxbox::Fluxbox(int m_argc, char **m_argv, const char *dpy_name, const char *rc)
|
Fluxbox::Fluxbox(int m_argc, char **m_argv, const char *dpy_name, const char *rc)
|
||||||
: BaseDisplay(m_argv[0], dpy_name), FbAtoms(getXDisplay()),
|
: BaseDisplay(m_argv[0], dpy_name),
|
||||||
|
m_fbatoms(new FbAtoms()),
|
||||||
m_resourcemanager(), m_screen_rm(),
|
m_resourcemanager(), m_screen_rm(),
|
||||||
m_rc_tabs(m_resourcemanager, true, "session.tabs", "Session.Tabs"),
|
m_rc_tabs(m_resourcemanager, true, "session.tabs", "Session.Tabs"),
|
||||||
m_rc_iconbar(m_resourcemanager, true, "session.iconbar", "Session.Iconbar"),
|
m_rc_iconbar(m_resourcemanager, true, "session.iconbar", "Session.Iconbar"),
|
||||||
|
@ -970,7 +973,7 @@ void Fluxbox::handleClientMessage(XClientMessageEvent &ce) {
|
||||||
if (ce.format != 32)
|
if (ce.format != 32)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (ce.message_type == getWMChangeStateAtom()) {
|
if (ce.message_type == m_fbatoms->getWMChangeStateAtom()) {
|
||||||
FluxboxWindow *win = searchWindow(ce.window);
|
FluxboxWindow *win = searchWindow(ce.window);
|
||||||
if (! win || ! win->validateClient())
|
if (! win || ! win->validateClient())
|
||||||
return;
|
return;
|
||||||
|
@ -979,18 +982,18 @@ void Fluxbox::handleClientMessage(XClientMessageEvent &ce) {
|
||||||
win->iconify();
|
win->iconify();
|
||||||
if (ce.data.l[0] == NormalState)
|
if (ce.data.l[0] == NormalState)
|
||||||
win->deiconify();
|
win->deiconify();
|
||||||
} else if (ce.message_type == getFluxboxChangeWorkspaceAtom()) {
|
} else if (ce.message_type == m_fbatoms->getFluxboxChangeWorkspaceAtom()) {
|
||||||
BScreen *screen = searchScreen(ce.window);
|
BScreen *screen = searchScreen(ce.window);
|
||||||
|
|
||||||
if (screen && ce.data.l[0] >= 0 &&
|
if (screen && ce.data.l[0] >= 0 &&
|
||||||
ce.data.l[0] < (signed)screen->getCount())
|
ce.data.l[0] < (signed)screen->getCount())
|
||||||
screen->changeWorkspaceID(ce.data.l[0]);
|
screen->changeWorkspaceID(ce.data.l[0]);
|
||||||
|
|
||||||
} else if (ce.message_type == getFluxboxChangeWindowFocusAtom()) {
|
} else if (ce.message_type == m_fbatoms->getFluxboxChangeWindowFocusAtom()) {
|
||||||
FluxboxWindow *win = searchWindow(ce.window);
|
FluxboxWindow *win = searchWindow(ce.window);
|
||||||
if (win && win->isVisible() && win->setInputFocus())
|
if (win && win->isVisible() && win->setInputFocus())
|
||||||
win->installColormap(True);
|
win->installColormap(True);
|
||||||
} else if (ce.message_type == getFluxboxCycleWindowFocusAtom()) {
|
} else if (ce.message_type == m_fbatoms->getFluxboxCycleWindowFocusAtom()) {
|
||||||
BScreen *screen = searchScreen(ce.window);
|
BScreen *screen = searchScreen(ce.window);
|
||||||
|
|
||||||
if (screen) {
|
if (screen) {
|
||||||
|
@ -999,7 +1002,7 @@ void Fluxbox::handleClientMessage(XClientMessageEvent &ce) {
|
||||||
else
|
else
|
||||||
screen->nextFocus();
|
screen->nextFocus();
|
||||||
}
|
}
|
||||||
} else if (ce.message_type == getFluxboxChangeAttributesAtom()) {
|
} else if (ce.message_type == m_fbatoms->getFluxboxChangeAttributesAtom()) {
|
||||||
|
|
||||||
FluxboxWindow *win = searchWindow(ce.window);
|
FluxboxWindow *win = searchWindow(ce.window);
|
||||||
|
|
||||||
|
@ -1290,7 +1293,7 @@ void Fluxbox::handleKeyEvent(XKeyEvent &ke) {
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
void Fluxbox::doWindowAction(Keys::KeyAction action, const int param) {
|
void Fluxbox::doWindowAction(int action, const int param) {
|
||||||
if (!focused_window)
|
if (!focused_window)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -1913,7 +1916,7 @@ void Fluxbox::load_rc() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Fluxbox::load_rc(BScreen *screen) {
|
void Fluxbox::load_rc(BScreen &screen) {
|
||||||
//get resource filename
|
//get resource filename
|
||||||
string dbfile(getRcFilename());
|
string dbfile(getRcFilename());
|
||||||
if (dbfile.size() != 0) {
|
if (dbfile.size() != 0) {
|
||||||
|
@ -1936,50 +1939,51 @@ void Fluxbox::load_rc(BScreen *screen) {
|
||||||
|
|
||||||
XrmValue value;
|
XrmValue value;
|
||||||
char *value_type, name_lookup[1024], class_lookup[1024];
|
char *value_type, name_lookup[1024], class_lookup[1024];
|
||||||
int screen_number = screen->getScreenNumber();
|
int screen_number = screen.getScreenNumber();
|
||||||
|
|
||||||
sprintf(name_lookup, "session.screen%d.rowPlacementDirection", screen_number);
|
sprintf(name_lookup, "session.screen%d.rowPlacementDirection", screen_number);
|
||||||
sprintf(class_lookup, "Session.Screen%d.RowPlacementDirection", screen_number);
|
sprintf(class_lookup, "Session.Screen%d.RowPlacementDirection", screen_number);
|
||||||
if (XrmGetResource(*database, name_lookup, class_lookup, &value_type,
|
if (XrmGetResource(*database, name_lookup, class_lookup, &value_type,
|
||||||
&value)) {
|
&value)) {
|
||||||
if (! strncasecmp(value.addr, "righttoleft", value.size))
|
if (! strncasecmp(value.addr, "righttoleft", value.size))
|
||||||
screen->saveRowPlacementDirection(BScreen::RIGHTLEFT);
|
screen.saveRowPlacementDirection(BScreen::RIGHTLEFT);
|
||||||
else
|
else
|
||||||
screen->saveRowPlacementDirection(BScreen::LEFTRIGHT);
|
screen.saveRowPlacementDirection(BScreen::LEFTRIGHT);
|
||||||
} else
|
} else
|
||||||
screen->saveRowPlacementDirection(BScreen::LEFTRIGHT);
|
screen.saveRowPlacementDirection(BScreen::LEFTRIGHT);
|
||||||
|
|
||||||
sprintf(name_lookup, "session.screen%d.colPlacementDirection", screen_number);
|
sprintf(name_lookup, "session.screen%d.colPlacementDirection", screen_number);
|
||||||
sprintf(class_lookup, "Session.Screen%d.ColPlacementDirection", screen_number);
|
sprintf(class_lookup, "Session.Screen%d.ColPlacementDirection", screen_number);
|
||||||
if (XrmGetResource(*database, name_lookup, class_lookup, &value_type,
|
if (XrmGetResource(*database, name_lookup, class_lookup, &value_type,
|
||||||
&value)) {
|
&value)) {
|
||||||
if (! strncasecmp(value.addr, "bottomtotop", value.size))
|
if (! strncasecmp(value.addr, "bottomtotop", value.size))
|
||||||
screen->saveColPlacementDirection(BScreen::BOTTOMTOP);
|
screen.saveColPlacementDirection(BScreen::BOTTOMTOP);
|
||||||
else
|
else
|
||||||
screen->saveColPlacementDirection(BScreen::TOPBOTTOM);
|
screen.saveColPlacementDirection(BScreen::TOPBOTTOM);
|
||||||
} else
|
} else
|
||||||
screen->saveColPlacementDirection(BScreen::TOPBOTTOM);
|
screen.saveColPlacementDirection(BScreen::TOPBOTTOM);
|
||||||
|
|
||||||
screen->removeWorkspaceNames();
|
screen.removeWorkspaceNames();
|
||||||
|
|
||||||
sprintf(name_lookup, "session.screen%d.workspaceNames", screen_number);
|
sprintf(name_lookup, "session.screen%d.workspaceNames", screen_number);
|
||||||
sprintf(class_lookup, "Session.Screen%d.WorkspaceNames", screen_number);
|
sprintf(class_lookup, "Session.Screen%d.WorkspaceNames", screen_number);
|
||||||
if (XrmGetResource(*database, name_lookup, class_lookup, &value_type,
|
if (XrmGetResource(*database, name_lookup, class_lookup, &value_type,
|
||||||
&value)) {
|
&value)) {
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
cerr<<__FILE__<<"("<<__LINE__<<"): Workspaces="<<screen->getNumberOfWorkspaces()<<endl;
|
cerr<<__FILE__<<"("<<__FUNCTION__<<"): Workspaces="<<
|
||||||
|
screen.getNumberOfWorkspaces()<<endl;
|
||||||
#endif // DEBUG
|
#endif // DEBUG
|
||||||
char *search = StringUtil::strdup(value.addr);
|
char *search = StringUtil::strdup(value.addr);
|
||||||
|
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; i < screen->getNumberOfWorkspaces(); i++) {
|
for (i = 0; i < screen.getNumberOfWorkspaces(); i++) {
|
||||||
char *nn;
|
char *nn;
|
||||||
|
|
||||||
if (! i) nn = strtok(search, ",");
|
if (! i) nn = strtok(search, ",");
|
||||||
else nn = strtok(0, ",");
|
else nn = strtok(0, ",");
|
||||||
|
|
||||||
if (nn)
|
if (nn)
|
||||||
screen->addWorkspaceName(nn);
|
screen.addWorkspaceName(nn);
|
||||||
else break;
|
else break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1992,13 +1996,13 @@ void Fluxbox::load_rc(BScreen *screen) {
|
||||||
if (XrmGetResource(*database, name_lookup, class_lookup, &value_type,
|
if (XrmGetResource(*database, name_lookup, class_lookup, &value_type,
|
||||||
&value)) {
|
&value)) {
|
||||||
if (! strncasecmp(value.addr, "RowSmartPlacement", value.size))
|
if (! strncasecmp(value.addr, "RowSmartPlacement", value.size))
|
||||||
screen->savePlacementPolicy(BScreen::ROWSMARTPLACEMENT);
|
screen.savePlacementPolicy(BScreen::ROWSMARTPLACEMENT);
|
||||||
else if (! strncasecmp(value.addr, "ColSmartPlacement", value.size))
|
else if (! strncasecmp(value.addr, "ColSmartPlacement", value.size))
|
||||||
screen->savePlacementPolicy(BScreen::COLSMARTPLACEMENT);
|
screen.savePlacementPolicy(BScreen::COLSMARTPLACEMENT);
|
||||||
else
|
else
|
||||||
screen->savePlacementPolicy(BScreen::CASCADEPLACEMENT);
|
screen.savePlacementPolicy(BScreen::CASCADEPLACEMENT);
|
||||||
} else
|
} else
|
||||||
screen->savePlacementPolicy(BScreen::ROWSMARTPLACEMENT);
|
screen.savePlacementPolicy(BScreen::ROWSMARTPLACEMENT);
|
||||||
|
|
||||||
#ifdef SLIT
|
#ifdef SLIT
|
||||||
sprintf(name_lookup, "session.screen%d.slit.placement", screen_number);
|
sprintf(name_lookup, "session.screen%d.slit.placement", screen_number);
|
||||||
|
@ -2006,34 +2010,34 @@ void Fluxbox::load_rc(BScreen *screen) {
|
||||||
if (XrmGetResource(*database, name_lookup, class_lookup, &value_type,
|
if (XrmGetResource(*database, name_lookup, class_lookup, &value_type,
|
||||||
&value)) {
|
&value)) {
|
||||||
if (! strncasecmp(value.addr, "TopLeft", value.size))
|
if (! strncasecmp(value.addr, "TopLeft", value.size))
|
||||||
screen->saveSlitPlacement(Slit::TOPLEFT);
|
screen.saveSlitPlacement(Slit::TOPLEFT);
|
||||||
else if (! strncasecmp(value.addr, "CenterLeft", value.size))
|
else if (! strncasecmp(value.addr, "CenterLeft", value.size))
|
||||||
screen->saveSlitPlacement(Slit::CENTERLEFT);
|
screen.saveSlitPlacement(Slit::CENTERLEFT);
|
||||||
else if (! strncasecmp(value.addr, "BottomLeft", value.size))
|
else if (! strncasecmp(value.addr, "BottomLeft", value.size))
|
||||||
screen->saveSlitPlacement(Slit::BOTTOMLEFT);
|
screen.saveSlitPlacement(Slit::BOTTOMLEFT);
|
||||||
else if (! strncasecmp(value.addr, "TopCenter", value.size))
|
else if (! strncasecmp(value.addr, "TopCenter", value.size))
|
||||||
screen->saveSlitPlacement(Slit::TOPCENTER);
|
screen.saveSlitPlacement(Slit::TOPCENTER);
|
||||||
else if (! strncasecmp(value.addr, "BottomCenter", value.size))
|
else if (! strncasecmp(value.addr, "BottomCenter", value.size))
|
||||||
screen->saveSlitPlacement(Slit::BOTTOMCENTER);
|
screen.saveSlitPlacement(Slit::BOTTOMCENTER);
|
||||||
else if (! strncasecmp(value.addr, "TopRight", value.size))
|
else if (! strncasecmp(value.addr, "TopRight", value.size))
|
||||||
screen->saveSlitPlacement(Slit::TOPRIGHT);
|
screen.saveSlitPlacement(Slit::TOPRIGHT);
|
||||||
else if (! strncasecmp(value.addr, "BottomRight", value.size))
|
else if (! strncasecmp(value.addr, "BottomRight", value.size))
|
||||||
screen->saveSlitPlacement(Slit::BOTTOMRIGHT);
|
screen.saveSlitPlacement(Slit::BOTTOMRIGHT);
|
||||||
else
|
else
|
||||||
screen->saveSlitPlacement(Slit::CENTERRIGHT);
|
screen.saveSlitPlacement(Slit::CENTERRIGHT);
|
||||||
} else
|
} else
|
||||||
screen->saveSlitPlacement(Slit::CENTERRIGHT);
|
screen.saveSlitPlacement(Slit::CENTERRIGHT);
|
||||||
|
|
||||||
sprintf(name_lookup, "session.screen%d.slit.direction", screen_number);
|
sprintf(name_lookup, "session.screen%d.slit.direction", screen_number);
|
||||||
sprintf(class_lookup, "Session.Screen%d.Slit.Direction", screen_number);
|
sprintf(class_lookup, "Session.Screen%d.Slit.Direction", screen_number);
|
||||||
if (XrmGetResource(*database, name_lookup, class_lookup, &value_type,
|
if (XrmGetResource(*database, name_lookup, class_lookup, &value_type,
|
||||||
&value)) {
|
&value)) {
|
||||||
if (! strncasecmp(value.addr, "Horizontal", value.size))
|
if (! strncasecmp(value.addr, "Horizontal", value.size))
|
||||||
screen->saveSlitDirection(Slit::HORIZONTAL);
|
screen.saveSlitDirection(Slit::HORIZONTAL);
|
||||||
else
|
else
|
||||||
screen->saveSlitDirection(Slit::VERTICAL);
|
screen.saveSlitDirection(Slit::VERTICAL);
|
||||||
} else
|
} else
|
||||||
screen->saveSlitDirection(Slit::VERTICAL);
|
screen.saveSlitDirection(Slit::VERTICAL);
|
||||||
|
|
||||||
|
|
||||||
sprintf(name_lookup, "session.screen%d.slit.autoHide", screen_number);
|
sprintf(name_lookup, "session.screen%d.slit.autoHide", screen_number);
|
||||||
|
@ -2041,11 +2045,11 @@ void Fluxbox::load_rc(BScreen *screen) {
|
||||||
if (XrmGetResource(*database, name_lookup, class_lookup, &value_type,
|
if (XrmGetResource(*database, name_lookup, class_lookup, &value_type,
|
||||||
&value)) {
|
&value)) {
|
||||||
if (! strncasecmp(value.addr, "True", value.size))
|
if (! strncasecmp(value.addr, "True", value.size))
|
||||||
screen->saveSlitAutoHide(True);
|
screen.saveSlitAutoHide(true);
|
||||||
else
|
else
|
||||||
screen->saveSlitAutoHide(False);
|
screen.saveSlitAutoHide(false);
|
||||||
} else
|
} else
|
||||||
screen->saveSlitAutoHide(False);
|
screen.saveSlitAutoHide(false);
|
||||||
/*
|
/*
|
||||||
#ifdef XINERAMA
|
#ifdef XINERAMA
|
||||||
int tmp_head;
|
int tmp_head;
|
||||||
|
@ -2067,9 +2071,9 @@ void Fluxbox::load_rc(BScreen *screen) {
|
||||||
sprintf(class_lookup, "Session.Screen%d.StrftimeFormat", screen_number);
|
sprintf(class_lookup, "Session.Screen%d.StrftimeFormat", screen_number);
|
||||||
if (XrmGetResource(*database, name_lookup, class_lookup, &value_type,
|
if (XrmGetResource(*database, name_lookup, class_lookup, &value_type,
|
||||||
&value))
|
&value))
|
||||||
screen->saveStrftimeFormat(value.addr);
|
screen.saveStrftimeFormat(value.addr);
|
||||||
else
|
else
|
||||||
screen->saveStrftimeFormat("%I:%M %p");
|
screen.saveStrftimeFormat("%I:%M %p");
|
||||||
#else // HAVE_STRFTIME
|
#else // HAVE_STRFTIME
|
||||||
|
|
||||||
sprintf(name_lookup, "session.screen%d.dateFormat", screen_number);
|
sprintf(name_lookup, "session.screen%d.dateFormat", screen_number);
|
||||||
|
@ -2077,11 +2081,11 @@ void Fluxbox::load_rc(BScreen *screen) {
|
||||||
if (XrmGetResource(*database, name_lookup, class_lookup, &value_type,
|
if (XrmGetResource(*database, name_lookup, class_lookup, &value_type,
|
||||||
&value)) {
|
&value)) {
|
||||||
if (strncasecmp(value.addr, "european", value.size))
|
if (strncasecmp(value.addr, "european", value.size))
|
||||||
screen->saveDateFormat(B_AMERICANDATE);
|
screen.saveDateFormat(B_AMERICANDATE);
|
||||||
else
|
else
|
||||||
screen->saveDateFormat(B_EUROPEANDATE);
|
screen.saveDateFormat(B_EUROPEANDATE);
|
||||||
} else
|
} else
|
||||||
screen->saveDateFormat(B_AMERICANDATE);
|
screen.saveDateFormat(B_AMERICANDATE);
|
||||||
|
|
||||||
sprintf(name_lookup, "session.screen%d.clockFormat", screen_number);
|
sprintf(name_lookup, "session.screen%d.clockFormat", screen_number);
|
||||||
sprintf(class_lookup, "Session.Screen%d.ClockFormat", screen_number);
|
sprintf(class_lookup, "Session.Screen%d.ClockFormat", screen_number);
|
||||||
|
@ -2089,23 +2093,23 @@ void Fluxbox::load_rc(BScreen *screen) {
|
||||||
&value)) {
|
&value)) {
|
||||||
int clock;
|
int clock;
|
||||||
if (sscanf(value.addr, "%d", &clock) != 1)
|
if (sscanf(value.addr, "%d", &clock) != 1)
|
||||||
screen->saveClock24Hour(False);
|
screen.saveClock24Hour(False);
|
||||||
else if (clock == 24)
|
else if (clock == 24)
|
||||||
screen->saveClock24Hour(True);
|
screen.saveClock24Hour(True);
|
||||||
else
|
else
|
||||||
screen->saveClock24Hour(False);
|
screen.saveClock24Hour(False);
|
||||||
} else
|
} else
|
||||||
screen->saveClock24Hour(False);
|
screen.saveClock24Hour(False);
|
||||||
#endif // HAVE_STRFTIME
|
#endif // HAVE_STRFTIME
|
||||||
|
|
||||||
//check size on toolbarwidth percent
|
//check size on toolbarwidth percent
|
||||||
if (screen->getToolbarWidthPercent() <= 0 ||
|
if (screen.getToolbarWidthPercent() <= 0 ||
|
||||||
screen->getToolbarWidthPercent() > 100)
|
screen.getToolbarWidthPercent() > 100)
|
||||||
screen->saveToolbarWidthPercent(66);
|
screen.saveToolbarWidthPercent(66);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Fluxbox::loadRootCommand(BScreen *screen) {
|
void Fluxbox::loadRootCommand(BScreen &screen) {
|
||||||
|
|
||||||
string dbfile(getRcFilename());
|
string dbfile(getRcFilename());
|
||||||
|
|
||||||
|
@ -2115,13 +2119,13 @@ void Fluxbox::loadRootCommand(BScreen *screen) {
|
||||||
|
|
||||||
XrmValue value;
|
XrmValue value;
|
||||||
char *value_type, name_lookup[1024], class_lookup[1024];
|
char *value_type, name_lookup[1024], class_lookup[1024];
|
||||||
sprintf(name_lookup, "session.screen%d.rootCommand", screen->getScreenNumber());
|
sprintf(name_lookup, "session.screen%d.rootCommand", screen.getScreenNumber());
|
||||||
sprintf(class_lookup, "Session.Screen%d.RootCommand", screen->getScreenNumber());
|
sprintf(class_lookup, "Session.Screen%d.RootCommand", screen.getScreenNumber());
|
||||||
if (XrmGetResource(*database, name_lookup, class_lookup, &value_type,
|
if (XrmGetResource(*database, name_lookup, class_lookup, &value_type,
|
||||||
&value)) {
|
&value)) {
|
||||||
screen->saveRootCommand(value.addr==0 ? "": value.addr);
|
screen.saveRootCommand(value.addr==0 ? "": value.addr);
|
||||||
} else
|
} else
|
||||||
screen->saveRootCommand("");
|
screen.saveRootCommand("");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,16 +22,14 @@
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
// $Id: fluxbox.hh,v 1.48 2003/04/15 00:50:25 rathnor Exp $
|
// $Id: fluxbox.hh,v 1.49 2003/04/15 12:11:10 fluxgen Exp $
|
||||||
|
|
||||||
#ifndef FLUXBOX_HH
|
#ifndef FLUXBOX_HH
|
||||||
#define FLUXBOX_HH
|
#define FLUXBOX_HH
|
||||||
|
|
||||||
#include "Resource.hh"
|
#include "Resource.hh"
|
||||||
#include "Keys.hh"
|
|
||||||
#include "BaseDisplay.hh"
|
#include "BaseDisplay.hh"
|
||||||
#include "Timer.hh"
|
#include "Timer.hh"
|
||||||
#include "Toolbar.hh"
|
|
||||||
#include "Observer.hh"
|
#include "Observer.hh"
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
|
@ -39,7 +37,6 @@
|
||||||
#endif // HAVE_CONFIG_H
|
#endif // HAVE_CONFIG_H
|
||||||
|
|
||||||
#include "SignalHandler.hh"
|
#include "SignalHandler.hh"
|
||||||
#include "FbAtoms.hh"
|
|
||||||
|
|
||||||
#include <X11/Xlib.h>
|
#include <X11/Xlib.h>
|
||||||
#include <X11/Xresource.h>
|
#include <X11/Xresource.h>
|
||||||
|
@ -65,6 +62,9 @@
|
||||||
|
|
||||||
class AtomHandler;
|
class AtomHandler;
|
||||||
class FluxboxWindow;
|
class FluxboxWindow;
|
||||||
|
class Keys;
|
||||||
|
class BScreen;
|
||||||
|
class FbAtoms;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
main class for the window manager.
|
main class for the window manager.
|
||||||
|
@ -72,7 +72,6 @@ class FluxboxWindow;
|
||||||
*/
|
*/
|
||||||
class Fluxbox : public BaseDisplay, public FbTk::TimeoutHandler,
|
class Fluxbox : public BaseDisplay, public FbTk::TimeoutHandler,
|
||||||
public FbTk::SignalEventHandler,
|
public FbTk::SignalEventHandler,
|
||||||
public FbAtoms,
|
|
||||||
public FbTk::Observer {
|
public FbTk::Observer {
|
||||||
public:
|
public:
|
||||||
Fluxbox(int argc, char **argv, const char * dpy_name= 0, const char *rc = 0);
|
Fluxbox(int argc, char **argv, const char * dpy_name= 0, const char *rc = 0);
|
||||||
|
@ -80,11 +79,10 @@ public:
|
||||||
|
|
||||||
static Fluxbox *instance() { return singleton; }
|
static Fluxbox *instance() { return singleton; }
|
||||||
|
|
||||||
inline bool useIconBar() { return *m_rc_iconbar; }
|
inline bool useIconBar() const { return *m_rc_iconbar; }
|
||||||
inline void saveIconBar(bool value) { m_rc_iconbar = value; }
|
inline void saveIconBar(bool value) { m_rc_iconbar = value; }
|
||||||
#ifdef HAVE_GETPID
|
|
||||||
inline Atom getFluxboxPidAtom() const { return fluxbox_pid; }
|
inline Atom getFluxboxPidAtom() const { return fluxbox_pid; }
|
||||||
#endif // HAVE_GETPID
|
|
||||||
|
|
||||||
FluxboxWindow *searchGroup(Window, FluxboxWindow *);
|
FluxboxWindow *searchGroup(Window, FluxboxWindow *);
|
||||||
FluxboxWindow *searchWindow(Window);
|
FluxboxWindow *searchWindow(Window);
|
||||||
|
@ -101,8 +99,8 @@ public:
|
||||||
|
|
||||||
enum FocusModel { SLOPPYFOCUS=0, SEMISLOPPYFOCUS, CLICKTOFOCUS };
|
enum FocusModel { SLOPPYFOCUS=0, SEMISLOPPYFOCUS, CLICKTOFOCUS };
|
||||||
|
|
||||||
inline const std::vector<Fluxbox::Titlebar>& getTitlebarRight() { return *m_rc_titlebar_right; }
|
inline const std::vector<Fluxbox::Titlebar>& getTitlebarRight() const { return *m_rc_titlebar_right; }
|
||||||
inline const std::vector<Fluxbox::Titlebar>& getTitlebarLeft() { return *m_rc_titlebar_left; }
|
inline const std::vector<Fluxbox::Titlebar>& getTitlebarLeft() const { return *m_rc_titlebar_left; }
|
||||||
inline const std::string &getStyleFilename() const { return *m_rc_stylefile; }
|
inline const std::string &getStyleFilename() const { return *m_rc_stylefile; }
|
||||||
|
|
||||||
inline const char *getMenuFilename() const { return m_rc_menufile->c_str(); }
|
inline const char *getMenuFilename() const { return m_rc_menufile->c_str(); }
|
||||||
|
@ -113,8 +111,8 @@ public:
|
||||||
// class to store layer numbers (special Resource type)
|
// class to store layer numbers (special Resource type)
|
||||||
class Layer {
|
class Layer {
|
||||||
public:
|
public:
|
||||||
Layer(int i) : m_num(i) {};
|
explicit Layer(int i) : m_num(i) {};
|
||||||
const int getNum() const { return m_num; }
|
inline int getNum() const { return m_num; }
|
||||||
|
|
||||||
Layer &operator=(int num) { m_num = num; return *this; }
|
Layer &operator=(int num) { m_num = num; return *this; }
|
||||||
|
|
||||||
|
@ -139,25 +137,25 @@ public:
|
||||||
|
|
||||||
inline void maskWindowEvents(Window w, FluxboxWindow *bw)
|
inline void maskWindowEvents(Window w, FluxboxWindow *bw)
|
||||||
{ masked = w; masked_window = bw; }
|
{ masked = w; masked_window = bw; }
|
||||||
inline void setNoFocus(Bool f) { no_focus = f; }
|
inline void setNoFocus(bool f) { no_focus = f; }
|
||||||
|
|
||||||
void watchKeyRelease(BScreen *screen, unsigned int mods);
|
void watchKeyRelease(BScreen *screen, unsigned int mods);
|
||||||
|
|
||||||
void setFocusedWindow(FluxboxWindow *w);
|
void setFocusedWindow(FluxboxWindow *w);
|
||||||
void shutdown();
|
void shutdown();
|
||||||
void load_rc(BScreen *);
|
void load_rc(BScreen &scr);
|
||||||
void loadRootCommand(BScreen *);
|
void loadRootCommand(BScreen &scr);
|
||||||
void loadTitlebar();
|
void loadTitlebar();
|
||||||
void saveStyleFilename(const char *val) { m_rc_stylefile = (val == 0 ? "" : val); }
|
void saveStyleFilename(const char *val) { m_rc_stylefile = (val == 0 ? "" : val); }
|
||||||
void saveMenuFilename(const char *);
|
void saveMenuFilename(const char *);
|
||||||
void saveTitlebarFilename(const char *);
|
void saveTitlebarFilename(const char *);
|
||||||
void saveSlitlistFilename(const char *val) { m_rc_slitlistfile = (val == 0 ? "" : val); }
|
void saveSlitlistFilename(const char *val) { m_rc_slitlistfile = (val == 0 ? "" : val); }
|
||||||
void saveWindowSearch(Window, FluxboxWindow *);
|
void saveWindowSearch(Window win, FluxboxWindow *fbwin);
|
||||||
void saveGroupSearch(Window, FluxboxWindow *);
|
void saveGroupSearch(Window win, FluxboxWindow *fbwin);
|
||||||
void save_rc();
|
void save_rc();
|
||||||
void removeWindowSearch(Window);
|
void removeWindowSearch(Window win);
|
||||||
void removeGroupSearch(Window);
|
void removeGroupSearch(Window win);
|
||||||
void restart(const char * = 0);
|
void restart(const char *command = 0);
|
||||||
void reconfigure();
|
void reconfigure();
|
||||||
void rereadMenu();
|
void rereadMenu();
|
||||||
void checkMenu();
|
void checkMenu();
|
||||||
|
@ -211,8 +209,11 @@ private:
|
||||||
void handleUnmapNotify(XUnmapEvent &ue);
|
void handleUnmapNotify(XUnmapEvent &ue);
|
||||||
void handleClientMessage(XClientMessageEvent &ce);
|
void handleClientMessage(XClientMessageEvent &ce);
|
||||||
void handleKeyEvent(XKeyEvent &ke);
|
void handleKeyEvent(XKeyEvent &ke);
|
||||||
void doWindowAction(Keys::KeyAction action, const int param);
|
void doWindowAction(int action, const int param);
|
||||||
|
void setTitlebar(std::vector<Fluxbox::Titlebar>& dir, const char *arg);
|
||||||
|
|
||||||
|
std::auto_ptr<FbAtoms> m_fbatoms;
|
||||||
|
|
||||||
ResourceManager m_resourcemanager, m_screen_rm;
|
ResourceManager m_resourcemanager, m_screen_rm;
|
||||||
|
|
||||||
//--- Resources
|
//--- Resources
|
||||||
|
@ -226,7 +227,6 @@ private:
|
||||||
Resource<TitlebarList> m_rc_titlebar_left, m_rc_titlebar_right;
|
Resource<TitlebarList> m_rc_titlebar_left, m_rc_titlebar_right;
|
||||||
Resource<unsigned int> m_rc_cache_life, m_rc_cache_max;
|
Resource<unsigned int> m_rc_cache_life, m_rc_cache_max;
|
||||||
|
|
||||||
void setTitlebar(std::vector<Fluxbox::Titlebar>& dir, const char *arg);
|
|
||||||
|
|
||||||
std::map<Window, FluxboxWindow *> windowSearch;
|
std::map<Window, FluxboxWindow *> windowSearch;
|
||||||
std::map<Window, FluxboxWindow *> groupSearch;
|
std::map<Window, FluxboxWindow *> groupSearch;
|
||||||
|
@ -241,9 +241,7 @@ private:
|
||||||
BScreen *watching_screen;
|
BScreen *watching_screen;
|
||||||
unsigned int watch_keyrelease;
|
unsigned int watch_keyrelease;
|
||||||
|
|
||||||
#ifdef HAVE_GETPID
|
|
||||||
Atom fluxbox_pid;
|
Atom fluxbox_pid;
|
||||||
#endif // HAVE_GETPID
|
|
||||||
|
|
||||||
bool no_focus, reconfigure_wait, reread_menu_wait;
|
bool no_focus, reconfigure_wait, reread_menu_wait;
|
||||||
Time last_time;
|
Time last_time;
|
||||||
|
@ -258,6 +256,7 @@ private:
|
||||||
|
|
||||||
static Fluxbox *singleton;
|
static Fluxbox *singleton;
|
||||||
std::vector<AtomHandler *> m_atomhandler;
|
std::vector<AtomHandler *> m_atomhandler;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue