all repos — fluxbox @ f6fcf362314ef7385bba48cf911ab967f5086667

custom fork of the fluxbox windowmanager

instance and class name in WinClient instead
fluxgen fluxgen
commit

f6fcf362314ef7385bba48cf911ab967f5086667

parent

b681e308a281559e4489cf5ad3d2a31f1494683a

2 files changed, 15 insertions(+), 37 deletions(-)

jump to
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.191 2003/06/13 20:49:05 fluxgen Exp $ +// $Id: Window.cc,v 1.192 2003/06/15 18:35:32 fluxgen Exp $ #include "Window.hh"

@@ -2055,39 +2055,21 @@ withdraw();

break; case NormalState: { - // if the window was destroyed while autogrouping + // if this window was destroyed while autogrouping bool destroyed = false; - + // check WM_CLASS only when we changed state to NormalState from - // WithdrawnState (ICCC 4.1.2.5) - XClassHint ch; - if (XGetClassHint(display, client->window(), &ch) == 0) { - cerr<<"Failed to read class hint!"<<endl; - } else { - if (ch.res_name != 0) { - m_instance_name = const_cast<char *>(ch.res_name); - XFree(ch.res_name); - } else - m_instance_name = ""; - - if (ch.res_class != 0) { - m_class_name = const_cast<char *>(ch.res_class); - XFree(ch.res_class); - } else - m_class_name = ""; + // WithdrawnState (ICCC 4.1.2.5) + client->updateWMClassHint(); - - Workspace *wsp = screen().getWorkspace(m_workspace_number); - // we must be resizable AND maximizable to be autogrouped - //!! TODO: there should be an isGroupable() function - if (wsp != 0 && isResizable() && isMaximizable()) { - destroyed = wsp->checkGrouping(*this); - } - - } - // if we wasn't grouped with another window we deiconify ourself - if (!destroyed) + Workspace *wsp = screen().getWorkspace(m_workspace_number); + if (wsp != 0 && isGroupable()) + destroyed = wsp->checkGrouping(*this); + + // if we wasn't grouped with another window we deiconify ourself + if (!destroyed) deiconify(false); + } break; case InactiveState:
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.77 2003/06/12 14:34:28 fluxgen Exp $ +// $Id: Window.hh,v 1.78 2003/06/15 18:34:48 fluxgen Exp $ #ifndef WINDOW_HH #define WINDOW_HH

@@ -304,8 +304,7 @@

unsigned int width() const; unsigned int height() const; unsigned int titlebarHeight() const; - const std::string &className() const { return m_class_name; } - const std::string &instanceName() const { return m_instance_name; } + bool isLowerTab() const; int initialState() const;

@@ -350,7 +349,7 @@ /// applies a shape mask to the window if it has one

void shape(); void grabButtons(); - + void startMoving(Window win); void stopMoving(); void startResizing(Window win, int x, int y, bool left);

@@ -389,9 +388,6 @@ void sendConfigureNotify();

// state and hint signals WinSubject m_hintsig, m_statesig, m_layersig, m_workspacesig, m_diesig; - std::string m_instance_name; /// instance name from WM_CLASS - std::string m_class_name; /// class name from WM_CLASS - // Window states bool moving, resizing, shaded, maximized, iconic, focused, stuck, send_focus_message, m_managed;