aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2004-01-18 19:14:08 (GMT)
committerfluxgen <fluxgen>2004-01-18 19:14:08 (GMT)
commiteb078ab8cf97634bff08979c43d9a238fca2b501 (patch)
tree192481847e4f3ebc0ab803bfc4522636e0122227 /src
parentdba6249a1c66a8ef78266d9bbbf83c5ae8048813 (diff)
downloadfluxbox-eb078ab8cf97634bff08979c43d9a238fca2b501.zip
fluxbox-eb078ab8cf97634bff08979c43d9a238fca2b501.tar.bz2
support for _NET_WM_STATE_HIDDEN and _NET_WM_STATE_SKIP_TASKBAR
Diffstat (limited to 'src')
-rw-r--r--src/Ewmh.cc51
-rw-r--r--src/Ewmh.hh5
-rw-r--r--src/Window.cc30
-rw-r--r--src/Window.hh8
4 files changed, 55 insertions, 39 deletions
diff --git a/src/Ewmh.cc b/src/Ewmh.cc
index f78432b..7b761d1 100644
--- a/src/Ewmh.cc
+++ b/src/Ewmh.cc
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: Ewmh.cc,v 1.36 2003/12/19 00:36:53 fluxgen Exp $ 22// $Id: Ewmh.cc,v 1.37 2004/01/18 19:12:11 fluxgen Exp $
23 23
24#include "Ewmh.hh" 24#include "Ewmh.hh"
25 25
@@ -78,6 +78,8 @@ void Ewmh::initForScreen(BScreen &screen) {
78 m_net_wm_state_maximized_horz, 78 m_net_wm_state_maximized_horz,
79 m_net_wm_state_maximized_vert, 79 m_net_wm_state_maximized_vert,
80 m_net_wm_state_fullscreen, 80 m_net_wm_state_fullscreen,
81 m_net_wm_state_hidden,
82 m_net_wm_state_skip_taskbar,
81 83
82 m_net_wm_desktop, 84 m_net_wm_desktop,
83 85
@@ -102,24 +104,26 @@ void Ewmh::initForScreen(BScreen &screen) {
102 104
103void Ewmh::setupClient(WinClient &winclient) { 105void Ewmh::setupClient(WinClient &winclient) {
104 updateStrut(winclient); 106 updateStrut(winclient);
107
105} 108}
106 109
107void Ewmh::setupFrame(FluxboxWindow &win) { 110void Ewmh::setupFrame(FluxboxWindow &win) {
108
109 Atom ret_type; 111 Atom ret_type;
110 int fmt; 112 int fmt;
111 unsigned long nitems, bytes_after; 113 unsigned long nitems, bytes_after;
112 long *data = 0; 114 unsigned char *data = 0;
113/* 115
114 if (XGetWindowProperty(disp, win.clientWindow(), 116 win.winClient().property(m_net_wm_state, 0, 0x7fffffff, False, XA_ATOM,
115 m_net_wm_state, 0, 1, False, XA_CARDINAL, 117 &ret_type, &fmt, &nitems, &bytes_after,
116 &ret_type, &fmt, &nitems, &bytes_after, 118 &data);
117 (unsigned char **) &data) == Success && data) { 119 if (data) {
118 flags = *data; 120 // we must convert to long
119 setState(win, flags); 121 unsigned long *real = (unsigned long *)data;
122 for (int i=0; i<nitems; ++i)
123 setState(win, real[i], true);
120 XFree(data); 124 XFree(data);
121 } 125 }
122*/ 126
123 if (win.winClient().property(m_net_wm_desktop, 0, 1, False, XA_CARDINAL, 127 if (win.winClient().property(m_net_wm_desktop, 0, 1, False, XA_CARDINAL,
124 &ret_type, &fmt, &nitems, &bytes_after, 128 &ret_type, &fmt, &nitems, &bytes_after,
125 (unsigned char **) &data) && data) { 129 (unsigned char **) &data) && data) {
@@ -143,7 +147,7 @@ void Ewmh::updateClientList(BScreen &screen) {
143 147
144 BScreen::Workspaces::const_iterator workspace_it = 148 BScreen::Workspaces::const_iterator workspace_it =
145 screen.getWorkspacesList().begin(); 149 screen.getWorkspacesList().begin();
146 BScreen::Workspaces::const_iterator workspace_it_end = 150 const BScreen::Workspaces::const_iterator workspace_it_end =
147 screen.getWorkspacesList().end(); 151 screen.getWorkspacesList().end();
148 for (; workspace_it != workspace_it_end; ++workspace_it) { 152 for (; workspace_it != workspace_it_end; ++workspace_it) {
149 Workspace::Windows::iterator win_it = 153 Workspace::Windows::iterator win_it =
@@ -179,9 +183,9 @@ void Ewmh::updateClientList(BScreen &screen) {
179 Workspace::Windows::const_iterator it_end = 183 Workspace::Windows::const_iterator it_end =
180 (*workspace_it)->windowList().end(); 184 (*workspace_it)->windowList().end();
181 for (; it != it_end; ++it) { 185 for (; it != it_end; ++it) {
182 if ((*it)->numClients() == 1) 186 if ((*it)->numClients() == 1) {
183 wl[win++] = (*it)->clientWindow(); 187 wl[win++] = (*it)->clientWindow();
184 else { 188 } else {
185 // add every client in fluxboxwindow to list window list 189 // add every client in fluxboxwindow to list window list
186 std::list<WinClient *>::iterator client_it = 190 std::list<WinClient *>::iterator client_it =
187 (*it)->clientList().begin(); 191 (*it)->clientList().begin();
@@ -201,11 +205,10 @@ void Ewmh::updateClientList(BScreen &screen) {
201 for (; client_it != client_it_end; ++client_it) 205 for (; client_it != client_it_end; ++client_it)
202 wl[win++] = (*client_it)->window(); 206 wl[win++] = (*client_it)->window();
203 } 207 }
204
205 //number of windows to show in client list 208 //number of windows to show in client list
206 num = win; 209 num = win;
207 screen.rootWindow().changeProperty(m_net_client_list, 210 screen.rootWindow().changeProperty(m_net_client_list,
208 XA_CARDINAL, 32, 211 XA_WINDOW, 32,
209 PropModeReplace, (unsigned char *)wl, num); 212 PropModeReplace, (unsigned char *)wl, num);
210 213
211 delete [] wl; 214 delete [] wl;
@@ -274,7 +277,6 @@ void Ewmh::updateWorkspace(FluxboxWindow &win) {
274 277
275// return true if we did handle the atom here 278// return true if we did handle the atom here
276bool Ewmh::checkClientMessage(const XClientMessageEvent &ce, BScreen * screen, WinClient * const winclient) { 279bool Ewmh::checkClientMessage(const XClientMessageEvent &ce, BScreen * screen, WinClient * const winclient) {
277
278 if (ce.message_type == m_net_wm_desktop) { 280 if (ce.message_type == m_net_wm_desktop) {
279 if (screen == 0) 281 if (screen == 0)
280 return true; 282 return true;
@@ -367,7 +369,7 @@ bool Ewmh::checkClientMessage(const XClientMessageEvent &ce, BScreen * screen, W
367 // ce.data.l[4] = height 369 // ce.data.l[4] = height
368 // TODO: gravity and flags 370 // TODO: gravity and flags
369 winclient->fbwindow()->moveResize(ce.data.l[1], ce.data.l[2], 371 winclient->fbwindow()->moveResize(ce.data.l[1], ce.data.l[2],
370 ce.data.l[3], ce.data.l[4]); 372 ce.data.l[3], ce.data.l[4]);
371 return true; 373 return true;
372 } 374 }
373 375
@@ -420,7 +422,9 @@ void Ewmh::createAtoms() {
420 m_net_wm_state_maximized_horz = XInternAtom(disp, "_NET_WM_STATE_MAXIMIZED_HORZ", False); 422 m_net_wm_state_maximized_horz = XInternAtom(disp, "_NET_WM_STATE_MAXIMIZED_HORZ", False);
421 m_net_wm_state_maximized_vert = XInternAtom(disp, "_NET_WM_STATE_MAXIMIZED_VERT", False); 423 m_net_wm_state_maximized_vert = XInternAtom(disp, "_NET_WM_STATE_MAXIMIZED_VERT", False);
422 m_net_wm_state_fullscreen = XInternAtom(disp, "_NET_WM_STATE_FULLSCREEN", False); 424 m_net_wm_state_fullscreen = XInternAtom(disp, "_NET_WM_STATE_FULLSCREEN", False);
423 425 m_net_wm_state_hidden = XInternAtom(disp, "_NET_WM_STATE_HIDDEN", False);
426 m_net_wm_state_skip_taskbar = XInternAtom(disp, "_NET_WM_STATE_SKIP_TASKBAR", False);
427
424 m_net_wm_strut = XInternAtom(disp, "_NET_WM_STRUT", False); 428 m_net_wm_strut = XInternAtom(disp, "_NET_WM_STRUT", False);
425 m_net_wm_icon_geometry = XInternAtom(disp, "_NET_WM_ICON_GEOMETRY", False); 429 m_net_wm_icon_geometry = XInternAtom(disp, "_NET_WM_ICON_GEOMETRY", False);
426 m_net_wm_icon = XInternAtom(disp, "_NET_WM_ICON", False); 430 m_net_wm_icon = XInternAtom(disp, "_NET_WM_ICON", False);
@@ -487,7 +491,9 @@ void Ewmh::setState(FluxboxWindow &win, Atom state, bool value) {
487 win.maximizeVertical(); 491 win.maximizeVertical();
488 } else if (state == m_net_wm_state_fullscreen) { // fullscreen 492 } else if (state == m_net_wm_state_fullscreen) { // fullscreen
489 setFullscreen(win, value); 493 setFullscreen(win, value);
490 } 494 } else if (state == m_net_wm_state_hidden ||
495 state == m_net_wm_state_skip_taskbar)
496 win.setHidden(value);
491} 497}
492 498
493// toggle window state 499// toggle window state
@@ -502,6 +508,9 @@ void Ewmh::toggleState(FluxboxWindow &win, Atom state) {
502 win.maximizeVertical(); 508 win.maximizeVertical();
503 } else if (state == m_net_wm_state_fullscreen) { // fullscreen 509 } else if (state == m_net_wm_state_fullscreen) { // fullscreen
504 setFullscreen(win, getState(win) == 0); // toggle current state 510 setFullscreen(win, getState(win) == 0); // toggle current state
511 } else if (state == m_net_wm_state_hidden ||
512 state == m_net_wm_state_skip_taskbar) {
513 win.setHidden(!win.isHidden());
505 } 514 }
506} 515}
507 516
diff --git a/src/Ewmh.hh b/src/Ewmh.hh
index c4419ba..6de9073 100644
--- a/src/Ewmh.hh
+++ b/src/Ewmh.hh
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: Ewmh.hh,v 1.12 2003/09/23 13:52:05 rathnor Exp $ 22// $Id: Ewmh.hh,v 1.13 2004/01/18 19:12:11 fluxgen Exp $
23 23
24#include "AtomHandler.hh" 24#include "AtomHandler.hh"
25 25
@@ -87,6 +87,9 @@ private:
87 m_net_wm_state, m_net_wm_state_sticky, m_net_wm_state_shaded, 87 m_net_wm_state, m_net_wm_state_sticky, m_net_wm_state_shaded,
88 m_net_wm_state_maximized_horz, m_net_wm_state_maximized_vert, 88 m_net_wm_state_maximized_horz, m_net_wm_state_maximized_vert,
89 m_net_wm_state_fullscreen, 89 m_net_wm_state_fullscreen,
90 m_net_wm_state_hidden,
91 m_net_wm_state_skip_taskbar,
92
90 m_net_wm_strut, m_net_wm_icon_geometry, m_net_wm_icon, m_net_wm_pid, 93 m_net_wm_strut, m_net_wm_icon_geometry, m_net_wm_icon, m_net_wm_pid,
91 m_net_wm_handled_icons; 94 m_net_wm_handled_icons;
92 95
diff --git a/src/Window.cc b/src/Window.cc
index 8a3bb31..9575e2a 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.262 2004/01/17 00:49:20 fluxgen Exp $ 25// $Id: Window.cc,v 1.263 2004/01/18 19:14:08 fluxgen Exp $
26 26
27#include "Window.hh" 27#include "Window.hh"
28 28
@@ -1684,6 +1684,12 @@ void FluxboxWindow::moveToLayer(int layernum) {
1684 } 1684 }
1685} 1685}
1686 1686
1687void FluxboxWindow::setHidden(bool value) {
1688 if(value)
1689 m_blackbox_attrib.flags |= ATTRIB_HIDDEN;
1690 else
1691 m_blackbox_attrib.flags ^= ATTRIB_HIDDEN;
1692}
1687 1693
1688// window has actually RECEIVED focus (got a FocusIn event) 1694// window has actually RECEIVED focus (got a FocusIn event)
1689// so now we make it a focused frame etc 1695// so now we make it a focused frame etc
@@ -2911,19 +2917,15 @@ void FluxboxWindow::doSnapping(int &orig_left, int &orig_top) {
2911 ///////////////////////////////////// 2917 /////////////////////////////////////
2912 // begin by checking the screen (or Xinerama head) edges 2918 // begin by checking the screen (or Xinerama head) edges
2913 2919
2914 if (screen().hasXinerama()) { 2920 // head "0" == whole screen width + height, which we skip since the
2915 // head "0" == whole screen width + height, which we skip since the 2921 // sum of all the heads covers those edges
2916 // sum of all the heads covers those edges 2922 for (int h = 1; h <= screen().numHeads(); h++) {
2917 for (int h = 1; h <= screen().numHeads(); h++) { 2923 snapToWindow(dx, dy, left, right, top, bottom,
2918 snapToWindow(dx, dy, left, right, top, bottom, 2924 screen().maxLeft(h),
2919 screen().maxLeft(h), 2925 screen().maxRight(h),
2920 screen().maxRight(h), 2926 screen().maxTop(h),
2921 screen().maxTop(h), 2927 screen().maxBottom(h));
2922 screen().maxBottom(h)); 2928 }
2923 }
2924 } else
2925 snapToWindow(dx, dy, left, right, top, bottom, 0, screen().width(), 0, screen().height());
2926
2927 ///////////////////////////////////// 2929 /////////////////////////////////////
2928 // now check window edges 2930 // now check window edges
2929 2931
diff --git a/src/Window.hh b/src/Window.hh
index d61703a..71c0b71 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.105 2003/12/30 20:56:40 fluxgen Exp $ 25// $Id: Window.hh,v 1.106 2004/01/18 19:14:08 fluxgen Exp $
26 26
27#ifndef WINDOW_HH 27#ifndef WINDOW_HH
28#define WINDOW_HH 28#define WINDOW_HH
@@ -100,7 +100,8 @@ public:
100 ATTRIB_OMNIPRESENT = 0x08, 100 ATTRIB_OMNIPRESENT = 0x08,
101 ATTRIB_WORKSPACE = 0x10, 101 ATTRIB_WORKSPACE = 0x10,
102 ATTRIB_STACK = 0x20, 102 ATTRIB_STACK = 0x20,
103 ATTRIB_DECORATION = 0x40 103 ATTRIB_DECORATION = 0x40,
104 ATTRIB_HIDDEN = 0x80,
104 }; 105 };
105 106
106 /** 107 /**
@@ -206,7 +207,7 @@ public:
206 void raiseLayer(); 207 void raiseLayer();
207 void lowerLayer(); 208 void lowerLayer();
208 void moveToLayer(int layernum); 209 void moveToLayer(int layernum);
209 210 void setHidden(bool value);
210 void reconfigure(); 211 void reconfigure();
211 212
212 213
@@ -261,6 +262,7 @@ public:
261 @name accessors 262 @name accessors
262 */ 263 */
263 //@{ 264 //@{
265 inline bool isHidden() const { return (m_blackbox_attrib.flags & ATTRIB_HIDDEN); }
264 inline bool isManaged() const { return m_managed; } 266 inline bool isManaged() const { return m_managed; }
265 inline bool isFocused() const { return focused; } 267 inline bool isFocused() const { return focused; }
266 bool isVisible() const; 268 bool isVisible() const;