aboutsummaryrefslogtreecommitdiff
path: root/src/Window.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/Window.cc')
-rw-r--r--src/Window.cc44
1 files changed, 13 insertions, 31 deletions
diff --git a/src/Window.cc b/src/Window.cc
index 85cadef..0e4e8b0 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: Window.cc,v 1.191 2003/06/13 20:49:05 fluxgen Exp $ 25// $Id: Window.cc,v 1.192 2003/06/15 18:35:32 fluxgen Exp $
26 26
27#include "Window.hh" 27#include "Window.hh"
28 28
@@ -2055,40 +2055,22 @@ void FluxboxWindow::mapRequestEvent(XMapRequestEvent &re) {
2055 break; 2055 break;
2056 2056
2057 case NormalState: { 2057 case NormalState: {
2058 // if the window was destroyed while autogrouping 2058 // if this window was destroyed while autogrouping
2059 bool destroyed = false; 2059 bool destroyed = false;
2060 2060
2061 // check WM_CLASS only when we changed state to NormalState from 2061 // check WM_CLASS only when we changed state to NormalState from
2062 // WithdrawnState (ICCC 4.1.2.5) 2062 // WithdrawnState (ICCC 4.1.2.5)
2063 XClassHint ch; 2063 client->updateWMClassHint();
2064 if (XGetClassHint(display, client->window(), &ch) == 0) { 2064
2065 cerr<<"Failed to read class hint!"<<endl; 2065 Workspace *wsp = screen().getWorkspace(m_workspace_number);
2066 } else { 2066 if (wsp != 0 && isGroupable())
2067 if (ch.res_name != 0) { 2067 destroyed = wsp->checkGrouping(*this);
2068 m_instance_name = const_cast<char *>(ch.res_name); 2068
2069 XFree(ch.res_name); 2069 // if we wasn't grouped with another window we deiconify ourself
2070 } else 2070 if (!destroyed)
2071 m_instance_name = "";
2072
2073 if (ch.res_class != 0) {
2074 m_class_name = const_cast<char *>(ch.res_class);
2075 XFree(ch.res_class);
2076 } else
2077 m_class_name = "";
2078
2079
2080 Workspace *wsp = screen().getWorkspace(m_workspace_number);
2081 // we must be resizable AND maximizable to be autogrouped
2082 //!! TODO: there should be an isGroupable() function
2083 if (wsp != 0 && isResizable() && isMaximizable()) {
2084 destroyed = wsp->checkGrouping(*this);
2085 }
2086
2087 }
2088 // if we wasn't grouped with another window we deiconify ourself
2089 if (!destroyed)
2090 deiconify(false); 2071 deiconify(false);
2091 2072
2073
2092 } break; 2074 } break;
2093 case InactiveState: 2075 case InactiveState:
2094 case ZoomState: 2076 case ZoomState: