fix some initialisation, especially relating to placement and

decoration/handler hints
This commit is contained in:
simonb 2005-01-04 10:51:38 +00:00
parent 338a985c05
commit 61bb3f039a
5 changed files with 30 additions and 25 deletions

View file

@ -1,5 +1,9 @@
(Format: Year/Month/Day) (Format: Year/Month/Day)
Changes for 0.9.12 Changes for 0.9.12
*05/01/04:
* Fix some initialisation states, especially window placement with no
decorations through apps (e.g. aterm)
Window.hh/cc Screen.cc Ewmh.cc
*05/01/02: *05/01/02:
* Fix for #996298, Windows dont respect toolbar.border.width (Mathias) * Fix for #996298, Windows dont respect toolbar.border.width (Mathias)
Toolbar.cc Toolbar.cc

View file

@ -238,14 +238,11 @@ void Ewmh::setupFrame(FluxboxWindow &win) {
if (desktop == 0xFFFFFFFF && !win.isStuck()) if (desktop == 0xFFFFFFFF && !win.isStuck())
win.stick(); win.stick();
else else
win.screen().sendToWorkspace(desktop, &win, false); win.setWorkspace(desktop, false);
XFree(data); XFree(data);
} }
updateWorkspace(win);
} }
void Ewmh::updateFrameClose(FluxboxWindow &win) { void Ewmh::updateFrameClose(FluxboxWindow &win) {

View file

@ -1220,9 +1220,9 @@ FluxboxWindow *BScreen::createWindow(Window client) {
else else
focused_list.push_back(&win->winClient()); focused_list.push_back(&win->winClient());
if (new_win) { // if (new_win) {
Fluxbox::instance()->attachSignals(*win); // Fluxbox::instance()->attachSignals(*win);
} // }
// we also need to check if another window expects this window to the left // we also need to check if another window expects this window to the left
// and if so, then join it. // and if so, then join it.
@ -1240,27 +1240,28 @@ FluxboxWindow *BScreen::createWindow(Window client) {
FluxboxWindow *BScreen::createWindow(WinClient &client) { FluxboxWindow *BScreen::createWindow(WinClient &client) {
if (isKdeDockapp(client.window()) && addKdeDockapp(client.window())) {
// we need to save old handler and readd it later
// I think rearranging the logic negates the need for this - sb 04jan2005
// FbTk::EventManager *evm = FbTk::EventManager::instance();
// FbTk::EventHandler *evh = evm->find(client.window());
// evm->add(*evh, client.window());
return 0;
}
FluxboxWindow *win = new FluxboxWindow(client, FluxboxWindow *win = new FluxboxWindow(client,
winFrameTheme(), winFrameTheme(),
*layerManager().getLayer(Fluxbox::instance()->getNormalLayer())); *layerManager().getLayer(Fluxbox::instance()->getNormalLayer()));
if (isKdeDockapp(client.window())) { // Why not KDE? - sb 04jan2005
if (addKdeDockapp(client.window())) { // if (!isKdeDockapp(client.window())) {
// we need to save old handler and readd it later
FbTk::EventManager *evm = FbTk::EventManager::instance();
FbTk::EventHandler *evh = evm->find(client.window());
delete win;
evm->add(*evh, client.window());
return 0;
}
} else {
#ifdef SLIT #ifdef SLIT
if (win->initialState() == WithdrawnState && slit() != 0) { if (win->initialState() == WithdrawnState && slit() != 0) {
slit()->addClient(win->clientWindow()); slit()->addClient(win->clientWindow());
} }
#endif // SLIT #endif // SLIT
} // }
if (!win->isManaged()) { if (!win->isManaged()) {
@ -1270,7 +1271,7 @@ FluxboxWindow *BScreen::createWindow(WinClient &client) {
// don't add to focused_list, as it should already be in there (since the // don't add to focused_list, as it should already be in there (since the
// WinClient already exists). // WinClient already exists).
Fluxbox::instance()->attachSignals(*win); // Fluxbox::instance()->attachSignals(*win);
m_clientlist_sig.notify(); m_clientlist_sig.notify();

View file

@ -485,6 +485,7 @@ void FluxboxWindow::init() {
m_timer.setCommand(raise_cmd); m_timer.setCommand(raise_cmd);
m_timer.fireOnce(true); m_timer.fireOnce(true);
// Slit client?
if (m_client->initial_state == WithdrawnState) { if (m_client->initial_state == WithdrawnState) {
return; return;
} }
@ -492,6 +493,7 @@ void FluxboxWindow::init() {
m_managed = true; //this window is managed m_managed = true; //this window is managed
Fluxbox::instance()->saveWindowSearchGroup(frame().window().window(), this); Fluxbox::instance()->saveWindowSearchGroup(frame().window().window(), this);
Fluxbox::instance()->attachSignals(*this);
// update transient infomation // update transient infomation
m_client->updateTransientInfo(); m_client->updateTransientInfo();
@ -518,11 +520,11 @@ void FluxboxWindow::init() {
grabButtons(); grabButtons();
restoreAttributes();
if (m_workspace_number < 0 || m_workspace_number >= screen().getCount()) if (m_workspace_number < 0 || m_workspace_number >= screen().getCount())
m_workspace_number = screen().currentWorkspaceID(); m_workspace_number = screen().currentWorkspaceID();
restoreAttributes();
bool place_window = true; bool place_window = true;
if (fluxbox.isStartup() || m_client->isTransient() || if (fluxbox.isStartup() || m_client->isTransient() ||
m_client->normal_hint_flags & (PPosition|USPosition)) { m_client->normal_hint_flags & (PPosition|USPosition)) {
@ -569,6 +571,7 @@ void FluxboxWindow::init() {
screen().getWorkspace(m_workspace_number)->addWindow(*this, place_window); screen().getWorkspace(m_workspace_number)->addWindow(*this, place_window);
setWorkspace(m_workspace_number, true);
if (shaded) { // start shaded if (shaded) { // start shaded
shaded = false; shaded = false;
@ -1745,7 +1748,7 @@ void FluxboxWindow::maximizeFull() {
} }
void FluxboxWindow::setWorkspace(int n) { void FluxboxWindow::setWorkspace(int n, bool notify) {
unsigned int old_wkspc = m_workspace_number; unsigned int old_wkspc = m_workspace_number;
m_workspace_number = n; m_workspace_number = n;
@ -1754,7 +1757,7 @@ void FluxboxWindow::setWorkspace(int n) {
m_blackbox_attrib.workspace = m_workspace_number; m_blackbox_attrib.workspace = m_workspace_number;
// notify workspace change // notify workspace change
if (!stuck && old_wkspc != m_workspace_number) { if (notify && !stuck && old_wkspc != m_workspace_number) {
#ifdef DEBUG #ifdef DEBUG
cerr<<this<<" notify workspace signal"<<endl; cerr<<this<<" notify workspace signal"<<endl;
#endif // DEBUG #endif // DEBUG

View file

@ -234,7 +234,7 @@ public:
/// move and resize frame to pox x,y and size width, height /// move and resize frame to pox x,y and size width, height
void moveResize(int x, int y, unsigned int width, unsigned int height, int gravity = ForgetGravity); void moveResize(int x, int y, unsigned int width, unsigned int height, int gravity = ForgetGravity);
void setWorkspace(int n); void setWorkspace(int n, bool notify = true);
void changeBlackboxHints(const BlackboxHints &bh); void changeBlackboxHints(const BlackboxHints &bh);
void updateFunctions(); void updateFunctions();
void restoreAttributes(); void restoreAttributes();