From 839cc974c15381de184f7f6c51821784709ef99d Mon Sep 17 00:00:00 2001 From: markt Date: Thu, 10 Aug 2006 06:35:14 +0000 Subject: implement _NET_WM_WINDOW_TYPE_MENU AND _NET_WM_WINDOW_TYPE_TOOLBAR --- ChangeLog | 2 ++ src/Ewmh.cc | 19 ++++++++++++++++--- src/Ewmh.hh | 2 ++ 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 73fa0f3..80514e0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,8 @@ (Format: Year/Month/Day) Changes for 1.0rc3: *06/08/10: + * Implement _NET_WM_WINDOW_TYPE_MENU and _NET_WM_WINDOW_TYPE_TOOLBAR (Mark) + Ewmh.cc/hh * Fix duplicated UTF-8 encoding in el_GR (thanks Slava Semushin) nls/el_GR/Makefile.am *06/08/09: diff --git a/src/Ewmh.cc b/src/Ewmh.cc index 97c66b8..cb9f0f6 100644 --- a/src/Ewmh.cc +++ b/src/Ewmh.cc @@ -144,6 +144,8 @@ void Ewmh::initForScreen(BScreen &screen) { m_net_wm_window_type_desktop, m_net_wm_window_type_splash, m_net_wm_window_type_dialog, + m_net_wm_window_type_menu, + m_net_wm_window_type_toolbar, m_net_wm_window_type_normal, // window actions @@ -300,8 +302,19 @@ void Ewmh::setupFrame(FluxboxWindow &win) { } else if (atoms[l] == m_net_wm_window_type_dialog) { // dialog windows should not be tabable win.setTabable(false); + } else if (atoms[l] == m_net_wm_window_type_menu || + atoms[l] == m_net_wm_window_type_toolbar) { + /* + * _NET_WM_WINDOW_TYPE_TOOLBAR and _NET_WM_WINDOW_TYPE_MENU + * indicate toolbar and pinnable menu windows, respectively + * (i.e. toolbars and menus "torn off" from the main + * application). Windows of this type may set the + * WM_TRANSIENT_FOR hint indicating the main application window. + */ + win.setDecoration(FluxboxWindow::DECOR_NONE); + win.setIconHidden(true); + win.moveToLayer(Layer::ABOVE_DOCK); } - } XFree(data); } else { @@ -317,8 +330,6 @@ void Ewmh::setupFrame(FluxboxWindow &win) { /* * NOT YET IMPLEMENTED: - * _NET_WM_WINDOW_TYPE_TOOLBAR - * _NET_WM_WINDOW_TYPE_MENU * _NET_WM_WINDOW_TYPE_UTILITY */ @@ -971,6 +982,8 @@ void Ewmh::createAtoms() { m_net_wm_window_type_desktop = XInternAtom(disp, "_NET_WM_WINDOW_TYPE_DESKTOP", False); m_net_wm_window_type_splash = XInternAtom(disp, "_NET_WM_WINDOW_TYPE_SPLASH", False); m_net_wm_window_type_dialog = XInternAtom(disp, "_NET_WM_WINDOW_TYPE_DIALOG", False); + m_net_wm_window_type_menu = XInternAtom(disp, "_NET_WM_WINDOW_TYPE_MENU", False); + m_net_wm_window_type_toolbar = XInternAtom(disp, "_NET_WM_WINDOW_TYPE_TOOLBAR", False); m_net_wm_window_type_normal = XInternAtom(disp, "_NET_WM_WINDOW_TYPE_NORMAL", False); // state atom and the supported state atoms diff --git a/src/Ewmh.hh b/src/Ewmh.hh index b033efe..8652c6b 100644 --- a/src/Ewmh.hh +++ b/src/Ewmh.hh @@ -114,6 +114,8 @@ private: m_net_wm_window_type_desktop, m_net_wm_window_type_splash, m_net_wm_window_type_dialog, + m_net_wm_window_type_menu, + m_net_wm_window_type_toolbar, m_net_wm_window_type_normal, // states -- cgit v0.11.2