all repos — fluxbox @ eb078ab8cf97634bff08979c43d9a238fca2b501

custom fork of the fluxbox windowmanager

support for _NET_WM_STATE_HIDDEN and _NET_WM_STATE_SKIP_TASKBAR
fluxgen fluxgen
commit

eb078ab8cf97634bff08979c43d9a238fca2b501

parent

dba6249a1c66a8ef78266d9bbbf83c5ae8048813

4 files changed, 55 insertions(+), 39 deletions(-)

jump to
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.36 2003/12/19 00:36:53 fluxgen Exp $ +// $Id: Ewmh.cc,v 1.37 2004/01/18 19:12:11 fluxgen Exp $ #include "Ewmh.hh"

@@ -78,6 +78,8 @@ m_net_wm_state_shaded,

m_net_wm_state_maximized_horz, m_net_wm_state_maximized_vert, m_net_wm_state_fullscreen, + m_net_wm_state_hidden, + m_net_wm_state_skip_taskbar, m_net_wm_desktop,

@@ -102,24 +104,26 @@ }

void Ewmh::setupClient(WinClient &winclient) { updateStrut(winclient); + } void Ewmh::setupFrame(FluxboxWindow &win) { - Atom ret_type; int fmt; unsigned long nitems, bytes_after; - long *data = 0; -/* - if (XGetWindowProperty(disp, win.clientWindow(), - m_net_wm_state, 0, 1, False, XA_CARDINAL, - &ret_type, &fmt, &nitems, &bytes_after, - (unsigned char **) &data) == Success && data) { - flags = *data; - setState(win, flags); + unsigned char *data = 0; + + win.winClient().property(m_net_wm_state, 0, 0x7fffffff, False, XA_ATOM, + &ret_type, &fmt, &nitems, &bytes_after, + &data); + if (data) { + // we must convert to long + unsigned long *real = (unsigned long *)data; + for (int i=0; i<nitems; ++i) + setState(win, real[i], true); XFree(data); - } -*/ + } + if (win.winClient().property(m_net_wm_desktop, 0, 1, False, XA_CARDINAL, &ret_type, &fmt, &nitems, &bytes_after, (unsigned char **) &data) && data) {

@@ -143,7 +147,7 @@ size_t num=0;

BScreen::Workspaces::const_iterator workspace_it = screen.getWorkspacesList().begin(); - BScreen::Workspaces::const_iterator workspace_it_end = + const BScreen::Workspaces::const_iterator workspace_it_end = screen.getWorkspacesList().end(); for (; workspace_it != workspace_it_end; ++workspace_it) { Workspace::Windows::iterator win_it =

@@ -179,9 +183,9 @@ (*workspace_it)->windowList().begin();

Workspace::Windows::const_iterator it_end = (*workspace_it)->windowList().end(); for (; it != it_end; ++it) { - if ((*it)->numClients() == 1) + if ((*it)->numClients() == 1) { wl[win++] = (*it)->clientWindow(); - else { + } else { // add every client in fluxboxwindow to list window list std::list<WinClient *>::iterator client_it = (*it)->clientList().begin();

@@ -201,11 +205,10 @@ FluxboxWindow::ClientList::iterator client_it_end = (*icon_it)->clientList().end();

for (; client_it != client_it_end; ++client_it) wl[win++] = (*client_it)->window(); } - //number of windows to show in client list num = win; screen.rootWindow().changeProperty(m_net_client_list, - XA_CARDINAL, 32, + XA_WINDOW, 32, PropModeReplace, (unsigned char *)wl, num); delete [] wl;

@@ -274,7 +277,6 @@ }

// return true if we did handle the atom here bool Ewmh::checkClientMessage(const XClientMessageEvent &ce, BScreen * screen, WinClient * const winclient) { - if (ce.message_type == m_net_wm_desktop) { if (screen == 0) return true;

@@ -367,7 +369,7 @@ // ce.data.l[3] = width

// ce.data.l[4] = height // TODO: gravity and flags winclient->fbwindow()->moveResize(ce.data.l[1], ce.data.l[2], - ce.data.l[3], ce.data.l[4]); + ce.data.l[3], ce.data.l[4]); return true; }

@@ -420,7 +422,9 @@ m_net_wm_state_shaded = XInternAtom(disp, "_NET_WM_STATE_SHADED", False);

m_net_wm_state_maximized_horz = XInternAtom(disp, "_NET_WM_STATE_MAXIMIZED_HORZ", False); m_net_wm_state_maximized_vert = XInternAtom(disp, "_NET_WM_STATE_MAXIMIZED_VERT", False); m_net_wm_state_fullscreen = XInternAtom(disp, "_NET_WM_STATE_FULLSCREEN", False); - + m_net_wm_state_hidden = XInternAtom(disp, "_NET_WM_STATE_HIDDEN", False); + m_net_wm_state_skip_taskbar = XInternAtom(disp, "_NET_WM_STATE_SKIP_TASKBAR", False); + m_net_wm_strut = XInternAtom(disp, "_NET_WM_STRUT", False); m_net_wm_icon_geometry = XInternAtom(disp, "_NET_WM_ICON_GEOMETRY", False); m_net_wm_icon = XInternAtom(disp, "_NET_WM_ICON", False);

@@ -487,7 +491,9 @@ (!value && win.isMaximized()))

win.maximizeVertical(); } 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); } // toggle window state

@@ -502,6 +508,9 @@ } else if (state == m_net_wm_state_maximized_vert) { // maximized Vertical

win.maximizeVertical(); } 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()); } }
M src/Ewmh.hhsrc/Ewmh.hh

@@ -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.hh,v 1.12 2003/09/23 13:52:05 rathnor Exp $ +// $Id: Ewmh.hh,v 1.13 2004/01/18 19:12:11 fluxgen Exp $ #include "AtomHandler.hh"

@@ -87,6 +87,9 @@ Atom m_net_properties, m_net_wm_name, m_net_wm_desktop, m_net_wm_window_type,

m_net_wm_state, m_net_wm_state_sticky, m_net_wm_state_shaded, m_net_wm_state_maximized_horz, m_net_wm_state_maximized_vert, m_net_wm_state_fullscreen, + m_net_wm_state_hidden, + m_net_wm_state_skip_taskbar, + m_net_wm_strut, m_net_wm_icon_geometry, m_net_wm_icon, m_net_wm_pid, m_net_wm_handled_icons;
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.262 2004/01/17 00:49:20 fluxgen Exp $ +// $Id: Window.cc,v 1.263 2004/01/18 19:14:08 fluxgen Exp $ #include "Window.hh"

@@ -1684,6 +1684,12 @@ }

} } +void FluxboxWindow::setHidden(bool value) { + if(value) + m_blackbox_attrib.flags |= ATTRIB_HIDDEN; + else + m_blackbox_attrib.flags ^= ATTRIB_HIDDEN; +} // window has actually RECEIVED focus (got a FocusIn event) // so now we make it a focused frame etc

@@ -2911,19 +2917,15 @@

///////////////////////////////////// // begin by checking the screen (or Xinerama head) edges - if (screen().hasXinerama()) { - // head "0" == whole screen width + height, which we skip since the - // sum of all the heads covers those edges - for (int h = 1; h <= screen().numHeads(); h++) { - snapToWindow(dx, dy, left, right, top, bottom, - screen().maxLeft(h), - screen().maxRight(h), - screen().maxTop(h), - screen().maxBottom(h)); - } - } else - snapToWindow(dx, dy, left, right, top, bottom, 0, screen().width(), 0, screen().height()); - + // head "0" == whole screen width + height, which we skip since the + // sum of all the heads covers those edges + for (int h = 1; h <= screen().numHeads(); h++) { + snapToWindow(dx, dy, left, right, top, bottom, + screen().maxLeft(h), + screen().maxRight(h), + screen().maxTop(h), + screen().maxBottom(h)); + } ///////////////////////////////////// // now check window edges
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.105 2003/12/30 20:56:40 fluxgen Exp $ +// $Id: Window.hh,v 1.106 2004/01/18 19:14:08 fluxgen Exp $ #ifndef WINDOW_HH #define WINDOW_HH

@@ -100,7 +100,8 @@ ATTRIB_MAXVERT = 0x04,

ATTRIB_OMNIPRESENT = 0x08, ATTRIB_WORKSPACE = 0x10, ATTRIB_STACK = 0x20, - ATTRIB_DECORATION = 0x40 + ATTRIB_DECORATION = 0x40, + ATTRIB_HIDDEN = 0x80, }; /**

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

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

@@ -261,6 +262,7 @@ /**

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