all repos — fluxbox @ 3c78d753c0c1b293d20ad52e38586929bf47f13e

custom fork of the fluxbox windowmanager

fixed focus issues with remember hidden, patch from Mathias Gumz
fluxgen fluxgen
commit

3c78d753c0c1b293d20ad52e38586929bf47f13e

parent

1e405808fb3cba1b19d6af9697312a6f4d8ec3ba

M src/Ewmh.ccsrc/Ewmh.cc

@@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Ewmh.cc,v 1.43 2004/02/14 12:15:35 fluxgen Exp $ +// $Id: Ewmh.cc,v 1.44 2004/02/20 09:05:38 fluxgen Exp $ #include "Ewmh.hh"

@@ -174,7 +174,8 @@ *

*/ if (atoms[l] == m_net_wm_window_type_dock) { // we also assume it shouldn't be visible in any toolbar - win.setHidden(true); + win.setFocusHidden(true); + win.setIconHidden(true); break; }

@@ -722,7 +723,8 @@ } else if (state == m_net_wm_state_fullscreen) { // fullscreen

setFullscreen(win, value); } else if (state == m_net_wm_state_hidden || state == m_net_wm_state_skip_taskbar) { - win.setHidden(value); + win.setFocusHidden(value); + win.setIconHidden(win.isFocusHidden()); } else if (state == m_net_wm_state_below) { if (value) win.moveToLayer(Fluxbox::instance()->getBottomLayer());

@@ -752,7 +754,8 @@ } else if (state == m_net_wm_state_fullscreen) { // fullscreen

setFullscreen(win, getState(win) == 0); // toggle current state } else if (state == m_net_wm_state_hidden || state == m_net_wm_state_skip_taskbar) { - win.setHidden(!win.isHidden()); + win.setFocusHidden(!win.isFocusHidden()); + win.setIconHidden(!win.isIconHidden()); } else if (state == m_net_wm_state_below) { if (win.layerNum() == Fluxbox::instance()->getBottomLayer()) win.moveToLayer(Fluxbox::instance()->getNormalLayer());
M src/Gnome.ccsrc/Gnome.cc

@@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Gnome.cc,v 1.33 2004/01/19 18:36:27 fluxgen Exp $ +// $Id: Gnome.cc,v 1.34 2004/02/20 09:05:38 fluxgen Exp $ #include "Gnome.hh"

@@ -369,7 +369,10 @@ } else if (win->isShaded())

win->shade(); if (state & WIN_STATE_HIDDEN) - win->setHidden(! win->isHidden()); + { + win->setFocusHidden(! win->isFocusHidden()); + win->setIconHidden(! win->isIconHidden()); + } /*
M src/IconbarTool.ccsrc/IconbarTool.cc

@@ -20,7 +20,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: IconbarTool.cc,v 1.33 2004/02/16 10:26:03 fluxgen Exp $ +// $Id: IconbarTool.cc,v 1.34 2004/02/20 09:05:24 fluxgen Exp $ #include "IconbarTool.hh"

@@ -211,7 +211,7 @@ ret_val = true;

break; } - if (win.isHidden()) + if (win.isIconHidden()) ret_val = false; return ret_val;

@@ -682,7 +682,7 @@ }

void IconbarTool::addWindow(FluxboxWindow &win) { // we just want windows that has clients - if (win.clientList().empty() || win.isHidden() ) + if (win.clientList().empty() || win.isIconHidden() ) return; IconButton *button = new IconButton(m_icon_container, m_theme.focusedText().font(), win);
M src/Remember.ccsrc/Remember.cc

@@ -21,7 +21,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Remember.cc,v 1.34 2004/02/16 10:25:33 fluxgen Exp $ +// $Id: Remember.cc,v 1.35 2004/02/20 09:05:38 fluxgen Exp $ #include "Remember.hh" #include "ClientPattern.hh"

@@ -210,7 +210,8 @@ group(0)

{ decostate_remember = dimensions_remember = - hiddenstate_remember = + focushiddenstate_remember = + iconhiddenstate_remember = jumpworkspace_remember = layer_remember = position_remember =

@@ -364,8 +365,13 @@ } else if (str_key == "Shaded") {

app.rememberShadedstate((str_label=="yes")); } else if (str_key == "Tab") { app.rememberTabstate((str_label=="yes")); + } else if (str_key == "FocusHidden") { + app.rememberFocusHiddenstate((str_label=="yes")); + } else if (str_key == "IconHidden") { + app.rememberIconHiddenstate((str_label=="yes")); } else if (str_key == "Hidden") { - app.rememberHiddenstate((str_label=="yes")); + app.rememberIconHiddenstate((str_label=="yes")); + app.rememberFocusHiddenstate((str_label=="yes")); } else if (str_key == "Deco") { if (str_label == "NONE") { app.rememberDecostate((unsigned int) 0);

@@ -548,9 +554,6 @@ }

if (a.tabstate_remember) { apps_file << " [Tab]\t\t{" << ((a.tabstate)?"yes":"no") << "}" << endl; } - if (a.hiddenstate_remember) { - apps_file << " [Hidden]\t\t{" << ((a.tabstate)?"yes":"no") << "}" << endl; - } if (a.decostate_remember) { switch (a.decostate) { case (0) :

@@ -578,6 +581,17 @@ apps_file << " [Deco]\t{0x"<<hex<<a.decostate<<dec<<"}"<<endl;

break; } } + + if (a.focushiddenstate_remember || a.iconhiddenstate_remember) { + if (a.focushiddenstate_remember && a.iconhiddenstate_remember && + a.focushiddenstate && a.iconhiddenstate) + apps_file << " [Hidden]\t{" << ((a.focushiddenstate)?"yes":"no") << "}" << endl; + else if (a.focushiddenstate_remember) { + apps_file << " [FocusHidden]\t{" << ((a.focushiddenstate)?"yes":"no") << "}" << endl; + } else if (a.iconhiddenstate_remember) { + apps_file << " [IconHidden]\t{" << ((a.iconhiddenstate)?"yes":"no") << "}" << endl; + } + } if (a.stuckstate_remember) { apps_file << " [Sticky]\t{" << ((a.stuckstate)?"yes":"no") << "}" << endl; }

@@ -607,8 +621,11 @@ break;

case REM_POSITION: return app->position_remember; break; - case REM_HIDDENSTATE: - return app->hiddenstate_remember; + case REM_FOCUSHIDDENSTATE: + return app->focushiddenstate_remember; + break; + case REM_ICONHIDDENSTATE: + return app->iconhiddenstate_remember; break; case REM_STUCKSTATE: return app->stuckstate_remember;

@@ -655,8 +672,11 @@ break;

case REM_POSITION: app->rememberPosition(win->x(), win->y()); break; - case REM_HIDDENSTATE: - app->rememberHiddenstate(win->isHidden()); + case REM_FOCUSHIDDENSTATE: + app->rememberFocusHiddenstate(win->isFocusHidden()); + break; + case REM_ICONHIDDENSTATE: + app->rememberIconHiddenstate(win->isIconHidden()); break; case REM_SHADEDSTATE: app->rememberShadedstate(win->isShaded());

@@ -703,8 +723,11 @@ break;

case REM_POSITION: app->forgetPosition(); break; - case REM_HIDDENSTATE: - app->forgetHiddenstate(); + case REM_FOCUSHIDDENSTATE: + app->forgetFocusHiddenstate(); + break; + case REM_ICONHIDDENSTATE: + app->forgetIconHiddenstate(); break; case REM_STUCKSTATE: app->forgetStuckstate();

@@ -809,8 +832,10 @@ // if inconsistent...

if (win.isStuck() && !app->stuckstate || !win.isStuck() && app->stuckstate) win.stick(); // toggles - if (app->hiddenstate_remember) - win.setHidden(true); + if (app->focushiddenstate_remember) + win.setFocusHidden(true); + if (app->iconhiddenstate_remember) + win.setIconHidden(true); if (app->layer_remember) win.moveToLayer(app->layer);
M src/Remember.hhsrc/Remember.hh

@@ -21,7 +21,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Remember.hh,v 1.15 2004/02/16 10:25:34 fluxgen Exp $ +// $Id: Remember.hh,v 1.16 2004/02/20 09:05:38 fluxgen Exp $ /* Based on the original "Remember patch" by Xavier Brouckaert */

@@ -50,7 +50,8 @@ inline void forgetPosition() { position_remember = false; }

inline void forgetShadedstate() { shadedstate_remember = false; } inline void forgetTabstate() { tabstate_remember = false; } inline void forgetDecostate() { decostate_remember = false; } - inline void forgetHiddenstate() { hiddenstate_remember= false; } + inline void forgetFocusHiddenstate() { focushiddenstate_remember= false; } + inline void forgetIconHiddenstate() { iconhiddenstate_remember= false; } inline void forgetStuckstate() { stuckstate_remember = false; } inline void forgetJumpworkspace() { jumpworkspace_remember = false; } inline void forgetLayer() { layer_remember = false; }

@@ -60,9 +61,10 @@ inline void rememberWorkspace(int ws)

{ workspace = ws; workspace_remember = true; } inline void rememberDimensions(int width, int height) { w = width; h = height; dimensions_remember = true; } - - inline void rememberHiddenstate(bool state) - { hiddenstate= state; hiddenstate_remember= true; } + inline void rememberFocusHiddenstate(bool state) + { focushiddenstate= state; focushiddenstate_remember= true; } + inline void rememberIconHiddenstate(bool state) + { iconhiddenstate= state; iconhiddenstate_remember= true; } inline void rememberPosition(int posx, int posy, unsigned char rfc= 0 ) { x = posx; y = posy; refc = rfc; position_remember = true; } inline void rememberShadedstate(bool state)

@@ -106,8 +108,11 @@

bool stuckstate_remember; bool stuckstate; - bool hiddenstate_remember; - bool hiddenstate; + bool focushiddenstate_remember; + bool focushiddenstate; + + bool iconhiddenstate_remember; + bool iconhiddenstate; bool jumpworkspace_remember; bool jumpworkspace;

@@ -138,7 +143,8 @@ */

enum Attribute { REM_DECOSTATE= 0, REM_DIMENSIONS, - REM_HIDDENSTATE, + REM_FOCUSHIDDENSTATE, + REM_ICONHIDDENSTATE, REM_JUMPWORKSPACE, REM_LAYER, REM_POSITION,
M src/Screen.ccsrc/Screen.cc

@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Screen.cc,v 1.266 2004/02/10 18:53:37 fluxgen Exp $ +// $Id: Screen.cc,v 1.267 2004/02/20 09:06:19 fluxgen Exp $ #include "Screen.hh"

@@ -2411,7 +2411,7 @@ (opts & CYCLESKIPSTUCK) != 0 && win->isStuck() || // skip if stuck

// skip if not active client (i.e. only visit each fbwin once) (opts & CYCLEGROUPS) != 0 && win->winClient().window() != winclient.window() || (opts & CYCLESKIPSHADED) != 0 && win->isShaded() || // skip if shaded - win->isHidden() + win->isFocusHidden() ); }
M src/Window.ccsrc/Window.cc

@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Window.cc,v 1.267 2004/02/16 09:19:45 fluxgen Exp $ +// $Id: Window.cc,v 1.268 2004/02/20 09:07:27 fluxgen Exp $ #include "Window.hh"

@@ -265,6 +265,7 @@ m_diesig(*this),

m_focussig(*this), m_titlesig(*this), m_themelistener(*this), + m_icon_hidden(false), moving(false), resizing(false), shaded(false), iconic(false), focused(false), stuck(false), m_managed(false),

@@ -1688,7 +1689,7 @@ }

} } -void FluxboxWindow::setHidden(bool value) { +void FluxboxWindow::setFocusHidden(bool value) { if(value) m_blackbox_attrib.flags |= ATTRIB_HIDDEN; else

@@ -1696,6 +1697,12 @@ m_blackbox_attrib.flags ^= ATTRIB_HIDDEN;

m_statesig.notify(); } + +void FluxboxWindow::setIconHidden(bool value) { + m_icon_hidden= value; + m_statesig.notify(); +} + // window has actually RECEIVED focus (got a FocusIn event) // so now we make it a focused frame etc
M src/Window.hhsrc/Window.hh

@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Window.hh,v 1.108 2004/02/16 20:47:51 fluxgen Exp $ +// $Id: Window.hh,v 1.109 2004/02/20 09:07:27 fluxgen Exp $ #ifndef WINDOW_HH #define WINDOW_HH

@@ -207,7 +207,8 @@ void tempRaise();

void raiseLayer(); void lowerLayer(); void moveToLayer(int layernum); - void setHidden(bool value); + void setFocusHidden(bool value); + void setIconHidden(bool value); void reconfigure();

@@ -262,7 +263,8 @@ /**

@name accessors */ //@{ - inline bool isHidden() const { return (m_blackbox_attrib.flags & ATTRIB_HIDDEN); } + inline bool isFocusHidden() const { return (m_blackbox_attrib.flags & ATTRIB_HIDDEN); } + inline bool isIconHidden() const { return m_icon_hidden; } inline bool isManaged() const { return m_managed; } inline bool isFocused() const { return focused; } bool isVisible() const;

@@ -468,7 +470,7 @@ bool resize, move, iconify, maximize, close;

} functions; bool m_shaped; ///< if the window is shaped with a mask - + bool m_icon_hidden; ///< if the window is in the iconbar int m_old_pos_x, m_old_pos_y; ///< old position so we can restore from maximized unsigned int m_old_width, m_old_height; ///< old size so we can restore from maximized state int m_last_button_x, ///< last known x position of the mouse button