aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarkt <markt>2007-05-20 21:45:51 (GMT)
committermarkt <markt>2007-05-20 21:45:51 (GMT)
commitcb3f9ed28a1f6972c83d116aa5e9c7f93f2d742a (patch)
tree5e9191a4607c9ff2b726b63c710c53ac60f3b56d
parentff5a2559184f68f4c8ac98125b7e3a5845765e41 (diff)
downloadfluxbox-cb3f9ed28a1f6972c83d116aa5e9c7f93f2d742a.zip
fluxbox-cb3f9ed28a1f6972c83d116aa5e9c7f93f2d742a.tar.bz2
added session.screen<N>.maxDisableMove/Resize, plus some other cleanup
-rw-r--r--ChangeLog3
-rw-r--r--nls/fluxbox-nls.hh2
-rw-r--r--src/FocusControl.cc6
-rw-r--r--src/Screen.cc24
-rw-r--r--src/Screen.hh7
-rw-r--r--src/Window.cc8
-rw-r--r--src/Workspace.cc9
7 files changed, 27 insertions, 32 deletions
diff --git a/ChangeLog b/ChangeLog
index 9f6f4b6..a5ec168 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,9 @@
1 (Format: Year/Month/Day) 1 (Format: Year/Month/Day)
2Changes for 1.1: 2Changes for 1.1:
3*07/05/20: 3*07/05/20:
4 * Added resources session.screen<N>.maxDisable{Move,Resize}: <boolean>, which
5 prevent maximized windows from being moved/resized (Mark)
6 Window.cc Screen.cc/hh nls/fluxbox-nls.hh
4 * Fixed bug #1717782, Bad fullscreen in ooimpress2 ( Henrik ) 7 * Fixed bug #1717782, Bad fullscreen in ooimpress2 ( Henrik )
5 mwm hint had no-resize which made resizing with 8 mwm hint had no-resize which made resizing with
6 FluxboxWindow::setFullscreen impossible. 9 FluxboxWindow::setFullscreen impossible.
diff --git a/nls/fluxbox-nls.hh b/nls/fluxbox-nls.hh
index 95c537b..6ad46c6 100644
--- a/nls/fluxbox-nls.hh
+++ b/nls/fluxbox-nls.hh
@@ -79,6 +79,8 @@ enum {
79 ConfigmenuClickTabFocus = 25, 79 ConfigmenuClickTabFocus = 25,
80 ConfigmenuMaxMenu = 26, 80 ConfigmenuMaxMenu = 26,
81 ConfigmenuMaxIgnoreInc = 27, 81 ConfigmenuMaxIgnoreInc = 27,
82 ConfigmenuMaxDisableMove = 28,
83 ConfigmenuMaxDisableResize = 29,
82 84
83 EwmhSet = 5, 85 EwmhSet = 5,
84 EwmhOutOfMemoryClientList = 1, 86 EwmhOutOfMemoryClientList = 1,
diff --git a/src/FocusControl.cc b/src/FocusControl.cc
index 11ee0a7..126f8b1 100644
--- a/src/FocusControl.cc
+++ b/src/FocusControl.cc
@@ -274,7 +274,7 @@ void FocusControl::stopCyclingFocus() {
274 * is given. 274 * is given.
275 */ 275 */
276Focusable *FocusControl::lastFocusedWindow(int workspace) { 276Focusable *FocusControl::lastFocusedWindow(int workspace) {
277 if (m_focused_list.empty()) return 0; 277 if (m_focused_list.empty() || m_screen.isShuttingdown()) return 0;
278 if (workspace < 0 || workspace >= (int) m_screen.numberOfWorkspaces()) 278 if (workspace < 0 || workspace >= (int) m_screen.numberOfWorkspaces())
279 return m_focused_list.front(); 279 return m_focused_list.front();
280 280
@@ -472,8 +472,6 @@ void FocusControl::shutdown() {
472 Focusables::reverse_iterator it = m_focused_list.rbegin(); 472 Focusables::reverse_iterator it = m_focused_list.rbegin();
473 for (; it != m_focused_list.rend(); ++it) { 473 for (; it != m_focused_list.rend(); ++it) {
474 WinClient *client = dynamic_cast<WinClient *>(*it); 474 WinClient *client = dynamic_cast<WinClient *>(*it);
475if (client)
476std::cerr << "FocusControl::shutdown: " << client->title() << std::endl;
477 if (client && client->fbwindow()) 475 if (client && client->fbwindow())
478 client->fbwindow()->restore(client, true); 476 client->fbwindow()->restore(client, true);
479 } 477 }
@@ -484,7 +482,7 @@ std::cerr << "FocusControl::shutdown: " << client->title() << std::endl;
484 * focus is meant to be, it'll make things right ;-) 482 * focus is meant to be, it'll make things right ;-)
485 */ 483 */
486void FocusControl::revertFocus(BScreen &screen) { 484void FocusControl::revertFocus(BScreen &screen) {
487 if (s_reverting) 485 if (s_reverting || screen.isShuttingdown())
488 return; 486 return;
489 487
490 FocusControl::s_reverting = true; 488 FocusControl::s_reverting = true;
diff --git a/src/Screen.cc b/src/Screen.cc
index 7f44e42..915c055 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -283,6 +283,8 @@ BScreen::ScreenResource::ScreenResource(FbTk::ResourceManager &rm,
283 opaque_move(rm, false, scrname + ".opaqueMove", altscrname+".OpaqueMove"), 283 opaque_move(rm, false, scrname + ".opaqueMove", altscrname+".OpaqueMove"),
284 full_max(rm, false, scrname+".fullMaximization", altscrname+".FullMaximization"), 284 full_max(rm, false, scrname+".fullMaximization", altscrname+".FullMaximization"),
285 max_ignore_inc(rm, true, scrname+".maxIgnoreIncrement", altscrname+".MaxIgnoreIncrement"), 285 max_ignore_inc(rm, true, scrname+".maxIgnoreIncrement", altscrname+".MaxIgnoreIncrement"),
286 max_disable_move(rm, false, scrname+".maxDisableMove", altscrname+".MaxDisableMove"),
287 max_disable_resize(rm, false, scrname+".maxDisableResize", altscrname+".MaxDisableResize"),
286 workspace_warping(rm, true, scrname+".workspacewarping", altscrname+".WorkspaceWarping"), 288 workspace_warping(rm, true, scrname+".workspacewarping", altscrname+".WorkspaceWarping"),
287 show_window_pos(rm, true, scrname+".showwindowposition", altscrname+".ShowWindowPosition"), 289 show_window_pos(rm, true, scrname+".showwindowposition", altscrname+".ShowWindowPosition"),
288 auto_raise(rm, true, scrname+".autoRaise", altscrname+".AutoRaise"), 290 auto_raise(rm, true, scrname+".autoRaise", altscrname+".AutoRaise"),
@@ -1350,17 +1352,11 @@ void BScreen::updateNetizenWindowFocus() {
1350 1352
1351 1353
1352void BScreen::updateNetizenWindowAdd(Window w, unsigned long p) { 1354void BScreen::updateNetizenWindowAdd(Window w, unsigned long p) {
1353
1354 // update the list of clients
1355 m_clientlist_sig.notify();
1356
1357 // and then send the signal to listeners
1358 Netizens::iterator it = m_netizen_list.begin(); 1355 Netizens::iterator it = m_netizen_list.begin();
1359 Netizens::iterator it_end = m_netizen_list.end(); 1356 Netizens::iterator it_end = m_netizen_list.end();
1360 for (; it != it_end; ++it) { 1357 for (; it != it_end; ++it) {
1361 (*it)->sendWindowAdd(w, p); 1358 (*it)->sendWindowAdd(w, p);
1362 } 1359 }
1363
1364} 1360}
1365 1361
1366 1362
@@ -1368,8 +1364,6 @@ void BScreen::updateNetizenWindowDel(Window w) {
1368 for_each(m_netizen_list.begin(), 1364 for_each(m_netizen_list.begin(),
1369 m_netizen_list.end(), 1365 m_netizen_list.end(),
1370 bind2nd(mem_fun(&Netizen::sendWindowDel), w)); 1366 bind2nd(mem_fun(&Netizen::sendWindowDel), w));
1371
1372 m_clientlist_sig.notify();
1373} 1367}
1374 1368
1375 1369
@@ -1638,20 +1632,12 @@ void BScreen::reassociateWindow(FluxboxWindow *w, unsigned int wkspc_id,
1638 if (w->isIconic()) { 1632 if (w->isIconic()) {
1639 removeIcon(w); 1633 removeIcon(w);
1640 getWorkspace(wkspc_id)->addWindow(*w); 1634 getWorkspace(wkspc_id)->addWindow(*w);
1641 // client list need to notify now even though
1642 // we didn't remove/add any window,
1643 // so listeners that uses the client list to
1644 // show whats on current/other workspace
1645 // gets updated
1646 m_clientlist_sig.notify();
1647 } else if (ignore_sticky || ! w->isStuck()) { 1635 } else if (ignore_sticky || ! w->isStuck()) {
1648 // fresh windows have workspaceNumber == -1, which leads to 1636 // fresh windows have workspaceNumber == -1, which leads to
1649 // an invalid workspace (unsigned int) 1637 // an invalid workspace (unsigned int)
1650 if (getWorkspace(w->workspaceNumber())) 1638 if (getWorkspace(w->workspaceNumber()))
1651 getWorkspace(w->workspaceNumber())->removeWindow(w, true); 1639 getWorkspace(w->workspaceNumber())->removeWindow(w, true);
1652 getWorkspace(wkspc_id)->addWindow(*w); 1640 getWorkspace(wkspc_id)->addWindow(*w);
1653 // see comment above
1654 m_clientlist_sig.notify();
1655 } 1641 }
1656} 1642}
1657 1643
@@ -1808,6 +1794,12 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) {
1808 "Ignore Resize Increment", 1794 "Ignore Resize Increment",
1809 "Maximizing Ignores Resize Increment (e.g. xterm)", 1795 "Maximizing Ignores Resize Increment (e.g. xterm)",
1810 *resource.max_ignore_inc, saverc_cmd); 1796 *resource.max_ignore_inc, saverc_cmd);
1797 _BOOLITEM(*maxmenu, Configmenu, MaxDisableMove,
1798 "Disable Moving", "Don't Allow Moving While Maximized",
1799 *resource.max_disable_move, saverc_cmd);
1800 _BOOLITEM(*maxmenu, Configmenu, MaxDisableResize,
1801 "Disable Resizing", "Don't Allow Resizing While Maximized",
1802 *resource.max_disable_resize, saverc_cmd);
1811 1803
1812 maxmenu->updateMenu(); 1804 maxmenu->updateMenu();
1813 menu.insert(maxmenu_label, maxmenu); 1805 menu.insert(maxmenu_label, maxmenu);
diff --git a/src/Screen.hh b/src/Screen.hh
index eb67067..602d5b9 100644
--- a/src/Screen.hh
+++ b/src/Screen.hh
@@ -124,6 +124,8 @@ public:
124 bool doOpaqueMove() const { return *resource.opaque_move; } 124 bool doOpaqueMove() const { return *resource.opaque_move; }
125 bool doFullMax() const { return *resource.full_max; } 125 bool doFullMax() const { return *resource.full_max; }
126 bool getMaxIgnoreIncrement() const { return *resource.max_ignore_inc; } 126 bool getMaxIgnoreIncrement() const { return *resource.max_ignore_inc; }
127 bool getMaxDisableMove() const { return *resource.max_disable_move; }
128 bool getMaxDisableResize() const { return *resource.max_disable_resize; }
127 bool doShowWindowPos() const { return *resource.show_window_pos; } 129 bool doShowWindowPos() const { return *resource.show_window_pos; }
128 bool decorateTransient() const { return *resource.decorate_transient; } 130 bool decorateTransient() const { return *resource.decorate_transient; }
129 const std::string &defaultDeco() const { return *resource.default_deco; } 131 const std::string &defaultDeco() const { return *resource.default_deco; }
@@ -562,8 +564,9 @@ private:
562 const std::string &altscrname); 564 const std::string &altscrname);
563 565
564 FbTk::Resource<bool> image_dither, opaque_move, full_max, 566 FbTk::Resource<bool> image_dither, opaque_move, full_max,
565 max_ignore_inc, workspace_warping, show_window_pos, 567 max_ignore_inc, max_disable_move, max_disable_resize,
566 auto_raise, click_raises, decorate_transient; 568 workspace_warping, show_window_pos, auto_raise, click_raises,
569 decorate_transient;
567 FbTk::Resource<std::string> default_deco; 570 FbTk::Resource<std::string> default_deco;
568 FbTk::Resource<std::string> rootcommand; 571 FbTk::Resource<std::string> rootcommand;
569 FbTk::Resource<ResizeModel> resize_model; 572 FbTk::Resource<ResizeModel> resize_model;
diff --git a/src/Window.cc b/src/Window.cc
index 3042812..0d8b9e5 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -1842,7 +1842,7 @@ void FluxboxWindow::stick() {
1842 stuck = !stuck; 1842 stuck = !stuck;
1843 1843
1844 if (m_initialized) { 1844 if (m_initialized) {
1845 setState(m_current_state, false); 1845 stateSig().notify();
1846 // notify since some things consider "stuck" to be a pseudo-workspace 1846 // notify since some things consider "stuck" to be a pseudo-workspace
1847 m_workspacesig.notify(); 1847 m_workspacesig.notify();
1848 } 1848 }
@@ -3233,6 +3233,9 @@ void FluxboxWindow::startMoving(int x, int y) {
3233 if (s_num_grabs > 0) 3233 if (s_num_grabs > 0)
3234 return; 3234 return;
3235 3235
3236 if (isMaximized() && screen().getMaxDisableMove())
3237 return;
3238
3236 // save first event point 3239 // save first event point
3237 m_last_resize_x = x; 3240 m_last_resize_x = x;
3238 m_last_resize_y = y; 3241 m_last_resize_y = y;
@@ -3503,6 +3506,9 @@ void FluxboxWindow::startResizing(int x, int y, ResizeDirection dir) {
3503 if (s_num_grabs > 0 || isShaded() || isIconic() ) 3506 if (s_num_grabs > 0 || isShaded() || isIconic() )
3504 return; 3507 return;
3505 3508
3509 if (isMaximized() && screen().getMaxDisableResize())
3510 return;
3511
3506 m_resize_corner = dir; 3512 m_resize_corner = dir;
3507 3513
3508 resizing = true; 3514 resizing = true;
diff --git a/src/Workspace.cc b/src/Workspace.cc
index 05d8420..1a4aa06 100644
--- a/src/Workspace.cc
+++ b/src/Workspace.cc
@@ -124,15 +124,6 @@ int Workspace::removeWindow(FluxboxWindow *w, bool still_alive) {
124 m_windowlist.remove(w); 124 m_windowlist.remove(w);
125 m_clientlist_sig.notify(); 125 m_clientlist_sig.notify();
126 126
127 if (!w->isStuck()) {
128 FluxboxWindow::ClientList::iterator client_it =
129 w->clientList().begin();
130 FluxboxWindow::ClientList::iterator client_it_end =
131 w->clientList().end();
132 for (; client_it != client_it_end; ++client_it)
133 screen().updateNetizenWindowDel((*client_it)->window());
134 }
135
136 return m_windowlist.size(); 127 return m_windowlist.size();
137} 128}
138 129