summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Window.cc44
-rw-r--r--src/Window.hh10
2 files changed, 16 insertions, 38 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:
diff --git a/src/Window.hh b/src/Window.hh
index 7a150e8..b5b86fa 100644
--- a/src/Window.hh
+++ b/src/Window.hh
@@ -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.hh,v 1.77 2003/06/12 14:34:28 fluxgen Exp $ 25// $Id: Window.hh,v 1.78 2003/06/15 18:34:48 fluxgen Exp $
26 26
27#ifndef WINDOW_HH 27#ifndef WINDOW_HH
28#define WINDOW_HH 28#define WINDOW_HH
@@ -304,8 +304,7 @@ public:
304 unsigned int width() const; 304 unsigned int width() const;
305 unsigned int height() const; 305 unsigned int height() const;
306 unsigned int titlebarHeight() const; 306 unsigned int titlebarHeight() const;
307 const std::string &className() const { return m_class_name; } 307
308 const std::string &instanceName() const { return m_instance_name; }
309 bool isLowerTab() const; 308 bool isLowerTab() const;
310 int initialState() const; 309 int initialState() const;
311 310
@@ -350,7 +349,7 @@ private:
350 void shape(); 349 void shape();
351 350
352 void grabButtons(); 351 void grabButtons();
353 352
354 void startMoving(Window win); 353 void startMoving(Window win);
355 void stopMoving(); 354 void stopMoving();
356 void startResizing(Window win, int x, int y, bool left); 355 void startResizing(Window win, int x, int y, bool left);
@@ -389,9 +388,6 @@ private:
389 // state and hint signals 388 // state and hint signals
390 WinSubject m_hintsig, m_statesig, m_layersig, m_workspacesig, m_diesig; 389 WinSubject m_hintsig, m_statesig, m_layersig, m_workspacesig, m_diesig;
391 390
392 std::string m_instance_name; /// instance name from WM_CLASS
393 std::string m_class_name; /// class name from WM_CLASS
394
395 // Window states 391 // Window states
396 bool moving, resizing, shaded, maximized, iconic, 392 bool moving, resizing, shaded, maximized, iconic,
397 focused, stuck, send_focus_message, m_managed; 393 focused, stuck, send_focus_message, m_managed;