summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathias <mathias>2005-01-05 01:56:19 (GMT)
committermathias <mathias>2005-01-05 01:56:19 (GMT)
commit0c74e8c9355f6f70d426edaacafd296331aa3523 (patch)
tree95fd218719254ca5c54b44880888443eab5ea453
parent1657de3cefd497823fcd3e57316cf32499dbd415 (diff)
downloadfluxbox_lack-0c74e8c9355f6f70d426edaacafd296331aa3523.zip
fluxbox_lack-0c74e8c9355f6f70d426edaacafd296331aa3523.tar.bz2
Simon's last changes lead to segfaults when the users specified <Sticky> or
<Workspace> in apps-file. Reason is, that an unmanaged window is not yet assigned to an workspace and thus the returned workspacenumber is -1 ... which leads in combination with getWorkspace(nr) to an invalid workspace (0x0) ... This also fixes the problem with several deiconify-modes of the iconbar, when the iconbar is in icons-only mode (same reason) The other changes in the files are just cosmetic, i throw out the comments about the changes Simon did coz they make sense and are correct imho.
-rw-r--r--src/IconButton.cc5
-rw-r--r--src/Screen.cc29
2 files changed, 9 insertions, 25 deletions
diff --git a/src/IconButton.cc b/src/IconButton.cc
index 24bdddf..40310e6 100644
--- a/src/IconButton.cc
+++ b/src/IconButton.cc
@@ -81,20 +81,17 @@ public:
81 m_win.screen().sendToWorkspace(m_win.screen().currentWorkspaceID(), &m_win); 81 m_win.screen().sendToWorkspace(m_win.screen().currentWorkspaceID(), &m_win);
82 } else { 82 } else {
83 m_win.screen().changeWorkspaceID(m_win.workspaceNumber()); 83 m_win.screen().changeWorkspaceID(m_win.workspaceNumber());
84 m_win.raiseAndFocus();
85 } 84 }
86 break; 85 break;
87 case IconbarTool::CURRENT: 86 case IconbarTool::CURRENT:
88 m_win.screen().sendToWorkspace(m_win.screen().currentWorkspaceID(), &m_win); 87 m_win.screen().sendToWorkspace(m_win.screen().currentWorkspaceID(), &m_win);
89 m_win.raiseAndFocus();
90 break; 88 break;
91 case IconbarTool::FOLLOW: 89 case IconbarTool::FOLLOW:
92 default: 90 default:
93 m_win.screen().changeWorkspaceID(m_win.workspaceNumber()); 91 m_win.screen().changeWorkspaceID(m_win.workspaceNumber());
94 m_win.raiseAndFocus();
95 break; 92 break;
96 }; 93 };
97 94 m_win.raiseAndFocus();
98 } else 95 } else
99 m_win.iconify(); 96 m_win.iconify();
100 } 97 }
diff --git a/src/Screen.cc b/src/Screen.cc
index dee150b..91e3c9f 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -1219,11 +1219,7 @@ FluxboxWindow *BScreen::createWindow(Window client) {
1219 focused_list.push_front(&win->winClient()); 1219 focused_list.push_front(&win->winClient());
1220 else 1220 else
1221 focused_list.push_back(&win->winClient()); 1221 focused_list.push_back(&win->winClient());
1222 1222
1223// if (new_win) {
1224// Fluxbox::instance()->attachSignals(*win);
1225// }
1226
1227 // we also need to check if another window expects this window to the left 1223 // we also need to check if another window expects this window to the left
1228 // and if so, then join it. 1224 // and if so, then join it.
1229 FluxboxWindow *otherwin = 0; 1225 FluxboxWindow *otherwin = 0;
@@ -1242,11 +1238,6 @@ FluxboxWindow *BScreen::createWindow(Window client) {
1242FluxboxWindow *BScreen::createWindow(WinClient &client) { 1238FluxboxWindow *BScreen::createWindow(WinClient &client) {
1243 1239
1244 if (isKdeDockapp(client.window()) && addKdeDockapp(client.window())) { 1240 if (isKdeDockapp(client.window()) && addKdeDockapp(client.window())) {
1245 // we need to save old handler and readd it later
1246// I think rearranging the logic negates the need for this - sb 04jan2005
1247// FbTk::EventManager *evm = FbTk::EventManager::instance();
1248// FbTk::EventHandler *evh = evm->find(client.window());
1249// evm->add(*evh, client.window());
1250 return 0; 1241 return 0;
1251 } 1242 }
1252 1243
@@ -1254,24 +1245,17 @@ FluxboxWindow *BScreen::createWindow(WinClient &client) {
1254 winFrameTheme(), 1245 winFrameTheme(),
1255 *layerManager().getLayer(Fluxbox::instance()->getNormalLayer())); 1246 *layerManager().getLayer(Fluxbox::instance()->getNormalLayer()));
1256 1247
1257// Why not KDE? - sb 04jan2005
1258// if (!isKdeDockapp(client.window())) {
1259#ifdef SLIT 1248#ifdef SLIT
1260 if (win->initialState() == WithdrawnState && slit() != 0) { 1249 if (win->initialState() == WithdrawnState && slit() != 0) {
1261 slit()->addClient(win->clientWindow()); 1250 slit()->addClient(win->clientWindow());
1262 } 1251 }
1263#endif // SLIT 1252#endif // SLIT
1264// }
1265 1253
1266 1254
1267 if (!win->isManaged()) { 1255 if (!win->isManaged()) {
1268 delete win; 1256 delete win;
1269 return 0; 1257 return 0;
1270 } 1258 }
1271 // don't add to focused_list, as it should already be in there (since the
1272 // WinClient already exists).
1273
1274// Fluxbox::instance()->attachSignals(*win);
1275 1259
1276 m_clientlist_sig.notify(); 1260 m_clientlist_sig.notify();
1277 1261
@@ -1355,7 +1339,10 @@ void BScreen::reassociateWindow(FluxboxWindow *w, unsigned int wkspc_id,
1355 // gets updated 1339 // gets updated
1356 m_clientlist_sig.notify(); 1340 m_clientlist_sig.notify();
1357 } else if (ignore_sticky || ! w->isStuck()) { 1341 } else if (ignore_sticky || ! w->isStuck()) {
1358 getWorkspace(w->workspaceNumber())->removeWindow(w, true); 1342 // fresh windows have workspaceNumber == -1, which leads to
1343 // an invalid workspace (unsigned int)
1344 if (getWorkspace(w->workspaceNumber()))
1345 getWorkspace(w->workspaceNumber())->removeWindow(w, true);
1359 getWorkspace(wkspc_id)->addWindow(*w); 1346 getWorkspace(wkspc_id)->addWindow(*w);
1360 // see comment above 1347 // see comment above
1361 m_clientlist_sig.notify(); 1348 m_clientlist_sig.notify();