From 9b7775751decd095f091d122c1ce057c6a04b64d Mon Sep 17 00:00:00 2001 From: rathnor Date: Sun, 20 Jun 2004 04:49:33 +0000 Subject: support _NET_WM_WINDOW_TYPE_DESKTOP (e.g. nautilus desktop windows) Allow FluxboxWindows to be untabable. --- ChangeLog | 3 +++ src/Ewmh.cc | 20 +++++++++++++++++++- src/Ewmh.hh | 3 ++- src/Window.cc | 13 ++++++++----- src/Window.hh | 12 +++++++++--- 5 files changed, 41 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1848902..6601db6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,9 @@ (Format: Year/Month/Day) Changes for 0.9.10: *04/06/20: + * Support _NET_WM_WINDOW_TYPE_DESKTOP (Simon) + - eg nautilus desktop windows are on the bottom, not tabable, etc + Ewmh.hh/cc Window.hh/cc * Fix honouring of initial state on window open (Simon) Window.hh/cc Screen.cc *04/06/18: diff --git a/src/Ewmh.cc b/src/Ewmh.cc index ff09588..ad6663f 100644 --- a/src/Ewmh.cc +++ b/src/Ewmh.cc @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Ewmh.cc,v 1.46 2004/06/07 11:46:04 rathnor Exp $ +// $Id: Ewmh.cc,v 1.47 2004/06/20 04:49:32 rathnor Exp $ #include "Ewmh.hh" @@ -86,6 +86,7 @@ void Ewmh::initForScreen(BScreen &screen) { // window type m_net_wm_window_type, m_net_wm_window_type_dock, + m_net_wm_window_type_desktop, // root properties m_net_client_list, @@ -178,6 +179,22 @@ void Ewmh::setupFrame(FluxboxWindow &win) { win.setFocusHidden(true); win.setIconHidden(true); break; + } else if (atoms[l] == m_net_wm_window_type_desktop) { + /* + * _NET_WM_WINDOW_TYPE_DOCK indicates a "false desktop" window + * We let it be the size it wants, but it gets no decoration, + * is hidden in the toolbar and window cycling list, plus + * windows don't tab with it and is right on the bottom. + */ + + win.setFocusHidden(true); + win.setIconHidden(true); + win.moveToLayer(Fluxbox::instance()->getDesktopLayer()); + win.setDecorationMask(0); + win.setTabable(false); + win.setMovable(false); + win.setResizable(false); + win.stick(); } } @@ -657,6 +674,7 @@ void Ewmh::createAtoms() { // type atoms m_net_wm_window_type = XInternAtom(disp, "_NET_WM_WINDOW_TYPE", False); m_net_wm_window_type_dock = XInternAtom(disp, "_NET_WM_WINDOW_TYPE_DOCK", False); + m_net_wm_window_type_desktop = XInternAtom(disp, "_NET_WM_WINDOW_TYPE_DESKTOP", False); // state atom and the supported state atoms m_net_wm_state = XInternAtom(disp, "_NET_WM_STATE", False); diff --git a/src/Ewmh.hh b/src/Ewmh.hh index d89f15b..d4bd09c 100644 --- a/src/Ewmh.hh +++ b/src/Ewmh.hh @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Ewmh.hh,v 1.17 2004/01/21 15:42:35 fluxgen Exp $ +// $Id: Ewmh.hh,v 1.18 2004/06/20 04:49:32 rathnor Exp $ #include "AtomHandler.hh" @@ -92,6 +92,7 @@ private: // types m_net_wm_window_type, m_net_wm_window_type_dock, + m_net_wm_window_type_desktop, // states m_net_wm_state, m_net_wm_state_sticky, m_net_wm_state_shaded, diff --git a/src/Window.cc b/src/Window.cc index 553c863..b36ade7 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Window.cc,v 1.290 2004/06/19 15:04:27 rathnor Exp $ +// $Id: Window.cc,v 1.291 2004/06/20 04:49:32 rathnor Exp $ #include "Window.hh" @@ -432,7 +432,7 @@ void FluxboxWindow::init() { decorations.sticky = decorations.shade = decorations.tab = true; - functions.resize = functions.move = functions.iconify = functions.maximize = true; + functions.resize = functions.move = functions.iconify = functions.maximize = functions.tabable = true; decorations.close = false; if (m_client->getBlackboxHint() != 0) @@ -1049,7 +1049,9 @@ void FluxboxWindow::updateMWMHintsFromClient(WinClient &client) { decorations.maximize = true; } } - + + // functions.tabable is ours, not special one + // note that it means this window is "tabbable" if (hint->flags & MwmHintsFunctions) { if (hint->functions & MwmFuncAll) { functions.resize = functions.move = functions.iconify = @@ -2532,7 +2534,8 @@ void FluxboxWindow::motionNotifyEvent(XMotionEvent &me) { screen().showGeometry(gx, gy); } - } else if ((me.state & Button2Mask) && inside_titlebar && (client != 0 || m_attaching_tab != 0)) { + } else if (functions.tabable && + (me.state & Button2Mask) && inside_titlebar && (client != 0 || m_attaching_tab != 0)) { // // drag'n'drop code for tabs // @@ -3084,7 +3087,7 @@ void FluxboxWindow::attachTo(int x, int y, bool interrupted) { } } if (attach_to_win != this && - attach_to_win != 0) { + attach_to_win != 0 && attach_to_win->isTabable()) { attach_to_win->attachClient(*m_attaching_tab); diff --git a/src/Window.hh b/src/Window.hh index 44c1f4d..f12384e 100644 --- a/src/Window.hh +++ b/src/Window.hh @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Window.hh,v 1.115 2004/06/19 15:04:28 rathnor Exp $ +// $Id: Window.hh,v 1.116 2004/06/20 04:49:33 rathnor Exp $ #ifndef WINDOW_HH #define WINDOW_HH @@ -258,7 +258,6 @@ public: void applyDecorations(bool initial = false); void toggleDecoration(); - unsigned int decorationMask() const; void setDecorationMask(unsigned int mask); @@ -266,6 +265,13 @@ public: @name accessors */ //@{ + // whether this window can be tabbed with other windows, + // and others tabbed with it + inline void setTabable(bool tabable) { functions.tabable = tabable; } + inline bool isTabable() { return functions.tabable; } + inline void setMovable(bool movable) { functions.move = movable; } + inline void setResizable(bool resizable) { functions.resize = resizable; } + inline bool isFocusHidden() const { return (m_blackbox_attrib.flags & ATTRIB_HIDDEN); } inline bool isIconHidden() const { return m_icon_hidden; } inline bool isManaged() const { return m_managed; } @@ -482,7 +488,7 @@ private: bool m_toggled_decos; struct _functions { - bool resize, move, iconify, maximize, close; + bool resize, move, iconify, maximize, close, tabable; } functions; bool m_shaped; ///< if the window is shaped with a mask -- cgit v0.11.2