aboutsummaryrefslogtreecommitdiff
path: root/src/Window.cc
diff options
context:
space:
mode:
authormarkt <markt>2007-07-22 11:18:38 (GMT)
committermarkt <markt>2007-07-22 11:18:38 (GMT)
commitd91bf8ffdb0be02f95a4c93fc57e7f213311b9d3 (patch)
tree43ec2137175e51368fe5ca9bdbc521fb76b1b212 /src/Window.cc
parentf6c5f7e9abbf808fb446a38ff1285b54510a04ed (diff)
downloadfluxbox-d91bf8ffdb0be02f95a4c93fc57e7f213311b9d3.zip
fluxbox-d91bf8ffdb0be02f95a4c93fc57e7f213311b9d3.tar.bz2
remove a bunch of ancient blackbox features that blackbox doesn't even support anymore
Diffstat (limited to 'src/Window.cc')
-rw-r--r--src/Window.cc196
1 files changed, 6 insertions, 190 deletions
diff --git a/src/Window.cc b/src/Window.cc
index 9ec92c4..aaa2348 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -147,7 +147,6 @@ void raiseFluxboxWindow(FluxboxWindow &win) {
147 win.screen().layerManager().lock(); 147 win.screen().layerManager().lock();
148 148
149 if (!win.isIconic()) { 149 if (!win.isIconic()) {
150 win.screen().updateNetizenWindowRaise(win.clientWindow());
151 win.layerItem().raise(); 150 win.layerItem().raise();
152 } 151 }
153 152
@@ -182,7 +181,6 @@ void lowerFluxboxWindow(FluxboxWindow &win) {
182 win.screen().layerManager().lock(); 181 win.screen().layerManager().lock();
183 182
184 if (!win.isIconic()) { 183 if (!win.isIconic()) {
185 win.screen().updateNetizenWindowLower(win.clientWindow());
186 win.layerItem().lower(); 184 win.layerItem().lower();
187 } 185 }
188 186
@@ -205,7 +203,6 @@ void tempRaiseFluxboxWindow(FluxboxWindow &win) {
205 win.oplock = true; 203 win.oplock = true;
206 204
207 if (!win.isIconic()) { 205 if (!win.isIconic()) {
208 // don't update netizen, as it is only temporary
209 win.layerItem().tempRaise(); 206 win.layerItem().tempRaise();
210 } 207 }
211 208
@@ -402,10 +399,7 @@ void FluxboxWindow::init() {
402 functions.resize = functions.move = functions.iconify = functions.maximize 399 functions.resize = functions.move = functions.iconify = functions.maximize
403 = functions.close = functions.tabable = true; 400 = functions.close = functions.tabable = true;
404 401
405 if (m_client->getBlackboxHint() != 0) 402 updateMWMHintsFromClient(*m_client);
406 updateBlackboxHintsFromClient(*m_client);
407 else
408 updateMWMHintsFromClient(*m_client);
409 403
410 //!! 404 //!!
411 // fetch client size and placement 405 // fetch client size and placement
@@ -1212,43 +1206,6 @@ void FluxboxWindow::updateFunctions() {
1212 setupWindow(); 1206 setupWindow();
1213} 1207}
1214 1208
1215void FluxboxWindow::updateBlackboxHintsFromClient(const WinClient &client) {
1216 const FluxboxWindow::BlackboxHints *hint = client.getBlackboxHint();
1217 if (!hint) return;
1218
1219 if (hint->flags & ATTRIB_SHADED)
1220 shaded = (hint->attrib & ATTRIB_SHADED);
1221
1222 if (hint->flags & ATTRIB_HIDDEN)
1223 iconic = (hint->attrib & ATTRIB_HIDDEN);
1224
1225 if ((hint->flags & ATTRIB_MAXHORIZ) &&
1226 (hint->flags & ATTRIB_MAXVERT))
1227 maximized = ((hint->attrib &
1228 (ATTRIB_MAXHORIZ |
1229 ATTRIB_MAXVERT)) ? MAX_FULL : MAX_NONE);
1230 else if (hint->flags & ATTRIB_MAXVERT)
1231 maximized = ((hint->attrib &
1232 ATTRIB_MAXVERT) ? MAX_VERT : MAX_NONE);
1233 else if (hint->flags & ATTRIB_MAXHORIZ)
1234 maximized = ((hint->attrib &
1235 ATTRIB_MAXHORIZ) ? MAX_HORZ : MAX_NONE);
1236
1237 if (hint->flags & ATTRIB_OMNIPRESENT)
1238 stuck = (hint->attrib & ATTRIB_OMNIPRESENT);
1239
1240 if (hint->flags & ATTRIB_WORKSPACE)
1241 m_workspace_number = hint->workspace;
1242
1243 if (hint->flags & ATTRIB_STACK)
1244 m_workspace_number = hint->stack;
1245
1246 if (hint->flags & ATTRIB_DECORATION) {
1247 m_old_decoration = static_cast<Decoration>(hint->decoration);
1248 setDecoration(m_old_decoration, false);
1249 }
1250}
1251
1252void FluxboxWindow::move(int x, int y) { 1209void FluxboxWindow::move(int x, int y) {
1253 moveResize(x, y, frame().width(), frame().height()); 1210 moveResize(x, y, frame().width(), frame().height());
1254} 1211}
@@ -1503,9 +1460,6 @@ void FluxboxWindow::iconify() {
1503 if (isIconic()) // no need to iconify if we're already 1460 if (isIconic()) // no need to iconify if we're already
1504 return; 1461 return;
1505 1462
1506 m_blackbox_attrib.flags |= ATTRIB_HIDDEN;
1507 m_blackbox_attrib.attrib |= ATTRIB_HIDDEN;
1508
1509 iconic = true; 1463 iconic = true;
1510 1464
1511 hide(true); 1465 hide(true);
@@ -1551,7 +1505,6 @@ void FluxboxWindow::deiconify(bool reassoc, bool do_raise) {
1551 1505
1552 bool was_iconic = iconic; 1506 bool was_iconic = iconic;
1553 1507
1554 m_blackbox_attrib.flags &= ~ATTRIB_HIDDEN;
1555 iconic = false; 1508 iconic = false;
1556 1509
1557 if (reassoc && !m_client->transients.empty()) { 1510 if (reassoc && !m_client->transients.empty()) {
@@ -1786,9 +1739,6 @@ void FluxboxWindow::setWorkspace(int n) {
1786 1739
1787 m_workspace_number = n; 1740 m_workspace_number = n;
1788 1741
1789 m_blackbox_attrib.flags |= ATTRIB_WORKSPACE;
1790 m_blackbox_attrib.workspace = m_workspace_number;
1791
1792 // notify workspace change 1742 // notify workspace change
1793 if (m_initialized && !stuck && old_wkspc != m_workspace_number) { 1743 if (m_initialized && !stuck && old_wkspc != m_workspace_number) {
1794#ifdef DEBUG 1744#ifdef DEBUG
@@ -1825,8 +1775,6 @@ void FluxboxWindow::shade() {
1825 frame().shade(); 1775 frame().shade();
1826 1776
1827 shaded = !shaded; 1777 shaded = !shaded;
1828 m_blackbox_attrib.flags ^= ATTRIB_SHADED;
1829 m_blackbox_attrib.attrib ^= ATTRIB_SHADED;
1830 1778
1831 // TODO: this should set IconicState, but then we can't focus the window 1779 // TODO: this should set IconicState, but then we can't focus the window
1832} 1780}
@@ -1847,8 +1795,6 @@ void FluxboxWindow::shadeOff() {
1847 1795
1848void FluxboxWindow::stick() { 1796void FluxboxWindow::stick() {
1849 1797
1850 m_blackbox_attrib.flags ^= ATTRIB_OMNIPRESENT;
1851 m_blackbox_attrib.attrib ^= ATTRIB_OMNIPRESENT;
1852 stuck = !stuck; 1798 stuck = !stuck;
1853 1799
1854 if (m_initialized) { 1800 if (m_initialized) {
@@ -1959,12 +1905,6 @@ void FluxboxWindow::moveToLayer(int layernum, bool force) {
1959 FluxboxWindow *win = client->fbwindow(); 1905 FluxboxWindow *win = client->fbwindow();
1960 if (!win) return; 1906 if (!win) return;
1961 1907
1962 if (!win->isIconic()) {
1963 if (layernum > m_layernum)
1964 screen().updateNetizenWindowLower(client->window());
1965 else
1966 screen().updateNetizenWindowRaise(client->window());
1967 }
1968 win->layerItem().moveToLayer(layernum); 1908 win->layerItem().moveToLayer(layernum);
1969 // remember number just in case a transient happens to revisit this window 1909 // remember number just in case a transient happens to revisit this window
1970 layernum = win->layerItem().getLayerNum(); 1910 layernum = win->layerItem().getLayerNum();
@@ -1980,7 +1920,6 @@ void FluxboxWindow::moveToLayer(int layernum, bool force) {
1980 for (; it != it_end; ++it) { 1920 for (; it != it_end; ++it) {
1981 FluxboxWindow *fbwin = (*it)->fbwindow(); 1921 FluxboxWindow *fbwin = (*it)->fbwindow();
1982 if (fbwin && !fbwin->isIconic()) { 1922 if (fbwin && !fbwin->isIconic()) {
1983 screen().updateNetizenWindowRaise((*it)->window());
1984 fbwin->layerItem().moveToLayer(layernum); 1923 fbwin->layerItem().moveToLayer(layernum);
1985 fbwin->setLayerNum(layernum); 1924 fbwin->setLayerNum(layernum);
1986 } 1925 }
@@ -2185,23 +2124,6 @@ void FluxboxWindow::restoreAttributes() {
2185 } else 2124 } else
2186 return; 2125 return;
2187 2126
2188 if (m_blackbox_attrib.flags & ATTRIB_SHADED &&
2189 m_blackbox_attrib.attrib & ATTRIB_SHADED)
2190 shaded = true;
2191
2192 if (m_blackbox_attrib.flags & ATTRIB_HIDDEN &&
2193 m_blackbox_attrib.attrib & ATTRIB_HIDDEN) {
2194 iconic = true;
2195 }
2196
2197 if (( m_blackbox_attrib.workspace != screen().currentWorkspaceID()) &&
2198 ( m_blackbox_attrib.workspace < screen().numberOfWorkspaces()))
2199 m_workspace_number = m_blackbox_attrib.workspace;
2200
2201 if (m_blackbox_attrib.flags & ATTRIB_OMNIPRESENT &&
2202 m_blackbox_attrib.attrib & ATTRIB_OMNIPRESENT)
2203 stuck = true;
2204
2205 if (m_blackbox_attrib.flags & ATTRIB_STACK) { 2127 if (m_blackbox_attrib.flags & ATTRIB_STACK) {
2206 //!! TODO check value? 2128 //!! TODO check value?
2207 m_layernum = m_blackbox_attrib.stack; 2129 m_layernum = m_blackbox_attrib.stack;
@@ -2209,21 +2131,10 @@ void FluxboxWindow::restoreAttributes() {
2209 2131
2210 if ((m_blackbox_attrib.flags & ATTRIB_MAXHORIZ) || 2132 if ((m_blackbox_attrib.flags & ATTRIB_MAXHORIZ) ||
2211 (m_blackbox_attrib.flags & ATTRIB_MAXVERT)) { 2133 (m_blackbox_attrib.flags & ATTRIB_MAXVERT)) {
2212 int x = m_blackbox_attrib.premax_x, y = m_blackbox_attrib.premax_y; 2134 m_blackbox_attrib.premax_x = m_blackbox_attrib.premax_x;
2213 unsigned int w = m_blackbox_attrib.premax_w, h = m_blackbox_attrib.premax_h; 2135 m_blackbox_attrib.premax_y = m_blackbox_attrib.premax_y;
2214 maximized = MAX_NONE; 2136 m_blackbox_attrib.premax_w = m_blackbox_attrib.premax_w;
2215 if ((m_blackbox_attrib.flags & ATTRIB_MAXHORIZ) && 2137 m_blackbox_attrib.premax_h = m_blackbox_attrib.premax_h;
2216 (m_blackbox_attrib.flags & ATTRIB_MAXVERT))
2217 maximized = MAX_FULL;
2218 else if (m_blackbox_attrib.flags & ATTRIB_MAXVERT)
2219 maximized = MAX_VERT;
2220 else if (m_blackbox_attrib.flags & ATTRIB_MAXHORIZ)
2221 maximized = MAX_HORZ;
2222
2223 m_blackbox_attrib.premax_x = x;
2224 m_blackbox_attrib.premax_y = y;
2225 m_blackbox_attrib.premax_w = w;
2226 m_blackbox_attrib.premax_h = h;
2227 } 2138 }
2228 2139
2229} 2140}
@@ -2535,14 +2446,6 @@ void FluxboxWindow::propertyNotifyEvent(WinClient &client, Atom atom) {
2535 updateMWMHintsFromClient(client); 2446 updateMWMHintsFromClient(client);
2536 updateRememberStateFromClient(client); 2447 updateRememberStateFromClient(client);
2537 applyDecorations(); // update decorations (if they changed) 2448 applyDecorations(); // update decorations (if they changed)
2538 } else if (atom == fbatoms->getFluxboxHintsAtom()) {
2539 client.updateBlackboxHints();
2540 updateBlackboxHintsFromClient(client);
2541 if (client.getBlackboxHint() != 0 &&
2542 (client.getBlackboxHint()->flags & ATTRIB_DECORATION)) {
2543 updateRememberStateFromClient(client);
2544 applyDecorations(); // update decoration
2545 }
2546 } 2449 }
2547 break; 2450 break;
2548 } 2451 }
@@ -2628,7 +2531,6 @@ void FluxboxWindow::configureRequestEvent(XConfigureRequestEvent &cr) {
2628 if (cr.value_mask & CWHeight) 2531 if (cr.value_mask & CWHeight)
2629 ch = cr.height; 2532 ch = cr.height;
2630 2533
2631 // whether we should send ConfigureNotify to netizens
2632 // the request is for client window so we resize the frame to it first 2534 // the request is for client window so we resize the frame to it first
2633 if (old_w != cw || old_h != ch) { 2535 if (old_w != cw || old_h != ch) {
2634 if (old_x != cx || old_y != cy) 2536 if (old_x != cx || old_y != cy)
@@ -3839,75 +3741,6 @@ unsigned int FluxboxWindow::normalHeight() const {
3839 3741
3840int FluxboxWindow::initialState() const { return m_client->initial_state; } 3742int FluxboxWindow::initialState() const { return m_client->initial_state; }
3841 3743
3842void FluxboxWindow::changeBlackboxHints(const BlackboxHints &net) {
3843 if ((net.flags & ATTRIB_SHADED) &&
3844 ((m_blackbox_attrib.attrib & ATTRIB_SHADED) !=
3845 (net.attrib & ATTRIB_SHADED)))
3846 shade();
3847
3848 if ((net.flags & ATTRIB_HIDDEN) &&
3849 ((m_blackbox_attrib.attrib & ATTRIB_HIDDEN) !=
3850 (net.attrib & ATTRIB_HIDDEN))) {
3851 bool want_iconic = net.attrib & ATTRIB_HIDDEN;
3852 if (!iconic && want_iconic)
3853 iconify();
3854 else if (iconic && !want_iconic)
3855 deiconify();
3856 }
3857
3858 if (net.flags & (ATTRIB_MAXVERT | ATTRIB_MAXHORIZ)) {
3859 // make maximise look like the net maximise flags
3860 int want_max = MAX_NONE;
3861
3862 if (net.flags & ATTRIB_MAXVERT)
3863 want_max |= MAX_VERT;
3864 if (net.flags & ATTRIB_MAXHORIZ)
3865 want_max |= MAX_HORZ;
3866
3867 if (want_max == MAX_NONE && maximized != MAX_NONE) {
3868 maximize(maximized);
3869 } else if (want_max == MAX_FULL && maximized != MAX_FULL) {
3870 maximize(MAX_FULL);
3871 } else {
3872 // either we want vert and aren't
3873 // or we want horizontal and aren't
3874 if (want_max == MAX_VERT ^ (bool)(maximized & MAX_VERT))
3875 maximize(MAX_VERT);
3876 if (want_max == MAX_HORZ ^ (bool)(maximized & MAX_HORZ))
3877 maximize(MAX_HORZ);
3878 }
3879 }
3880
3881 if ((net.flags & ATTRIB_OMNIPRESENT) &&
3882 ((m_blackbox_attrib.attrib & ATTRIB_OMNIPRESENT) !=
3883 (net.attrib & ATTRIB_OMNIPRESENT)))
3884 stick();
3885
3886 if ((net.flags & ATTRIB_WORKSPACE) &&
3887 (m_workspace_number != net.workspace)) {
3888
3889 screen().reassociateWindow(this, net.workspace, true);
3890
3891 if (screen().currentWorkspaceID() != net.workspace)
3892 hide(true);
3893 else
3894 deiconify();
3895 }
3896
3897 if (net.flags & ATTRIB_STACK) {
3898 if ((unsigned int) m_layernum != net.stack) {
3899 moveToLayer(net.stack);
3900 }
3901 }
3902
3903 if (net.flags & ATTRIB_DECORATION) {
3904 m_old_decoration = static_cast<Decoration>(net.decoration);
3905 setDecoration(m_old_decoration);
3906 }
3907
3908}
3909
3910
3911void FluxboxWindow::fixsize(int *user_w, int *user_h, bool maximizing) { 3744void FluxboxWindow::fixsize(int *user_w, int *user_h, bool maximizing) {
3912 int titlebar_height = (decorations.titlebar ? 3745 int titlebar_height = (decorations.titlebar ?
3913 frame().titlebar().height() + 3746 frame().titlebar().height() +
@@ -3952,7 +3785,7 @@ void FluxboxWindow::moveResizeClient(WinClient &client, int x, int y,
3952 frame().clientArea().height()); 3785 frame().clientArea().height());
3953} 3786}
3954 3787
3955void FluxboxWindow::sendConfigureNotify(bool send_to_netizens) { 3788void FluxboxWindow::sendConfigureNotify() {
3956 ClientList::iterator client_it = m_clientlist.begin(); 3789 ClientList::iterator client_it = m_clientlist.begin();
3957 ClientList::iterator client_it_end = m_clientlist.end(); 3790 ClientList::iterator client_it_end = m_clientlist.end();
3958 for (; client_it != client_it_end; ++client_it) { 3791 for (; client_it != client_it_end; ++client_it) {
@@ -3970,23 +3803,6 @@ void FluxboxWindow::sendConfigureNotify(bool send_to_netizens) {
3970 frame().clientArea().width(), 3803 frame().clientArea().width(),
3971 frame().clientArea().height()); 3804 frame().clientArea().height());
3972 3805
3973 if (send_to_netizens) {
3974 XEvent event;
3975 event.type = ConfigureNotify;
3976
3977 event.xconfigure.display = display;
3978 event.xconfigure.event = client.window();
3979 event.xconfigure.window = client.window();
3980 event.xconfigure.x = frame().x() + frame().clientArea().x();
3981 event.xconfigure.y = frame().y() + frame().clientArea().y();
3982 event.xconfigure.width = client.width();
3983 event.xconfigure.height = client.height();
3984 event.xconfigure.border_width = client.old_bw;
3985 event.xconfigure.above = frame().window().window();
3986 event.xconfigure.override_redirect = false;
3987
3988 screen().updateNetizenConfigNotify(event);
3989 }
3990 } // end for 3806 } // end for
3991 3807
3992} 3808}