all repos — fluxbox @ 41adf369ddc24d8fae4dfa9cd804420435d7a6aa

custom fork of the fluxbox windowmanager

little cleanup
markt markt
commit

41adf369ddc24d8fae4dfa9cd804420435d7a6aa

parent

9d5e2f143ba2dc33c5f79a1a18646512b04c942d

2 files changed, 2 insertions(+), 91 deletions(-)

jump to
M src/Ewmh.ccsrc/Ewmh.cc

@@ -357,7 +357,6 @@

} void Ewmh::updateFrameClose(FluxboxWindow &win) { - clearState(win); } void Ewmh::updateFocusedWindow(BScreen &screen, Window win) {

@@ -1029,40 +1028,6 @@ m_net_wm_ping = XInternAtom(disp, "_NET_WM_PING", False);

utf8_string = XInternAtom(disp, "UTF8_STRING", False); } - -void Ewmh::setFullscreen(FluxboxWindow &win, bool value) { - // fullscreen implies maximised, above dock layer, - // and no decorations (or decorations offscreen) - // - // TODO: do we need the WindowState etc here anymore? - // FluxboxWindow::setFullscreen() remembering old values - // already and set them... - // only reason i can see is that the user manually - // moved the (fullscreened) window - WindowState *saved_state = getState(win); - if (value) { - // fullscreen on - if (!saved_state) { // not already fullscreen - saved_state = new WindowState(win.x(), win.y(), win.width(), - win.height(), win.layerNum(), win.decorationMask()); - saveState(win, saved_state); - win.setFullscreen(true); - } - } else { // turn off fullscreen - if (saved_state) { // no saved state, can't restore it - win.setFullscreen(false); - /* - win.setDecorationMask(saved_state->decor); - win.moveResize(saved_state->x, saved_state->y, - saved_state->width, saved_state->height); - win.moveToLayer(saved_state->layer); - */ - clearState(win); - saved_state = 0; - } - } -} - // set window state void Ewmh::setState(FluxboxWindow &win, Atom state, bool value) { if (state == m_net_wm_state_sticky) { // STICKY

@@ -1084,7 +1049,7 @@ win.maximizeVertical();

} else if (state == m_net_wm_state_fullscreen) { // fullscreen if ((value && !win.isFullscreen()) || (!value && win.isFullscreen())) - setFullscreen(win, value); + win.setFullscreen(value); } else if (state == m_net_wm_state_hidden) { // minimized if (value && !win.isIconic()) win.iconify();

@@ -1126,7 +1091,7 @@ win.maximizeHorizontal();

} else if (state == m_net_wm_state_maximized_vert) { // maximized Vertical win.maximizeVertical(); } else if (state == m_net_wm_state_fullscreen) { // fullscreen - setFullscreen(win, getState(win) == 0); // toggle current state + win.setFullscreen(!win.isFullscreen()); // toggle current state } else if (state == m_net_wm_state_hidden) { // minimized if(win.isIconic()) win.deiconify();

@@ -1289,41 +1254,3 @@ XA_CARDINAL, 32, PropModeReplace,

(unsigned char *)extents, 4); } } - - -Ewmh::WindowState::WindowState(int t_x, int t_y, - unsigned int t_width, - unsigned int t_height, - int t_layer, unsigned int t_decor) : - x(t_x), y(t_y), - layer(t_layer), - width(t_width), - height(t_height), - decor(t_decor) -{} - -Ewmh::WindowState *Ewmh::getState(FluxboxWindow &win) { - SavedState::iterator it = m_savedstate.find(&win); - if (it == m_savedstate.end()) - return 0; - else - return it->second; -} - -void Ewmh::clearState(FluxboxWindow &win) { - WindowState *state = 0; - SavedState::iterator it = m_savedstate.find(&win); - if (it == m_savedstate.end()) - return; - - state = it->second; - - m_savedstate.erase(it); - delete state; -} - -void Ewmh::saveState(FluxboxWindow &win, WindowState *state) { - m_savedstate[&win] = state; -} - -
M src/Ewmh.hhsrc/Ewmh.hh

@@ -60,19 +60,9 @@ bool propertyNotify(WinClient &winclient, Atom the_property);

void updateFrameClose(FluxboxWindow &win); void updateClientClose(WinClient &winclient); - - - void setFullscreen(FluxboxWindow &win, bool value); void updateFrameExtents(FluxboxWindow &win); private: - - typedef struct WindowState { - WindowState(int x, int y, unsigned int width, unsigned int height, - int layer, unsigned int decor); - int x, y, layer; - unsigned int width, height, decor; - } WindowState; enum { STATE_REMOVE = 0, STATE_ADD = 1, STATE_TOGGLE = 2};

@@ -153,12 +143,6 @@

Atom utf8_string; std::vector<Window> m_windows; - typedef std::map<FluxboxWindow *, WindowState *> SavedState; - SavedState m_savedstate; - - WindowState *getState(FluxboxWindow &win); - void clearState(FluxboxWindow &win); - void saveState(FluxboxWindow &win, WindowState *state); FbTk::FbString getUTF8Property(Atom property); };