diff options
author | fluxgen <fluxgen> | 2004-01-21 09:37:10 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2004-01-21 09:37:10 (GMT) |
commit | f8224b1537a68dae01a8113da80bbd94f286ef3a (patch) | |
tree | 36d25ccad109a7d005720eb36ae46037bc574efe /src | |
parent | b0e18549c68b3c8985679ca78a42ad7772634dc2 (diff) | |
download | fluxbox-f8224b1537a68dae01a8113da80bbd94f286ef3a.zip fluxbox-f8224b1537a68dae01a8113da80bbd94f286ef3a.tar.bz2 |
support for _NET_WM_WINDOW_TYPE and _NET_WM_WINDOW_TYPE_DOCK
Diffstat (limited to 'src')
-rw-r--r-- | src/Ewmh.cc | 54 | ||||
-rw-r--r-- | src/Ewmh.hh | 10 |
2 files changed, 58 insertions, 6 deletions
diff --git a/src/Ewmh.cc b/src/Ewmh.cc index 56d524e..190850b 100644 --- a/src/Ewmh.cc +++ b/src/Ewmh.cc | |||
@@ -1,5 +1,5 @@ | |||
1 | // Ewmh.cc for fluxbox | 1 | // Ewmh.cc for fluxbox |
2 | // Copyright (c) 2002-2003 Henrik Kinnunen (fluxgen at user.sourceforge.net) | 2 | // Copyright (c) 2002-2004 Henrik Kinnunen (fluxgen at user.sourceforge.net) |
3 | // | 3 | // |
4 | // Permission is hereby granted, free of charge, to any person obtaining a | 4 | // Permission is hereby granted, free of charge, to any person obtaining a |
5 | // copy of this software and associated documentation files (the "Software"), | 5 | // copy of this software and associated documentation files (the "Software"), |
@@ -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.39 2004/01/19 22:43:08 fluxgen Exp $ | 22 | // $Id: Ewmh.cc,v 1.40 2004/01/21 09:37:10 fluxgen Exp $ |
23 | 23 | ||
24 | #include "Ewmh.hh" | 24 | #include "Ewmh.hh" |
25 | 25 | ||
@@ -82,6 +82,10 @@ void Ewmh::initForScreen(BScreen &screen) { | |||
82 | m_net_wm_state_hidden, | 82 | m_net_wm_state_hidden, |
83 | m_net_wm_state_skip_taskbar, | 83 | m_net_wm_state_skip_taskbar, |
84 | 84 | ||
85 | // window type | ||
86 | m_net_wm_window_type, | ||
87 | m_net_wm_window_type_dock, | ||
88 | |||
85 | // root properties | 89 | // root properties |
86 | m_net_client_list, | 90 | m_net_client_list, |
87 | m_net_client_list_stacking, | 91 | m_net_client_list_stacking, |
@@ -164,6 +168,44 @@ void Ewmh::setupFrame(FluxboxWindow &win) { | |||
164 | } | 168 | } |
165 | 169 | ||
166 | updateWorkspace(win); | 170 | updateWorkspace(win); |
171 | |||
172 | /* From Extended Window Manager Hints, draft 1.3: | ||
173 | * | ||
174 | * _NET_WM_WINDOW_TYPE, ATOM[]/32 | ||
175 | * | ||
176 | * This SHOULD be set by the Client before mapping to a list of atoms | ||
177 | * indicating the functional type of the window. This property SHOULD | ||
178 | * be used by the window manager in determining the decoration, | ||
179 | * stacking position and other behavior of the window. The Client | ||
180 | * SHOULD specify window types in order of preference (the first being | ||
181 | * most preferable) but MUST include at least one of the basic window | ||
182 | * type atoms from the list below. This is to allow for extension of | ||
183 | * the list of types whilst providing default behavior for Window | ||
184 | * Managers that do not recognize the extensions. | ||
185 | * | ||
186 | */ | ||
187 | win.winClient().property(m_net_wm_window_type, 0, 0x7fffffff, False, XA_ATOM, | ||
188 | &ret_type, &fmt, &nitems, &bytes_after, | ||
189 | &data); | ||
190 | if (data) { | ||
191 | Atom *atoms = (unsigned long *)data; | ||
192 | for (unsigned long l=0; l<nitems; ++l) { | ||
193 | /* From Extended Window Manager Hints, draft 1.3: | ||
194 | * | ||
195 | * _NET_WM_WINDOW_TYPE_DOCK indicates a dock or panel feature. | ||
196 | * Typically a Window Manager would keep such windows on top | ||
197 | * of all other windows. | ||
198 | * | ||
199 | */ | ||
200 | if (atoms[l] == m_net_wm_window_type_dock) { | ||
201 | win.moveToLayer(Fluxbox::instance()->getDockLayer()); | ||
202 | // we also assume it shouldn't be visible in any toolbar | ||
203 | win.setHidden(true); | ||
204 | break; | ||
205 | } | ||
206 | |||
207 | } | ||
208 | } | ||
167 | } | 209 | } |
168 | 210 | ||
169 | void Ewmh::updateFrameClose(FluxboxWindow &win) { | 211 | void Ewmh::updateFrameClose(FluxboxWindow &win) { |
@@ -319,7 +361,7 @@ void Ewmh::updateWorkspaceNames(BScreen &screen) { | |||
319 | &text, m_net_desktop_names); | 361 | &text, m_net_desktop_names); |
320 | XFree(text.value); | 362 | XFree(text.value); |
321 | } | 363 | } |
322 | 364 | ||
323 | for (size_t i = 0; i < number_of_desks; i++) | 365 | for (size_t i = 0; i < number_of_desks; i++) |
324 | delete [] names[i]; | 366 | delete [] names[i]; |
325 | } | 367 | } |
@@ -458,6 +500,7 @@ void Ewmh::updateWorkspace(FluxboxWindow &win) { | |||
458 | 500 | ||
459 | } | 501 | } |
460 | 502 | ||
503 | |||
461 | // return true if we did handle the atom here | 504 | // return true if we did handle the atom here |
462 | bool Ewmh::checkClientMessage(const XClientMessageEvent &ce, BScreen * screen, WinClient * const winclient) { | 505 | bool Ewmh::checkClientMessage(const XClientMessageEvent &ce, BScreen * screen, WinClient * const winclient) { |
463 | if (ce.message_type == m_net_wm_desktop) { | 506 | if (ce.message_type == m_net_wm_desktop) { |
@@ -599,8 +642,11 @@ void Ewmh::createAtoms() { | |||
599 | m_net_properties = XInternAtom(disp, "_NET_PROPERTIES", False); | 642 | m_net_properties = XInternAtom(disp, "_NET_PROPERTIES", False); |
600 | m_net_wm_name = XInternAtom(disp, "_NET_WM_NAME", False); | 643 | m_net_wm_name = XInternAtom(disp, "_NET_WM_NAME", False); |
601 | m_net_wm_desktop = XInternAtom(disp, "_NET_WM_DESKTOP", False); | 644 | m_net_wm_desktop = XInternAtom(disp, "_NET_WM_DESKTOP", False); |
645 | |||
646 | // type atoms | ||
602 | m_net_wm_window_type = XInternAtom(disp, "_NET_WM_WINDOW_TYPE", False); | 647 | m_net_wm_window_type = XInternAtom(disp, "_NET_WM_WINDOW_TYPE", False); |
603 | 648 | m_net_wm_window_type_dock = XInternAtom(disp, "_NET_WM_WINDOW_TYPE_DOCK", False); | |
649 | |||
604 | // state atom and the supported state atoms | 650 | // state atom and the supported state atoms |
605 | m_net_wm_state = XInternAtom(disp, "_NET_WM_STATE", False); | 651 | m_net_wm_state = XInternAtom(disp, "_NET_WM_STATE", False); |
606 | m_net_wm_state_sticky = XInternAtom(disp, "_NET_WM_STATE_STICKY", False); | 652 | m_net_wm_state_sticky = XInternAtom(disp, "_NET_WM_STATE_STICKY", False); |
diff --git a/src/Ewmh.hh b/src/Ewmh.hh index 1c5475c..52e91f7 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.15 2004/01/20 14:30:33 fluxgen Exp $ | 22 | // $Id: Ewmh.hh,v 1.16 2004/01/21 09:37:04 fluxgen Exp $ |
23 | 23 | ||
24 | #include "AtomHandler.hh" | 24 | #include "AtomHandler.hh" |
25 | 25 | ||
@@ -27,6 +27,7 @@ | |||
27 | #include <vector> | 27 | #include <vector> |
28 | #include <map> | 28 | #include <map> |
29 | 29 | ||
30 | /// Implementes Extended Window Manager Hints ( http://www.freedesktop.org/Standards/wm-spec ) | ||
30 | class Ewmh:public AtomHandler { | 31 | class Ewmh:public AtomHandler { |
31 | public: | 32 | public: |
32 | 33 | ||
@@ -86,7 +87,12 @@ private: | |||
86 | Atom m_net_close_window, m_net_wm_moveresize; | 87 | Atom m_net_close_window, m_net_wm_moveresize; |
87 | 88 | ||
88 | // application window properties | 89 | // application window properties |
89 | Atom m_net_properties, m_net_wm_name, m_net_wm_desktop, m_net_wm_window_type, | 90 | Atom m_net_properties, m_net_wm_name, m_net_wm_desktop, |
91 | // types | ||
92 | m_net_wm_window_type, | ||
93 | m_net_wm_window_type_dock, | ||
94 | |||
95 | // states | ||
90 | m_net_wm_state, m_net_wm_state_sticky, m_net_wm_state_shaded, | 96 | m_net_wm_state, m_net_wm_state_sticky, m_net_wm_state_shaded, |
91 | m_net_wm_state_maximized_horz, m_net_wm_state_maximized_vert, | 97 | m_net_wm_state_maximized_horz, m_net_wm_state_maximized_vert, |
92 | m_net_wm_state_fullscreen, | 98 | m_net_wm_state_fullscreen, |